Skip to content

[executorch][vulkan] Round f16 image stores to nearest even - #24547

Merged
JakeStevens merged 1 commit into
gh/digantdesai/198/origfrom
gh/digantdesai/199/orig
Nov 5, 2026
Merged

JakeStevens merged 1 commit into
gh/digantdesai/198/origfrom
gh/digantdesai/199/orig

Conversation

@pytorchbot

@pytorchbot pytorchbot commented Nov 3, 2026 •

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: #24372 by @digantdesai
^ 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/digantdesai/199/base
ghstack PR head: https://github.com/pytorch/executorch/tree/gh/digantdesai/199/head
Merge bot PR base: https://github.com/pytorch/executorch/tree/gh/digantdesai/198/orig
Merge bot PR head: https://github.com/pytorch/executorch/tree/gh/digantdesai/199/orig

@diff-train-skip-merge

cc @SS-JIA @manuelcandales @digantdesai @cbilgin

Pull Request resolved: #24372

Vulkan lets the device choose how stores to rgba16f images round, and devices that round toward zero bias f16 outputs; shader float controls don't govern that conversion. `gen_vulkan_spv.py` now wraps `imageStore` on writable rgba16f images in a round-to-nearest-even helper, and six shaders that declared such images by hand, two of them test shaders, now use the codegen.

On devices that round toward zero, stores of 65520 and above now give inf, as the CPU conversion does, instead of 65504. The four texture shaders that already call `round_to_half_rte` on their outputs (`binary_scalar_texture`, `full_texture`, `reduce`, `scalar_tensor`) now round twice, with identical results; removing those calls is a follow-up. `aten._to_copy` from f32 to f16 textures is a `vkCmdBlitImage`, which the codegen doesn't reach, so `test_to_copy` keeps its one-ulp tolerance.

Authored with Claude Code.

@bypass-github-export-checks
@bypass-github-pytorch-ci-checks
@bypass-github-executorch-ci-checks
ghstack-source-id: 463657749
@exported-using-ghexport

Differential Revision: [D128254886](https://our.internmc.facebook.com/intern/diff/D128254886/)
@pytorchbot
pytorchbot requested a review from SS-JIA as a code owner November 3, 2026 21:28
@pytorch-bot pytorch-bot Bot added the module: vulkan Issues related to the Vulkan delegate and code under backends/vulkan/ label Nov 3, 2026
@pytorch-bot

pytorch-bot Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

🔗 Helpful Links

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

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:

❌ 2 New Failures, 1 Unrelated Failure

As of commit 1e84ada with merge base 0f8e096 (image):

NEW FAILURES - The following jobs have failed:

FLAKY - The following job failed but was likely due to flakiness present on trunk:

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 Nov 3, 2026
@JakeStevens
JakeStevens added this pull request to stack #24685 November 5, 2026 18:31
@JakeStevens
JakeStevens merged commit bd4a6ff into gh/digantdesai/189/orig Nov 5, 2026
235 of 246 checks passed
@JakeStevens
JakeStevens deleted the gh/digantdesai/199/orig branch November 5, 2026 18:54

This branch was previously deployed

1 inactive deployment
cadence — 1e84adaf Deployed Nov 3, 2026 by pytorchbot via hifi-op-test / hifi4 #36378
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. module: vulkan Issues related to the Vulkan delegate and code under backends/vulkan/

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants