Skip to content

Commit ad2fee0

Browse files
committed
add multi nodes eval tests
Signed-off-by: Xin He (SW-GPU) <[email protected]>
1 parent 898f37f commit ad2fee0

File tree

4 files changed

+71
-10
lines changed

4 files changed

+71
-10
lines changed

tests/integration/defs/common.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -956,3 +956,23 @@ def get_dummy_spec_decoding_heads(hf_model_dir,
956956
export_hf_checkpoint(model,
957957
dtype=model.config.torch_dtype,
958958
export_dir=os.path.join(save_dir, 'fp8'))
959+
960+
961+
def get_mmlu_accuracy(output):
962+
mmlu_line = None
963+
for line in output.split('\n'):
964+
if "MMLU weighted average accuracy:" in line:
965+
mmlu_line = line
966+
break
967+
968+
if mmlu_line is None:
969+
raise Exception(
970+
f"Could not find 'MMLU weighted average accuracy:' in output. Full output:\n{output}"
971+
)
972+
973+
mmlu_accuracy = float(
974+
mmlu_line.split("MMLU weighted average accuracy: ")[1].split(" (")[0])
975+
976+
print(f"MMLU weighted average accuracy is: {mmlu_accuracy}")
977+
978+
return mmlu_accuracy

tests/integration/defs/test_e2e.py

Lines changed: 44 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,9 @@
2828
from defs.trt_test_alternative import (check_call, check_call_negative_test,
2929
check_output)
3030

31-
from .common import (PluginOptions, convert_weights, prune_checkpoint,
32-
quantize_data, refit_model, venv_check_call)
31+
from .common import (PluginOptions, convert_weights, get_mmlu_accuracy,
32+
prune_checkpoint, quantize_data, refit_model,
33+
venv_check_call)
3334
from .conftest import (llm_models_root, skip_no_sm120, skip_nvlink_inactive,
3435
skip_post_blackwell, skip_pre_blackwell, skip_pre_hopper,
3536
tests_path, unittest_path)
@@ -42,6 +43,7 @@
4243
os.environ['TLLM_LOG_LEVEL'] = 'INFO'
4344

4445
_MEM_FRACTION_50 = 0.5
46+
_MEM_FRACTION_80 = 0.8
4547
_MEM_FRACTION_95 = 0.95
4648

4749

@@ -2677,4 +2679,43 @@ def test_ptp_quickstart_advanced_llama_multi_nodes(llm_root, llm_venv,
26772679
check_call(" ".join(run_cmd), shell=True, env=llm_venv._new_env)
26782680

26792681

2680-
# End of Pivot-To-Python examples
2682+
@pytest.mark.timeout(5400)
2683+
@pytest.mark.skip_less_device_memory(80000)
2684+
@pytest.mark.skip_less_device(4)
2685+
@pytest.mark.parametrize("eval_task", ["mmlu"])
2686+
@pytest.mark.parametrize("tp_size,pp_size,ep_size", [(16, 1, 8), (8, 2, 8)],
2687+
ids=["tp16", "tp8pp2"])
2688+
@pytest.mark.parametrize("model_path", [
2689+
pytest.param('llama-3.3-models/Llama-3.3-70B-Instruct',
2690+
marks=skip_pre_hopper),
2691+
pytest.param('llama4-models/Llama-4-Maverick-17B-128E-Instruct',
2692+
marks=skip_pre_hopper),
2693+
pytest.param('llama4-models/nvidia/Llama-4-Maverick-17B-128E-Instruct-FP8',
2694+
marks=skip_pre_hopper),
2695+
pytest.param('Qwen3/Qwen3-235B-A22B', marks=skip_pre_hopper),
2696+
pytest.param('Qwen3/saved_models_Qwen3-235B-A22B_nvfp4_hf',
2697+
marks=skip_pre_blackwell),
2698+
pytest.param('DeepSeek-R1/DeepSeek-R1-0528-FP4', marks=skip_pre_blackwell),
2699+
])
2700+
def test_multi_nodes_eval(llm_venv, model_path, tp_size, pp_size, ep_size,
2701+
eval_task):
2702+
if "Llama-4" in model_path and tp_size == 16:
2703+
pytest.skip("Llama-4 with tp16 is not supported")
2704+
2705+
mmlu_threshold = 81.5
2706+
run_cmd = [
2707+
"trtllm-llmapi-launch",
2708+
"trtllm-eval",
2709+
f"--model={llm_models_root()}/{model_path}",
2710+
f"--ep_size={ep_size}",
2711+
f"--tp_size={tp_size}",
2712+
f"--pp_size={pp_size}",
2713+
f"--kv_cache_free_gpu_memory_fraction={_MEM_FRACTION_80}",
2714+
"--max_batch_size=32",
2715+
eval_task,
2716+
]
2717+
output = check_output(" ".join(run_cmd), shell=True, env=llm_venv._new_env)
2718+
2719+
if os.environ.get("SLURM_PROCID", '0') == '0':
2720+
mmlu_accuracy = get_mmlu_accuracy(output)
2721+
assert mmlu_accuracy > mmlu_threshold, f"MMLU accuracy {mmlu_accuracy} is less than threshold {mmlu_threshold}"
Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
examples/test_llama.py::test_llm_llama_v3_1_2nodes_8gpus[llama-3.1-8b-disable_fp8-tp16pp1-build]
2-
examples/test_llama.py::test_llm_llama_v3_1_2nodes_8gpus[llama-3.1-8b-disable_fp8-tp16pp1-infer]
3-
examples/test_mixtral.py::test_llm_mixtral_2nodes_8gpus[Mixtral-8x22B-v0.1-plugin-renormalize-tensor_parallel-build]
4-
examples/test_mixtral.py::test_llm_mixtral_2nodes_8gpus[Mixtral-8x22B-v0.1-plugin-renormalize-tensor_parallel-infer]
51
test_e2e.py::test_ptp_quickstart_advanced_deepseek_multi_nodes[DeepSeek-V3]
6-
test_e2e.py::test_ptp_quickstart_advanced_deepseek_multi_nodes[DeepSeek-R1/DeepSeek-R1-0528-FP4]
7-
test_e2e.py::test_ptp_quickstart_advanced_llama_multi_nodes[llama-3.3-models/Llama-3.3-70B-Instruct]
8-
test_e2e.py::test_ptp_quickstart_advanced_llama_multi_nodes[llama4-models/Llama-4-Maverick-17B-128E-Instruct]
92
test_e2e.py::test_openai_multinodes_chat_tp16pp1
3+
test_e2e.py::test_multi_nodes_eval[llama-3.3-models/Llama-3.3-70B-Instruct-tp16-mmlu]
4+
test_e2e.py::test_multi_nodes_eval[llama4-models/Llama-4-Maverick-17B-128E-Instruct-tp8pp2-mmlu]
5+
test_e2e.py::test_multi_nodes_eval[llama4-models/nvidia/Llama-4-Maverick-17B-128E-Instruct-FP8-tp8pp2-mmlu]
6+
test_e2e.py::test_multi_nodes_eval[Qwen3/Qwen3-235B-A22B-tp16-mmlu]
7+
test_e2e.py::test_multi_nodes_eval[Qwen3/saved_models_Qwen3-235B-A22B_nvfp4_hf-tp16-mmlu]
8+
test_e2e.py::test_multi_nodes_eval[DeepSeek-R1/DeepSeek-R1-0528-FP4-tp16-mmlu]

tests/integration/test_lists/waives.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -324,3 +324,4 @@ accuracy/test_disaggregated_serving.py::TestQwen3_30B_A3B::test_mixed_ctx_gen_mo
324324
full:L40S/accuracy/test_disaggregated_serving.py::TestDeepSeekV3Lite::test_auto_dtype[mtp_nextn=0-overlap_scheduler=False] SKIP (https://nvbugs/5347051)
325325
full:L40S/accuracy/test_disaggregated_serving.py::TestLlama3_1_8BInstruct::test_eagle3[eagle3_one_model=False-overlap_scheduler=False] SKIP (https://nvbugs/5471106)
326326
full:L40S/accuracy/test_disaggregated_serving.py::TestLlama3_1_8BInstruct::test_tp_pp_symmetric[MMLU-tp2pp2] SKIP (https://nvbugs/5471108)
327+
test_e2e.py::test_multi_nodes_eval[llama4-models/nvidia/Llama-4-Maverick-17B-128E-Instruct-FP8-tp8pp2-mmlu] SKIP (https://nvbugs/5473781)

0 commit comments

Comments
 (0)