You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[ET-VK][runtime] Derive SPIR-V requirements and enable Vulkan shader features - #24340
Run supported shaders with the required Vulkan features enabled, and skip unsupported shaders before driver compilation.
Rationale
Make compiled SPIR-V the source of shader capability requirements and carry those requirements through code generation, device setup, and pipeline validation. GLSL extension declarations can be hidden in includes or unused. Vulkan features must also be enabled on the logical device before shaders can use them.
Details
Area
Before
After
Requirement detection
Six flags inferred from GLSL extension text.
Require compiled SPIR-V, preserve every declared OpCapability, and remove GLSL extension matching.
Runtime validation
Check the six feature flags.
Map capability IDs to arithmetic, storage, image, subgroup, and cooperative-matrix support; reject unsupported or unrecognized IDs before shader-module/pipeline creation.
Device setup
Cache selected core features and enable shaderInt16, shaderInt64, and shaderFloat64.
Cache the full core feature query and also enable supported shader image/indexing features required by the expanded checks.
Error reporting
Describe requirements using the fixed VulkanExtension enum.
Accept requirement descriptions that include arbitrary SPIR-V capability IDs.
gen_vulkan_spv.py emits the capability list into ShaderInfo.required_capabilities; named SpirvCapability IDs make the runtime mapping readable. Device caches feature queries, Adapter configures the device and checks support, and Context/ComputeGraph enforce requirements. Existing flag checks remain for manually constructed metadata without a list.
info=getShaderInfo(glsl_path, spv_path)
context.check_device_capabilities(shader);
Use the authoritative Python host tool in shader-generation builds. Keep descriptor, tile, and required-subgroup-size metadata parsing. Generator tests cover mappings, ignored GLSL extension declarations, unknown-capability preservation, and malformed modules; framework-dependent integration tests accompany the later benchmark commit.
meta-claBot
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
Oct 30, 2026
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"
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
CLA SignedThis label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.meta-exportedmodule: vulkanIssues related to the Vulkan delegate and code under backends/vulkan/
3 participants
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.
Stack from ghstack (oldest at bottom):
Ulterior Motive
Run supported shaders with the required Vulkan features enabled, and skip unsupported shaders before driver compilation.
Rationale
Make compiled SPIR-V the source of shader capability requirements and carry those requirements through code generation, device setup, and pipeline validation. GLSL extension declarations can be hidden in includes or unused. Vulkan features must also be enabled on the logical device before shaders can use them.
Details
OpCapability, and remove GLSL extension matching.shaderInt16,shaderInt64, andshaderFloat64.VulkanExtensionenum.gen_vulkan_spv.pyemits the capability list intoShaderInfo.required_capabilities; namedSpirvCapabilityIDs make the runtime mapping readable.Devicecaches feature queries,Adapterconfigures the device and checks support, andContext/ComputeGraphenforce requirements. Existing flag checks remain for manually constructed metadata without a list.Use the authoritative Python host tool in shader-generation builds. Keep descriptor, tile, and required-subgroup-size metadata parsing. Generator tests cover mappings, ignored GLSL extension declarations, unknown-capability preservation, and malformed modules; framework-dependent integration tests accompany the later benchmark commit.
Authored with Codex (AI).
Differential Revision: D128509572
cc @manuelcandales @digantdesai @cbilgin