Skip to content

[ET-VK] double, short, and uint16 dtype runtime support #11670

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

Open
wants to merge 2 commits into
base: gh/ahmtox/17/orig
Choose a base branch
from

Conversation

pytorchbot
Copy link
Collaborator

This PR was created by the merge bot to help merge the original PR into the main branch.
ghstack PR number: #11365 by @ahmtox
^ 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/ahmtox/7/base
ghstack PR head: https://github.com/pytorch/executorch/tree/gh/ahmtox/7/head
Merge bot PR base: https://github.com/pytorch/executorch/tree/gh/ahmtox/17/orig
Merge bot PR head: https://github.com/pytorch/executorch/tree/gh/ahmtox/7/orig
@diff-train-skip-merge

Pull Request resolved: #11365

# Context
This diff generally aims provide improvements to the existing framework for defining dtype GLSL shader variants, along with setting up support that would be necessary for future shader implementations that wish to support int64 and double dtypes. In order to allow doubles as input/output dtypes for dequantization and quantization, this diff will create the dtype runtime support on the Vulkan backend in Executorch by establishing the relationship between different tensor types and different GLSL types.

# Changes
The main changes are included in `gen_vulkan_spv.py` which maps the relationship between different dtypes and their GLSL types. For instance, we add aliases for every common dtype which includes `uint8`, `int8`, `uint16`, `int16`, `uint32`, `int32`, `uint64`, `int64`, and `double`. We maintain support for `int`, `uint`, and `bool` alises such that we can avoid making the change overly complex while supporting the most common recognizable alias (int). Furthermore, this diff also modifies the vulkan api to incorporate new types, namely `uint32_t`, `double`, the int16 and int64 variants. We then make sure that the `ShaderNameUtils` (which is commonly used by most operators for creating their variant names), utilizes the new aliasing. Beyond that we also throw an exception to disallow YAML files to include just "int", and to be more specific, like with "int32".

We then modify dozens of files to switch to the new alias of int32. Furthermore, we also include double in certain shaders that are used as intermediaries for image to buffer to nchw converisons.
ghstack-source-id: 290376491
@exported-using-ghexport

Differential Revision: [D75959063](https://our.internmc.facebook.com/intern/diff/D75959063/)
@pytorchbot pytorchbot requested a review from SS-JIA as a code owner June 14, 2025 03:46
Copy link

pytorch-bot bot commented Jun 14, 2025

🔗 Helpful Links

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

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

❌ 1 New Failure

As of commit 9a82e98 with merge base 56392aa (image):

NEW FAILURE - The following job has failed:

  • Lint / lintrunner / linux-job (gh)
    RuntimeError: Command docker exec -t 0aeede2af7e15ad68fbb8a157208fdf21f8e33436e8d06bb83d51761df12f051 /exec failed with exit code 127

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

@facebook-github-bot facebook-github-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 Jun 14, 2025
@ahmtox ahmtox self-requested a review June 14, 2025 03:57
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.

3 participants