Skip to content

Commit 3496f4e

Browse files
author
wangxiaoxin-sherie
committed
xx
1 parent 370ecd0 commit 3496f4e

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
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"

0 commit comments

Comments
 (0)