Repository navigation
(fix: quantization) skip non-float module boundary values in graph mode - #173
Merged
Merged
Conversation
Signed-off-by: Prathamesh Mandke <46148373+pkmandke@users.noreply.github.com>
Signed-off-by: Prathamesh Mandke <46148373+pkmandke@users.noreply.github.com>
vineet-g
requested changes
Oct 30, 2026
pkmandke
marked this pull request as ready for review
November 2, 2026 23:41
Signed-off-by: Prathamesh Mandke <46148373+pkmandke@users.noreply.github.com>
crowbat
approved these changes
Nov 3, 2026
vineet-g
approved these changes
Nov 5, 2026
Signed-off-by: Prathamesh Mandke <46148373+pkmandke@users.noreply.github.com>
pkmandke
enabled auto-merge (squash)
November 5, 2026 20:33
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.
tl;dr:
module_input_spec={0: ...}on a decomposed SDPA module resolved to aSymIntfromsym_size.prepare()then attached aFakeQuantizeto a Python int and crashed ontensor.ndim. This fix skips non-float boundary values duringprepare()in graph mode.A module-level
module_input_spec/module_output_specthat resolves to ashape integer crashes
prepare:The prepared graph has
activation_post_process_N(sym_size_int_M): aFakeQuantize attached to a Python int.
Change/Fix
Skip non-floating-point values in
_find_and_apply_module_level_spec(inputs andoutputs).
How it was found
module_input_spec={0: <fp8>}on a decomposedSDPAmodule, meant to quantize thequery.
SDPAbuilds its causal mask from shape integers before touching the query,so boundary input 0 ends up being a
SymInt.Tests
TestNonFloatModuleBoundaryintest_graph_mode_quantizer.py, for the wildcardand
{0: spec}cases. Both fail before this change with the error above andpass after.