Skip to content

Commit 4b50ec9

Browse files
authored
add MINI_PYTEST_PARAMS to test_moe_align_block_size (vllm-project#81)
Signed-off-by: mayuyuace <qiming1.zhang@intel.com>
1 parent 8661c1c commit 4b50ec9

1 file changed

Lines changed: 25 additions & 8 deletions

File tree

tests/test_moe_align_block_size.py

Lines changed: 25 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,17 @@
1818
BLOCK_SIZES = [32, 128]
1919
seed_everything(0)
2020

21+
#override pytest parameters when enable mini pytest
22+
MINI_PYTEST_PARAMS = {
23+
"default": {
24+
"m": [1],
25+
"num_experts": [32],
26+
"topk": [1],
27+
"block_size": [32],
28+
"max_tokens_per_batch": [13]
29+
},
30+
}
31+
2132

2233
def _group_tokens_by_expert(
2334
sorted_ids: torch.Tensor,
@@ -281,9 +292,12 @@ def test_moe_align_block_size_with_expert_map(m: int, topk: int,
281292
)
282293

283294

284-
def test_moe_align_block_size_deterministic():
285-
m, topk, num_experts, block_size = 128, 2, 32, 64
286-
295+
@pytest.mark.parametrize("m", [128])
296+
@pytest.mark.parametrize("topk", [2])
297+
@pytest.mark.parametrize("num_experts", [32])
298+
@pytest.mark.parametrize("block_size", [64])
299+
def test_moe_align_block_size_deterministic(m: int, topk: int,
300+
num_experts: int, block_size: int):
287301
torch.manual_seed(42)
288302
topk_ids = torch.randint(0,
289303
num_experts, (m, topk),
@@ -435,11 +449,14 @@ def test_moe_align_block_size_opcheck():
435449
)
436450

437451

438-
def test_batched_moe_align_block_size_opcheck():
439-
max_tokens_per_batch = 512
440-
num_experts = 4
441-
block_size = 16
442-
452+
@pytest.mark.parametrize("max_tokens_per_batch", [512])
453+
@pytest.mark.parametrize("num_experts", [4])
454+
@pytest.mark.parametrize("block_size", [16])
455+
def test_batched_moe_align_block_size_opcheck(
456+
max_tokens_per_batch: int,
457+
num_experts: int,
458+
block_size: int,
459+
):
443460
expert_num_tokens = torch.randint(
444461
low=0,
445462
high=max_tokens_per_batch,

0 commit comments

Comments
 (0)