@tduncan / Nvidia-Optimization-Stack-VLLM Mirror · read-only / commits / b03ff6a96b
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 7, 05:15 UTC

[CI] Stabilize test_no_args_tool_call and add ROCm-specific server args (#36107)

Signed-off-by: Andreas Karatzas <akaratza@amd.com>

Andreas Karatzas committed Mar 5, 2026 at 07:52 UTC b03ff6a96bb090676cab07c432b4b0937abb7011
1 file changed +43 -5
tests/entrypoints/openai/test_completion_with_function_calling.py
+43 -5
@@ -9,6 +9,8 @@ import openai # use the official client for correctness check
9 import pytest
10 import pytest_asyncio
11
12 +from vllm.platforms import current_platform
13 +
14 # downloading lora to test lora requests
15 from ...utils import RemoteOpenAIServer
16
@@ -139,8 +141,19 @@ def server():
141 "qwen3",
142 "--gpu-memory-utilization",
143 "0.4",
144 + "--enforce-eager",
145 ]
146
147 + rocm_args = {
148 + "--max-num-seqs": "1",
149 + "--no-enable-prefix-caching": None,
150 + }
151 + if current_platform.is_rocm():
152 + for k, v in rocm_args.items():
153 + args.append(k)
154 + if v is not None:
155 + args.append(v)
156 +
157 with RemoteOpenAIServer(MODEL_NAME, args) as remote_server:
158 yield remote_server
159
@@ -294,7 +307,10 @@ async def test_no_args_tool_call(
307 "type": "function",
308 "function": {
309 "name": "get_current_time",
297 - "description": "Get the current date and time. No parameters needed.",
310 + "description": (
311 + "Get the current date and time. Call this when the user "
312 + "asks what time or date it is. No parameters needed."
313 + ),
314 "parameters": {
315 "type": "object",
316 "properties": {}, # No parameters
@@ -303,10 +319,28 @@ async def test_no_args_tool_call(
319 },
320 }
321 ]
306 - messages = [{"role": "user", "content": "What time is it now?"}]
322 + messages = [
323 + {
324 + "role": "system",
325 + "content": (
326 + "You are a helpful assistant. Always use the available tools "
327 + "when relevant, and reply with a short sentence after "
328 + "receiving a tool result."
329 + ),
330 + },
331 + {"role": "user", "content": "What time is it now?"},
332 + ]
333 +
334 + shared_kwargs = dict(
335 + model=model_name,
336 + temperature=0.0,
337 + seed=42,
338 + extra_body={"chat_template_kwargs": {"enable_thinking": False}},
339 + )
340 +
341 # Step 2: Send user message and let model decide whether to call the tool
342 response = await client.chat.completions.create(
309 - model=model_name,
343 + **shared_kwargs,
344 messages=messages,
345 tools=tools,
346 tool_choice="auto", # Let model choose automatically
@@ -334,11 +368,15 @@ async def test_no_args_tool_call(
368 )
369 # Step 5: Send tool result back to model to continue conversation
370 final_response = await client.chat.completions.create(
337 - model=model_name,
371 + **shared_kwargs,
372 messages=messages,
373 + max_completion_tokens=128,
374 )
375 # Output final natural language response
341 - assert final_response.choices[0].message.content is not None
376 + assert (
377 + final_response.choices[0].message.content is not None
378 + and final_response.choices[0].message.content.strip() != ""
379 + )
380
381 else:
382 # No tool called — just print model's direct reply