Skip to content

[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

Closed
wants to merge 6 commits into from

Conversation

freddan80
Copy link
Collaborator

Min/max range values need to be on quantized form.

Min/max range values need to be on quantized form.

Change-Id: I68d091306890f0a500d829ce20fc337e6cbe9dba
Signed-off-by: Fredrik Knutsson <fredrik.knutsson@arm.com>
Copy link

pytorch-bot bot commented Apr 17, 2024

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/3092

Note: Links to docs will display an error until the docs builds have been completed.

✅ You can merge normally! (1 Unrelated Failure)

As of commit ef71c6d with merge base 73599f4 (image):

BROKEN TRUNK - The following job failed but were present on the merge base:

👉 Rebase onto the `viable/strict` branch to avoid these failures

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Apr 17, 2024
@freddan80 freddan80 added ciflow/trunk partner: arm For backend delegation, kernels, demo, etc. from the 3rd-party partner, Arm labels Apr 17, 2024
Change-Id: Ie59881824d76d5a9c30e95a8024dbbb11055577b
reference_output,
quantization_scale,
) = self._calculate_reference_output(
(reference_output, quantization_scale,) = self._calculate_reference_output(
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lintrunner did this

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm, the CI lintrunner seem to think differently than my local one

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Weird. I use the same version, 0.11.0, as mandated by the contribution guidelines. I had to re-run lintrunner init to get the same result. I'll push the update soon...

atol=atol,
rtol=rtol,
), (
assert torch.allclose(model, ref, atol=atol, rtol=rtol,), (
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dito

Change-Id: Ia773c04d17f24bd155365a412b3e96c3b3d9aa63
@freddan80
Copy link
Collaborator Author

CI failures not related to this PR.

scale, zp = get_quant_node_args(node.all_input_nodes[0])
# Convert to quantized representation
clamp_min_qs = round((inputs[1].number / scale) + zp)
clamp_min_qs = max(clamp_min_qs, -128)
Copy link
Contributor

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

freddan80 and others added 2 commits April 19, 2024 12:13
Change-Id: I9dee9bec58e51fcef57ebb287dbad62016c221d1
@facebook-github-bot
Copy link
Contributor

@digantdesai has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@facebook-github-bot
Copy link
Contributor

@digantdesai merged this pull request in b0a400c.

@mergennachin mergennachin mentioned this pull request Apr 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ciflow/trunk CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Merged partner: arm For backend delegation, kernels, demo, etc. from the 3rd-party partner, Arm
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants