File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change 1+ import unittest
2+ import os
3+ from unittest import mock
4+
5+ from vllm_ascend .ascend_forward_context import get_dispatcher_name
6+
7+
8+ class TestGetDispatcherName (unittest .TestCase ):
9+
10+ def test_get_dispatcher_name (self ):
11+ result = get_dispatcher_name (1 , False )
12+ assert result == "TokenDispatcherWithAllGather"
13+ result = get_dispatcher_name (4 , False )
14+ assert result == "TokenDispatcherWithAll2AllV"
15+ result = get_dispatcher_name (16 , True )
16+ assert result == "TokenDispatcherWithAll2AllV"
17+ result = get_dispatcher_name (16 , False )
18+ assert result == "TokenDispatcherWithMC2"
19+ with mock .patch .dict (os .environ , {"VLLM_ENABLE_FUSED_EXPERTS_ALLGATHER_EP" : "1" }):
20+ result = get_dispatcher_name (16 , False )
21+ assert result == "TokenDispatcherWithAllGather"
You can’t perform that action at this time.
0 commit comments