Skip to content

[ET-VK][codegen][fix] Split codegen and SPIR-V compilation into separate steps in gen_vulkan_spv #11823

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

Merged
merged 1 commit into from
Jun 20, 2025

Conversation

SS-JIA
Copy link
Contributor

@SS-JIA SS-JIA commented Jun 20, 2025

Stack from ghstack (oldest at bottom):

Changes

  • As title
  • Also removed caching mechanism for the codegen step for simplicity, and ad hoc latency testing didn't reveal any improvements from caching this step

Motivation

As written, gen_vulkan_spv has a potential bug where generated header files are out of date when SPIR-V compilation occurs. Due to the parallelization of SPIR-V compilation, it's possible for a generated GLSL file to be processed before header files that it uses are generated.

The fix is to separate the steps of code generation and SPIR-V compilation, such that code generation finished before SPIR-V compilation occurs.

Differential Revision: D77034022

cc @manuelcandales @cbilgin

…ate steps in gen_vulkan_spv

## Changes

* As title
* Also removed caching mechanism for the codegen step for simplicity, and ad hoc latency testing didn't reveal any improvements from caching this step

## Motivation

As written, gen_vulkan_spv has a potential bug where generated header files are out of date when SPIR-V compilation occurs. Due to the parallelization of SPIR-V compilation, it's possible for a generated GLSL file to be processed before header files that it uses are generated.

The fix is to separate the steps of code generation and SPIR-V compilation, such that code generation finished before SPIR-V compilation occurs.

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

[ghstack-poisoned]
SS-JIA added a commit that referenced this pull request Jun 20, 2025
…ate steps in gen_vulkan_spv

## Changes

* As title
* Also removed caching mechanism for the codegen step for simplicity, and ad hoc latency testing didn't reveal any improvements from caching this step

## Motivation

As written, gen_vulkan_spv has a potential bug where generated header files are out of date when SPIR-V compilation occurs. Due to the parallelization of SPIR-V compilation, it's possible for a generated GLSL file to be processed before header files that it uses are generated.

The fix is to separate the steps of code generation and SPIR-V compilation, such that code generation finished before SPIR-V compilation occurs.

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

ghstack-source-id: 291681597
Pull Request resolved: #11823
@pytorch-bot pytorch-bot bot added the module: vulkan Issues related to the Vulkan delegate and code under backends/vulkan/ label Jun 20, 2025
Copy link

pytorch-bot bot commented Jun 20, 2025

🔗 Helpful Links

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

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

✅ No Failures

As of commit cc52ea1 with merge base 496cb05 (image):
💚 Looks good so far! There are no failures yet. 💚

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 20, 2025
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D77034022

Copy link

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.

@facebook-github-bot facebook-github-bot merged commit 6d569c2 into gh/SS-JIA/244/base Jun 20, 2025
98 of 101 checks passed
@facebook-github-bot facebook-github-bot deleted the gh/SS-JIA/244/head branch June 20, 2025 19:05
SS-JIA added a commit that referenced this pull request Jun 20, 2025
…ate steps in gen_vulkan_spv (#11829)

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

cc @SS-JIA @manuelcandales @cbilgin

Co-authored-by: Stephen Jia <[email protected]>
hinriksnaer pushed a commit to hinriksnaer/executorch that referenced this pull request Jun 26, 2025
…ate steps in gen_vulkan_spv (pytorch#11829)

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

cc @SS-JIA @manuelcandales @cbilgin

Co-authored-by: Stephen Jia <[email protected]>
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. fb-exported module: vulkan Issues related to the Vulkan delegate and code under backends/vulkan/
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants