add imatrix calibration data resolution to quant config - #787
add imatrix calibration data resolution to quant config#787Roderick-Wu wants to merge 2 commits into
Conversation
Signed-off-by: Roderick Wu <Roderick-Wu@h100-01.nemg-001.lab.rdu2.dc.redhat.com>
|
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
WalkthroughChangesCalibration Detection
Estimated code review effort: 1 (Trivial) | ~5 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/compressed_tensors/quantization/quant_config.py`:
- Around line 300-305: Replace the boolean-wrapped any() condition in the
surrounding scheme loop with a direct if condition checking scheme.weights,
scheme.weights.observer, and its case-insensitive "imatrix_mse" value; preserve
the existing return True behavior when all checks match.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 582515c3-a4f2-4fe9-8063-19b202b49815
📒 Files selected for processing (1)
src/compressed_tensors/quantization/quant_config.py
🔗 Linked repositories identified
CodeRabbit considers these linked repositories for cross-repo context during reviews:
vllm-project/llm-compressor(manual) → reviewed against open PR#2920Roderick-Wu/remove-imatrixgathererinstead of the default branch
| if any( | ||
| scheme.weights is not None | ||
| and scheme.weights.observer is not None | ||
| and scheme.weights.observer.lower() == "imatrix_mse" | ||
| ): | ||
| return True |
There was a problem hiding this comment.
🎯 Functional Correctness | 🔴 Critical | ⚡ Quick win
Replace any() with a direct condition
any() is receiving a boolean, not an iterable, so every call reaching this branch raises TypeError: 'bool' object is not iterable. The surrounding loop already evaluates one scheme at a time; use a direct if condition instead.
Proposed fix
- if any(
+ if (
scheme.weights is not None
and scheme.weights.observer is not None
and scheme.weights.observer.lower() == "imatrix_mse"
):📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| if any( | |
| scheme.weights is not None | |
| and scheme.weights.observer is not None | |
| and scheme.weights.observer.lower() == "imatrix_mse" | |
| ): | |
| return True | |
| if ( | |
| scheme.weights is not None | |
| and scheme.weights.observer is not None | |
| and scheme.weights.observer.lower() == "imatrix_mse" | |
| ): | |
| return True |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@src/compressed_tensors/quantization/quant_config.py` around lines 300 - 305,
Replace the boolean-wrapped any() condition in the surrounding scheme loop with
a direct if condition checking scheme.weights, scheme.weights.observer, and its
case-insensitive "imatrix_mse" value; preserve the existing return True behavior
when all checks match.
Source: Path instructions
| if ( | ||
| scheme.weights is not None | ||
| and scheme.weights.observer is not None | ||
| and scheme.weights.observer.lower() == "imatrix_mse" |
There was a problem hiding this comment.
lets make a list of observers that require calibration in llm-compressor and use it here instead of hardcoding a bunch of observer names
Merge Protections🔴 1 of 1 protections blocking · waiting on 👀 reviews
🔴 Require one maintainer reviewWaiting for
This rule is failing.All PRs must have at least one approving review from a maintainer before merging.
|
vllm-project/llm-compressor#2920