Skip to content

Qualcomm AI Engine Direct - Fix Argmin #8308

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 2 commits into from
Feb 11, 2025

Conversation

winskuo-quic
Copy link
Collaborator

@winskuo-quic winskuo-quic commented Feb 7, 2025

  • Update argmin opbuilder so it outputs int64, aligning with Pytorch
  • Add a pass to cast argmin output to int32 since most OP in QNN does not support int64

Summary

  • Annotate argmin input only.
  • Update argmin opbuilder so it outputs int64 dtype since PyTorch only supports int64 argmin.
  • Add a pass to cast argmin output to int32 since most OPs in QNN don't support int64.

Test plan

  • Added more UT to cover edge cases

cc @cccclai @shewu-quic

- Update argmin opbuilder so it outputs int64, aligning with Pytorch
- Add a pass to cast argmin output to int32 since most OP in QNN does
  not support int64
Copy link

pytorch-bot bot commented Feb 7, 2025

🔗 Helpful Links

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

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

❌ 1 New Failure, 2 Cancelled Jobs

As of commit 66929fd with merge base e63c923 (image):

NEW FAILURE - The following job has failed:

CANCELLED JOBS - The following jobs were cancelled. Please retry:

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 7, 2025
@winskuo-quic
Copy link
Collaborator Author

Hi @cccclai, @billmguo
This PR should be able to resolve argmin output dtype failure issue.
Please have a look.
Thanks

@facebook-github-bot
Copy link
Contributor

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

@digantdesai digantdesai added the partner: qualcomm For backend delegation, kernels, demo, etc. from the 3rd-party partner, Qualcomm label Feb 7, 2025
@cccclai
Copy link
Contributor

cccclai commented Feb 11, 2025

There is an error

executorch/examples/qualcomm/oss_scripts/llama/llama.py", line 22, in <module>
    from executorch.backends.qualcomm._passes.i64_to_i32 import I64toI32
ModuleNotFoundError: No module named 'executorch.backends.qualcomm._passes.i64_to_i32'

can you help resolving it

@winskuo-quic
Copy link
Collaborator Author

There is an error

executorch/examples/qualcomm/oss_scripts/llama/llama.py", line 22, in <module>
    from executorch.backends.qualcomm._passes.i64_to_i32 import I64toI32
ModuleNotFoundError: No module named 'executorch.backends.qualcomm._passes.i64_to_i32'

can you help resolving it

I pushed a new commit that should resolve the error. Thanks for the reminder.

@facebook-github-bot
Copy link
Contributor

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

billmguo pushed a commit to billmguo/executorch that referenced this pull request Feb 11, 2025
Summary:
- Update argmin opbuilder so it outputs int64, aligning with Pytorch
- Add a pass to cast argmin output to int32 since most OP in QNN does not support int64

- Annotate argmin input only.
- Update argmin opbuilder so it outputs int64 dtype since PyTorch only supports int64 argmin.
- Add a pass to cast argmin output to int32 since most OPs in QNN don't support int64.

Pull Request resolved: pytorch#8308

Test Plan: - Added more UT to cover edge cases

Differential Revision: D69313329

Pulled By: billmguo
@cccclai cccclai added the release notes: qualcomm Changes to the Qualcomm backend delegate label Feb 11, 2025
@cccclai cccclai merged commit 5c52fbe into pytorch:main Feb 11, 2025
44 of 47 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. partner: qualcomm For backend delegation, kernels, demo, etc. from the 3rd-party partner, Qualcomm release notes: qualcomm Changes to the Qualcomm backend delegate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants