Skip to content

Conversation

@LiuXiaoxuanPKU
Copy link
Collaborator

@LiuXiaoxuanPKU LiuXiaoxuanPKU commented Mar 22, 2025

This PR

  1. changes the interface of spec decode so that it can better fit eagle.
  2. add num_lookahead slots in scheduler so that it will allocate slots for eagle heads.

Some notes:

  1. I have not added full parameters required by eagle, feel free to add @sroy745.
  2. Will rebased once [V1][Usage] Refactor speculative decoding configuration and tests #14434 is merged.

@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.

🚀

@LiuXiaoxuanPKU LiuXiaoxuanPKU marked this pull request as draft March 22, 2025 15:37
@mergify mergify bot added the v1 label Mar 22, 2025
Comment on lines +159 to +160
num_new_tokens = (request.num_tokens_with_spec +
self.num_lookahead_slots -
Copy link
Collaborator

Choose a reason for hiding this comment

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

IIUC, this is not correct because num_lookahead_slots is only for memory allocation, not about how many tokens to be batched in this step.

Copy link
Contributor

Choose a reason for hiding this comment

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

Can I ask how is self.num_lookahead_slots different from len(request.spec_token_ids)?
Isn't request.num_tokens_with_spec is taking into account the number of draft token for the req as it is def as len(request._all_token_ids) + len(request.spec_token_ids)?

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah, probably self.num_lookahead_slots is needed for kv cache of transformer block in eagle proposer? If so, then we need a bigger kvc for eagle module when doing prefill since the entire prompt is processed by the eagle module.

@abstractmethod
def generate_draft_token_ids(
self, input_batch: InputBatch, sampled_token_ids: list[list[int]],
sampling_metadata: SamplingMetadata) -> list[list[int]]:
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

change it similar to *args

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

add if statement in the model_runner to pass in different parameters

@mergify
Copy link

mergify bot commented Mar 24, 2025

This pull request has merge conflicts that must be resolved before it can be
merged. Please rebase the PR, @LiuXiaoxuanPKU.

https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/syncing-a-fork

@mergify mergify bot added the needs-rebase label Mar 24, 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