Skip to content

[ez][ET-VK][glsl-codegen] Use mediump precision for half-precision shader variants#19287

Open
SS-JIA wants to merge 1 commit intogh/SS-JIA/525/basefrom
gh/SS-JIA/525/head
Open

[ez][ET-VK][glsl-codegen] Use mediump precision for half-precision shader variants#19287
SS-JIA wants to merge 1 commit intogh/SS-JIA/525/basefrom
gh/SS-JIA/525/head

Conversation

@SS-JIA
Copy link
Copy Markdown
Contributor

@SS-JIA SS-JIA commented May 4, 2026

Stack from ghstack (oldest at bottom):

The highp default in gen_vulkan_spv.py blocks Mali GPUs from using FP16 ALU because Mali respects the highp precision contract literally. Adreno silently demotes via Qualcomm's relaxed-precision pass, so it was unaffected, but Mali-G715 was running half-precision shaders at FP32 throughput. The mediump qualifier produces SPIR-V with RelaxedPrecision decorations, which Mali's compiler uses to enable f16 packed math. Note: this is a partial fix — texture-storage shaders still declare local vec4 working values, so the speedup is bounded; the follow-up is to make texel_type("half") return f16vec4 and enable the FP16 extension on the texture path.

Differential Revision: D103759541

…ader variants

The highp default in gen_vulkan_spv.py blocks Mali GPUs from using FP16 ALU because Mali respects the highp precision contract literally. Adreno silently demotes via Qualcomm's relaxed-precision pass, so it was unaffected, but Mali-G715 was running half-precision shaders at FP32 throughput. The mediump qualifier produces SPIR-V with RelaxedPrecision decorations, which Mali's compiler uses to enable f16 packed math. Note: this is a partial fix — texture-storage shaders still declare local `vec4` working values, so the speedup is bounded; the follow-up is to make `texel_type("half")` return `f16vec4` and enable the FP16 extension on the texture path.

Differential Revision: [D103759541](https://our.internmc.facebook.com/intern/diff/D103759541/)

[ghstack-poisoned]
@pytorch-bot
Copy link
Copy Markdown

pytorch-bot Bot commented May 4, 2026

🔗 Helpful Links

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

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

❗ 1 Active SEVs

There are 1 currently active SEVs. If your PR is affected, please view them below:

❌ 1 New Failure, 1 Cancelled Job, 2 Unrelated Failures

As of commit bd5dd01 with merge base a6ee309 (image):

NEW FAILURE - The following job has failed:

CANCELLED JOB - The following job was cancelled. Please retry:

BROKEN TRUNK - The following jobs failed but were present on the merge base:

👉 Rebase onto the `viable/strict` branch to avoid these failures

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 May 4, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 4, 2026

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.

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. fb-exported meta-exported

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant