Skip to content

Fix critical quantization parameter bugs in AWQ and NVFP4#6

Merged
j4ys0n merged 1 commit into
mainfrom
claude/msquant-ui-quantization-011CUnDrUZLYgbNPBXZ8iKzY
Nov 4, 2025
Merged

Fix critical quantization parameter bugs in AWQ and NVFP4#6
j4ys0n merged 1 commit into
mainfrom
claude/msquant-ui-quantization-011CUnDrUZLYgbNPBXZ8iKzY

Conversation

@j4ys0n

@j4ys0n j4ys0n commented Nov 4, 2025

Copy link
Copy Markdown
Contributor

Root Cause #1: Invalid parameter name 'dataset_split'

  • LLM-Compressor's oneshot() expects 'splits' not 'dataset_split'
  • The parameter must be a dict: {"calibration": split_name}
  • This was causing: ValueError: Some keys are not used by the HfArgumentParser: ['dataset_split']

Root Cause #2: Inverted symmetric/zero_point logic

  • AWQ config had: "symmetric": config.zero_point
  • Correct: "symmetric": not config.zero_point
  • When zero_point=True → asymmetric quantization → symmetric=False
  • When zero_point=False → symmetric quantization → symmetric=True
  • This bug caused incorrect quantization configuration

Changes:

  • AWQ: Fixed splits parameter format (line 151)
  • AWQ: Fixed symmetric parameter logic (line 111)
  • NVFP4: Fixed splits parameter format (line 225)

Both quantizers now use the correct LLM-Compressor API format.

Tested with: llmcompressor 0.8.1, wikitext dataset

Root Cause #1: Invalid parameter name 'dataset_split'
- LLM-Compressor's oneshot() expects 'splits' not 'dataset_split'
- The parameter must be a dict: {"calibration": split_name}
- This was causing: ValueError: Some keys are not used by the
  HfArgumentParser: ['dataset_split']

Root Cause #2: Inverted symmetric/zero_point logic
- AWQ config had: "symmetric": config.zero_point
- Correct: "symmetric": not config.zero_point
- When zero_point=True → asymmetric quantization → symmetric=False
- When zero_point=False → symmetric quantization → symmetric=True
- This bug caused incorrect quantization configuration

Changes:
- AWQ: Fixed splits parameter format (line 151)
- AWQ: Fixed symmetric parameter logic (line 111)
- NVFP4: Fixed splits parameter format (line 225)

Both quantizers now use the correct LLM-Compressor API format.

Tested with: llmcompressor 0.8.1, wikitext dataset
Copilot AI review requested due to automatic review settings November 4, 2025 05:39

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes a critical bug in AWQ quantization configuration and updates the API parameter name for dataset splits to match the llm-compressor library interface.

  • Fixed inverted logic for the symmetric quantization parameter
  • Updated dataset_split parameter to splits dictionary format for both AWQ and NVFP4 quantizers
  • Removed trailing whitespace for code consistency

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@j4ys0n

j4ys0n commented Nov 4, 2025

Copy link
Copy Markdown
Contributor Author

Automated review 🤖

Summary of Changes
This PR fixes two critical bugs in the AWQ and NVFP4 quantization pipelines. First, it corrects the parameter name and format for dataset splits to match the LLM-Compressor API (splits dict instead of dataset_split). Second, it fixes the logic for symmetric quantization by inverting the zero_point flag, ensuring correct quantization behavior. These changes ensure that quantization runs correctly with the LLM-Compressor library.

Key Changes & Positives

  • 🟢 Fixed symmetric parameter logic in AWQ quantizer: not config.zero_point now correctly maps to symmetric/asymmetric behavior.
  • 🟢 Corrected dataset_split to splits parameter format for both AWQ and NVFP4, aligning with LLM-Compressor API.
  • 🟢 Minimal, focused changes that directly address root causes without side effects.

Potential Issues & Recommendations

  1. Issue / Risk: Incorrect symmetric quantization logic could lead to incorrect weight quantization behavior.
    Impact: Quantized models may not behave as expected, affecting accuracy and performance.
    Recommendation: Verify quantization outputs with test models to confirm correct symmetric/asymmetric behavior.
    Status: 🟡 Needs review

  2. Issue / Risk: Parameter name change from dataset_split to splits may not be backward compatible if used elsewhere.
    Impact: Existing configurations or integrations may break if they still reference the old parameter.
    Recommendation: Confirm that all downstream consumers of config.calib_split are updated or that a deprecation path is in place.
    Status: 🟡 Needs review

Language/Framework Checks

  • Python: Parameter handling and config parsing are consistent with LLM-Compressor expectations. No syntax or type issues.
  • LLM-Compressor API: Correct usage of splits dict and oneshot() parameters confirmed.

Security & Privacy
No security or privacy concerns introduced.

Build/CI & Ops
No build or deployment changes. Ensure CI tests cover quantization pipelines with both AWQ and NVFP4.

Tests

  • Add unit tests to validate symmetric/asymmetric behavior with zero_point=True/False.
  • Add integration tests to confirm splits parameter is correctly passed to oneshot() in both quantizers.

Approval Recommendation
Approve with caveats

  • Verify symmetric/asymmetric quantization behavior with test cases
  • Confirm backward compatibility or deprecation strategy for dataset_split usage
  • Ensure CI includes tests for both AWQ and NVFP4 quantizers with updated parameters

@j4ys0n
j4ys0n merged commit 24f2f54 into main Nov 4, 2025
7 checks passed
@j4ys0n
j4ys0n deleted the claude/msquant-ui-quantization-011CUnDrUZLYgbNPBXZ8iKzY branch November 4, 2025 05:42
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.

3 participants