Vulkan: add the missing int32 -> uint8 view_convert variant - #22321
Open
msluszniak wants to merge 1 commit into
Open
Vulkan: add the missing int32 -> uint8 view_convert variant#22321msluszniak wants to merge 1 commit into
msluszniak wants to merge 1 commit into
Conversation
The view_convert combo lists generate uint8 -> int32 but not the reverse, so a graph containing an int32 -> uint8 view_convert lowers cleanly and then aborts at run time: Could not find ShaderInfo with name view_convert_buffer_int32_uint8 (ShaderRegistry.cpp:54, (it != listings_.end()) is false) The partitioner has no visibility into which dtype pairs were generated, so this surfaces as a crash on device rather than the node being left on host. sentence-transformers/all-MiniLM-L6-v2 hits it through its attention mask on any graph lowered with VulkanPartitioner. view_convert is a plain elementwise OUT_T(in) cast, so the pair needs nothing beyond being listed. Verified on a Galaxy S26 Ultra (Adreno 840): with this variant generated, all-MiniLM-L6-v2 runs and its embedding matches the eager reference to cosine 0.99999726 (max abs deviation 4.0e-04), bit-identical across 90 in-process replays.
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/22321
Note: Links to docs will display an error until the docs builds have been completed.
|
This PR needs a
|
msluszniak
added a commit
to software-mansion-labs/executorch
that referenced
this pull request
Aug 30, 2026
The combo lists carried [uint8, int32] but not the reverse, so a graph needing an int32 to uint8 view lowered cleanly and then aborted at runtime with "Could not find ShaderInfo with name view_convert_buffer_int32_uint8". all-MiniLM-L6-v2 hits this through its attention mask. Backport of upstream pytorch/executorch#22321.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #22320.
The
view_convertcombo lists generateuint8 -> int32but not the reverse, so a graph containing anint32 -> uint8view_convert lowers cleanly throughVulkanPartitionerand then aborts on device:The partitioner has no visibility into which dtype pairs were generated, so the node is accepted at AOT and the failure only appears at run time.
sentence-transformers/all-MiniLM-L6-v2hits this through its attention mask on any graph lowered withVulkanPartitioner.view_convertis a plain elementwiseOUT_T(t_inp[...])cast, so the pair needs nothing beyond being listed in the buffer and texture variant lists.Test plan
On a Galaxy S26 Ultra (Adreno 840), arm64-v8a, NDK 27.1,
main@ c27baa8:Before,
executor_runneraborts loading the model with the error above. After, all-MiniLM-L6-v2 loads and runs, and its embedding matches the eager reference:Bit-identical across 90 in-process replays (3 rounds x 30 executions), so the added cast is stable as well as correct. Median 7.76 ms/iteration against 8.38 ms for the same model on XNNPACK.
cc @SS-JIA @manuelcandales @digantdesai @cbilgin