[Bugfix] bugfix for moe_mlp in vllm-ascend/v0.11.0-dev (#4885)

### What this PR does / why we need it?
This PR fixes a bug in the moe_mlp module by correcting the arguments
passed to the torch_npu.npu_dequant_swiglu_quant function.It properly
converts group_list from a cumulative sum to counts for the group_index
parameter.

### Does this PR introduce _any_ user-facing change?
No


- vLLM version: v0.12.0
- vLLM main: https://github.com/vllm-project/vllm/main

---------

Signed-off-by: tanqingshan (A)  <50050625@china.huawei.com>
Signed-off-by: tanqingshan (A) <50050625@china.huawei.com>
Co-authored-by: tanqingshan (A) <50050625@china.huawei.com>
Co-authored-by: Mercykid-bash <ruanche0218@gmail.com>
This commit is contained in:
Clorist33
2025-12-12 14:51:47 +08:00
committed by GitHub
parent 9c0ad46c1a
commit 4f0dddc9ee
5 changed files with 41 additions and 34 deletions

View File

@@ -130,7 +130,7 @@ class TestTokenDispatcherWithMC2(TestBase):
self.dispatcher.need_extra_args = True
self.dispatcher.enable_dispatch_v2 = True
self.dispatcher.output = torch.randint(0, 8, (10, 1))
self.dispatcher.moe_expert_num = len(self.dispatcher.expert_map)
kwargs = self.dispatcher.get_combine_mc_kwargs(hidden_states)
self.assertIn("tp_send_counts", kwargs)
@@ -148,6 +148,7 @@ class TestTokenDispatcherWithMC2(TestBase):
self.dispatcher.enable_dispatch_v2 = True
self.dispatcher.swiglu_out_scale = torch.randint(0, 8, (10, 1))
self.dispatcher.output = torch.randint(0, 8, (10, 1))
self.dispatcher.moe_expert_num = len(self.dispatcher.expert_map)
self.hidden_states = torch.randn(10, 128)
with patch("torch_npu.npu_moe_distribute_combine_v2",