Skip to content

Enable weight fake quantization in calibration mode#25

Merged
u-simha merged 3 commits into
apple:mainfrom
u-simha:u/usimha/enable-weight-fq-in-calibration-mode
Jul 10, 2026
Merged

Enable weight fake quantization in calibration mode#25
u-simha merged 3 commits into
apple:mainfrom
u-simha:u/usimha/enable-weight-fq-in-calibration-mode

Conversation

@u-simha

@u-simha u-simha commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Quantizer.calibration_mode() previously disabled fake quantization on both weights and activations. It now only disables activation fake quantization, so activation observers see the effect of quantized weights when computing activation ranges.

Adds enable_weight_fake_quant/disable_activation_fake_quant helpers used by both the eager and graph quantizers, and updates docs/tests accordingly.

@u-simha u-simha requested a review from crowbat July 1, 2026 22:59
Utkarsh Simha and others added 3 commits July 10, 2026 13:28
…bration mode

Quantizer.calibration_mode() previously disabled fake quantization on both
weights and activations. It now only disables activation fake quantization,
so activation observers see the effect of quantized weights when computing
activation ranges.

Adds enable_weight_fake_quant/disable_activation_fake_quant helpers used by
both the eager and graph quantizers, and updates docs/tests accordingly.
…hange

- Move enable_weight_fake_quant/disable_activation_fake_quant into a new
  _fake_quant_utils module so they can import FakeQuantizeImplBase and
  CompressionTargetTensor at module scope instead of via local imports,
  keeping _utils.py free of dependencies on other quantization modules.
- Use basic_config (weight + activation quantization) instead of
  input_activation_only_config in test_calibration_mode so the weight-FQ
  branch is actually exercised; only assert scale drift for activation
  modules, since weight ranges are fixed at prepare time.
- Drop the changelog.d entry.
@u-simha u-simha force-pushed the u/usimha/enable-weight-fq-in-calibration-mode branch from 0a6ddba to 3eb12bd Compare July 10, 2026 20:39
@u-simha u-simha merged commit 519f21c into apple:main Jul 10, 2026
8 checks passed
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.

2 participants