Add tqdm to apply_quantization_config#730
Conversation
|
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:
WalkthroughThe PR adds optional progress-bar display to quantization application. ChangesProgress Bar for Quantization Application
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Warning Review ran into problems🔥 ProblemsLinked repositories: Your configuration references 1 linked repositories, but your current plan allows 0. Analyzed ``, skipped 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.
🧹 Nitpick comments (1)
src/compressed_tensors/quantization/lifecycle/apply.py (1)
136-144: 💤 Low valueCorrect implementation of progress bar.
The implementation correctly materializes the matched modules and wraps the iteration with tqdm. The
disable=not show_progresspattern matches the existing codebase convention fromdispatch_with_map.Optional: Consider adding unit parameter for clarity
for name, submodule in tqdm( matched_modules, desc="Applying quantization config", disable=not show_progress, + unit="module", ):This would make the progress bar display "X/Y modules" instead of "X/Y items", providing slightly clearer context to users.
🤖 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/lifecycle/apply.py` around lines 136 - 144, The progress bar created when iterating over matched_modules should include a unit label for clarity; update the tqdm call in apply.py (the loop that iterates over matched_modules from match_named_modules) to pass a unit parameter (e.g., unit="module" or unit="modules") so the progress display reads "X/Y modules" instead of "X/Y items" while keeping disable=not show_progress and the existing desc.
🤖 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.
Nitpick comments:
In `@src/compressed_tensors/quantization/lifecycle/apply.py`:
- Around line 136-144: The progress bar created when iterating over
matched_modules should include a unit label for clarity; update the tqdm call in
apply.py (the loop that iterates over matched_modules from match_named_modules)
to pass a unit parameter (e.g., unit="module" or unit="modules") so the progress
display reads "X/Y modules" instead of "X/Y items" while keeping disable=not
show_progress and the existing desc.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 967fc852-1946-40fa-a174-7442f64d99b0
📒 Files selected for processing (1)
src/compressed_tensors/quantization/lifecycle/apply.py
Purpose
match_named_modulesfor even very large models is negligible, so it's fine to compute the length of the matched modules upfrontChanges
apply_quantization_config