vllm - 💡(How to fix) Fix [Bug]: Language Models Test (Extended Generation) test_models[False-False-5-32-bigcode/starcoder2-3b] test issue [2 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
vllm-project/vllm#37304Fetched 2026-04-08 00:53:37
View on GitHub
Comments
2
Participants
2
Timeline
7
Reactions
0
Author
Participants
Timeline (top)
commented ×2mentioned ×2subscribed ×2labeled ×1

Error Message

[2026-03-13T16:18:07Z] E AssertionError: Test1:

[2026-03-13T16:18:07Z] E Matched tokens: [222, 40, 494, 447, 9009, 98, 828, 366] [2026-03-13T16:18:07Z] E hf: '\n# + [markdown] id="5f7o229v00-L"\n# 1950 - <NAME>' {59: -4.088154315948486, 58: -4.088154315948486, 56: -4.213154315948486, 55: -4.213154315948486, 54: -4.213154315948486} [2026-03-13T16:18:07Z] E vllm: '\n# + [markdown] id="68284477"\n# 1950\n#\n# - ' {59: Logprob(logprob=-4.071040153503418, rank=1, decoded_token='6'), 56: Logprob(logprob=-4.196040153503418, rank=2, decoded_token='3'), 54: Logprob(logprob=-4.196040153503418, rank=3, decoded_token='1'), 57: Logprob(logprob=-4.196040153503418, rank=4, decoded_token='4'), 55: Logprob(logprob=-4.196040153503418, rank=5, decoded_token='2')}

Code Example

[2026-03-13T16:18:07Z] E                   AssertionError: Test1:
--
[2026-03-13T16:18:07Z] E                   Matched tokens:	[222, 40, 494, 447, 9009, 98, 828, 366]
[2026-03-13T16:18:07Z] E                   hf:	'\n# + [markdown] id="5f7o229v00-L"\n# **1950** - <NAME>'	{59: -4.088154315948486, 58: -4.088154315948486, 56: -4.213154315948486, 55: -4.213154315948486, 54: -4.213154315948486}
[2026-03-13T16:18:07Z] E                   vllm:	'\n# + [markdown] id="68284477"\n# **1950**\n#\n# - '	{59: Logprob(logprob=-4.071040153503418, rank=1, decoded_token='6'), 56: Logprob(logprob=-4.196040153503418, rank=2, decoded_token='3'), 54: Logprob(logprob=-4.196040153503418, rank=3, decoded_token='1'), 57: Logprob(logprob=-4.196040153503418, rank=4, decoded_token='4'), 55: Logprob(logprob=-4.196040153503418, rank=5, decoded_token='2')}
RAW_BUFFERClick to expand / collapse

Your current environment

main

🐛 Describe the bug

I got the test to fail under the following two situations:

  1. We're trying to upgrade PyTorch from 2.10 to 2.11. The test succeeds in PyTorch 2.10, but fails in PyTorch 2.11 (logs)
  2. In PyTorch 2.10, if I add --enforce-eager, the test fails.

The error message looks the same in both cases. (logs)

[2026-03-13T16:18:07Z] E                   AssertionError: Test1:
--
[2026-03-13T16:18:07Z] E                   Matched tokens:	[222, 40, 494, 447, 9009, 98, 828, 366]
[2026-03-13T16:18:07Z] E                   hf:	'\n# + [markdown] id="5f7o229v00-L"\n# **1950** - <NAME>'	{59: -4.088154315948486, 58: -4.088154315948486, 56: -4.213154315948486, 55: -4.213154315948486, 54: -4.213154315948486}
[2026-03-13T16:18:07Z] E                   vllm:	'\n# + [markdown] id="68284477"\n# **1950**\n#\n# - '	{59: Logprob(logprob=-4.071040153503418, rank=1, decoded_token='6'), 56: Logprob(logprob=-4.196040153503418, rank=2, decoded_token='3'), 54: Logprob(logprob=-4.196040153503418, rank=3, decoded_token='1'), 57: Logprob(logprob=-4.196040153503418, rank=4, decoded_token='4'), 55: Logprob(logprob=-4.196040153503418, rank=5, decoded_token='2')}

Here's a link to the test

I'm trying to figure out if we should block the PyTorch 2.11 release on this test. Given datapoint (2): the test fails when adding --enforce-eager, I think there is something wrong with the test and that we shouldn't block on this. I don't have very much context over this test though.

@hmellor I see you poked around at this file recently for Gemma and Gemma2. Do you have any thoughts here?

Before submitting a new issue...

  • Make sure you already searched for relevant issues, and asked the chatbot living at the bottom right corner of the documentation page, which can answer lots of frequently asked questions.

extent analysis

Fix Plan

To fix the test failure, we need to update the test to account for the changes in PyTorch 2.11 and the --enforce-eager flag. Here are the steps:

  • Update the test to use the torch.no_grad() context manager to ensure that the model is in evaluation mode.
  • Modify the test to check for the correct output shape and values, rather than relying on the exact log probabilities.
  • Add a tolerance to the assertions to account for any minor differences in the output.

Example code:

import torch

# ...

with torch.no_grad():
    output = model(input_ids, attention_mask)

# Check output shape and values
assert output.shape == expected_shape
assert torch.allclose(output, expected_output, atol=1e-4)

# ...

Verification

To verify that the fix worked, run the test with PyTorch 2.11 and the --enforce-eager flag. The test should pass without any errors.

Extra Tips

  • Make sure to update the test to use the latest PyTorch API and best practices.
  • Consider adding more tests to cover different scenarios and edge cases.
  • If the issue persists, try to reproduce the error with a minimal example and debug the code step by step.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING