Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V1 integration #6

Open
wants to merge 12 commits into
base: main
Choose a base branch
from
Open

V1 integration #6

wants to merge 12 commits into from

Conversation

joerunde
Copy link
Collaborator

@joerunde joerunde commented Feb 28, 2025

@tjohnson31415 and I spent a while hacking through a new V1-compatible worker , runner, and scheduler. This works on an AIU chip! 🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉

The main blockers here are:

We'll push up a draft PR with some temporary changes for vLLM for the above blockers so we can at least move development forward here on v1

Copy link

👋 Hi! Thank you for contributing to the vLLM project.
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 do one of these:

  • Add ready label to the PR
  • Enable auto-merge.

🚀

@sducouedic
Copy link
Collaborator

sducouedic commented Mar 3, 2025

The error that you report on AIU with V1, I think Dhruval already observed that with the image built on Friday 28.02, meaning V0.

@joerunde
Copy link
Collaborator Author

joerunde commented Mar 3, 2025

Interesting, I can confirm though that with this code and vllm@cd1d3c3d the v0 engine works and serves requests using the sendnn_decoder backend

@joerunde
Copy link
Collaborator Author

joerunde commented Mar 4, 2025

We found the problem, and it was us!

An erroneous @torch.inference_mode was causing extra compilation at runtime (instead of just during warmup) which was failing. Without that, V1 is working on the AIU chip!

@sducouedic
Copy link
Collaborator

@joerunde nice! Where was this @torch.inference_mode set?

@joerunde
Copy link
Collaborator Author

joerunde commented Mar 4, 2025

@sducouedic we had copied over code from the v1 gpu worker here in this PR for the new execute_model interface, and accidentally included the annotation along with it 🤦

This bit here

@sducouedic
Copy link
Collaborator

thanks @joerunde !

@joerunde joerunde changed the title [Do not merge] V1 integration V1 integration Mar 5, 2025
@joerunde
Copy link
Collaborator Author

joerunde commented Mar 5, 2025

Alright, the v0 tests are all passing and the linter's happy. I removed the [Do not merge] tag, I think we can consider merging this since it wont' break v0 support and we can iterate on v1 in our development environments

@yannicks1 yannicks1 self-requested a review March 6, 2025 09:48
dummy_tensors = lambda v: torch.full(
(num_reqs, ), v, device=self.device)
dummy_metadata = SamplingMetadata(
temperature=dummy_tensors(0.0),
Copy link
Collaborator

Choose a reason for hiding this comment

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

Updated the hard coded sampling temperature to 0.0 to do greedy sampling as in most of our test cases.

# seq_lens = []
num_reqs = len(scheduler_output.scheduled_cached_reqs)

# TODO: Cache the sampling params for the current batch and build this
Copy link
Collaborator

Choose a reason for hiding this comment

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

I believe there is some upstream implementation still missing for V1 to correctly fill in the sampling metadata here. So I would say that's okay for now.

sampled_token_ids=output.sampled_token_ids.tolist(),
spec_token_ids=None,
logprobs=
None, # TODO: add logprobs, needs to be converted from tensor here
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is there something hindering us from providing the correct logprobs here? Asking because this is needed to run the tests in vllm-spyre/tests...

Comment on lines +355 to +358
print("\n\n\n FINISHED ITERATION \n\n\n")
print(self._req_ids2idx)
print(output.sampled_token_ids)
print("\n\n")
Copy link
Collaborator

Choose a reason for hiding this comment

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

I believe that was for debugging purposes and can be removed.

Comment on lines +207 to +210
# TODO See if we can use `self.execute_model` instead for the warmup
# It's slightly risky to implement different forward pass logic here,
# which can go out of sync with the real forward pass and cause problems
# for torch.compile
Copy link
Collaborator

Choose a reason for hiding this comment

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

good point!

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.

3 participants