Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
May 30, 2025

Conversation

mgoin
Copy link
Member

@mgoin mgoin commented May 28, 2025

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

Copy link

👋 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
@mgoin
Copy link
Member Author

mgoin commented May 28, 2025

PTAL @pavanimajety @jinzhen-lin

@jinzhen-lin
Copy link
Contributor

jinzhen-lin commented May 29, 2025

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
69 checks passed
amitm02 pushed a commit to amitm02/vllm that referenced this pull request Jun 1, 2025
amitm02 pushed a commit to amitm02/vllm that referenced this pull request Jun 1, 2025
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