-
Notifications
You must be signed in to change notification settings - Fork 26.3k
[MPS][BE][EZ] Aggregate macros #148187
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
[MPS][BE][EZ] Aggregate macros #148187
Conversation
Refactor `INSTANTIATE_UPSAMPLE_BILINEAR2D(DTYPE)`, `INSTANTIATE_UPSAMPLE_BICUBIC2D(DTYPE)` and `INSTANTIATE_UPSAMPLE_BILINEAR2DAA(DTYPE)` use common `INSTANTIATE_UPSAMPLE2D` Then combine multiple invocations into `INSTANTIATE_UPSAMPLE_ALL` I.e. functionally it's a no-op, but achieves the same with fewer lines of code [ghstack-poisoned]
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/148187
Note: Links to docs will display an error until the docs builds have been completed. ⏳ No Failures, 30 PendingAs of commit 5ac55f9 with merge base 926b7b5 ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
Refactor `INSTANTIATE_UPSAMPLE_BILINEAR2D(DTYPE)`, `INSTANTIATE_UPSAMPLE_BICUBIC2D(DTYPE)` and `INSTANTIATE_UPSAMPLE_BILINEAR2DAA(DTYPE)` use common `INSTANTIATE_UPSAMPLE2D` Then combine multiple invocations into `INSTANTIATE_UPSAMPLE_ALL` I.e. functionally it's a no-op, but achieves the same with fewer lines of code [ghstack-poisoned]
Refactor `INSTANTIATE_UPSAMPLE_BILINEAR2D(DTYPE)`, `INSTANTIATE_UPSAMPLE_BICUBIC2D(DTYPE)` and `INSTANTIATE_UPSAMPLE_BILINEAR2DAA(DTYPE)` use common `INSTANTIATE_UPSAMPLE2D` Then combine multiple invocations into `INSTANTIATE_UPSAMPLE_ALL` I.e. functionally it's a no-op, but achieves the same with fewer lines of code [ghstack-poisoned]
|
@pytorchbot merge -f "Roses are red, violets are blue, MPS is green, so I merge you" |
Merge startedYour change will be merged immediately since you used the force (-f) flag, bypassing any CI checks (ETA: 1-5 minutes). Please use Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
- First, by stopp inverting sizes and strides, i.e. passing them as is, but reading them in inverse order in the shader as 1st stride of 4D tensor is one used for batches, 2nd for channels and 3rd and 4th for spatial coordinates - Pass `scales` as float2 even in linear tensor Above allows one to collide two flavors `upsample_kernel_out_template` into one Pull Request resolved: #148211 Approved by: https://github.com/dcci ghstack dependencies: #148154, #148187
Not sure why tolerances were set like that, this logic was added in #104181 without much explanation But if I'm to make a guess, it's likely due to the inaccuracy of bilinear op, that has since been replaced by shader Pull Request resolved: #148224 Approved by: https://github.com/Skylion007, https://github.com/dcci ghstack dependencies: #148154, #148187, #148211
Stack from ghstack (oldest at bottom):
upsample_kernel_out_templateinto one #148211Refactor
INSTANTIATE_UPSAMPLE_BILINEAR2D(DTYPE),INSTANTIATE_UPSAMPLE_BICUBIC2D(DTYPE)andINSTANTIATE_UPSAMPLE_BILINEAR2DAA(DTYPE)use commonINSTANTIATE_UPSAMPLE2DThen combine multiple invocations into
INSTANTIATE_UPSAMPLE_ALLI.e. functionally it's a no-op, but achieves the same with fewer lines of code