Skip to content

Conversation

@tlrmchlsmth
Copy link
Member

@tlrmchlsmth tlrmchlsmth commented Feb 24, 2025

Fp8MoEMethod is reaching into the layer to get the number of experts during process_weights_after_loading, which isn't right when using expert parallelism.

VLLM_TEST_ENABLE_EP=1 vllm serve neuralmagic/Mixtral-8x7B-Instruct-v0.1-FP8 --tensor-parallel-size 2

Would hit the following error:

ERROR 02-24 19:29:54 [engine.py:400]   File "/home/tms/vllm/vllm/model_executor/model_loader/loader.py", line 167, in _process_weights_after_loading
ERROR 02-24 19:29:54 [engine.py:400]     quant_method.process_weights_after_loading(module)
ERROR 02-24 19:29:54 [engine.py:400]   File "/home/tms/vllm/vllm/model_executor/layers/quantization/fp8.py", line 651, in process_weights_after_loading
ERROR 02-24 19:29:54 [engine.py:400]     layer.w13_weight[expert_id][start:start +
ERROR 02-24 19:29:54 [engine.py:400]     ~~~~~~~~~~~~~~~~^^^^^^^^^^^
ERROR 02-24 19:29:54 [engine.py:400] IndexError: index 4 is out of bounds for dimension 0 with size 4

I changed num_experts to global_num_experts and added a local_num_experts as well, and fixed similar spots in quark_moe.py and compressed_tensors_moe.py.

I also fixed up a couple of other spots where we are looking at the layer's num_experts for heuristics.


Signed-off-by: Tyler Michael Smith <[email protected]>
@github-actions
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.

🚀

Signed-off-by: Tyler Michael Smith <[email protected]>
Copy link
Member

@mgoin mgoin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch

@mgoin mgoin added bug Something isn't working quantization ready ONLY add when PR is ready to merge/full CI is needed labels Feb 24, 2025
Signed-off-by: Tyler Michael Smith <[email protected]>
Copy link
Member

@mgoin mgoin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lovely, thanks!

@tlrmchlsmth tlrmchlsmth enabled auto-merge (squash) February 24, 2025 21:20
@youkaichao youkaichao disabled auto-merge February 25, 2025 02:54
@youkaichao youkaichao merged commit 1e15aae into main Feb 25, 2025
38 of 39 checks passed
@youkaichao youkaichao deleted the fix_layer_num_experts branch February 25, 2025 02:54
Akshat-Tripathi pushed a commit to krai/vllm that referenced this pull request Mar 3, 2025
lulmer pushed a commit to lulmer/vllm that referenced this pull request Apr 7, 2025
Signed-off-by: Tyler Michael Smith <[email protected]>
Signed-off-by: Louis Ulmer <[email protected]>
shreyankg pushed a commit to shreyankg/vllm that referenced this pull request May 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working quantization 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.

4 participants