Skip to content

[ET-VK] Add dynamic-shape resize to q8ta ops#20367

Merged
SS-JIA merged 1 commit into
gh/SS-JIA/559/origfrom
gh/SS-JIA/558/orig
Jun 18, 2026
Merged

[ET-VK] Add dynamic-shape resize to q8ta ops#20367
SS-JIA merged 1 commit into
gh/SS-JIA/559/origfrom
gh/SS-JIA/558/orig

Conversation

@pytorchbot

Copy link
Copy Markdown
Collaborator

This PR was created by the merge bot to help merge the original PR into the main branch.
ghstack PR number: #20312 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/558/base
ghstack PR head: https://github.com/pytorch/executorch/tree/gh/SS-JIA/558/head
Merge bot PR base: https://github.com/pytorch/executorch/tree/gh/SS-JIA/559/orig
Merge bot PR head: https://github.com/pytorch/executorch/tree/gh/SS-JIA/558/orig
Differential Revision: D108788845
@diff-train-skip-merge

Pull Request resolved: #20312

The q8ta (quantized int8) op `DynamicDispatchNode`s were constructed with an empty resize-args list and no resize function, so their output tensors were never `virtual_resize`d on `trigger_resize()`. On a dynamic-shape graph this froze the q8ta outputs at the build-time upper-bound shape — the same failure mode the fp32 ops already avoid. Concretely, in a quantized Vulkan-delegated graph the terminal pointwise conv produces the graph output, so a smaller input (e.g. 238 rows fed into a graph allocated at the 241-row upper bound) left stale rows that propagate downstream, where GroupNorm's global per-group statistics smear them across the whole tensor.

Add resize functions across the q8ta op family, each matching that op's output-shape semantics (mirroring the corresponding fp32 op's resize):
- `q8ta_conv2d` / `q8ta_conv2d_dw`: output H/W recomputed from the input via `calc_out_sizes_hw`.
- `q8ta_conv2d_pw`: 1x1 conv preserves spatial dims (out H/W == in H/W).
- `q8ta_conv2d_transposed`: transposed output formula via `calc_out_sizes_hw(transposed=true)` (threads `output_padding` through the dispatch, which was previously dropped).
- `q8ta` im2col scratch: flattened-window `K` from channels/kernel/groups, `H_out`/`W_out` from the current input.
- `q8ta_linear`: `[*input.shape[:-1], out_features]`.
- `q8ta` binary: `broadcast(in_a, in_b)`.
- `q8ta` quantize / dequantize: elementwise, output shape == input shape.

The quantized conv/quant path now honors dynamic input shapes like the fp32 path.
ghstack-source-id: 394480015
@exported-using-ghexport

Differential Revision: [D108788845](https://our.internmc.facebook.com/intern/diff/D108788845/)
@pytorchbot pytorchbot requested a review from SS-JIA as a code owner June 18, 2026 01:53
@pytorch-bot

pytorch-bot Bot commented Jun 18, 2026

Copy link
Copy Markdown

🔗 Helpful Links

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

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

❌ 3 New Failures, 1 Unrelated Failure

As of commit d299469 with merge base 0eb8247 (image):

NEW FAILURES - The following jobs have failed:

FLAKY - The following job failed but was likely due to flakiness present on trunk:

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@linux-foundation-easycla

Copy link
Copy Markdown

CLA Missing ID

  • ❌ The email address for the commit (d299469) is not linked to the GitHub account, preventing the EasyCLA check. Consult this Help Article and GitHub Help to resolve. (To view the commit's email address, add .patch at the end of this PR page's URL.) For further assistance with EasyCLA, please visit our EasyCLA portal and chat with our support bot.

@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 Jun 18, 2026
@SS-JIA SS-JIA merged commit c0460b9 into gh/SS-JIA/559/orig Jun 18, 2026
180 of 186 checks passed
@SS-JIA SS-JIA deleted the gh/SS-JIA/558/orig branch June 18, 2026 14:44
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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants