aboutsummaryrefslogtreecommitdiff
path: root/verif/conformance/README.md
blob: 8ac4d63c8339762a1d1c91c278efd1d1dc50adb8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
# Conformance

This directory contains the scripts and data files to generate the conformance tests.

The data files are in JSON format and they describe what tests to create and/or select from the `tosa_verif_build_tests` generator script.

## JSON files

### TOSA ops

Naming: `tosa_ext_profile_ops_info.json`

Contains a dictionary of operator names.

Each operator entry contains:

* "group" - name of the group this operator is in, in the spec
* "gen_filter" - optional filter string for op to give to tosa_verif_build_tests - defaults to "^opname$"
* "support_for" - optional list of supported creation modes (for FP tests only) out of:
    * lazy_data_gen - data generation just before test run
    * stable_random_gen - more stable method of generation of tests
    * random_const_inputs - random choice of const or input tensor per op
* "generation" - dictionary of test generation details - see below
* "selection" - dictionary of test selection details - see below

In the generation dictionary each entry is a name for a generation group -
a set of tests generated together and then selected from using the selection
criteria.

Each generation group is a dictionary that contains some ways to control when the generation group is run:

* "supports_all" - list of profiles and/or extensions that must all be chosen for generation
* "supports_any" - list of profiles and/or extensions that individually can be chosen for generation
* "from_version" - optional version string for when the tests have been introduced in TOSA
of the form "vM.mm.p" where `M` is the major version, `mm` is the minor version
and `p` is the patch version

Other dictionary entries in a generation group are:

* "no_negative_tests" - optional "true" indicator that no negative tests are relevant/generated
* "negative_dim_range" - optional range of dimensions for negative tests
* "generator_args" - list of argument lists to supply to the `tosa_verif_build_tests` (see that tool for more details)
* "selector" - optional name for the selection criteria to use for this generation group, if not supplied "default" will be used

In the selection dictionary each entry is a name for a selection criteria - there must be one called "default" which is used by default. Others may exist and be used by the different generation groups.

Each selection criteria is a dictionary that contains:

* "all": "true" - to select all tests (and not use test_select)
* "generator_select" - optional "true" to use generator selector instead of conformance test_select

for selection criteria that has "generator_select" set:

* "permutes" - optional list of parameters whose values are to be permuted, the default is ["rank", "dtype"]
* "maximum" - optional number - at most "maximum" tests (not including specific tests) will be captured per permuted "permutes" value, effects "full_params" as well
* "full_params" - optional list of parameter names used to select tests covering a full range of values for these params up to "maximum"
* "specifics" - optional dictionary of params with lists of values, tests that meet any of these "specifics" will be selected and kept (even using "post_sparsity")
* "groups" - optional list of parameters that should be considered as a grouping of tests and treated as one test for "sparsity" and "specifics"
* "num_errorifs" - optional value of error_if tests to keep per error_if case, the default is 1

or for other select criteria it defaults to the old test select (more information for each entry in `test_select.py`):

* "params" - optional dictionary with mappings of parameter names to the values to select
* "permutes" - optional list of parameter names to be permuted
* "preselected" - optional list of dictionaries containing parameter names and pre-chosen values
* "sparsity" - optional dictionary of parameter names with a sparsity value
* "exclude_patterns" - optional list of regex's whereby each match will not be considered for selection. Exclusion happens BEFORE test selection (i.e.
before permutes are applied)
* "errorifs" - optional list of ERRORIF case names to be selected after exclusion (negative tests)