From 3047625f7d4b3a77cb3a3480481122f7ba01be2d Mon Sep 17 00:00:00 2001 From: Jeremy Johnson Date: Mon, 20 Nov 2023 16:15:30 +0000 Subject: Adjust random data ranges for Main Compliance to avoid FP inf and nan POW - there are now 3 test sets to cover random ranges. Also added ROUND mode to data generator to force integer exponent values. LOG, EXP, RSQRT, REDUCE_SUM & FULLY_CONNECTED - have had their ranges reduced for each test. Fix generate library configuration defaults and checks. Signed-off-by: Jeremy Johnson Change-Id: Ie5d3bd78f690cc787a2ca4eb9b4bd6808bd9238c --- verif/conformance/test_select.py | 45 ++++++++++++++++++++++++++-------------- 1 file changed, 30 insertions(+), 15 deletions(-) (limited to 'verif/conformance') diff --git a/verif/conformance/test_select.py b/verif/conformance/test_select.py index faefc85..cebdf62 100644 --- a/verif/conformance/test_select.py +++ b/verif/conformance/test_select.py @@ -125,8 +125,6 @@ class Operator: # Working set of param_names - updated for negative tests wks_param_names = None - COMPLIANCE_SETS = ("_s0", "_s1", "_s2", "_s3", "_s4", "_s5") - def __init__( self, test_dir: Path, @@ -260,13 +258,13 @@ class Operator: if (not negative and "ERRORIF" not in str(path)) or ( negative and "ERRORIF" in str(path) ): - # Check for compliance test set paths - suffix = path.name[-3:] - if suffix in Operator.COMPLIANCE_SETS: - if suffix != Operator.COMPLIANCE_SETS[0]: - # Only return one of the test sets - continue - yield path.with_name(path.name[:-3]) + # Check for test set paths + match = re.match(r"(.*)_s([0-9]+)", path.name) + if match: + if match.group(2) == "0": + # Only return the truncated test name + # of the first test of a set + yield path.with_name(match.group(1)) else: yield path @@ -298,6 +296,23 @@ class Operator: params[param] = sorted(list(params[param])) return params + @staticmethod + def _get_test_set_paths(path): + """Expand a path to find all the test sets.""" + s = 0 + paths = [] + # Have a bound for the maximum test sets + while s < 100: + set_path = path.with_name(f"{path.name}_s{s}") + if set_path.exists(): + paths.append(set_path) + else: + if s == 0: + logger.error(f"Could not find test set 0 - {str(set_path)}") + break + s += 1 + return paths + def select_tests(self): # noqa: C901 (function too complex) """Generate the paths to the selected tests for this operator.""" if not self.test_paths: @@ -356,9 +371,9 @@ class Operator: if path.exists(): yield path else: - # Compliance test series - expand to all sets - for s in Operator.COMPLIANCE_SETS: - yield path.with_name(f"{path.name}{s}") + # Must be a test set - expand to all test sets + for p in Operator._get_test_set_paths(path): + yield p # search for tests that match any unused parameter values for n, path in enumerate(sorted(list(unused_paths))): @@ -377,9 +392,9 @@ class Operator: if path.exists(): yield path else: - # Compliance test series - expand to all sets - for s in Operator.COMPLIANCE_SETS: - yield path.with_name(f"{path.name}{s}") + # Must be a test set - expand to all test sets + for p in Operator._get_test_set_paths(path): + yield p break if not self.ignore_missing: -- cgit v1.2.1