Skip to content

[ET-VK][shaders] Harden UBO vector indexing for Adreno - #23381

Open
SS-JIA wants to merge 1 commit into
gh/SS-JIA/652/basefrom
gh/SS-JIA/652/head
Open

SS-JIA wants to merge 1 commit into
gh/SS-JIA/652/basefrom
gh/SS-JIA/652/head

Conversation

@SS-JIA

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

Copy link
Copy Markdown
Contributor

Stack from ghstack (oldest at bottom):

Ulterior Motive

Prevent Qualcomm shader-compiler crashes during Vulkan pipeline creation across the ET-VK operator library.

Rationale

What: Route runtime-indexed vector reads through branch-based safe_idx() helpers and writes through safe_set().

Why: Adreno 720/740 drivers can null-dereference inside CreateQGLCProgram when specialization constants, push constants, or runtime dimensions index UBO-backed vectors. Mean, buffer softmax, and buffer variance reproduced this failure independently.

Details

The shared accessors now live in common.glslh, making them available to both current and legacy indexing code. BufferMetadata size, stride, and dimension-order accessors handle all eight dimensions without runtime vector or array indexing. Direct unsafe accesses in reduction, variance, packed NCHW conversion, and buffer padding use the same helpers.

Arithmetic, shader interfaces, and tensor layouts remain unchanged.

Authored with Codex.

Differential Revision: D123131865

[ghstack-poisoned]
@pytorch-bot

pytorch-bot Bot commented Oct 3, 2026 •

Copy link
Copy Markdown

🔗 Helpful Links

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

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

✅ No Failures

As of commit c91cd15 with merge base ecf5c39 (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 3, 2026
@github-actions

github-actions Bot commented Oct 3, 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.

This branch was successfully deployed

1 active deployment
cadence — c91cd15e Deployed Oct 3, 2026 by SS-JIA via hifi-op-test / hifi4 #31212
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