aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLes Bell <les.bell@arm.com>2021-09-06 11:29:46 +0100
committerKevin Cheng <kevin.cheng@arm.com>2021-09-16 01:48:01 +0100
commitf414b3c9250d148c0a125e88967a1e9b603fa5e8 (patch)
tree71d6492672dd1508bbb731d071a5ba13d8461504
parent1533b85d198a1dd2b1ce995b6c9d69456e56eb3f (diff)
downloadreference_model-f414b3c9250d148c0a125e88967a1e9b603fa5e8.tar.gz
Generate more CONV3D tests
* plus extra debug info for some exceptions Change-Id: I667ee9b8a1cba8c6bd47c31231f1805eba680ba5 Signed-off-by: Les Bell <les.bell@arm.com>
-rw-r--r--verif/tosa_ref_run.py2
-rw-r--r--verif/tosa_test_gen.py54
-rwxr-xr-xverif/tosa_verif_run_ref.py8
3 files changed, 39 insertions, 25 deletions
diff --git a/verif/tosa_ref_run.py b/verif/tosa_ref_run.py
index 499513b..c14f490 100644
--- a/verif/tosa_ref_run.py
+++ b/verif/tosa_ref_run.py
@@ -67,7 +67,7 @@ class TosaRefRunner(TosaTestRunner):
else:
result = TosaTestRunner.Result.UNEXPECTED_FAILURE
else:
- raise Exception("Return code unknown.")
+ raise Exception(f"Return code ({rc}) unknown.")
except Exception as e:
raise Exception("Runtime Error when running: {}".format(" ".join(ref_cmd)))
diff --git a/verif/tosa_test_gen.py b/verif/tosa_test_gen.py
index 9555195..a19c5f4 100644
--- a/verif/tosa_test_gen.py
+++ b/verif/tosa_test_gen.py
@@ -502,30 +502,36 @@ class TosaArgGen:
assert len(ifm_shape) == 5
assert len(filter_shape) == 5
- # Generate basic argument list now
- # TODO: increase coverage
- s = [1, 1, 1]
- p = [0, 0, 0, 0, 0, 0]
- d = [1, 1, 1]
- arg_list.append(
- (
- "st{}{}{}_pad{}{}{}{}{}{}_dilat{}{}{}".format(
- s[0],
- s[1],
- s[2],
- p[0],
- p[1],
- p[2],
- p[3],
- p[4],
- p[5],
- d[0],
- d[1],
- d[2],
- ),
- [s, p, d],
- )
- )
+ # Generate comprehensive argument list
+ p_range = [x for x in range(0, testGen.args.max_conv_padding + 1)]
+ paddings = [x for x in itertools.product(*([p_range] * 6))]
+ s_range = [x for x in range(1, testGen.args.max_conv_stride + 1)]
+ strides = [x for x in itertools.product(*([s_range] * 3))]
+ d_range = [x for x in range(1, testGen.args.max_conv_dilation + 1)]
+ dilations = [x for x in itertools.product(*([d_range] * 3))]
+
+ # There are too many parameter combinations, so generate them sparsely
+ # To get a variety of parameter combinations sparsity should not be a multiple of 2, or 3
+ # TODO: make sparsity a CLI option
+ sparsity = 37
+ n = 0
+
+ for s in strides:
+ for p in paddings:
+ for d in dilations:
+ if n % sparsity == 0:
+ arg_list.append(
+ (
+ "st{}_pad{}_dilat{}".format(
+ "".join([str(x) for x in s]),
+ "".join([str(x) for x in p]),
+ "".join([str(x) for x in d]),
+ ),
+ [s, p, d],
+ )
+ )
+ n += 1
+
return arg_list
@staticmethod
diff --git a/verif/tosa_verif_run_ref.py b/verif/tosa_verif_run_ref.py
index e3926ea..3f23f6b 100755
--- a/verif/tosa_verif_run_ref.py
+++ b/verif/tosa_verif_run_ref.py
@@ -153,6 +153,14 @@ def workerThread(task_queue, runnerList, args, result_queue):
rc = runner.runModel()
except Exception as e:
rc = TosaTestRunner.Result.INTERNAL_ERROR
+ print(f"runner.runModel Exception: {e}")
+ print(
+ "".join(
+ traceback.format_exception(
+ etype=type(e), value=e, tb=e.__traceback__
+ )
+ )
+ )
except Exception as e:
print("Internal regression error: {}".format(e))
print(