Skip to content

Conversation

@SS-JIA
Copy link
Contributor

@SS-JIA SS-JIA commented Nov 14, 2025

Stack from ghstack (oldest at bottom):

Title says it all!

Adds int32 and uint8 shader variants to a bunch of operators that don't currently have variants for these dtypes, but should.

This should prevent folks from running into dtype crashes at runtime when using the Vulkan delegate.

Differential Revision: D87082724

@pytorch-bot
Copy link

pytorch-bot bot commented Nov 14, 2025

🔗 Helpful Links

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

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

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 14, 2025
SS-JIA pushed a commit that referenced this pull request Nov 14, 2025
Title says it all!

Adds `int32` and `uint8` shader variants to a bunch of operators that don't currently have variants for these dtypes, but should.

This should prevent folks from running into dtype crashes at runtime when using the Vulkan delegate.

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

ghstack-source-id: 323344490
Pull Request resolved: #15829
@github-actions
Copy link

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.

SS-JIA added a commit that referenced this pull request Nov 14, 2025
Stack from [ghstack](https://github.com/ezyang/ghstack) (oldest at
bottom):
* #15829
* #15796
* #15795
* #15794
* __->__ #15793

As title. The current implementation of split_with_sizes uses functions
from the `Copy.[h|cpp]` file in particular
`add_copy_channel_offset_node`. However, the shaders dispatched by this
function have a critical bug where the output tensor is passed in
separately with difference access types, i.e.

```cpp
graph.execute_nodes().emplace_back(new DispatchNode(
        graph,
        VK_KERNEL_FROM_STR(kernel_name),
        global_size,
        local_size,
        // Inputs and Outputs
        {
            {out, vkapi::kWrite},
            {out, vkapi::kRead},
            {in, vkapi::kRead},
        },
```

This creates many validation layer errors because the memory barriers
for the resource cannot be formed properly. The shader essentially
relies on undefined behaviour to work correctly

To fix, this diff re-implements the operator from scratch with a
dedicated compute shader.

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

---------

Co-authored-by: ssjia <ssjia@devvm26340.ftw0.facebook.com>
SS-JIA added a commit that referenced this pull request Nov 14, 2025
#15794)

Stack from [ghstack](https://github.com/ezyang/ghstack) (oldest at
bottom):
* #15829
* #15796
* #15795
* __->__ #15794
* #15793

As title. Make sure that ops that do not support quantized tensors do
not get assigned memory layouts that are intended for quantized tensors.

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

---------

Co-authored-by: ssjia <ssjia@devvm26340.ftw0.facebook.com>
SS-JIA added a commit that referenced this pull request Nov 14, 2025
)

Stack from [ghstack](https://github.com/ezyang/ghstack) (oldest at
bottom):
* #15829
* #15796
* __->__ #15795
* #15794
* #15793

Title says it all!

Add two additional export options:

1. `skip_memory_planning` - skips the memory planning pass which can be
useful for debugging.
2. `small_texture_limits` - sets the default texture limit to be (2048,
2048, 2048) which is compatible with more devices (i.e. desktop/laptop
GPUs) compared to the default (16384, 16384, 2048) which is more
targeted for mobile GPUs

