feat: add --dry-run VRAM/size estimation mode#1958
Open
mvanhorn wants to merge 3 commits into
Open
Conversation
Adds a --dry-run flag that estimates peak block-tuning VRAM, output size, and approximate time from the model config alone (AutoConfig only, no weights). The VRAM estimate is built on auto-round's own block-wise memory model, reusing auto_round.utils.device.estimate_tuning_block_mem and get_moe_memory_ratio per maintainer feedback on intel#1592: - peak memory at decoder-block granularity (card_0 = block I/O cache + layer activations + additional overhead) - block input/output cache excluded when low_gpu_mem_usage is set - MoE handled via get_moe_memory_ratio - robust layer/hidden-size discovery across config field names and nested (text_config etc.) configs Adds unit tests for helper reuse, the low_gpu_mem_usage path, MoE, and layer-count fallbacks. Signed-off-by: Matt Van Horn <455140+mvanhorn@users.noreply.github.com>
for more information, see https://pre-commit.ci Signed-off-by: Matt Van Horn <455140+mvanhorn@users.noreply.github.com>
Matches the codebase convention (calib_dataset.py, utils/model.py) where every optional modelscope import carries a pylint E0401 disable, since modelscope is not in requirements. Fixes the Code-Scan-AutoRound failure. Signed-off-by: Matt Van Horn <455140+mvanhorn@users.noreply.github.com>
4649988 to
700c697
Compare
Author
|
Pushed a fix for the two red checks:
|
This was
linked to
issues
Jul 2, 2026
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.
Re-submit of #1592, reworked per your feedback. The VRAM estimate is now built on auto-round's own block-wise memory model instead of a raw parameter count:
auto_round.utils.device.estimate_tuning_block_memandget_moe_memory_ratio(@xin3he'scard_0 = block_input_output + layer_activation + additionalformula).low_gpu_mem_usageis set, and includes it otherwise (@wenhuach21's caching point).get_moe_memory_ratio; layer/hidden-size discovery is robust across config field names and nested configs (text_configetc.) sincenum_hidden_layersdoesn't cover every model (@xin3he).AutoConfigonly, no weights.Unit tests cover helper reuse, the
low_gpu_mem_usagepath, MoE, and layer-count fallbacks (8 passing). Supersedes #1592 (couldn't reopen after the rebase).