Skip to content

[Bugfix] Remove NVFP4 scales assertions to fix load_format=dummy - #18861

Merged
DarkLight1337 merged 4 commits into
vllm-project:mainfrom
neuralmagic:fix-fp4-marlin-dummy
May 30, 2025
Merged

DarkLight1337 merged 4 commits into
vllm-project:mainfrom
neuralmagic:fix-fp4-marlin-dummy

Conversation

@mgoin

@mgoin mgoin commented May 28, 2025 •

Copy link
Copy Markdown
Member

Currently on 0.9.0 when running vllm serve nvidia/DeepSeek-R1-FP4 --quantization modelopt_fp4 -tp 8 --load-format dummy on A100, we run into

(VllmWorker rank=5 pid=3888806) ERROR 05-28 18:39:46 [multiproc_executor.py:487]   File "/home/mgoin/venvs/vllm-rel/lib/python3.12/site-packages/vllm/model_executor/layers/quantization/utils/marlin_utils_fp4.py", line 25, in fp4_marlin_process_scales
(VllmWorker rank=5 pid=3888806) ERROR 05-28 18:39:46 [multiproc_executor.py:487]     assert (marlin_scales >= 0).all()
(VllmWorker rank=5 pid=3888806) ERROR 05-28 18:39:46 [multiproc_executor.py:487]            ^^^^^^^^^^^^^^^^^^^^^^^^^^
(VllmWorker rank=5 pid=3888806) ERROR 05-28 18:39:46 [multiproc_executor.py:487] AssertionError

Then on B200 when running vllm serve nvidia/DeepSeek-R1-FP4 --quantization modelopt_fp4 -tp 4 --load-format dummy, we run into

(VllmWorker rank=3 pid=2693151) ERROR 05-28 18:48:28 [multiproc_executor.py:487]   File "/home/mgoin/code/vllm/vllm/model_executor/layers/quantization/modelopt.py", line 588, in process_weights_after_loading
(VllmWorker rank=3 pid=2693151) ERROR 05-28 18:48:28 [multiproc_executor.py:487]     assert torch.allclose(
(VllmWorker rank=3 pid=2693151) ERROR 05-28 18:48:28 [multiproc_executor.py:487]            ^^^^^^^^^^^^^^^
(VllmWorker rank=3 pid=2693151) ERROR 05-28 18:48:28 [multiproc_executor.py:487] AssertionError: w1_weight_scale_2 must match w3_weight_scale_2

These asserts are hit because dummy weights are likely to have random values. It doesn't seem this check is truly necessary

@github-actions

Copy link
Copy Markdown

👋 Hi! Thank you for contributing to the vLLM project.

💬 Join our developer Slack at https://slack.vllm.ai to discuss your PR in #pr-reviews, coordinate on features in #feat- channels, or join special interest groups in #sig- channels.

Just a reminder: PRs would not trigger full CI run by default. Instead, it would only run fastcheck CI which starts running only a small and essential subset of CI tests to quickly catch errors. You can run other CI tests on top of those by going to your fastcheck build on Buildkite UI (linked in the PR checks section) and unblock them. If you do not have permission to unblock, ping simon-mo or khluu to add you in our Buildkite org.

Once the PR is approved and ready to go, your PR reviewer(s) can run CI to test the changes comprehensively before merging.

To run CI, PR reviewers can either: Add ready label to the PR or enable auto-merge.

🚀

@mgoin mgoin changed the title [Bugfix] Remove fp4 marlin scales assertion to fix load_format=dummy [Bugfix] Remove NVFP4 scales assertions to fix load_format=dummy May 28, 2025
Signed-off-by: mgoin <mgoin64@gmail.com>
@mgoin

mgoin commented May 28, 2025

Copy link
Copy Markdown
Member Author

PTAL @pavanimajety @jinzhen-lin

@jinzhen-lin

jinzhen-lin commented May 29, 2025 •

Copy link
Copy Markdown
Contributor

In Marlin NVFP4, I changed the scales from FP8-S1E4M3 to a special FP8-S0E5M3 format to speedup the dequantization, this assumed the origin scales to be >=0, if we can always ensure that for real weight, this assertion can be removed.

@mgoin mgoin added ready ONLY add when PR is ready to merge/full CI is needed ci/build labels May 29, 2025
@DarkLight1337
DarkLight1337 merged commit 4d0a154 into vllm-project:main May 30, 2025
amitm02 pushed a commit to amitm02/vllm that referenced this pull request Jun 1, 2025
…m-project#18861)

Signed-off-by: mgoin <mgoin64@gmail.com>
Signed-off-by: amit <amit.man@gmail.com>
amitm02 pushed a commit to amitm02/vllm that referenced this pull request Jun 1, 2025
…m-project#18861)

Signed-off-by: mgoin <mgoin64@gmail.com>
Signed-off-by: amit <amit.man@gmail.com>
0826joyce pushed a commit to 0826joyce/vllm-serving-optimization that referenced this pull request May 19, 2026
philippesic pushed a commit to philippesic/vllm-semantic-cache that referenced this pull request Jul 19, 2026
plasticchris pushed a commit to plasticchris/vllm that referenced this pull request Jul 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci/build ready ONLY add when PR is ready to merge/full CI is needed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants