Skip to content

Conversation

njhill
Copy link
Member

@njhill njhill commented Aug 10, 2025

TPU functionality was broken by #22157.

This is a quick fix, it would be good to also apply the changes in #21980 to TPUModelRunner.

cc @sdavidbd

Incorrect assumptions about when it can be None.

Signed-off-by: Nick Hill <[email protected]>
Copy link

👋 Hi! Thank you for contributing to the vLLM project.

💬 Join our developer Slack at https://slack.vllm.ai to discuss your PR in #pr-reviews, coordinate on features in #feat- channels, or join special interest groups in #sig- channels.

Just a reminder: PRs would not trigger full CI run by default. Instead, it would only run fastcheck CI which starts running only a small and essential subset of CI tests to quickly catch errors. You can run other CI tests on top of those by going to your fastcheck build on Buildkite UI (linked in the PR checks section) and unblock them. If you do not have permission to unblock, ping simon-mo or khluu to add you in our Buildkite org.

Once the PR is approved and ready to go, your PR reviewer(s) can run CI to test the changes comprehensively before merging.

To run CI, PR reviewers can either: Add ready label to the PR or enable auto-merge.

🚀

@mergify mergify bot added v1 tpu Related to Google TPUs labels Aug 10, 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 fixes a bug where TPU functionality was broken when using KVConnector. The issue stemmed from TPUModelRunner always creating a KVConnectorOutput object, even when KV transfer was disabled. This caused an assertion failure in the scheduler.

The fix involves modifying TPUModelRunner to only create a KVConnectorOutput object when there are actual finished KV transfers, otherwise setting it to None. A corresponding change is made in the test utilities. Additionally, a defensive check is added to the scheduler to handle cases where a model runner might still produce a KVConnectorOutput when no connector is configured, preventing potential crashes.

The changes are logical, directly address the bug, and improve the robustness of the scheduler. The fix appears correct and complete.

@njhill njhill added the bug Something isn't working label Aug 10, 2025
@mgoin mgoin added the ready ONLY add when PR is ready to merge/full CI is needed label Aug 10, 2025
Copy link
Member

@DarkLight1337 DarkLight1337 left a comment

Choose a reason for hiding this comment

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

Thanks for fixing!

@vllm-bot vllm-bot merged commit 5898b13 into vllm-project:main Aug 11, 2025
44 of 50 checks passed
@sdavidbd
Copy link
Contributor

@njhill I might be missing some context about the TPU use case, but as I mentioned in #22473, I think we should maintain the invariant that kv_connector_output is not None if and only if connector is not None.

@njhill njhill deleted the fix-kvconn-output branch August 11, 2025 14:38
jingyu-ml pushed a commit to jingyu-ml/vllm that referenced this pull request Aug 11, 2025
aarnphm pushed a commit to aarnphm/vllm that referenced this pull request Aug 13, 2025
paulpak58 pushed a commit to paulpak58/vllm that referenced this pull request Aug 13, 2025
taneem-ibrahim pushed a commit to taneem-ibrahim/vllm that referenced this pull request Aug 14, 2025
BoyuanFeng pushed a commit to BoyuanFeng/vllm that referenced this pull request Aug 14, 2025
wangxiyuan pushed a commit to vllm-project/vllm-ascend that referenced this pull request Aug 15, 2025
### What this PR does / why we need it?

Mainline vLLM fixes its disaggregated prefill in
vllm-project/vllm#22598 . But it is still not
working in vllm-ascend.
To be concrete, decoder instances crash before vllm's fix and hang after
vllm's fix in ascend devices.
This patch allows disaggregated prefill to work.

### Does this PR introduce _any_ user-facing change?
No.

### How was this patch tested?
Qwen3-0.6B 1P1D tp=1 dp=1


- vLLM version: v0.10.0
- vLLM main:
vllm-project/vllm@0fe8508

---------

Signed-off-by: CaveNightingale <[email protected]>
diegocastanibm pushed a commit to diegocastanibm/vllm that referenced this pull request Aug 15, 2025
juuice-lee pushed a commit to juuice-lee/vllm-moe.code that referenced this pull request Aug 18, 2025
yiliu30 pushed a commit to yiliu30/vllm-fork that referenced this pull request Aug 19, 2025
epwalsh pushed a commit to epwalsh/vllm that referenced this pull request Aug 28, 2025
xiao-llm pushed a commit to xiao-llm/vllm that referenced this pull request Aug 28, 2025
xiao-llm pushed a commit to xiao-llm/vllm that referenced this pull request Aug 28, 2025
zhewenl pushed a commit to zhewenl/vllm that referenced this pull request Aug 28, 2025
dumb0002 pushed a commit to dumb0002/vllm that referenced this pull request Aug 28, 2025
googlercolin pushed a commit to googlercolin/vllm that referenced this pull request Aug 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working ready ONLY add when PR is ready to merge/full CI is needed tpu Related to Google TPUs v1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants