reduce ram&vram usage for vlm calib stage#1488
Merged
WeiweiZhang1 merged 13 commits intomainfrom Mar 9, 2026
Merged
Conversation
Signed-off-by: WeiweiZhang1 <weiwei1.zhang@intel.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR aims to reduce RAM/VRAM usage during the MLLM/VLM calibration stage by limiting dataset item caching and by enabling earlier forward-stop behavior during input caching.
Changes:
- Add an optional bounded (LRU) runtime cache for MLLM dataset samples, configurable via
AR_MLLM_DATASET_CACHE_SIZE, and clear it after calibration. - Refactor MLLM dataset instantiation to pass optional
cache_sizeonly when supported. - Improve early-stop caching logic in the base compressor by inferring
last_cache_namefor MLLMs and stopping forward once the last target is reached.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| auto_round/compressors/mllm/dataset.py | Adds bounded LRU caching for dataset __getitem__ and wiring for cache_size via env var. |
| auto_round/compressors/mllm/compressor.py | Reduces VRAM during calib by passing use_cache=False and clears dataset runtime cache post-calib. |
| auto_round/compressors/base.py | Infers the last cache target for MLLMs and uses early-stop to reduce runtime/memory during caching. |
wenhuach21
reviewed
Mar 3, 2026
Contributor
|
Besides, help test a moe model, like qwen35-35B, the patching code may introduce some issues |
Signed-off-by: n1ck-guo <heng.guo@intel.com>
Signed-off-by: WeiweiZhang1 <weiwei1.zhang@intel.com>
for more information, see https://pre-commit.ci
Signed-off-by: WeiweiZhang1 <weiwei1.zhang@intel.com>
Signed-off-by: WeiweiZhang1 <weiwei1.zhang@intel.com>
Signed-off-by: WeiweiZhang1 <weiwei1.zhang@intel.com>
for more information, see https://pre-commit.ci
yiliu30
approved these changes
Mar 6, 2026
wenhuach21
reviewed
Mar 9, 2026
| lr (float): The learning rate (default is 0.005). | ||
| minmax_lr (float): The learning rate for min-max tuning (default is None). | ||
| low_gpu_mem_usage (bool): Whether to use low GPU memory (default is False). | ||
| low_gpu_mem_usage (bool): Whether to use low GPU memory (default is True). |
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Qwen3-VL-8B-Instruct example:

before:
after:

Type of Change
Related Issues
Fixes or relates to # #1214
Checklist Before Submitting