@tduncan / Nvidia-Optimization-Stack-VLLM Mirror · read-only / commits / 33d7cbe02c
Fork 0

A high-throughput and memory-efficient inference and serving engine for LLMs

Mirrored from https://github.com/tduncan-lum/Nvidia-Optimization-Stack---VLLM.git

Synced Nov 2, 22:00 UTC

[Model Runner v2] Force v1 runner for tests (#43233)

Signed-off-by: yewentao256 <zhyanwentao@126.com>

Wentao Ye committed May 23, 2026 at 19:37 UTC 33d7cbe02ca100d3f0314cd22f4342d5cd23ba15
6 files changed +50 -6
tests/compile/correctness_e2e/test_async_tp.py
+14 -2
@@ -92,7 +92,13 @@ def test_async_tp_pass_correctness(
92 "mp",
93 ]
94
95 - compare_two_settings(model_id, async_tp_args, tp_args, method="generate")
95 + compare_two_settings(
96 + model_id,
97 + async_tp_args,
98 + tp_args,
99 + method="generate",
100 + force_v1_runner=True,
101 + )
102
103
104 @create_new_process_for_each_test()
@@ -154,4 +160,10 @@ def test_async_tp_pass_nvfp4_correctness(num_gpus_available: int, monkeypatch):
160 "mp",
161 ]
162
157 - compare_two_settings(NVFP4_MODEL_ID, async_tp_args, tp_args, method="generate")
163 + compare_two_settings(
164 + NVFP4_MODEL_ID,
165 + async_tp_args,
166 + tp_args,
167 + method="generate",
168 + force_v1_runner=True,
169 + )
tests/compile/correctness_e2e/test_sequence_parallel.py
+7 -1
@@ -294,7 +294,13 @@ def _compare_sp(
294 "mp",
295 ]
296
297 - compare_two_settings(model_id, tp_sp_args, tp_args, method=method)
297 + compare_two_settings(
298 + model_id,
299 + tp_sp_args,
300 + tp_args,
301 + method=method,
302 + force_v1_runner=True,
303 + )
304
305
306 SP_TEXT_GENERATION_MODELS = {
tests/compile/fullgraph/test_basic_correctness.py
+2 -1
@@ -145,6 +145,7 @@ def test_compile_correctness(
145 all_args,
146 all_envs,
147 method=method if method != "generate" else "generate_close",
148 + force_v1_runner=True,
149 )
150 all_envs.clear()
151 all_args.clear()
@@ -158,4 +159,4 @@ def test_compile_correctness(
159 all_args.append(final_args + [f"-cc.mode={mode.name}", "-cc.backend=eager"])
160 all_envs.append({})
161
161 - compare_all_settings(model, all_args, all_envs, method=method)
162 + compare_all_settings(model, all_args, all_envs, method=method, force_v1_runner=True)
tests/distributed/test_pipeline_parallel.py
+8 -1
@@ -349,7 +349,14 @@ def _compare_tp(
349 "mp",
350 ]
351
352 - compare_two_settings(model_id, pp_args, tp_args, pp_env, tp_env, method=method)
352 + compare_two_settings(
353 + model_id,
354 + pp_args,
355 + tp_args,
356 + pp_env,
357 + tp_env,
358 + method=method,
359 + )
360
361
362 @pytest.mark.parametrize(
tests/models/quantization/test_bitsandbytes.py
+5 -1
@@ -137,7 +137,11 @@ def test_load_pp_4bit_bnb_model(model_name, description) -> None:
137 "--pipeline-parallel-size",
138 "2",
139 ]
140 - compare_two_settings(model_name, common_args, pp_args)
140 + compare_two_settings(
141 + model_name,
142 + common_args,
143 + pp_args,
144 + )
145
146
147 @pytest.mark.skipif(
tests/utils.py
+14
@@ -1117,6 +1117,7 @@ def compare_two_settings(
1117 method: str = "generate",
1118 max_wait_seconds: float | None = None,
1119 include_seeded_sampling: bool = True,
1120 + force_v1_runner: bool = False,
1121 ) -> None:
1122 """
1123 Launch API server with two different sets of arguments/environments
@@ -1130,6 +1131,9 @@ def compare_two_settings(
1131 env2: The second set of environment variables to pass to the API server.
1132 include_seeded_sampling: Whether to include temperature=1.0 seeded
1133 sampling checks in the default generate comparison.
1134 + force_v1_runner: Whether to pin all compared settings to the v1 model
1135 + runner to avoid mixing model runner differences into correctness
1136 + tests.
1137 """
1138
1139 compare_all_settings(
@@ -1139,6 +1143,7 @@ def compare_two_settings(
1143 method=method,
1144 max_wait_seconds=max_wait_seconds,
1145 include_seeded_sampling=include_seeded_sampling,
1146 + force_v1_runner=force_v1_runner,
1147 )
1148
1149
@@ -1150,6 +1155,7 @@ def compare_all_settings(
1155 method: str = "generate",
1156 max_wait_seconds: float | None = None,
1157 include_seeded_sampling: bool = True,
1158 + force_v1_runner: bool = False,
1159 ) -> None:
1160 """
1161 Launch API server with several different sets of arguments/environments
@@ -1160,8 +1166,16 @@ def compare_all_settings(
1166 all_envs: A list of environment dictionaries to pass to the API server.
1167 include_seeded_sampling: Whether to include temperature=1.0 seeded
1168 sampling checks in the default generate comparison.
1169 + force_v1_runner: Whether to pin all compared settings to the v1 model
1170 + runner to avoid mixing model runner differences into correctness
1171 + tests.
1172 """
1173
1174 + if force_v1_runner:
1175 + all_envs = [
1176 + {"VLLM_USE_V2_MODEL_RUNNER": "0", **(env or {})} for env in all_envs
1177 + ]
1178 +
1179 trust_remote_code = False
1180 for args in all_args:
1181 if "--trust-remote-code" in args: