Skip to content

Conversation

Aryanpagaria
Copy link

Changes

Fixed a subtle bug in _get_smooth_quant_param_grid where matmul values were returned as single-element tuples instead of plain floats.

Replaced:
AdvancedSmoothQuantParameters(matmul=alpha_v) for alpha_v in itertools.product(alpha_values)
With:
AdvancedSmoothQuantParameters(matmul=alpha_v) for alpha_v, in itertools.product(alpha_values)
This ensures matmul values are floats, preventing TypeError in the PTQ pipeline.

Reason for changes

itertools.product always returns tuples, even for a single iterable.
Previously, this caused a crash when the code tried to compare sq_params.matmul >= 0 because tuples cannot be compared to integers.
The change fixes this by unpacking the single-element tuples to get plain float values.

Related tickets

Closes #3613

Tests

Verified manually that _get_smooth_quant_param_grid() now returns AdvancedSmoothQuantParameters with float matmul values, e.g., 0.15, 0.25, instead of (0.15,).
Results of test :
0.15 <class 'float'>
0.25 <class 'float'>
0.5 <class 'float'>
...

Ran existing pytest suite — all tests passed successfully.

No new tests were required as the logic is unchanged, only the tuple unpacking was fixed.

@Aryanpagaria Aryanpagaria requested a review from a team as a code owner October 21, 2025 11:54
@ljaljushkin
Copy link
Contributor

@andrey-churkin, could you please take a look?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

_get_smooth_quant_param_grid is broken

2 participants