Conversation
…pose Summary: Without this change, aten.hardswish.default decomposes into several arithmetic ops (add, clamp, mul, div) which prevents the Vulkan conv2d depthwise fusion pass from recognizing and fusing the activation. Adding hardswish to ops_not_to_decompose keeps it as a single op so the conv2d output tile shader can apply the clamp fusion. Also adds the conv2d_dw_output_tile_3x3_b1x1_clamp shader variant needed for the fused path. Authored with Claude. Test Plan: Exported MobileNetV3 for Vulkan and verified hardswish no longer decomposes. Reviewers: Subscribers: Tasks: Tags:
Summary: Previously, copy.default was unconditionally added to the Vulkan partition as an ephemeral op (assumed to always be a no-op removed by RemoveRedundantOpsTransform). However, copy.default can also represent a dtype cast, and blindly partitioning casts to Vulkan causes runtime failures since the Vulkan backend has no copy implementation. Replace the unconditional registration with a custom are_node_inputs_supported_fn that checks both dtype and shape match between src and dst. Only same-dtype, same-shape copies (true no-ops) are partitioned to Vulkan; dtype casts remain on CPU. Authored with Claude. Test Plan: Exported EfficientNet for Vulkan, which contains copy.default for dtype casts, and confirmed it no longer errors during Vulkan compilation. No-op copies in other models (e.g. MobileNetV3) still partition correctly. Reviewers: Subscribers: Tasks: Tags:
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/18576
Note: Links to docs will display an error until the docs builds have been completed. ❌ 1 New Failure, 28 PendingAs of commit 9e73dc8 with merge base fa81941 ( NEW FAILURE - The following job has failed:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
This PR needs a
|
manuelcandales
approved these changes
Mar 30, 2026
rascani
pushed a commit
to rascani/executorch
that referenced
this pull request
Apr 1, 2026
…orch#18576) Summary: Previously, copy.default was unconditionally added to the Vulkan partition as an ephemeral op (assumed to always be a no-op removed by RemoveRedundantOpsTransform). However, copy.default can also represent a dtype cast, and blindly partitioning casts to Vulkan causes runtime failures since the Vulkan backend has no copy implementation. Replace the unconditional registration with a custom are_node_inputs_supported_fn that checks both dtype and shape match between src and dst. Only same-dtype, same-shape copies (true no-ops) are partitioned to Vulkan; dtype casts remain on CPU. Authored with Claude. Test Plan: Exported EfficientNet for Vulkan, which contains copy.default for dtype casts, and confirmed it no longer errors during Vulkan compilation. No-op copies in other models (e.g. MobileNetV3) still partition correctly. Reviewers: Subscribers: Tasks: Tags: --- [ET-VK] Prevent hardswish decomposition by adding to ops_not_to_decompose Summary: Without this change, aten.hardswish.default decomposes into several arithmetic ops (add, clamp, mul, div) which prevents the Vulkan conv2d depthwise fusion pass from recognizing and fusing the activation. Adding hardswish to ops_not_to_decompose keeps it as a single op so the conv2d output tile shader can apply the clamp fusion. Also adds the conv2d_dw_output_tile_3x3_b1x1_clamp shader variant needed for the fused path. Authored with Claude. Test Plan: Exported MobileNetV3 for Vulkan and verified hardswish no longer decomposes. Reviewers: Subscribers: Tasks: Tags: --- [//]: # (BEGIN SAPLING FOOTER) Stack created with [Sapling](https://sapling-scm.com). Best reviewed with [ReviewStack](https://reviewstack.dev/pytorch/executorch/pull/18576). * __->__ pytorch#18576 * pytorch#18575 cc @manuelcandales @digantdesai @cbilgin
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: Previously, copy.default was unconditionally added to the Vulkan partition as
an ephemeral op (assumed to always be a no-op removed by
RemoveRedundantOpsTransform). However, copy.default can also represent a dtype
cast, and blindly partitioning casts to Vulkan causes runtime failures since
the Vulkan backend has no copy implementation.
Replace the unconditional registration with a custom
are_node_inputs_supported_fn that checks both dtype and shape match between
src and dst. Only same-dtype, same-shape copies (true no-ops) are partitioned
to Vulkan; dtype casts remain on CPU.
Authored with Claude.
Test Plan: Exported EfficientNet for Vulkan, which contains copy.default for dtype casts,
and confirmed it no longer errors during Vulkan compilation. No-op copies in
other models (e.g. MobileNetV3) still partition correctly.
Reviewers:
Subscribers:
Tasks:
Tags:
Stack created with Sapling. Best reviewed with ReviewStack.
cc @manuelcandales @digantdesai @cbilgin