-
Notifications
You must be signed in to change notification settings - Fork 606
[ET-VK][ez][buck] Simplify test buck file #7593
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
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…uring dispatch ## Context Now that we are using GLSL/SPIR-V extensions more heavily in our shaders, there is a risk that a particular shader uses an extension that is not supported by the physical device. It is tedious to manually check that all the extensions required by a shader is supported by the device; it would be much more convenient for developers if there was an automated way to perform this check. This diff provides a solution for this. Materially, this has manifested into an issue with our internal CI tests that run on Android emulator (which uses swiftshader under the hood). If the emulator tries to compile a shader that requires the `shaderInt16` feature, then the emulator will crash. ## Solution 1. Update `ShaderInfo` to have fields indicating whether certain extensions that require device support is required. 2. Update the `gen_vulkan_spv.py` shader compilation script to parse the GLSL code and log whether aforemention extensions are needed in the generated `ShaderInfo`. 3. Introduce a new exception class, `ShaderNotSupportedError`. 4. Before dispatching, check that all extensions required by the shader is supported by the device. If not, throw the new exception class. 4. In the generated operator correctness tests, skip the test if `ShaderNotSupportedError` is thrown. Differential Revision: [D67992067](https://our.internmc.facebook.com/intern/diff/D67992067/) ghstack-source-id: 260809479 Pull Request resolved: #7576
## Context The targets file for the op tests define a binary and test rule for each c++ file; instead of manually defining these rules each time, create a helper function to condense the code. Differential Revision: [D67992066](https://our.internmc.facebook.com/intern/diff/D67992066/) ghstack-source-id: 260809480 Pull Request resolved: #7577
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/7593
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit 66aa5ed with merge base e1c0bcf ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
lucylq
approved these changes
Jan 13, 2025
YIWENX14
pushed a commit
that referenced
this pull request
Jan 28, 2025
* [ET-VK] Parse required extensions of shaders and check capabilities during dispatch ## Context Now that we are using GLSL/SPIR-V extensions more heavily in our shaders, there is a risk that a particular shader uses an extension that is not supported by the physical device. It is tedious to manually check that all the extensions required by a shader is supported by the device; it would be much more convenient for developers if there was an automated way to perform this check. This diff provides a solution for this. Materially, this has manifested into an issue with our internal CI tests that run on Android emulator (which uses swiftshader under the hood). If the emulator tries to compile a shader that requires the `shaderInt16` feature, then the emulator will crash. ## Solution 1. Update `ShaderInfo` to have fields indicating whether certain extensions that require device support is required. 2. Update the `gen_vulkan_spv.py` shader compilation script to parse the GLSL code and log whether aforemention extensions are needed in the generated `ShaderInfo`. 3. Introduce a new exception class, `ShaderNotSupportedError`. 4. Before dispatching, check that all extensions required by the shader is supported by the device. If not, throw the new exception class. 4. In the generated operator correctness tests, skip the test if `ShaderNotSupportedError` is thrown. Differential Revision: [D67992067](https://our.internmc.facebook.com/intern/diff/D67992067/) ghstack-source-id: 260809479 Pull Request resolved: #7576 * [ET-VK][ez][buck] Simplify test buck file ## Context The targets file for the op tests define a binary and test rule for each c++ file; instead of manually defining these rules each time, create a helper function to condense the code. Differential Revision: [D67992066](https://our.internmc.facebook.com/intern/diff/D67992066/) ghstack-source-id: 260809480 Pull Request resolved: #7577 --------- 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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR was created by the merge bot to help merge the original PR into the main branch.
ghstack PR number: #7577
^ 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/163/base
ghstack PR head: https://github.com/pytorch/executorch/tree/gh/SS-JIA/163/head
Merge bot PR base: https://github.com/pytorch/executorch/tree/gh/SS-JIA/162/orig
Merge bot PR head: https://github.com/pytorch/executorch/tree/gh/SS-JIA/163/orig
@diff-train-skip-merge