Skip to content

feat: add quantize_mixed() for per-layer quantization#28

Open
nathanhubens wants to merge 1 commit into
fix/fasterai-cleanupfrom
feature/mixed-precision-quant
Open

feat: add quantize_mixed() for per-layer quantization#28
nathanhubens wants to merge 1 commit into
fix/fasterai-cleanupfrom
feature/mixed-precision-quant

Conversation

@nathanhubens
Copy link
Copy Markdown
Collaborator

Summary

  • Add standalone quantize_mixed(model, layer_configs) function using torchao's FqnToConfig
  • Applies different quantization configs (INT8/INT4/skip) to different layers in a single quantize_() call
  • Validates FQNs against model and warns on mismatches
  • Consumes the {fqn: config_or_None} dict from AnalysisResult.to_quant_config()

Test plan

  • nbdev-test --path nbs/quantize/quantizer.ipynb — unit tests for mixed config, empty config, all-None, FQN mismatch warning

@nathanhubens nathanhubens force-pushed the feature/mixed-precision-quant branch 3 times, most recently from 65fb507 to 17cfd40 Compare April 7, 2026 08:35
…parameter

1. quantize_mixed() — per-layer quantization via torchao FqnToConfig
2. IntxWeightOnlyConfig — Conv2d + Linear INT4/INT8 (excludes depthwise)
3. Observer parameter — histogram/moving_average for better PTQ calibration
@nathanhubens nathanhubens force-pushed the feature/mixed-precision-quant branch from 17cfd40 to 25e9acd Compare April 7, 2026 08:40
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.

1 participant