Skip to content

[ET-VK] Add per-operator dtype constraints to op_registry#17355

Merged
SS-JIA merged 1 commit intomainfrom
gh/SS-JIA/414/orig
Feb 11, 2026
Merged

[ET-VK] Add per-operator dtype constraints to op_registry#17355
SS-JIA merged 1 commit intomainfrom
gh/SS-JIA/414/orig

Conversation

@pytorchbot
Copy link
Copy Markdown
Collaborator

This PR was created by the merge bot to help merge the original PR into the main branch.
ghstack PR number: #17336 by @SS-JIA
^ Please use this as the source of truth for the PR details, comments, and reviews
ghstack PR base: https://github.com/pytorch/executorch/tree/gh/SS-JIA/414/base
ghstack PR head: https://github.com/pytorch/executorch/tree/gh/SS-JIA/414/head
Merge bot PR base: https://github.com/pytorch/executorch/tree/gh/SS-JIA/413/orig
Merge bot PR head: https://github.com/pytorch/executorch/tree/gh/SS-JIA/414/orig
Differential Revision: D92740295
@diff-train-skip-merge

@pytorchbot pytorchbot requested a review from SS-JIA as a code owner February 10, 2026 22:19
@pytorch-bot
Copy link
Copy Markdown

pytorch-bot Bot commented Feb 10, 2026

🔗 Helpful Links

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

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

⏳ No Failures, 154 Pending

As of commit 78dfdd4 with merge base bc3b703 (image):
💚 Looks good so far! There are no failures yet. 💚

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

@meta-cla meta-cla 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 Feb 10, 2026
Base automatically changed from gh/SS-JIA/413/orig to main February 11, 2026 00:07
Previously, dtype validation for Vulkan operators was scattered across
individual node-checking functions (e.g., `check_to_copy_node` had inline
float16/float32 checks). This made it difficult to see at a glance which
dtypes each operator supports.

This diff introduces a centralized dtype constraint system:

- `utils.py`: Adds dtype set constants (`FP_T`, `INT_T`, `FP_INT32_T`,
  `FP_INT32_BOOL_T`, etc.) and a `DtypeSetList` wrapper class with
  broadcasting semantics. The `check_node_dtypes()` function validates
  tensor inputs/outputs against allowed dtype sets and returns descriptive
  error messages.

- `op_registry.py`: Extends `OpFeatures` with `inputs_dtypes` and
  `outputs_dtypes` parameters. Each operator registration now explicitly
  declares its supported dtypes. Simplified node-checking functions like
  `check_to_copy_node` since dtype logic is now handled declaratively.

- `vulkan_partitioner.py`: Calls `features.check_dtypes()` early in
  validation, failing fast with a clear skip reason if dtypes are invalid.

This approach improves maintainability by making dtype support explicit and
centralizing the validation logic.

Authored with assistance from Claude.

Differential Revision: [D92740295](https://our.internmc.facebook.com/intern/diff/D92740295/)

ghstack-source-id: 339885885
Pull Request resolved: #17336
@SS-JIA SS-JIA force-pushed the gh/SS-JIA/414/orig branch from fac8492 to 78dfdd4 Compare February 11, 2026 00:16
@github-actions
Copy link
Copy Markdown

This PR needs a release notes: label

If your change should be included in the release notes (i.e. would users of this library care about this change?), please use a label starting with release notes:. This helps us keep track and include your important work in the next release notes.

To add a label, you can comment to pytorchbot, for example
@pytorchbot label "release notes: none"

For more information, see
https://github.com/pytorch/pytorch/wiki/PyTorch-AutoLabel-Bot#why-categorize-for-release-notes-and-how-does-it-work.

@SS-JIA SS-JIA merged commit 4630347 into main Feb 11, 2026
155 of 163 checks passed
@SS-JIA SS-JIA deleted the gh/SS-JIA/414/orig branch February 11, 2026 00:30
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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants