[ROCm][Bugfix] fix exception related to trust_remote_code for MiniMax-M2.1-MXFP4#37698
[ROCm][Bugfix] fix exception related to trust_remote_code for MiniMax-M2.1-MXFP4#37698hongxiayang wants to merge 4 commits intovllm-project:mainfrom
Conversation
There was a problem hiding this comment.
Code Review
This pull request effectively addresses the bug related to trust_remote_code for Quark models by propagating the hf_config from ModelConfig down to maybe_update_config. This avoids re-fetching the configuration with a hardcoded trust_remote_code=False and also adds a performance improvement by skipping logic for non-applicable models. The signature changes across various quantization configs are correctly handled to maintain compatibility. I've added one comment regarding improving the robustness of dictionary access to prevent potential KeyError exceptions.
|
Hi @hongxiayang, the pre-commit checks have failed. Please run: uv pip install pre-commit>=4.5.1
pre-commit install
pre-commit run --all-filesThen, commit the changes and push to your branch. For future commits, Tip Is
|
|
cc @dllehr-amd |
… amd quark models Signed-off-by: Hongxia Yang <[email protected]>
Signed-off-by: Hongxia Yang <[email protected]>
Signed-off-by: Hongxia Yang <[email protected]>
Signed-off-by: Hongxia Yang <[email protected]>
d86a7a3 to
30d7c71
Compare
Purpose
Bug Fix: QuarkConfig.maybe_update_config
Problem: The original code called get_config() with hardcoded trust_remote_code=False for every Quark model. This caused:
For example:
File Changes
vllm/model_executor/layers/quantization/quark/quark.py:Replaced get_config() call with pre-loaded hf_config from ModelConfig, so no need to get from hf config. Also, user should be able to override trust_remote_code from command line.
Added early return for non-deepseek_v3 model types via _DEEPSEEK_V3_FAMILY_MODEL_TYPES frozenset.
vllm/model_executor/layers/quantization/base_config.py: Extended base maybe_update_config signature to accept revision + **kwargsvllm.py: Passes hf_config, revision, and trust_remote_code from ModelConfig to maybe_update_configThis will allow user to specify trust_remote_code.
and other places to align with the signature change.
Added new Test
tests/quantization/test_quark_maybe_update_config.py: 3 tests using real HF configs — verifies amd/MiniMax-M2.1-MXFP4 stays False, amd/DeepSeek-R1-MXFP4-ASQ enables True, and missing hf_config doesn't crash
Test Result
root@node:/home/vllm/tests/quantization# pytest test_quark_maybe_update_config.py
==================================================== test session starts ====================================================
platform linux -- Python 3.12.12, pytest-9.0.2, pluggy-1.6.0
rootdir: /dockerx/vllm
configfile: pyproject.toml
plugins: asyncio-1.3.0, anyio-4.12.1
asyncio: mode=Mode.STRICT, debug=False, asyncio_default_fixture_loop_scope=None, asyncio_default_test_loop_scope=function
collected 3 items
test_quark_maybe_update_config.py ... [100%]
=============================================== 3 passed, 2 warnings in 4.72s ===============================================
sys:1: DeprecationWarning: builtin type swigvarlink has no module attribute
Essential Elements of an Effective PR Description Checklist
supported_models.mdandexamplesfor a new model.