Skip to content

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

Closed
pytorchbot wants to merge 1 commit into
gh/SS-JIA/669/origfrom
gh/SS-JIA/657/orig
Closed

pytorchbot wants to merge 1 commit into
gh/SS-JIA/669/origfrom
gh/SS-JIA/657/orig

Conversation

@pytorchbot

Copy link
Copy Markdown
Collaborator

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

Pull Request resolved: #23490

## 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.
ghstack-source-id: 446951693
@exported-using-ghexport

Differential Revision: [D123101914](https://our.internmc.facebook.com/intern/diff/D123101914/)
@pytorchbot
pytorchbot requested a review from SS-JIA as a code owner October 13, 2026 01:39
@pytorch-bot

pytorch-bot Bot commented Oct 13, 2026

Copy link
Copy Markdown

🔗 Helpful Links

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

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

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 13, 2026
@SS-JIA SS-JIA closed this Oct 13, 2026

This branch was successfully deployed

1 active deployment
cadence — 72c78ae1 Deployed Oct 13, 2026 by pytorchbot via hifi-op-test / hifi4 #33010
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.

2 participants