-
Notifications
You must be signed in to change notification settings - Fork 532
[MoE][Dist] Fix Qwen MoE accuracy bug in DP scenario #1856
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
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1856 +/- ##
==========================================
+ Coverage 74.41% 76.67% +2.26%
==========================================
Files 100 107 +7
Lines 11208 11968 +760
==========================================
+ Hits 8340 9177 +837
+ Misses 2868 2791 -77
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
What is confusing is that this patch indeed can solve the accuracy problem of online scenes, but it destroys the functional availability of offline scenes. |
online:run dp2 on single node #!/bin/sh
# this obtained through ifconfig
# nic_name is the network interface name corresponding to local_ip
nic_name="enp67s0f5"
local_ip="192.168.0.183"
export HCCL_IF_IP=$local_ip
export GLOO_SOCKET_IFNAME=$nic_name
export TP_SOCKET_IFNAME=$nic_name
export HCCL_SOCKET_IFNAME=$nic_name
export OMP_PROC_BIND=false
export OMP_NUM_THREADS=100
export VLLM_USE_V1=1
export HCCL_BUFFSIZE=1024
vllm serve /root/.cache/Qwen3-30B-A3B \
--host 0.0.0.0 \
--port 8004 \
--data-parallel-size 2 \
--data-parallel-size-local 2 \
--data-parallel-address $local_ip \
--data-parallel-rpc-port 13389 \
--seed 1024 \
--served-model-name qwen \
--enable-expert-parallel \
--max-num-seqs 16 \
--max-model-len 32768 \
--max-num-batched-tokens 4096 \
--trust-remote-code \
--no-enable-prefix-caching \
--gpu-memory-utilization 0.9 \
--additional-config '{"ascend_scheduler_config":{"enabled":true},"torchair_graph_config":{"enabled":false}}'result: INFO: 127.0.0.1:38768 - "POST /v1/completions HTTP/1.1" 200 OKclient curl http://127.0.0.1:8004/v1/completions \mpletions \
-H "Content-Type: application/json" \
-d '{
"model": "qwen",
"prompt": "The future of AI is",
"max_tokens": 50,
"temperature": 0
}'
{"id":"cmpl-5ac0743caa7f4c67aca6582781d07769","object":"text_completion","created":1752805401,"model":"qwen","choices":[{"index":0,"text":" not just about the technology itself, but about how it is used to solve real-world problems. As AI continues to evolve, it will become more integrated into our daily lives, from healthcare and education to transportation and entertainment. The key to unlocking the full","logprobs":null,"finish_reason":"length","stop_reason":null,"prompt_logprobs":null}],"service_tier":null,"system_fingerprint":null,"usage":{"prompt_tokens":5,"total_tokens":55,"completion_tokens":50,"prompt_tokens_details":null},"kv_transfer_params":null}offline mode:run offline_data_parallel_script.py python examples/offline_data_parallel.py \
--model="/root/.cache/Qwen3-30B-A3B" \
--dp-size=2 \
--tp-size=2 \
--enable-expert-parallelresult: (EngineCore_0 pid=3232) File "/vllm-workspace/vllm/vllm/v1/engine/core.py", line 596, in run_engine_core
(EngineCore_0 pid=3232) raise e
(EngineCore_0 pid=3232) File "/vllm-workspace/vllm/vllm/v1/engine/core.py", line 585, in run_engine_core
(EngineCore_0 pid=3232) engine_core.run_busy_loop()
(EngineCore_0 pid=3232) File "/vllm-workspace/vllm/vllm/v1/engine/core.py", line 944, in run_busy_loop
(EngineCore_0 pid=3232) executed = self._process_engine_step()
(EngineCore_0 pid=3232) File "/vllm-workspace/vllm/vllm/v1/engine/core.py", line 637, in _process_engine_step
(EngineCore_0 pid=3232) outputs, model_executed = self.step_fn()
(EngineCore_0 pid=3232) File "/vllm-workspace/vllm/vllm/v1/engine/core.py", line 241, in step
(EngineCore_0 pid=3232) model_output = self.execute_model(scheduler_output)
(EngineCore_0 pid=3232) File "/vllm-workspace/vllm/vllm/v1/engine/core.py", line 227, in execute_model
(EngineCore_0 pid=3232) raise err
(EngineCore_0 pid=3232) File "/vllm-workspace/vllm/vllm/v1/engine/core.py", line 218, in execute_model
(EngineCore_0 pid=3232) return self.model_executor.execute_model(scheduler_output)
(EngineCore_0 pid=3232) File "/vllm-workspace/vllm/vllm/v1/executor/multiproc_executor.py", line 172, in execute_model
(EngineCore_0 pid=3232) (output, ) = self.collective_rpc(
(EngineCore_0 pid=3232) File "/vllm-workspace/vllm/vllm/v1/executor/multiproc_executor.py", line 247, in collective_rpc
(EngineCore_0 pid=3232) raise TimeoutError(f"RPC call to {method} timed out.") from e
(EngineCore_0 pid=3232) TimeoutError: RPC call to execute_model timed out. |
Signed-off-by: MengqingCao <cmq0113@163.com>
|
will add ut on |
|
This PR can fix all the MOE model which use |
| "chatgpt is", | ||
| ] * 10 | ||
|
|
||
| # 并发发送 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use english
| prompt, result = future.result() | ||
| print(f"> Prompt: {prompt}\nResult: {result}\n") | ||
|
|
||
| # resp = requests.post(COMPLETIONS_URL, json=payload, timeout=30) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove the uesless code directly
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will update the dp accuracy test using gsm8k, as the outputs between different dp groups don't seem to be exactly the same, although they all look reasonable. thus this will be removed latter
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done now, plz take a look again, thanks!
Signed-off-by: MengqingCao <cmq0113@163.com>
| p.join() | ||
| result = result_queue.get() | ||
| print(result) | ||
| assert (EXPECTED_VALUE[model] - RTOL < result < EXPECTED_VALUE[model] + RTOL), \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We use the same EXPECTED_VALUE as that of llm without dp to make sure the accuracy of dp is correct
|
Let's fixed the bug first. The AscendFuedMOE way can be done in the future. |
### What this PR does / why we need it? Fix Qwen MoE accuracy bug in DP scenario. Now the implentment of `FusedMoE` in vLLM use `All2AllManager` to manager different all2all algorithm branch. And the default branch use `Multicast` in `dispatch` phase and `all_reduce` in `combine` phase, which are not implented in vLLM-Ascend. This leading to invoking into a default implentment in `base_communicator`, with empty `dispatch` and `combine` operations, thus causing the accuracy issue on it. This pr is a temporary workaround, refacting all2all in vLLM-Ascend could be a better way. - vLLM version: v0.10.0 - vLLM main: vllm-project/vllm@ad57f23 --------- Signed-off-by: MengqingCao <cmq0113@163.com>
### What this PR does / why we need it? Fix Qwen MoE accuracy bug in DP scenario. Now the implentment of `FusedMoE` in vLLM use `All2AllManager` to manager different all2all algorithm branch. And the default branch use `Multicast` in `dispatch` phase and `all_reduce` in `combine` phase, which are not implented in vLLM-Ascend. This leading to invoking into a default implentment in `base_communicator`, with empty `dispatch` and `combine` operations, thus causing the accuracy issue on it. This pr is a temporary workaround, refacting all2all in vLLM-Ascend could be a better way. - vLLM version: v0.10.0 - vLLM main: vllm-project/vllm@ad57f23 --------- Signed-off-by: MengqingCao <cmq0113@163.com>
I would like to nominate Mengqing Cao (@MengqingCao https://github.com/MengqingCao) as a maintainer, starting with my +1. ## Reason Review Quality: She has completed [120+ reviews](https://github.com/vllm-project/vllm-ascend/pulls?q=is%3Apr+is%3Aclosed+commenter%3Amengqingcao+-author%3Amengqingcao) since Feb. 2025, include [#review-3077842852](#2088 (review)), [comment-2990074116](#1032 (comment)), [comment-2921063723](#1013 (comment)) high quality review. Sustained and Quality Contributions: She has Deep understanding of vLLM and vLLM Ascend codebases and solid contributions include The vLLM contributions and help vLLM Ascend release is the main reason I nominated her: - vLLM: Things worth mentioning that she completed [28+ PR contributions](https://github.com/vllm-project/vllm/pulls?q=is%3Apr+author%3AMengqingCao+is%3Amerged+) in vllm-project/vllm, especially for vLLM platform module to improve vLLM mult hardware support. She is one of the important co-authors of [vllm#8054](vllm-project/vllm#8054) and hardware plugin RFC, this makes vllm-ascend plugin possible. Community Involvement: She is also very active and involved in [60+ issues](https://github.com/vllm-project/vllm-ascend/issues?q=is%3Aissue%20state%3Aclosed%20-author%3AMengqingCao%20commenter%3AMengqingCao). So I think she's a great addition to the vLLM Ascend Maintainer team. - ✅**Review Quality:** She has completed 120+ reviews since Feb. 2025. https://github.com/vllm-project/vllm-ascend/pulls?q=is%3Apr+is%3Aclosed+commenter%3Amengqingcao+-author%3Amengqingcao, include #2088 (review), #1446 (comment), #1032 (comment), #1013 (comment) quality review. - ✅**Sustained Contributions:** 99+ PR merged in vllm-project/vllm-ascend https://github.com/vllm-project/vllm-ascend/pulls?q=is%3Apr+author%3AMengqingCao+is%3Amerged - ✅**Quality Contribution:** She is one of the important co-authors of vllm-project/vllm#8054 , this makes vllm-ascend plugin possible. Things worth mentioning that she complete 28+ PR contributions in vllm-project/vllm, especially for vLLM platform module to improve vLLM mult hardware support: https://github.com/vllm-project/vllm/pulls?q=is%3Apr+author%3AMengqingCao+is%3Amerged+. At 2025 Q2, She also lead the [[RFC]: E2E CI test for key features](#413) and [[RFC]: Unit test coverage improvement](#1298) to help vllm ascend improve the coverage. Her main contributions focus on the adaptation of parallel strategies and communicator, such as #1800, #1856. These contributions are sufficient to prove she has “Deep understanding of vLLM and vLLM Ascend codebases” - ✅**Community Involvement:** Involved in 63+ issue reviewer https://github.com/vllm-project/vllm-ascend/issues?q=is%3Aissue%20state%3Aclosed%20-author%3AMengqingCao%20commenter%3AMengqingCao She led the v0.10.1 release as release manager - vLLM version: v0.10.0 - vLLM main: vllm-project/vllm@78dba40 Signed-off-by: Jade Zheng <zheng.shoujian@outlook.com>
I would like to nominate Mengqing Cao (@MengqingCao https://github.com/MengqingCao) as a maintainer, starting with my +1. ## Reason Review Quality: She has completed [120+ reviews](https://github.com/vllm-project/vllm-ascend/pulls?q=is%3Apr+is%3Aclosed+commenter%3Amengqingcao+-author%3Amengqingcao) since Feb. 2025, include [#review-3077842852](vllm-project#2088 (review)), [comment-2990074116](vllm-project#1032 (comment)), [comment-2921063723](vllm-project#1013 (comment)) high quality review. Sustained and Quality Contributions: She has Deep understanding of vLLM and vLLM Ascend codebases and solid contributions include The vLLM contributions and help vLLM Ascend release is the main reason I nominated her: - vLLM: Things worth mentioning that she completed [28+ PR contributions](https://github.com/vllm-project/vllm/pulls?q=is%3Apr+author%3AMengqingCao+is%3Amerged+) in vllm-project/vllm, especially for vLLM platform module to improve vLLM mult hardware support. She is one of the important co-authors of [vllm#8054](vllm-project/vllm#8054) and hardware plugin RFC, this makes vllm-ascend plugin possible. Community Involvement: She is also very active and involved in [60+ issues](https://github.com/vllm-project/vllm-ascend/issues?q=is%3Aissue%20state%3Aclosed%20-author%3AMengqingCao%20commenter%3AMengqingCao). So I think she's a great addition to the vLLM Ascend Maintainer team. - ✅**Review Quality:** She has completed 120+ reviews since Feb. 2025. https://github.com/vllm-project/vllm-ascend/pulls?q=is%3Apr+is%3Aclosed+commenter%3Amengqingcao+-author%3Amengqingcao, include vllm-project#2088 (review), vllm-project#1446 (comment), vllm-project#1032 (comment), vllm-project#1013 (comment) quality review. - ✅**Sustained Contributions:** 99+ PR merged in vllm-project/vllm-ascend https://github.com/vllm-project/vllm-ascend/pulls?q=is%3Apr+author%3AMengqingCao+is%3Amerged - ✅**Quality Contribution:** She is one of the important co-authors of vllm-project/vllm#8054 , this makes vllm-ascend plugin possible. Things worth mentioning that she complete 28+ PR contributions in vllm-project/vllm, especially for vLLM platform module to improve vLLM mult hardware support: https://github.com/vllm-project/vllm/pulls?q=is%3Apr+author%3AMengqingCao+is%3Amerged+. At 2025 Q2, She also lead the [[RFC]: E2E CI test for key features](vllm-project#413) and [[RFC]: Unit test coverage improvement](vllm-project#1298) to help vllm ascend improve the coverage. Her main contributions focus on the adaptation of parallel strategies and communicator, such as vllm-project#1800, vllm-project#1856. These contributions are sufficient to prove she has “Deep understanding of vLLM and vLLM Ascend codebases” - ✅**Community Involvement:** Involved in 63+ issue reviewer https://github.com/vllm-project/vllm-ascend/issues?q=is%3Aissue%20state%3Aclosed%20-author%3AMengqingCao%20commenter%3AMengqingCao She led the v0.10.1 release as release manager - vLLM version: v0.10.0 - vLLM main: vllm-project/vllm@78dba40 Signed-off-by: Jade Zheng <zheng.shoujian@outlook.com>
### What this PR does / why we need it? Fix Qwen MoE accuracy bug in DP scenario. Now the implentment of `FusedMoE` in vLLM use `All2AllManager` to manager different all2all algorithm branch. And the default branch use `Multicast` in `dispatch` phase and `all_reduce` in `combine` phase, which are not implented in vLLM-Ascend. This leading to invoking into a default implentment in `base_communicator`, with empty `dispatch` and `combine` operations, thus causing the accuracy issue on it. This pr is a temporary workaround, refacting all2all in vLLM-Ascend could be a better way. - vLLM version: v0.10.0 - vLLM main: vllm-project/vllm@ad57f23 --------- Signed-off-by: MengqingCao <cmq0113@163.com>
I would like to nominate Mengqing Cao (@MengqingCao https://github.com/MengqingCao) as a maintainer, starting with my +1. ## Reason Review Quality: She has completed [120+ reviews](https://github.com/vllm-project/vllm-ascend/pulls?q=is%3Apr+is%3Aclosed+commenter%3Amengqingcao+-author%3Amengqingcao) since Feb. 2025, include [#review-3077842852](vllm-project#2088 (review)), [comment-2990074116](vllm-project#1032 (comment)), [comment-2921063723](vllm-project#1013 (comment)) high quality review. Sustained and Quality Contributions: She has Deep understanding of vLLM and vLLM Ascend codebases and solid contributions include The vLLM contributions and help vLLM Ascend release is the main reason I nominated her: - vLLM: Things worth mentioning that she completed [28+ PR contributions](https://github.com/vllm-project/vllm/pulls?q=is%3Apr+author%3AMengqingCao+is%3Amerged+) in vllm-project/vllm, especially for vLLM platform module to improve vLLM mult hardware support. She is one of the important co-authors of [vllm#8054](vllm-project/vllm#8054) and hardware plugin RFC, this makes vllm-ascend plugin possible. Community Involvement: She is also very active and involved in [60+ issues](https://github.com/vllm-project/vllm-ascend/issues?q=is%3Aissue%20state%3Aclosed%20-author%3AMengqingCao%20commenter%3AMengqingCao). So I think she's a great addition to the vLLM Ascend Maintainer team. - ✅**Review Quality:** She has completed 120+ reviews since Feb. 2025. https://github.com/vllm-project/vllm-ascend/pulls?q=is%3Apr+is%3Aclosed+commenter%3Amengqingcao+-author%3Amengqingcao, include vllm-project#2088 (review), vllm-project#1446 (comment), vllm-project#1032 (comment), vllm-project#1013 (comment) quality review. - ✅**Sustained Contributions:** 99+ PR merged in vllm-project/vllm-ascend https://github.com/vllm-project/vllm-ascend/pulls?q=is%3Apr+author%3AMengqingCao+is%3Amerged - ✅**Quality Contribution:** She is one of the important co-authors of vllm-project/vllm#8054 , this makes vllm-ascend plugin possible. Things worth mentioning that she complete 28+ PR contributions in vllm-project/vllm, especially for vLLM platform module to improve vLLM mult hardware support: https://github.com/vllm-project/vllm/pulls?q=is%3Apr+author%3AMengqingCao+is%3Amerged+. At 2025 Q2, She also lead the [[RFC]: E2E CI test for key features](vllm-project#413) and [[RFC]: Unit test coverage improvement](vllm-project#1298) to help vllm ascend improve the coverage. Her main contributions focus on the adaptation of parallel strategies and communicator, such as vllm-project#1800, vllm-project#1856. These contributions are sufficient to prove she has “Deep understanding of vLLM and vLLM Ascend codebases” - ✅**Community Involvement:** Involved in 63+ issue reviewer https://github.com/vllm-project/vllm-ascend/issues?q=is%3Aissue%20state%3Aclosed%20-author%3AMengqingCao%20commenter%3AMengqingCao She led the v0.10.1 release as release manager - vLLM version: v0.10.0 - vLLM main: vllm-project/vllm@78dba40 Signed-off-by: Jade Zheng <zheng.shoujian@outlook.com>
### What this PR does / why we need it? Fix Qwen MoE accuracy bug in DP scenario. Now the implentment of `FusedMoE` in vLLM use `All2AllManager` to manager different all2all algorithm branch. And the default branch use `Multicast` in `dispatch` phase and `all_reduce` in `combine` phase, which are not implented in vLLM-Ascend. This leading to invoking into a default implentment in `base_communicator`, with empty `dispatch` and `combine` operations, thus causing the accuracy issue on it. This pr is a temporary workaround, refacting all2all in vLLM-Ascend could be a better way. - vLLM version: v0.10.0 - vLLM main: vllm-project/vllm@ad57f23 --------- Signed-off-by: MengqingCao <cmq0113@163.com>
I would like to nominate Mengqing Cao (@MengqingCao https://github.com/MengqingCao) as a maintainer, starting with my +1. ## Reason Review Quality: She has completed [120+ reviews](https://github.com/vllm-project/vllm-ascend/pulls?q=is%3Apr+is%3Aclosed+commenter%3Amengqingcao+-author%3Amengqingcao) since Feb. 2025, include [#review-3077842852](vllm-project#2088 (review)), [comment-2990074116](vllm-project#1032 (comment)), [comment-2921063723](vllm-project#1013 (comment)) high quality review. Sustained and Quality Contributions: She has Deep understanding of vLLM and vLLM Ascend codebases and solid contributions include The vLLM contributions and help vLLM Ascend release is the main reason I nominated her: - vLLM: Things worth mentioning that she completed [28+ PR contributions](https://github.com/vllm-project/vllm/pulls?q=is%3Apr+author%3AMengqingCao+is%3Amerged+) in vllm-project/vllm, especially for vLLM platform module to improve vLLM mult hardware support. She is one of the important co-authors of [vllm#8054](vllm-project/vllm#8054) and hardware plugin RFC, this makes vllm-ascend plugin possible. Community Involvement: She is also very active and involved in [60+ issues](https://github.com/vllm-project/vllm-ascend/issues?q=is%3Aissue%20state%3Aclosed%20-author%3AMengqingCao%20commenter%3AMengqingCao). So I think she's a great addition to the vLLM Ascend Maintainer team. - ✅**Review Quality:** She has completed 120+ reviews since Feb. 2025. https://github.com/vllm-project/vllm-ascend/pulls?q=is%3Apr+is%3Aclosed+commenter%3Amengqingcao+-author%3Amengqingcao, include vllm-project#2088 (review), vllm-project#1446 (comment), vllm-project#1032 (comment), vllm-project#1013 (comment) quality review. - ✅**Sustained Contributions:** 99+ PR merged in vllm-project/vllm-ascend https://github.com/vllm-project/vllm-ascend/pulls?q=is%3Apr+author%3AMengqingCao+is%3Amerged - ✅**Quality Contribution:** She is one of the important co-authors of vllm-project/vllm#8054 , this makes vllm-ascend plugin possible. Things worth mentioning that she complete 28+ PR contributions in vllm-project/vllm, especially for vLLM platform module to improve vLLM mult hardware support: https://github.com/vllm-project/vllm/pulls?q=is%3Apr+author%3AMengqingCao+is%3Amerged+. At 2025 Q2, She also lead the [[RFC]: E2E CI test for key features](vllm-project#413) and [[RFC]: Unit test coverage improvement](vllm-project#1298) to help vllm ascend improve the coverage. Her main contributions focus on the adaptation of parallel strategies and communicator, such as vllm-project#1800, vllm-project#1856. These contributions are sufficient to prove she has “Deep understanding of vLLM and vLLM Ascend codebases” - ✅**Community Involvement:** Involved in 63+ issue reviewer https://github.com/vllm-project/vllm-ascend/issues?q=is%3Aissue%20state%3Aclosed%20-author%3AMengqingCao%20commenter%3AMengqingCao She led the v0.10.1 release as release manager - vLLM version: v0.10.0 - vLLM main: vllm-project/vllm@78dba40 Signed-off-by: Jade Zheng <zheng.shoujian@outlook.com>
What this PR does / why we need it?
Fix Qwen MoE accuracy bug in DP scenario.
Now the implentment of
FusedMoEin vLLM useAll2AllManagerto manager different all2all algorithm branch. And the default branch useMulticastindispatchphase andall_reduceincombinephase, which are not implented in vLLM-Ascend. This leading to invoking into a default implentment inbase_communicator, with emptydispatchandcombineoperations, thus causing the accuracy issue on it.This pr is a temporary workaround, refacting all2all in vLLM-Ascend could be a better way.
Does this PR introduce any user-facing change?
How was this patch tested?