Also adds some improvements to the export script that were made while
debugging the `YOLO_NAS` model
(#15700)

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

---------

Co-authored-by: ssjia <ssjia@devvm26340.ftw0.facebook.com>
SS-JIA added a commit that referenced this pull request Nov 14, 2025
…eMetadata (#15796)

Stack from [ghstack](https://github.com/ezyang/ghstack) (oldest at
bottom):
* #15829
* __->__ #15796
* #15795
* #15794
* #15793

Title says it all!

Motivation: code simplification and allows these ops to handle high dim
tensors.

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

---------

Co-authored-by: ssjia <ssjia@devvm26340.ftw0.facebook.com>
@SS-JIA SS-JIA changed the base branch from gh/SS-JIA/373/base to main November 14, 2025 21:45
Title says it all!

Adds `int32` and `uint8` shader variants to a bunch of operators that don't currently have variants for these dtypes, but should.

This should prevent folks from running into dtype crashes at runtime when using the Vulkan delegate.

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

ghstack-source-id: 323344490
Pull Request resolved: #15829
@SS-JIA SS-JIA force-pushed the gh/SS-JIA/373/head branch from 2a4a03f to aaa63b0 Compare November 14, 2025 21:48
@SS-JIA SS-JIA merged commit a6c5921 into main Nov 14, 2025
141 of 146 checks passed
@SS-JIA SS-JIA deleted the gh/SS-JIA/373/head branch November 14, 2025 21:48
@SS-JIA
Copy link
Contributor Author

SS-JIA commented Nov 14, 2025

@pytorchbot cherry-pick --onto release/1.0 -c critical

@pytorchbot
Copy link
Collaborator

Cherry picking #15829

Command git -C /home/runner/work/executorch/executorch cherry-pick -x -X theirs a6c59218cf27ed25495bf34a0892710ebfe1e79b returned non-zero exit code 1

CONFLICT (modify/delete): backends/vulkan/runtime/graph/ops/glsl/gather_buffer.yaml deleted in HEAD and modified in a6c59218cf ([ET-VK] Add int and bool tensor support for many operators (#15829)).  Version a6c59218cf ([ET-VK] Add int and bool tensor support for many operators (#15829)) of backends/vulkan/runtime/graph/ops/glsl/gather_buffer.yaml left in tree.
CONFLICT (modify/delete): backends/vulkan/runtime/graph/ops/glsl/gather_texture.yaml deleted in HEAD and modified in a6c59218cf ([ET-VK] Add int and bool tensor support for many operators (#15829)).  Version a6c59218cf ([ET-VK] Add int and bool tensor support for many operators (#15829)) of backends/vulkan/runtime/graph/ops/glsl/gather_texture.yaml left in tree.
CONFLICT (modify/delete): backends/vulkan/runtime/graph/ops/glsl/split_buffer.yaml deleted in HEAD and modified in a6c59218cf ([ET-VK] Add int and bool tensor support for many operators (#15829)).  Version a6c59218cf ([ET-VK] Add int and bool tensor support for many operators (#15829)) of backends/vulkan/runtime/graph/ops/glsl/split_buffer.yaml left in tree.
CONFLICT (modify/delete): backends/vulkan/runtime/graph/ops/glsl/split_texture.yaml deleted in HEAD and modified in a6c59218cf ([ET-VK] Add int and bool tensor support for many operators (#15829)).  Version a6c59218cf ([ET-VK] Add int and bool tensor support for many operators (#15829)) of backends/vulkan/runtime/graph/ops/glsl/split_texture.yaml left in tree.
error: could not apply a6c59218cf... [ET-VK] Add int and bool tensor support for many operators (#15829)
hint: After resolving the conflicts, mark them with
hint: "git add/rm <pathspec>", then run
hint: "git cherry-pick --continue".
hint: You can instead skip this commit with "git cherry-pick --skip".
hint: To abort and get back to the state before "git cherry-pick",
hint: run "git cherry-pick --abort".
hint: Disable this message with "git config set advice.mergeConflict false"
Details for Dev Infra team Raised by workflow job

SS-JIA added a commit that referenced this pull request Nov 14, 2025
Stack from [ghstack](https://github.com/ezyang/ghstack) (oldest at
bottom):
* __->__ #15829
* #15796
* #15795
* #15794
* #15793

Title says it all!

Adds `int32` and `uint8` shader variants to a bunch of operators that
don't currently have variants for these dtypes, but should.

This should prevent folks from running into dtype crashes at runtime
when using the Vulkan delegate.

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

Co-authored-by: ssjia <ssjia@devvm1479.ncg0.facebook.com>
(cherry picked from commit a6c5921)
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.

4 participants