[ET-VK][ez] Fix duplicate placeholder target in create_constant_placeholder#18031
Open
pytorchbot wants to merge 5 commits intomainfrom
Open
[ET-VK][ez] Fix duplicate placeholder target in create_constant_placeholder#18031pytorchbot wants to merge 5 commits intomainfrom
pytorchbot wants to merge 5 commits intomainfrom
Conversation
…holder Pull Request resolved: #18013 When multiple pattern replacements (e.g., quantized conv and quantized linear) share the same weight parameter, each independently calls create_constant_placeholder to create a _sums placeholder with the same name. torch.fx.Graph.create_node deduplicates node.name but not node.target, so the second call produces a placeholder with a unique name but a duplicate target. Since recompile() uses node.target for function parameter names, this causes a SyntaxError: duplicate argument in function definition. Fix by checking the state_dict/constants dicts (O(1) lookup) before creating the node. If the name already exists, find and return the existing placeholder node. ghstack-source-id: 349646647 @exported-using-ghexport Differential Revision: [D95807071](https://our.internmc.facebook.com/intern/diff/D95807071/)
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/18031
Note: Links to docs will display an error until the docs builds have been completed. ❌ 1 New FailureAs of commit 08cb793 with merge base f09bd55 ( NEW FAILURE - The following job has failed:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
This PR needs a
|
added 4 commits
March 10, 2026 10:38
…quantization Pull Request resolved: #18014 When `aten.linear` has 3D+ inputs, it decomposes into `view_copy -> mm -> view_copy`. The output view_copy between mm and the subsequent quantize_per_tensor node was preventing the pattern matcher from detecting output quantization, causing the match to fall through to `linear_q8ta_q8csw` instead of `q8ta_linear_gemv`. This caused a dtype mismatch during FakeTensor re-tracing in FusePatternsPass because `linear_q8ta_q8csw`'s composite implementation does not dequantize its input, producing int8 output where float32 was expected. Mirror the existing input-side view_copy handling (lines 99-104) on the output side so the quantize node is found through the view_copy. ghstack-source-id: 349646653 @exported-using-ghexport Differential Revision: [D95807075](https://our.internmc.facebook.com/intern/diff/D95807075/)
…per tensor Pull Request resolved: #18015 The Q8ta quantize/dequantize ops were limited to 4D tensors because the GLSL block indexing infrastructure only handled 4 dimensions. This adds native 8D support to the block indexing helpers so that tensors with 5+ dimensions (common in models with batch dimensions) can be quantized/dequantized without falling back to CPU. The approach adds 8D versions of the block index functions (using TensorIndex instead of TensorIndex4D), 8D block load/store macros, and an 8D block decomposition function. Packed dim indices are guaranteed < 4, so the block dimensions always operate on data[0] while dims 4-7 are handled as implicit outer batch dimensions. The C++ dispatch functions are also updated to include extra batch dims in the thread count computation. This diff was authored with the assistance of an AI coding tool. ghstack-source-id: 349646650 @exported-using-ghexport Differential Revision: [D95807073](https://our.internmc.facebook.com/intern/diff/D95807073/)
Pull Request resolved: #18016 Implement quantized transposed 2D convolution for the Vulkan backend, enabling int8 transposed convolutions used in decoder/upsampling networks. The GLSL shader iterates over all kernel positions and derives valid input positions via (output + padding - kernel) / stride. Invalid positions use input_zp_packed so the precomputed weight_sums zero-point correction remains consistent. Reuses the existing q8ta_conv2d weight packing and workgroup size selection since, after the pattern matcher reshapes transposed weights from (IC, OC, KH, KW) to (OC, KH*KW*IC), the layout is identical to regular conv2d. Supports hardware int8 dot product with software fallback, grouped convolutions, optional bias and ReLU activation. Only dilation=1 is supported (matching the ATen conv_transpose2d constraint). This diff was authored with Claude. ghstack-source-id: 349646651 @exported-using-ghexport Differential Revision: [D95807070](https://our.internmc.facebook.com/intern/diff/D95807070/)
Pull Request resolved: #18017 Some quantized linear projections (e.g. in EdgeTAM's SpatialPerceiver / mask decoder) decompose as aten.bmm instead of aten.mm. Add aten.bmm.default as an anchor node in the quantized linear pattern detector so these nodes can be fused into custom quantized linear ops. Reject bmm nodes with batch dim > 1 since the custom ops assume a single batch. ghstack-source-id: 349646654 @exported-using-ghexport Differential Revision: [D95807072](https://our.internmc.facebook.com/intern/diff/D95807072/)
SS-JIA
approved these changes
Mar 10, 2026
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.
This PR was created by the merge bot to help merge the original PR into the main branch.
ghstack PR number: #18013 by @SS-JIA
^ 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/SS-JIA/460/base
ghstack PR head: https://github.com/pytorch/executorch/tree/gh/SS-JIA/460/head
Merge bot PR base: https://github.com/pytorch/executorch/tree/main
Merge bot PR head: https://github.com/pytorch/executorch/tree/gh/SS-JIA/460/orig
Differential Revision: D95807071
@diff-train-skip-merge