Skip to content

[ET-VK][codegen] Support nested shader directories - #23490

Open
SS-JIA wants to merge 4 commits into
gh/SS-JIA/657/basefrom
gh/SS-JIA/657/head
Open

SS-JIA wants to merge 4 commits into
gh/SS-JIA/657/basefrom
gh/SS-JIA/657/head

Conversation

@SS-JIA

@SS-JIA SS-JIA commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Stack from ghstack (oldest at bottom):

Ulterior Motive

Reorganize the flat Vulkan shader directory by operator implementation route before landing additional convolution implementations such as Winograd.

Rationale

What: Make shader code generation and build discovery preserve nested source paths.

Why: The generator discovered nested files but identified and emitted them by basename. Repeated basenames overwrote each other, YAML templates were globally keyed, generated files were flattened, and build inputs excluded nested files.

Details

  • Shader identity
    • Before: Source, YAML template, generated source, cache, and SPIR-V paths were basename-based.
    • After: Paths are relative to each shader source root and preserve directories through generation and caching.
  • Includes
    • Before: Cache invalidation resolved includes only from the generated output root.
    • After: Includes resolve from the including shader's directory, then each ancestor directory up to the generated output root, nearest first. glslc receives the same include path list, so route subdirectories (e.g. convolution/conv2d/im2col/) can share family-level headers (e.g. convolution/conv2d/conv2d_common.glslh).
  • Build discovery
    • Before: Buck and CMake shader filegroups selected only direct children.
    • After: Runtime, test, custom-op, and tool shader filegroups recursively include nested files.

Runtime shader registry names remain flat and unchanged. Duplicate runtime shader names now fail during code generation instead of silently overwriting an earlier source.

Differential Revision: D123101914

[ghstack-poisoned]
@pytorch-bot

pytorch-bot Bot commented Oct 6, 2026 •

Copy link
Copy Markdown

🔗 Helpful Links

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

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

✅ No Failures

As of commit b5a29dd with merge base bdb489e (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 Oct 6, 2026
@github-actions

github-actions Bot commented Oct 6, 2026

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.

[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]

This branch was successfully deployed

1 active deployment
cadence — b5a29dde Deployed Oct 10, 2026 by SS-JIA via hifi-op-test / hifi4 #32853
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. meta-exported

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant