KEMBAR78
Add `max_pool3d` for MPS by kurtamohler · Pull Request #156467 · pytorch/pytorch · GitHub
Skip to content

Conversation

@kurtamohler
Copy link
Collaborator

@kurtamohler kurtamohler commented Jun 20, 2025

[ghstack-poisoned]
@pytorch-bot
Copy link

pytorch-bot bot commented Jun 20, 2025

🔗 Helpful Links

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

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

❗ 1 Active SEVs

There are 1 currently active SEVs. If your PR is affected, please view them below:

⏳ 11 Pending, 1 Unrelated Failure

As of commit 05ce616 with merge base 43a0918 (image):

FLAKY - The following job failed but was likely due to flakiness present on trunk:

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/inductor ciflow/mps Run MPS tests (subset of trunk) release notes: mps Release notes category release notes: inductor (aoti) labels Jun 20, 2025
[ghstack-poisoned]
kurtamohler added a commit that referenced this pull request Jun 20, 2025
ghstack-source-id: 1e727c9
Pull-Request: #156467
@github-actions
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:

@github-actions
Copy link
Contributor

Attention! PyTorch one of the C-stable API file was changed

You MUST NOT change existing function declarations in this, as this header defines a stable C ABI. If you need to change the signature for a function, introduce a new v2 version of the function and modify code generation to target the new version of the function.


Caused by:

[ghstack-poisoned]
[ghstack-poisoned]
kurtamohler added a commit that referenced this pull request Jun 24, 2025
ghstack-source-id: 7790260
Pull-Request: #156467
[ghstack-poisoned]
[ghstack-poisoned]
@kurtamohler kurtamohler changed the title WIP: Add max_pool3d for MPS Add max_pool3d for MPS Jun 25, 2025
@kurtamohler kurtamohler marked this pull request as ready for review June 25, 2025 02:48
[ghstack-poisoned]
[ghstack-poisoned]
kurtamohler added a commit that referenced this pull request Jun 25, 2025
ghstack-source-id: 5cff6b2
Pull-Request: #156467
[ghstack-poisoned]
struct PoolingParams {
int32_t dims;
int32_t pooling_dims;
_ARRAY_NS::array<int64_t, N> input_sizes;
Copy link
Collaborator Author

@kurtamohler kurtamohler Jun 26, 2025

Choose a reason for hiding this comment

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

One small thing to note about providing these parameters in a struct is that the buffers in the struct need to be a fixed size at compile time (if I understand correctly), whereas before I made this change, the sizes could be determined at runtime. So this puts a limit on how many dimensions we can support while reusing the same code. But at the moment, pytorch doesn't support anything higher than 3-D pooling with 2 leading dims and I'm guessing there aren't any plans to support any higher dimensionality, so it's probably not really an issue. Of course if an arbitrary number of dims are needed in the future, we can just switch it back to specifying these params directly to mtl_setArgs instead of in a struct

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, this is correct, but even for total number of dims there is an upper limit on total number of tensor dimensions, which I think is currently 16

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Oh I didn't realize that, good to know

[ghstack-poisoned]
kurtamohler added a commit that referenced this pull request Jun 26, 2025
ghstack-source-id: 099de78
Pull-Request: #156467
@malfet
Copy link
Contributor

malfet commented Jun 26, 2025

@pytorchbot merge -f "Hopefully it's all good"

@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

@malfet malfet linked an issue Jul 21, 2025 that may be closed by this pull request
@github-actions github-actions bot deleted the gh/kurtamohler/37/head branch July 27, 2025 02:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

max_pool3d_with_indices

4 participants