Skip to content

Conversation

@njhill
Copy link
Member

@njhill njhill commented May 16, 2025

For async loading there are kind of two passes int the scheduler for the request. The first time, the connector methods are called and it goes into WAITING_FOR_REMOTE_KVS state.

Once the async load is ready, it goes through the "waiting" part of the schedule() method again for that request... previously it was calling the connector methods again when this happened, even though we don't want to do any more since the computation is now done.

This originally wasn't causing a problem because the nixl connector unsets the flag in the transfer params to that it's ignored the second tim.

But in the multi-connector, when get_num_matched_tokens returns 0 from one of the connectors it moves on to the next one ... so in this second pass we were actually triggering the LMCache connector.

So this change makes things more explicit/robust in the scheduler w.r.t. when the connectors are invoked. Similarly it also only calls update_state_after_alloc if get_num_matched_tokens returned nonzero.. since in terms of the API contract it doesn't really make sense to invoke the connector after the allocation if it's saying that it is not providing any tokens.

Same as upstream PR vllm-project#18232

njhill and others added 4 commits May 16, 2025 06:38
vllm-project#18001 changed the behaviour subtly and broke some multi-connector cases.

This change ensures we don't call the connector get_num_new_matched_tokens method a second time for a given request after an async load has completed.

Signed-off-by: Nick Hill <nhill@redhat.com>
Signed-off-by: Nick Hill <nhill@redhat.com>
Signed-off-by: Nick Hill <nhill@redhat.com>
Co-authored-by: Nicolò Lucchesi <nicolo.lucchesi@gmail.com>
@github-actions
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.

🚀

@njhill njhill merged commit 16bed57 into neuralmagic:pd-launch-branch May 16, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants