Skip to content

[MPS][1/N] Fix unsupported dtypes error checking for some MPS ops#166273

Closed
malfet wants to merge 11 commits intogh/malfet/575/basefrom
gh/malfet/575/head
Closed

[MPS][1/N] Fix unsupported dtypes error checking for some MPS ops#166273
malfet wants to merge 11 commits intogh/malfet/575/basefrom
gh/malfet/575/head

Conversation

@malfet
Copy link
Copy Markdown
Contributor

@malfet malfet commented Oct 26, 2025

Stack from ghstack (oldest at bottom):

Partially vibe-coded with ClaudeCode, and changes following ops (summary also created by Claude):

  • Activation operations: Added checks rejecting Long, Complex, and Bool types for operations like log_softmax, log_sigmoid, mish, softplus, and silu, as MPS doesn't support exponent operations on these types

  • Linear algebra operations: Restricted linalg_lu_factor, linalg_solve, and linalg_solve_triangular to Float type only (previously only checked for complex types)

  • Pooling operations: Added checks to reject Complex types for avg_pool2d and max_pool2d operations

  • Loss functions: Added type checks for nll_loss (Complex), huber_loss (Long, Complex), and grid_sampler_2d (Complex)

  • Reduction operations:

    • Fixed NANSUM to handle integral types correctly (can't contain NaN, so just performs regular sum)
    • Added Long type check for std/var operations
  • Other operations:

    • softmax: Now explicitly requires floating point types
    • bincount: Rejects Bool type to prevent crashes

All checks use TORCH_CHECK_NOT_IMPLEMENTED

[ghstack-poisoned]
@pytorch-bot
Copy link
Copy Markdown

pytorch-bot Bot commented Oct 26, 2025

🔗 Helpful Links

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

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

⏳ No Failures, 53 Pending

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

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 Oct 26, 2025
malfet added a commit that referenced this pull request Oct 26, 2025
ghstack-source-id: cb5bebe
Pull Request resolved: #166273
@malfet malfet marked this pull request as draft October 27, 2025 01:40
malfet and others added 3 commits October 26, 2025 18:46
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
malfet added a commit that referenced this pull request Oct 28, 2025
ghstack-source-id: 604ff04
Pull Request resolved: #166273
[ghstack-poisoned]
malfet added a commit that referenced this pull request Oct 28, 2025
ghstack-source-id: fd1aea3
Pull Request resolved: #166273
[ghstack-poisoned]
malfet and others added 2 commits October 30, 2025 19:56
[ghstack-poisoned]
[ghstack-poisoned]
Khanaksahu pushed a commit to Khanaksahu/pytorch that referenced this pull request Nov 17, 2025
ghstack-source-id: c091944
Pull Request resolved: pytorch/pytorch#166273
@malfet malfet added the topic: bug fixes topic category label Nov 18, 2025
[ghstack-poisoned]
@malfet malfet changed the title [MPS] Work in progress error checking [MPS] FIx unsupported dtypes error checking for some MPS ops Nov 18, 2025
[ghstack-poisoned]
@malfet malfet marked this pull request as ready for review November 18, 2025 22:56
@malfet malfet requested a review from kulinseth as a code owner November 18, 2025 22:56
[ghstack-poisoned]
malfet added a commit that referenced this pull request Nov 19, 2025
ghstack-source-id: e2cf3c1
Pull Request resolved: #166273
@malfet malfet changed the title [MPS] FIx unsupported dtypes error checking for some MPS ops [MPS][1/N] Fix unsupported dtypes error checking for some MPS ops Nov 19, 2025
@malfet
Copy link
Copy Markdown
Contributor Author

malfet commented Nov 19, 2025

@pytorchbot merge -f "Lint + MPS are green"

@pytorchmergebot
Copy link
Copy Markdown
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

tiendatngcs pushed a commit to tiendatngcs/pytorch-Dec25 that referenced this pull request Dec 10, 2025
ghstack-source-id: 0cfe35c
Pull Request resolved: pytorch/pytorch#166273
@github-actions github-actions Bot deleted the gh/malfet/575/head branch December 20, 2025 02:16
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: bug fixes topic category

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants