Skip to content

Conversation

@SS-JIA
Copy link
Contributor

@SS-JIA SS-JIA commented Dec 10, 2025

Stack from ghstack (oldest at bottom):

It seems that choose_qparams_affine has recently appended some arguments to the schema. This causes newly exported models to break because at runtime, the output arg can no longer be found.

Fix by locating the output argument as the last entry in the args vector, rather than continuously incrementing the args index.

Update quantize/dequantize ops as well since it seems quantized_decomposed namespace ops are subject to change in the future.

Note that it would be good to do this for all operators in the Vulkan backend as a later refactor.

Differential Revision: D88887463

It seems that `choose_qparams_affine` has recently appended some arguments to the schema. This causes newly exported models to break because at runtime, the output arg can no longer be found.

Fix by locating the output argument as the last entry in the args vector, rather than continuously incrementing the args index.

Update quantize/dequantize ops as well since it seems quantized_decomposed namespace ops are subject to change in the future.

Note that it would be good to do this for all operators in the Vulkan backend as a later refactor.

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

[ghstack-poisoned]
@pytorch-bot
Copy link

pytorch-bot bot commented Dec 10, 2025

🔗 Helpful Links

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

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

❌ 1 New Failure, 1 Unrelated Failure

As of commit c9abd59 with merge base a0a6278 (image):

NEW FAILURE - The following job has failed:

UNSTABLE - The following job is marked as unstable, possibly due to flakiness 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 Dec 10, 2025
@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.

It seems that `choose_qparams_affine` has recently appended some arguments to the schema. This causes newly exported models to break because at runtime, the output arg can no longer be found.

Fix by locating the output argument as the last entry in the args vector, rather than continuously incrementing the args index.

Update quantize/dequantize ops as well since it seems quantized_decomposed namespace ops are subject to change in the future.

Note that it would be good to do this for all operators in the Vulkan backend as a later refactor.

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

[ghstack-poisoned]
const std::vector<ValueRef>& args) {
int32_t arg_idx = 0;
size_t arg_idx = 0;
size_t last_arg_idx = args.size() - 1;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the ones in between do you just rely on default behavior? What if they are serialized with values != default? Shouldnt you error out?

Copy link
Contributor Author

@SS-JIA SS-JIA Dec 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, that's a good point. I have a planned updated to improve arg checking for quantized_decomposed ops since there are currently a lot of unsupported input cases which are not accounted for - I will include this in that update.

The primary purpose of this PR as-is is to recover a currently broken CI signal, so I would prefer to keep it as simple as possible. In practice, not validating the args should be ok (for now) since the quantized_decomposed ops are inserted by a quantization workflow and Vulkan doesn't really work with non-supported quant workflows anyways 😛

@SS-JIA SS-JIA changed the base branch from gh/SS-JIA/380/base to main December 11, 2025 19:48
@SS-JIA SS-JIA merged commit f168dbf into main Dec 11, 2025
163 of 166 checks passed
@SS-JIA SS-JIA deleted the gh/SS-JIA/380/head branch December 11, 2025 19:48
SS-JIA added a commit that referenced this pull request Dec 11, 2025
Stack from [ghstack](https://github.com/ezyang/ghstack) (oldest at
bottom):
* __->__ #16187
* #16186

TSIA!

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

cc @manuelcandales @digantdesai @cbilgin

---------

Co-authored-by: ssjia <ssjia@devvm1479.ncg0.facebook.com>
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