Skip to content

Commit 2f2a13a

Browse files
authored
test: add AIConfigurator dense model tests for Dynamo Planner Profiler (#4526)
Signed-off-by: Jason Zhou <[email protected]>
1 parent c655585 commit 2f2a13a

File tree

4 files changed

+26
-18
lines changed

4 files changed

+26
-18
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,9 @@ llm_engine.h
7777
### Ruff ###
7878
.ruff_cache/
7979

80+
### MyPy ###
81+
.mypy_cache/
82+
8083
### Python ###
8184
__pycache__/
8285
*.py[cod]

benchmarks/profiler/utils/config_modifiers/vllm.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,8 @@ def convert_config(
123123
args = break_arguments(args)
124124

125125
# remove --is-prefill-worker flag
126-
args.remove("--is-prefill-worker")
126+
if "--is-prefill-worker" in args:
127+
args.remove("--is-prefill-worker")
127128

128129
# disable prefix caching
129130
if "--enable-prefix-caching" in args:

benchmarks/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ classifiers = [
4040
]
4141

4242
dependencies = [
43-
"aiconfigurator @ git+https://github.com/ai-dynamo/aiconfigurator.git@5554d2eb8206738c66048bf2d72183e9bcd85759",
43+
"aiconfigurator @ git+https://github.com/ai-dynamo/aiconfigurator.git@release/0.4.0",
4444
"networkx",
4545
"pandas",
4646
"pydantic>=2",

tests/profiler/test_profile_sla_aiconfigurator.py

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class TestProfileSlaAiconfigurator:
3737
"""Test class for profile_sla aiconfigurator functionality."""
3838

3939
@pytest.fixture
40-
def trtllm_args(self, request):
40+
def llm_args(self, request):
4141
class Args:
4242
def __init__(self):
4343
self.model = ""
@@ -82,12 +82,12 @@ def __init__(self):
8282
@pytest.mark.parallel
8383
@pytest.mark.asyncio
8484
@pytest.mark.parametrize("missing_arg", ["aic_system", "aic_hf_id"])
85-
async def test_aiconfigurator_missing_args(self, trtllm_args, missing_arg):
85+
async def test_aiconfigurator_missing_args(self, llm_args, missing_arg):
8686
# Check that validation error happens when a required arg is missing.
8787
# Note: aic_backend_version is optional - when None, auto-detects latest version
88-
setattr(trtllm_args, missing_arg, None)
88+
setattr(llm_args, missing_arg, None)
8989
with pytest.raises(ValueError):
90-
await run_profile(trtllm_args)
90+
await run_profile(llm_args)
9191

9292
@pytest.mark.pre_merge
9393
@pytest.mark.gpu_0
@@ -102,21 +102,21 @@ async def test_aiconfigurator_missing_args(self, trtllm_args, missing_arg):
102102
("aic_backend_version", "0.1.0"),
103103
],
104104
)
105-
async def test_aiconfiguator_no_data(self, trtllm_args, arg_name, bad_value):
105+
async def test_aiconfigurator_no_data(self, llm_args, arg_name, bad_value):
106106
# Check that an appropriate error is raised when the system/model/backend
107107
# is not found in the aiconfigurator database.
108-
setattr(trtllm_args, arg_name, bad_value)
108+
setattr(llm_args, arg_name, bad_value)
109109
with pytest.raises(ValueError, match="Database not found"):
110-
await run_profile(trtllm_args)
110+
await run_profile(llm_args)
111111

112112
@pytest.mark.pre_merge
113113
@pytest.mark.parallel
114114
@pytest.mark.asyncio
115115
@pytest.mark.gpu_1
116116
@pytest.mark.performance
117-
async def test_trtllm_aiconfigurator_single_model(self, trtllm_args):
118-
# Test that profile_sla works with the model & backend in the trtllm_args fixture.
119-
await run_profile(trtllm_args)
117+
async def test_trtllm_aiconfigurator_single_model(self, llm_args):
118+
# Test that profile_sla works with the model & backend in the llm_args fixture.
119+
await run_profile(llm_args)
120120

121121
@pytest.mark.parallel
122122
@pytest.mark.asyncio
@@ -129,6 +129,10 @@ async def test_trtllm_aiconfigurator_single_model(self, trtllm_args):
129129
("trtllm", None),
130130
("trtllm", "0.20.0"),
131131
("trtllm", "1.0.0rc3"),
132+
("vllm", None),
133+
("vllm", "0.11.0"),
134+
("sglang", None),
135+
("sglang", "0.5.1.post1"),
132136
],
133137
)
134138
@pytest.mark.parametrize(
@@ -138,11 +142,11 @@ async def test_trtllm_aiconfigurator_single_model(self, trtllm_args):
138142
"meta-llama/Llama-3.1-405B",
139143
],
140144
)
141-
async def test_trtllm_aiconfigurator_many(
142-
self, trtllm_args, hf_model_id, backend, aic_backend_version
145+
async def test_aiconfigurator_dense_models(
146+
self, llm_args, hf_model_id, backend, aic_backend_version
143147
):
144148
# Test that profile_sla works with a variety of backend versions and model names.
145-
trtllm_args.aic_hf_id = hf_model_id
146-
trtllm_args.backend = backend
147-
trtllm_args.aic_backend_version = aic_backend_version
148-
await run_profile(trtllm_args)
149+
llm_args.aic_hf_id = hf_model_id
150+
llm_args.backend = backend
151+
llm_args.aic_backend_version = aic_backend_version
152+
await run_profile(llm_args)

0 commit comments

Comments
 (0)