Skip to content

Commit 4c0fd83

Browse files
committed
Handle output from TOSA reference model being int8
Move TOSA reference model. This add .npy array now is aligned to output int8 for BI models. Make sure the dequantization not overflows by adding a cast to int32. Signed-off-by: Per Åstrand <[email protected]> Change-Id: I2274955bc02a6f3a75687bb2f731b2058834c44f
1 parent cd2d2b4 commit 4c0fd83

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

backends/arm/test/runner_utils.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -439,6 +439,9 @@ def run_tosa_ref_model(
439439

440440
if self.is_quantized:
441441
# Need to dequant back to FP32 for comparison with torch output
442+
# Convert to int32 prior to dequantize the output
443+
if tosa_ref_output.dtype == np.int8:
444+
tosa_ref_output = tosa_ref_output.astype(np.int32)
442445
quant_param = self.qp_output
443446
assert (
444447
quant_param is not None

examples/arm/setup.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ ethos_u_base_rev="24.08"
8888

8989
# tosa reference model
9090
tosa_reference_model_url="https://review.mlplatform.org/tosa/reference_model"
91-
tosa_reference_model_rev="444eb365d92774430006e56a8c20161be2f2674f"
91+
tosa_reference_model_rev="f9ea4ab7da19318fe36b1c34d68a3e40fd6e56c5"
9292

9393
########
9494
### Mandatory user args

0 commit comments

Comments
 (0)