Skip to content

Commit 3f3f365

Browse files
committed
fix modelscope
Signed-off-by: MengqingCao <cmq0113@163.com>
1 parent c9c382b commit 3f3f365

File tree

5 files changed

+18
-16
lines changed

5 files changed

+18
-16
lines changed

tests/conftest.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -357,8 +357,8 @@ def ilama_lora_files():
357357
return snapshot_download(repo_id="jeeejeee/ilama-text2sql-spider")
358358

359359

360-
@pytest.fixture(scope="function")
361-
def enable_model_scope_env():
360+
@pytest.fixture
361+
def enable_modelscope_env():
362362
import os
363363
from unittest.mock import patch
364364
with patch.dict(os.environ, {"VLLM_USE_MODEL_SCOPE": "TRUE"}):

tests/multicard/test_offline_inference_distributed.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
("deepseek-ai/DeepSeek-V2-Lite", "mp"),
3636
])
3737
def test_models_distributed(
38-
enable_model_scope_env,
38+
enable_modelscope_env,
3939
model: str,
4040
distributed_executor_backend: str,
4141
) -> None:

tests/singlecard/spec_decode/e2e/test_mtp_correctness.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@
9494
@pytest.mark.parametrize("batch_size", [1, 32])
9595
@pytest.mark.parametrize("seed", [1])
9696
def test_mtp_e2e_greedy_correctness(
97-
enable_model_scope_env,
97+
enable_modelscope_env,
9898
vllm_runner,
9999
common_llm_kwargs,
100100
per_test_common_llm_kwargs,
@@ -145,7 +145,7 @@ def test_mtp_e2e_greedy_correctness(
145145
@pytest.mark.parametrize("batch_size", [1, 32])
146146
@pytest.mark.parametrize("seed", [1])
147147
def test_mtp_e2e_quant_greedy_correctness(
148-
enable_model_scope_env,
148+
enable_modelscope_env,
149149
vllm_runner,
150150
common_llm_kwargs,
151151
per_test_common_llm_kwargs,
@@ -204,7 +204,7 @@ def test_mtp_e2e_quant_greedy_correctness(
204204
@pytest.mark.parametrize("seed", [1])
205205
@pytest.mark.parametrize("logprobs", [1, 6])
206206
def test_mtp_e2e_greedy_logprobs(
207-
enable_model_scope_env,
207+
enable_modelscope_env,
208208
vllm_runner,
209209
common_llm_kwargs,
210210
per_test_common_llm_kwargs,
@@ -263,7 +263,7 @@ def test_mtp_e2e_greedy_logprobs(
263263
@pytest.mark.parametrize("batch_size", [1, 32])
264264
@pytest.mark.parametrize("seed", [1])
265265
def test_mtp_e2e_greedy_correctness_torchair_graph(
266-
enable_model_scope_env,
266+
enable_modelscope_env,
267267
vllm_runner,
268268
common_llm_kwargs,
269269
per_test_common_llm_kwargs,
@@ -314,7 +314,7 @@ def test_mtp_e2e_greedy_correctness_torchair_graph(
314314
@pytest.mark.parametrize("batch_size", [1, 32])
315315
@pytest.mark.parametrize("seed", [1])
316316
def test_mtp_e2e_quant_greedy_correctness_torchair_graph(
317-
enable_model_scope_env,
317+
enable_modelscope_env,
318318
vllm_runner,
319319
common_llm_kwargs,
320320
per_test_common_llm_kwargs,
@@ -372,7 +372,7 @@ def test_mtp_e2e_quant_greedy_correctness_torchair_graph(
372372
@pytest.mark.parametrize("batch_size", [4])
373373
@pytest.mark.parametrize("seed", [1])
374374
def test_mtp_e2e_greedy_correctness_with_preemption(
375-
enable_model_scope_env,
375+
enable_modelscope_env,
376376
vllm_runner,
377377
common_llm_kwargs,
378378
per_test_common_llm_kwargs,
@@ -430,7 +430,7 @@ def test_mtp_e2e_greedy_correctness_with_preemption(
430430
])
431431
@pytest.mark.parametrize("seed", [1])
432432
def test_mtp_different_k(
433-
enable_model_scope_env,
433+
enable_modelscope_env,
434434
vllm_runner,
435435
common_llm_kwargs,
436436
per_test_common_llm_kwargs,
@@ -483,7 +483,7 @@ def test_mtp_different_k(
483483
])
484484
@pytest.mark.parametrize("seed", [1])
485485
def test_mtp_disable_queue(
486-
enable_model_scope_env,
486+
enable_modelscope_env,
487487
vllm_runner,
488488
common_llm_kwargs,
489489
per_test_common_llm_kwargs,

tests/singlecard/spec_decode/e2e/test_v1_spec_decode.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ def eagle3_model_name():
6060

6161

6262
def test_ngram_correctness(
63-
enable_model_scope_env,
63+
enable_modelscope_env,
6464
monkeypatch: pytest.MonkeyPatch,
6565
test_prompts: list[list[dict[str, Any]]],
6666
sampling_config: SamplingParams,
@@ -72,8 +72,10 @@ def test_ngram_correctness(
7272
'''
7373
with monkeypatch.context() as m:
7474
m.setenv("VLLM_USE_V1", "1")
75+
m.setenv("VLLM_USE_MODELSCOPE", "True")
7576

76-
ref_llm = LLM(model=model_name, max_model_len=1024)
77+
ref_llm = LLM(model="LLM-Research/Meta-Llama-3.1-8B-Instruct",
78+
max_model_len=1024)
7779
ref_outputs = ref_llm.chat(test_prompts, sampling_config)
7880
del ref_llm
7981

@@ -106,7 +108,7 @@ def test_ngram_correctness(
106108

107109
@pytest.mark.parametrize("use_eagle3", [False, True], ids=["eagle", "eagle3"])
108110
def test_eagle_correctness(
109-
enable_model_scope_env,
111+
enable_modelscope_env,
110112
monkeypatch: pytest.MonkeyPatch,
111113
test_prompts: list[list[dict[str, Any]]],
112114
sampling_config: SamplingParams,

tests/singlecard/test_offline_inference.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
@pytest.mark.parametrize("dtype", ["half", "float16"])
4343
@pytest.mark.parametrize("max_tokens", [5])
4444
def test_models(
45-
enable_model_scope_env,
45+
enable_modelscope_env,
4646
model: str,
4747
dtype: str,
4848
max_tokens: int,
@@ -66,7 +66,7 @@ def test_models(
6666
@pytest.mark.skipif(os.getenv("VLLM_USE_V1") == "1",
6767
reason="qwen2.5_vl is not supported on v1")
6868
def test_multimodal(
69-
enable_model_scope_env,
69+
enable_modelscope_env,
7070
model,
7171
prompt_template,
7272
vllm_runner,

0 commit comments

Comments
 (0)