Skip to content

Vulkan: keep a reshape that follows a dynamically quantized linear - #24055

Open
msluszniak wants to merge 1 commit into
pytorch:mainfrom
msluszniak:ms/vulkan-qlinear-keep-reshape
Open

msluszniak wants to merge 1 commit into
pytorch:mainfrom
msluszniak:ms/vulkan-qlinear-keep-reshape

Conversation

@msluszniak

@msluszniak msluszniak commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Summary

QuantizedLinearMatch absorbed any single-user view_copy after a dynamically quantized linear into the pattern. The fused linear_dq8ca_q4gsw returns input.shape[:-1] + [N], so an unrelated reshape after the linear was dropped and FusePatternsPass failed. Now only the view that restores a decomposed N-D linear's leading dims is absorbed.

Test plan

python -m unittest backends.vulkan.test.test_vulkan_passes (new test_fuse_8da4w_linear_keeps_following_reshape fails without the fix).

cc @SS-JIA @manuelcandales @digantdesai @cbilgin @nil-is-all

QuantizedLinearMatch absorbed any single-user view_copy after the linear
into the pattern once the input was dynamically quantized. The fused op
replaces the pattern output and returns input.shape[:-1] + [N], so an
unrelated reshape (e.g. [6, 32] -> [2, 3, 32]) was dropped and the next
op failed shape propagation in FusePatternsPass. Only absorb the view
that restores a decomposed N-D linear's leading dims.
@msluszniak
msluszniak requested a review from SS-JIA as a code owner October 21, 2026 10:02
@pytorch-bot pytorch-bot Bot added the module: vulkan Issues related to the Vulkan delegate and code under backends/vulkan/ label Oct 21, 2026
@pytorch-bot

pytorch-bot Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

🔗 Helpful Links

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

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

❌ 128 New Failures, 2 Unrelated Failures, 4 Unclassified Failures

As of commit c6fcfe3 with merge base e9e21b5 (image):

NEW FAILURES - The following jobs have failed:

UNCLASSIFIED FAILURES - DrCI could not classify the following jobs because the workflow did not run on the merge base. The failures may be pre-existing on trunk or introduced by this PR:

FLAKY - The following jobs failed but were likely due to flakiness present on trunk:

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 Oct 21, 2026
@executorch-triage executorch-triage Bot added the community: contribution PRs coming from community (excluding hardware partners) label Oct 21, 2026
@nil-is-all nil-is-all added the release notes: vulkan Changes to the Vulkan backend delegate label Oct 21, 2026
borys3kk pushed a commit to borys3kk/swm_executorch that referenced this pull request Oct 22, 2026

This branch has not been deployed

No deployments
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. community: contribution PRs coming from community (excluding hardware partners) module: vulkan Issues related to the Vulkan delegate and code under backends/vulkan/ release notes: vulkan Changes to the Vulkan backend delegate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants