Skip to content

[CI/Build] Add dtype to LLM creation in v1/sample/test_logprobs.py#29225

Closed
rasmith wants to merge 1 commit intovllm-project:mainfrom
rasmith:ransmith_fix_test_logprobs
Closed

[CI/Build] Add dtype to LLM creation in v1/sample/test_logprobs.py#29225
rasmith wants to merge 1 commit intovllm-project:mainfrom
rasmith:ransmith_fix_test_logprobs

Conversation

@rasmith
Copy link
Contributor

@rasmith rasmith commented Nov 22, 2025

This PR adds the dtype to LLM creation in v1/sample/test_logprobs.py since the model will use bfloat16 if the dtype is not specified which leads to a numpy error, where numpy does not support bfloat16 for lists.

Adding the dtype allows all the tests to pass.

The test now returns:

23 passed, 7 skipped, 4 warnings

Signed-off-by: Randall Smith <ransmith@amd.com>
@mergify mergify bot added the v1 label Nov 22, 2025
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request addresses a numpy error in v1/sample/test_logprobs.py that occurs when the LLM is created without a specified dtype, defaulting to bfloat16 on some hardware. By explicitly setting dtype="half", the tests are now able to pass. The change is correct and well-contained. I approve of this fix.

@DarkLight1337
Copy link
Member

DarkLight1337 commented Nov 22, 2025

Why didn't this fail in the regular CI? I think using logprobs shouldn't depend on specific dtypes to work. cc @njhill

@DarkLight1337
Copy link
Member

Can you check if #29216 solves it without having to modify the tests?

@njhill
Copy link
Member

njhill commented Nov 22, 2025

Agree with @DarkLight1337 we should fix the code rather than the tests. Should hopefully be fixed by #29216.

@rasmith
Copy link
Contributor Author

rasmith commented Nov 22, 2025

#29216 indeed fixes the issue! Closing!

@rasmith rasmith closed this Nov 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants