Conversation
u-simha
requested changes
Sep 17, 2026
u-simha
left a comment
Contributor
There was a problem hiding this comment.
couple small changes requested; thanks for opening up the PR.
Contributor
Author
|
Hi @u-simha, thank you for the review! I've addressed both feedback points in commit c057094:
All 26 |
u-simha
approved these changes
Sep 17, 2026
|
|
||
|
|
||
| # Alias to support PyTorch standard spelling | ||
| extract_name_from_parametrization = extract_name_from_parameterization |
Contributor
There was a problem hiding this comment.
I think we can just use the PyTorch standard spelling for the function extract_name_from_parametrization and skip the aliasing.
Contributor
Author
There was a problem hiding this comment.
Updated! Renamed the function directly to extract_name_from_parametrization across the codebase and removed the alias in commit 7477f88.
rohith500
force-pushed
the
fix/quantization-root-module-fq-mapping
branch
from
September 18, 2026 00:44
7477f88 to
3dd3cc7
Compare
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.
Summary of Changes
Closes #100.
This PR fixes a critical defect in
EagerQuantizerwhere fake-quantize modules for root module weights are mapped to"parametrizations"instead of the canonical root module identifier"", causing weight fake-quantizers to silently lose their configuredQATSchedule._get_fake_quantize_modules:src/coreai_opt/quantization/_eager/quantizer.py:.rsplit(".", 2)[0]heuristic with exact.parametrizations.namespace detection.name == "parametrizations.weight"),.rsplit(".", 2)[0]previously returned"parametrizations"because there was only one dot. Now,".parametrizations." in nameisFalse, cleanly returning"".name == "layer.parametrizations.weight"), splits at.parametrizations., returning"layer".name == "encoder.layers.0.parametrizations.weight"), splits at the rightmost.parametrizations., returning"encoder.layers.0".Motivation & Impact
In Eager QAT (
ExecutionMode.EAGER):quantizer.prepare()registers schedules via:"". Because weight FQs were mapped to"parametrizations",_module_config_dict.get("parametrizations")returnedNone, and weight fake-quantizers were never added to_fq_to_schedule.quantizer.step()):_fq_to_scheduleremained completely empty, emittingUserWarning: step() called but no qat_schedule is configured on any module.Automated Tests Added
Added to
tests/quantization/test_qat_schedule.py:test_root_module_fake_quantize_mapping_and_schedule:ExecutionMode.EAGERandExecutionMode.GRAPH._get_fake_quantize_modules()produces only the canonical root key""."parametrizations"is not present infq_map.keys()._fq_to_schedule.quantizer.training_mode()and verifies observer and fake-quantization transitions at each step (step 0: observer on, FQ offstep 2: FQ on).Verification
pytest tests/quantization/test_qat_schedule.py -k "test_root_module_fake_quantize_mapping_and_schedule": 2 passed in 4.72s.pytest tests/quantization/test_qat_schedule.py: 50 passed, 1 xfailed (known upstream xfail) in 19.74s.pytest tests/quantization/ -m "not slow" -n auto: 1,676 passed, 240 skipped, 37 xfailed in 149.63s.make check: All checks passed (26/26):ruff,darkerruff-lint,checkmake,pymarkdown 0.9.40): Passed__all__, import aliasing): PassedChecklist
fix(quantization): map root module weight FQs to root key for eager QAT scheduling (#100))SHA256:0wr/nMrZodwxsOOHBGpcwRXPk8c3rePKishJLzmhj98)changelog.d/100.fixed)make checkwithout warnings or diff pollution