Skip to content

Add support for torch.pow in the Arm backend #9309

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
Apr 1, 2025
Merged

Conversation

martinlsm
Copy link
Collaborator

@martinlsm martinlsm commented Mar 17, 2025

Copy link

pytorch-bot bot commented Mar 17, 2025

🔗 Helpful Links

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

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

⏳ No Failures, 1 Pending

As of commit 5379416 with merge base feb3fcd (image):
💚 Looks good so far! There are no failures yet. 💚

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 Mar 17, 2025
@martinlsm
Copy link
Collaborator Author

@pytorchbot label "topic: not user facing"

@martinlsm
Copy link
Collaborator Author

@pytorchbot label "partner: arm"

@pytorch-bot pytorch-bot bot added the partner: arm For backend delegation, kernels, demo, etc. from the 3rd-party partner, Arm label Mar 17, 2025
@martinlsm
Copy link
Collaborator Author

@pytorchbot label ciflow/trunk

Copy link
Contributor

@digantdesai digantdesai left a comment

Choose a reason for hiding this comment

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

LGTM, thanks.

@martinlsm martinlsm marked this pull request as draft March 23, 2025 19:19
@martinlsm martinlsm closed this Mar 26, 2025
@martinlsm martinlsm reopened this Mar 26, 2025
@martinlsm martinlsm marked this pull request as ready for review March 26, 2025 14:36
@martinlsm
Copy link
Collaborator Author

@digantdesai I have updated this PR so you might want to check it again.

@digantdesai
Copy link
Contributor

Rebase?

@martinlsm
Copy link
Collaborator Author

@digantdesai I'm on it. Had some test failures after rebasing locally but the patch is on it's way.

Implement support for torch.pow in the MI and BI profile of TOSA.

For MI, the operator works as Pytorch's reference implementation except
for that the base operand cannot be a scalar but must be a tensor.

For BI, the exponent operand must be a scalar and a constant value. The
base operand must be a tensor.

Split the ReplaceScalarWithTensorArgsPass into two subclasses: one for
MI and one for BI. For MI, the pow operator's exponent will converted to
a tensor in case it is a scalar. For BI, the scalar will be kept, but
instead it will be consumed in the InsertTableOpsPass, meaning that the
operator will be converted into a table operation with one input and
output. This still enforces the exponent to be constant for the BI
profile.

Change-Id: I464ab91ff46c0a6ad28d0fb84735a403a74e6323
@zingo zingo merged commit a5e326a into pytorch:main Apr 1, 2025
166 checks passed
kirklandsign pushed a commit that referenced this pull request Apr 11, 2025
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.

4 participants