@@ -26,7 +26,6 @@ def setUp(self):
2626 self .moe_config .dp_group = MagicMock ()
2727 self .moe_config .num_global_redundant_experts = 0
2828
29- @patch ("vllm_ascend.ops.fused_moe.moe_comm_method.get_current_vllm_config" )
3029 @patch ("vllm_ascend.ops.fused_moe.moe_comm_method.get_forward_context" )
3130 @patch (
3231 "vllm_ascend.ops.fused_moe.moe_comm_method.PrepareAndFinalizeWithAllGather"
@@ -36,11 +35,7 @@ def setUp(self):
3635 )
3736 def test_all_gather_comm_impl (self , mock_token_dispatcher ,
3837 mock_prepare_finalize ,
39- mock_get_forward_context ,
40- mock_get_current_vllm_config ):
41- # Mock vLLM config
42- mock_get_current_vllm_config .return_value = MagicMock ()
43-
38+ mock_get_forward_context ):
4439 # Mock forward context
4540 mock_context = MagicMock ()
4641 mock_context .moe_comm_method = "all_gather"
@@ -76,17 +71,12 @@ def test_all_gather_comm_impl(self, mock_token_dispatcher,
7671 context_metadata = context_metadata )
7772 mock_pf_instance .finalize .assert_called_once_with (h_out , True , None )
7873
79- @patch ("vllm_ascend.ops.fused_moe.moe_comm_method.get_current_vllm_config" )
8074 @patch ("vllm_ascend.ops.fused_moe.moe_comm_method.get_forward_context" )
8175 @patch (
8276 "vllm_ascend.ops.fused_moe.moe_comm_method.PrepareAndFinalizeWithMC2" )
8377 @patch ("vllm_ascend.ops.fused_moe.moe_comm_method.TokenDispatcherWithMC2" )
8478 def test_mc2_comm_impl (self , mock_token_dispatcher , mock_prepare_finalize ,
85- mock_get_forward_context ,
86- mock_get_current_vllm_config ):
87- # Mock vLLM config
88- mock_get_current_vllm_config .return_value = MagicMock ()
89-
79+ mock_get_forward_context ):
9080 # Mock forward context
9181 mock_context = MagicMock ()
9282 mock_context .moe_comm_method = "mc2"
@@ -124,7 +114,6 @@ def test_mc2_comm_impl(self, mock_token_dispatcher, mock_prepare_finalize,
124114 context_metadata = context_metadata )
125115 mock_pf_instance .finalize .assert_called_once_with (h_out , True , None )
126116
127- @patch ("vllm_ascend.ops.fused_moe.moe_comm_method.get_current_vllm_config" )
128117 @patch ("vllm_ascend.ops.fused_moe.moe_comm_method.get_forward_context" )
129118 @patch (
130119 "vllm_ascend.ops.fused_moe.moe_comm_method.PrepareAndFinalizeWithAll2All"
@@ -134,11 +123,7 @@ def test_mc2_comm_impl(self, mock_token_dispatcher, mock_prepare_finalize,
134123 )
135124 def test_alltoall_comm_impl (self , mock_token_dispatcher ,
136125 mock_prepare_finalize ,
137- mock_get_forward_context ,
138- mock_get_current_vllm_config ):
139- # Mock vLLM config
140- mock_get_current_vllm_config .return_value = MagicMock ()
141-
126+ mock_get_forward_context ):
142127 # Mock forward context
143128 mock_context = MagicMock ()
144129 mock_context .moe_comm_method = "alltoall"
@@ -168,7 +153,6 @@ def test_alltoall_comm_impl(self, mock_token_dispatcher,
168153 mock_pf_instance .prepare .assert_called_once_with (
169154 hidden_states , router_logits , False , False , QuantType .NONE )
170155
171- @patch ("vllm_ascend.ops.fused_moe.moe_comm_method.get_current_vllm_config" )
172156 @patch ("vllm_ascend.ops.fused_moe.moe_comm_method.get_forward_context" )
173157 @patch (
174158 "vllm_ascend.ops.fused_moe.moe_comm_method.PrepareAndFinalizeWithAllGather"
@@ -179,11 +163,7 @@ def test_alltoall_comm_impl(self, mock_token_dispatcher,
179163 @patch ("vllm_ascend.ops.fused_moe.moe_comm_method.unified_apply_mlp" )
180164 def test_fused_experts_method (self , mock_unified_apply_mlp ,
181165 mock_token_dispatcher , mock_prepare_finalize ,
182- mock_get_forward_context ,
183- mock_get_current_vllm_config ):
184- # Mock vLLM config
185- mock_get_current_vllm_config .return_value = MagicMock ()
186-
166+ mock_get_forward_context ):
187167 # Mock forward context
188168 mock_context = MagicMock ()
189169 mock_context .moe_comm_method = "all_gather"
0 commit comments