Skip to content
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

elementwise_util: s/common/compute/ almost everywhere and deprecate SAME_AS_COMPUTE #9613

Merged
merged 1 commit into from
Mar 26, 2025

Conversation

swolchok
Copy link
Contributor

@swolchok swolchok commented Mar 25, 2025

As the title says, this is mostly a few related find-replaces, plus marking SupportedTensorDtypes::SAME_AS_COMPUTE deprecated.

[ghstack-poisoned]
Copy link

pytorch-bot bot commented Mar 25, 2025

🔗 Helpful Links

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

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 aab3e03 with merge base 811352d (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.

swolchok added a commit that referenced this pull request Mar 25, 2025
…AME_AS_COMMON

As the title says, this is mostly a few related find-replaces, plus marking SupportedTensorDtypes::SAME_AS_COMMON deprecated.
ghstack-source-id: 96ac25a9a2d2dc5b72a7e813f2c53c6a3966228a
ghstack-comment-id: 2752741465
Pull-Request-resolved: #9613
@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 25, 2025
@swolchok swolchok changed the title elementwise_util: s/common/compute/ almost everywhere and deprecate SAME_AS_COMMON elementwise_util: s/common/compute/ almost everywhere and deprecate SAME_AS_COMPUTE Mar 25, 2025
@swolchok
Copy link
Contributor Author

I'm not sure of the best way to handle SAME_AS_COMMON/SAME_AS_COMPUTE. The problems are as follows:

  • SAME_AS_COMPUTE is likely not what anybody meant; the output type is a function of the input types not a function of whatever precision we happen to compute in. (hence this diff deprecating it)
  • We labelled the incoming type CTYPE_COMMON, but it's really the compute dtype (hence this diff changing the label).
  • We don't actually know the common dtype. We can't add it to the elementwise_util interface without a breaking change because elementwise_util isn't marked internal. I'm not sure how to solve this part (but I'm sending a PR right now to deprecate the non-internal elementwise_util interface on grounds that it's demonstrably not stable yet).

swolchok added a commit that referenced this pull request Mar 25, 2025
As the code comment says, these APIs are undergoing development (see e.g. #9613) and it's pretty inconvenient that they're incidentally committed-to externally. Mark them deprecated so we have the option to drop that commitment in (IIUC) 0.7.
ghstack-source-id: f9ea4ab39bd8c9ce4a8ebf7ec7c66b9b51da3079
ghstack-comment-id: 2752758912
Pull-Request-resolved: #9621
@swolchok swolchok added the release notes: api Changes to public facing apis (any interfaces, pybinded runtime methods, etc.) label Mar 26, 2025
@swolchok
Copy link
Contributor Author

we should land this if and only if @manuelcandales agrees it is improving the code, since the diffs I was trying to support with it have been abandoned.

@swolchok swolchok merged commit 118f0a4 into main Mar 26, 2025
80 of 83 checks passed
@swolchok swolchok deleted the gh/swolchok/398/head branch March 26, 2025 21:06
swolchok added a commit that referenced this pull request Mar 26, 2025
As the code comment says, these APIs are undergoing development (see
e.g. #9613) and it's pretty
inconvenient that they're incidentally committed-to externally. Mark
them deprecated so we have the option to drop that commitment in (IIUC)
0.7.
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. release notes: api Changes to public facing apis (any interfaces, pybinded runtime methods, etc.)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants