-
Notifications
You must be signed in to change notification settings - Fork 793
[Arm backend] Fix for TOSA BI clamp ops #3092
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 2 commits
06ae770
66b2ffa
b95eb03
34fcfe3
86fca94
ef71c6d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -555,10 +555,7 @@ def run_method_and_compare_outputs( | |
| print(f"Run {run_iteration} with input shapes: {input_shapes}") | ||
|
|
||
| # Reference output (and quantization scale) | ||
| ( | ||
| reference_output, | ||
| quantization_scale, | ||
| ) = self._calculate_reference_output( | ||
| (reference_output, quantization_scale,) = self._calculate_reference_output( | ||
|
||
| reference_stage.artifact, inputs_to_run | ||
| ) | ||
|
|
||
|
|
@@ -586,16 +583,11 @@ def _assert_outputs_equal(model_output, ref_output, atol=1e-03, rtol=1e-03): | |
| for i in range(len(model_output)): | ||
| model = model_output[i] | ||
| ref = ref_output[i] | ||
| assert torch.allclose( | ||
| model, | ||
| ref, | ||
| atol=atol, | ||
| rtol=rtol, | ||
| ), ( | ||
| assert torch.allclose(model, ref, atol=atol, rtol=rtol,), ( | ||
|
||
| f"Output {i} does not match reference output.\n" | ||
| f"\tGiven atol: {atol}, rtol: {rtol}.\n" | ||
| f"\tOutput tensor shape: {model.shape}, dtype: {model.dtype}\n" | ||
| f"\tDifference: max: {torch.max(model-ref)}, abs: {torch.max(torch.abs(model-ref))}.\n" | ||
| f"\tDifference: max: {torch.max(model-ref)}, abs: {torch.max(torch.abs(model-ref))}, mean abs error: {torch.mean(torch.abs(model-ref))}.\n" | ||
digantdesai marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| f"\t-- Model vs. Reference --\n" | ||
| f"\t Numel: {model.numel()}, {ref.numel()}\n" | ||
| f"\tMedian: {model.median()}, {ref.median()}\n" | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should get qmin/qmax from the quant node