Skip to content

[MPS] Add bicubic2d_aa #149378

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

Closed
wants to merge 3 commits into from
Closed

[MPS] Add bicubic2d_aa #149378

wants to merge 3 commits into from

Conversation

malfet
Copy link
Contributor

@malfet malfet commented Mar 18, 2025

Stack from ghstack (oldest at bottom):

Which is currently the most frequently requested op in #141287

Mostly done by refactoring upsample_bilinear2d_aa to accept Functor as one of the template arguments, which closely ideas from https://github.com/python-pillow/Pillow/blob/eec43cfbc0c9962af2b728677d1d011b311584db/src/libImaging/Resample.c as well as

template <typename scalar_t, typename accscalar_t, typename InterpFilter>
C10_LAUNCH_BOUNDS_1(256) // 256 performs better then 1024
__global__ void upsample_gen2d_aa_out_frame(
const accscalar_t height_scale,
const accscalar_t width_scale,
const PackedTensorAccessor64<const scalar_t, 4> idata,
PackedTensorAccessor64<scalar_t, 4> odata,

Populate unit tests by copying upsample_bilinear_2d_aa and reusing it as upsample_bicubic2d_aa

At that point, only difference between upsample_bilinear2d_aa and upsample_bicubic2d_aa are convolution kernel function and size: for bilinear it's 3x3, for bicubic it's 5x5

[ghstack-poisoned]
@malfet malfet requested a review from kulinseth as a code owner March 18, 2025 03:03
Copy link

pytorch-bot bot commented Mar 18, 2025

🔗 Helpful Links

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

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

⏳ 19 Pending, 1 Unrelated Failure

As of commit 7b6c5bf with merge base acf42b0 (image):

UNSTABLE - The following job is marked as unstable, possibly due to flakiness on trunk:

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@pytorch-bot pytorch-bot bot added ciflow/mps Run MPS tests (subset of trunk) release notes: mps Release notes category labels Mar 18, 2025
@malfet malfet requested a review from dcci March 18, 2025 03:03
Copy link
Contributor

Attention! native_functions.yaml was changed

If you are adding a new function or defaulted argument to native_functions.yaml, you cannot use it from pre-existing Python frontend code until our FC window passes (two weeks). Split your PR into two PRs, one which adds the new C++ functionality, and one that makes use of it from Python, and land them two weeks apart. See https://github.com/pytorch/pytorch/wiki/PyTorch's-Python-Frontend-Backward-and-Forward-Compatibility-Policy#forwards-compatibility-fc for more info.


Caused by:

@malfet malfet added the topic: improvements topic category label Mar 18, 2025
Copy link
Member

@dcci dcci left a comment

Choose a reason for hiding this comment

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

LG if CI is happy

malfet added 2 commits March 17, 2025 20:32
[ghstack-poisoned]
[ghstack-poisoned]
@malfet
Copy link
Contributor Author

malfet commented Mar 18, 2025

@pytorchbot merge -f "Human TD: Lint + MPS are green"

@pytorchmergebot
Copy link
Collaborator

Merge started

Your change will be merged immediately since you used the force (-f) flag, bypassing any CI checks (ETA: 1-5 minutes). Please use -f as last resort and instead consider -i/--ignore-current to continue the merge ignoring current failures. This will allow currently pending tests to finish and report signal before the merge.

Learn more about merging in the wiki.

Questions? Feedback? Please reach out to the PyTorch DevX Team

Advanced Debugging
Check the merge workflow status
here

jurgen-paul pushed a commit to jurgen-paul/pytorch.git.file that referenced this pull request Mar 19, 2025
Which is currently the most frequently requested op in pytorch/pytorch#141287

Small TODO: refactor two AA functions into one

ghstack-source-id: 87ca392
Pull Request resolved: pytorch/pytorch#149378
@github-actions github-actions bot deleted the gh/malfet/237/head branch May 12, 2025 02:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ciflow/mps Run MPS tests (subset of trunk) Merged release notes: mps Release notes category topic: improvements topic category
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants