Skip to content

Arm backend: Add support for amax/max/amin/min #8829

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

Merged
merged 1 commit into from
Feb 28, 2025

Conversation

AdrianLundell
Copy link
Collaborator

@AdrianLundell AdrianLundell commented Feb 28, 2025

Max/min can be decomposed as for example
max(x) = (amax(x), argmax(x))

For MI, an operator support check is added to support max-ops for which the argmax is not used. For BI, the int64 dtype returned by argmax is currently not supported by the arm_quantizer, and the program will crash. This is the same behaviour as before the patch, but with an improved error message.

  • Adds op_amax/op_amin node visitors.
  • Renames op_max/min->op_maximum/minimum to clearly separate the two ops.
  • Adds convert_minmax_pass to make min/max/amin/amax TOSA-compatible.
  • Adds unittests

Util updates:

  • Updates analyze_output_utils to support rank 0.
  • Adds quantization to OpNotSupportedPipeline

cc @digantdesai @freddan80 @per @zingo @oscarandersson8218

Max/min can be decomposed as for example
  max(x) = (amax(x), argmax(x))

For MI, an operator support check is added to support max-ops for
which the argmax is not used. For BI, the int64 dtype returned by
argmax is currently not supported by the arm_quantizer, and the
program will crash. This is the same behaviour as before the patch,
but with an improved error message.

- Adds op_amax/op_amin node visitors.
- Renames op_max/min->op_maximum/minimum to clearly separate the two
  ops.
- Adds convert_minmax_pass to make min/max/amin/amax TOSA-compatible.
- Adds unittests

Util updates:
- Updates analyze_output_utils to support rank 0.
- Adds quantization to OpNotSupportedPipeline

Change-Id: I0a7ff126696a9b46568787c40cdf128f0c00f631
Signed-off-by: Adrian Lundell <[email protected]>
@AdrianLundell AdrianLundell added partner: arm For backend delegation, kernels, demo, etc. from the 3rd-party partner, Arm ciflow/trunk topic: not user facing labels Feb 28, 2025
Copy link

pytorch-bot bot commented Feb 28, 2025

🔗 Helpful Links

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

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

❌ 1 Cancelled Job, 1 Unrelated Failure

As of commit 25e6802 with merge base 4df0ade (image):

CANCELLED JOB - The following job was cancelled. Please retry:

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 Feb 28, 2025
@zingo
Copy link
Collaborator

zingo commented Feb 28, 2025

MacOS fails unrelated

@zingo zingo merged commit 709fa38 into pytorch:main Feb 28, 2025
118 of 121 checks passed
@AdrianLundell AdrianLundell deleted the change-966216 branch March 19, 2025 07:52
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. partner: arm For backend delegation, kernels, demo, etc. from the 3rd-party partner, Arm topic: not user facing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants