Deprecate Mllama support in llm_ptq/vlm_ptq examples#1332
Deprecate Mllama support in llm_ptq/vlm_ptq examples#1332kevalmorabia97 merged 1 commit intomainfrom
Conversation
Remove the Mllama (Llama 3.2 Vision) model-type branches and the MllamaImageProcessor helper across examples and library: - examples/llm_ptq/hf_ptq.py: drop mllama branches in load_model, make_calib_dataloader, export_quantized, and remove MllamaImageProcessor isinstance checks in input_decode/output_decode. - examples/llm_ptq/example_utils.py: drop mllama branch in get_processor and its now-unused device parameter. - modelopt/torch/utils/vlm_dataset_utils.py: drop the legacy MllamaImageProcessor path. - modelopt/torch/utils/image_processor.py: delete (no remaining users). - CHANGELOG.rst: note the deprecation under 0.44 Backward Breaking Changes. Signed-off-by: Chenjie Luo <chenjiel@nvidia.com>
📝 WalkthroughWalkthroughThis pull request removes Mllama (Llama 3.2 Vision) support from quantization examples and utilities by deleting the image processor abstraction, eliminating model-specific handling in example code, and updating documentation to direct users toward alternative approaches. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes 🚥 Pre-merge checks | ✅ 5 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
|
There was a problem hiding this comment.
🧹 Nitpick comments (1)
CHANGELOG.rst (1)
22-22: Prefer “Removed” over “Deprecated” in this breaking-change note.This line says support is deprecated but also says the code paths were removed. Using “Removed” avoids ambiguity for users upgrading.
Proposed wording tweak
-- Deprecated Mllama (Llama 3.2 Vision) support in the ``llm_ptq`` and ``vlm_ptq`` examples. +- Removed Mllama (Llama 3.2 Vision) support in the ``llm_ptq`` and ``vlm_ptq`` examples.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@CHANGELOG.rst` at line 22, The changelog wording is ambiguous — it says "Deprecated" but the code branches (model_type == "mllama") and uses of MllamaImageProcessor were removed; update the sentence in CHANGELOG.rst to use "Removed" instead of "Deprecated" and keep the remaining details intact (mentioning removal from hf_ptq.py and example_utils.py, and advising use of --calib_with_images with a supported VLM per the Nemotron VL section in examples/llm_ptq/README.md) so users understand the functionality was removed, not merely deprecated.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@CHANGELOG.rst`:
- Line 22: The changelog wording is ambiguous — it says "Deprecated" but the
code branches (model_type == "mllama") and uses of MllamaImageProcessor were
removed; update the sentence in CHANGELOG.rst to use "Removed" instead of
"Deprecated" and keep the remaining details intact (mentioning removal from
hf_ptq.py and example_utils.py, and advising use of --calib_with_images with a
supported VLM per the Nemotron VL section in examples/llm_ptq/README.md) so
users understand the functionality was removed, not merely deprecated.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: a80fda8b-b46e-4839-9383-4bb9040e48a7
📒 Files selected for processing (5)
CHANGELOG.rstexamples/llm_ptq/example_utils.pyexamples/llm_ptq/hf_ptq.pymodelopt/torch/utils/image_processor.pymodelopt/torch/utils/vlm_dataset_utils.py
💤 Files with no reviewable changes (2)
- modelopt/torch/utils/vlm_dataset_utils.py
- modelopt/torch/utils/image_processor.py
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1332 +/- ##
==========================================
- Coverage 72.74% 69.06% -3.68%
==========================================
Files 459 476 +17
Lines 48611 54931 +6320
==========================================
+ Hits 35361 37938 +2577
- Misses 13250 16993 +3743
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
meenchen
left a comment
There was a problem hiding this comment.
Clean deprecation PR. Removes Mllama-specific code paths from llm_ptq/vlm_ptq examples and deletes the now-unused MllamaImageProcessor class. All references to the removed imports and model_type == "mllama" branches are consistently cleaned up across the touched files. The remaining mllama references in modelopt/torch/export/ are for TRT-LLM export config mapping and are outside this PR's scope. CHANGELOG entry is present. Small, focused, and straightforward.
Summary
llm_ptqexample (hf_ptq.py,example_utils.py) and drops the now-unusedMllamaImageProcessorwrapper frommodelopt/torch/utils/.MllamaImageProcessorpath inmodelopt/torch/utils/vlm_dataset_utils.py; the generic HF ProcessorMixin path handles the remaining cases.Test plan
examples/llm_ptq/scripts/huggingface_example.sh --model <llm> --quant fp8(text-only path, non-mllama)Summary by CodeRabbit
--calib_with_imagesflag with other supported VLMs instead of Mllama-specific processing paths.