[ET-VK] Replace dynamic UBO indexing with safe_idx across shaders#18512
[ET-VK] Replace dynamic UBO indexing with safe_idx across shaders#18512meta-codesync[bot] merged 1 commit intogh/SS-JIA/511/basefrom
Conversation
The Adreno 740 GPU driver crashes (SIGSEGV in vkCreateComputePipelines) when GLSL shaders dynamically index a UBO-backed ivec4/ivec3 with a specialization-constant-derived value. This was causing the skin segmentation model to crash during pipeline creation on Samsung S23. Fix all instances across 18 shader files by replacing patterns like `meta.sizes[packed_dim]` with `safe_idx(meta.sizes, packed_dim)`, which uses an if/else chain that the driver resolves at pipeline creation time. Changes: - Add safe_idx(ivec3) overload to indexing.glslh - Fix transfer_texture.glsl, slice.glslh, select.glslh (transfer ops) - Fix nchw_to_int8x4_buffer.glsl, full_texture.glsl (staging/utility) - Fix gather, split, index_tensor, where, expand, pad, repeat, arange texture shaders (1-line fixes each) - Fix softmax.glsl, reduce.glsl, reduce2d.glsl, var_texture3d.glsl (reduction shaders with multiple fixes + added indexing.glslh include) - Remove unused ShaderNameUtils.h include from Slice.cpp Differential Revision: [D98220450](https://our.internmc.facebook.com/intern/diff/D98220450/) [ghstack-poisoned]
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/18512
Note: Links to docs will display an error until the docs builds have been completed. ❌ 1 Cancelled Job, 7 Pending, 2 Unrelated FailuresAs of commit 9363a9c with merge base 8d43d97 ( 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. |
The Adreno 740 GPU driver crashes (SIGSEGV in vkCreateComputePipelines) when GLSL shaders dynamically index a UBO-backed ivec4/ivec3 with a specialization-constant-derived value. This was causing the skin segmentation model to crash during pipeline creation on Samsung S23. Fix all instances across 18 shader files by replacing patterns like `meta.sizes[packed_dim]` with `safe_idx(meta.sizes, packed_dim)`, which uses an if/else chain that the driver resolves at pipeline creation time. Changes: - Add safe_idx(ivec3) overload to indexing.glslh - Fix transfer_texture.glsl, slice.glslh, select.glslh (transfer ops) - Fix nchw_to_int8x4_buffer.glsl, full_texture.glsl (staging/utility) - Fix gather, split, index_tensor, where, expand, pad, repeat, arange texture shaders (1-line fixes each) - Fix softmax.glsl, reduce.glsl, reduce2d.glsl, var_texture3d.glsl (reduction shaders with multiple fixes + added indexing.glslh include) - Remove unused ShaderNameUtils.h include from Slice.cpp Differential Revision: [D98220450](https://our.internmc.facebook.com/intern/diff/D98220450/) ghstack-source-id: 357844383 Pull Request resolved: #18512
This PR needs a
|
a37e1aa
into
gh/SS-JIA/511/base
The Adreno 740 GPU driver crashes (SIGSEGV in vkCreateComputePipelines) when GLSL shaders dynamically index a UBO-backed ivec4/ivec3 with a specialization-constant-derived value. This was causing the skin segmentation model to crash during pipeline creation on Samsung S23. Fix all instances across 18 shader files by replacing patterns like `meta.sizes[packed_dim]` with `safe_idx(meta.sizes, packed_dim)`, which uses an if/else chain that the driver resolves at pipeline creation time. Changes: - Add safe_idx(ivec3) overload to indexing.glslh - Fix transfer_texture.glsl, slice.glslh, select.glslh (transfer ops) - Fix nchw_to_int8x4_buffer.glsl, full_texture.glsl (staging/utility) - Fix gather, split, index_tensor, where, expand, pad, repeat, arange texture shaders (1-line fixes each) - Fix softmax.glsl, reduce.glsl, reduce2d.glsl, var_texture3d.glsl (reduction shaders with multiple fixes + added indexing.glslh include) - Remove unused ShaderNameUtils.h include from Slice.cpp Differential Revision: [D98220450](https://our.internmc.facebook.com/intern/diff/D98220450/) ghstack-source-id: 357844383 Pull Request resolved: #18512
The Adreno 740 GPU driver crashes (SIGSEGV in vkCreateComputePipelines) when GLSL shaders dynamically index a UBO-backed ivec4/ivec3 with a specialization-constant-derived value. This was causing the skin segmentation model to crash during pipeline creation on Samsung S23. Fix all instances across 18 shader files by replacing patterns like `meta.sizes[packed_dim]` with `safe_idx(meta.sizes, packed_dim)`, which uses an if/else chain that the driver resolves at pipeline creation time. Changes: - Add safe_idx(ivec3) overload to indexing.glslh - Fix transfer_texture.glsl, slice.glslh, select.glslh (transfer ops) - Fix nchw_to_int8x4_buffer.glsl, full_texture.glsl (staging/utility) - Fix gather, split, index_tensor, where, expand, pad, repeat, arange texture shaders (1-line fixes each) - Fix softmax.glsl, reduce.glsl, reduce2d.glsl, var_texture3d.glsl (reduction shaders with multiple fixes + added indexing.glslh include) - Remove unused ShaderNameUtils.h include from Slice.cpp Differential Revision: [D98220450](https://our.internmc.facebook.com/intern/diff/D98220450/) ghstack-source-id: 357844383 Pull Request resolved: #18512
Stack from ghstack (oldest at bottom):
The Adreno 740 GPU driver crashes (SIGSEGV in vkCreateComputePipelines)
when GLSL shaders dynamically index a UBO-backed ivec4/ivec3 with a
specialization-constant-derived value. This was causing the skin
segmentation model to crash during pipeline creation on Samsung S23.
Fix all instances across 18 shader files by replacing patterns like
meta.sizes[packed_dim]withsafe_idx(meta.sizes, packed_dim), whichuses an if/else chain that the driver resolves at pipeline creation time.
Changes:
texture shaders (1-line fixes each)
(reduction shaders with multiple fixes + added indexing.glslh include)
Differential Revision: D98220450