-
Notifications
You must be signed in to change notification settings - Fork 2.8k
[PD] Update prefill.py #7190
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
[PD] Update prefill.py #7190
Conversation
eb0acce
to
a9eb917
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Summary of Changes
Hello @ByronHsu, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!
This pull request updates the prefill disaggregation component to align with open source standards and minimize conflicts. The changes introduce more detailed configuration options for distributed setups (TP, DP, PP), add a safeguard against oversized requests, and refine the request handling flow within the prefill disaggregation queues, including support for pipeline parallelism coordination.
Highlights
- Disaggregation Configuration: Added new parameters to
KVArgs
andServerArgs
to support specifying decode TP/DP sizes and prefill PP size, allowing for more flexible disaggregation setups. - Request Capacity Check: Implemented a check in the prefill disaggregation queue to prevent processing requests that exceed the maximum configured KV capacity, logging an error and aborting the request if necessary.
- Prefill Bootstrap/Inflight Queue Enhancements: Modified the prefill bootstrap and inflight queues to handle failed requests more explicitly and added logic for pipeline parallelism (PP) coordination, including checking request IDs against previous ranks.
- Code Alignment and Refactoring: Renamed the
FakeBootstrapHost
constant toFAKE_BOOTSTRAP_HOST
for better naming conventions and addedKVArgs
as a recognized class type in the disaggregation utilities. - Typo Correction: Corrected a consistent typo in comments and variable names related to the 'inflight' queue, changing it to 'infight'.
Using Gemini Code Assist
The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.
Invoking Gemini
You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command>
or @gemini-code-assist <command>
. Below is a summary of the supported commands.
Feature | Command | Description |
---|---|---|
Code Review | /gemini review |
Performs a code review for the current pull request in its current state. |
Pull Request Summary | /gemini summary |
Provides a summary of the current pull request in its current state. |
Comment | @gemini-code-assist | Responds in comments when explicitly tagged, both in issue comments and review comments. |
Help | /gemini help |
Displays a list of available commands. |
Customization
To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/
folder in the base of the repository. Detailed instructions can be found here.
Limitations & Feedback
Gemini Code Assist is currently in preview and may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments to provide feedback.
You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.
Footnotes
-
Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configureGemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩
There was a problem hiding this 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 updates the prefill disaggregation logic, introducing new parameters and refining existing functionalities. There are a few issues regarding attribute naming and type consistency that need to be addressed to prevent runtime errors.
max_total_num_tokens: int, | ||
# TODO(OSS): [x] add server args | ||
decode_tp_size: int, | ||
decode_dp_size: int, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
assert token_id >= 0, f"token_id: {token_id} is negative" | ||
output_id_buffer = self.metadata_buffers[0] | ||
output_id_buffer[idx] = token_id | ||
self.max_total_num_tokens = max_total_num_tokens |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
6247a60
to
4c8b7ae
Compare
4c8b7ae
to
bcc5943
Compare
The tests failed due to huggingface connectivity. Disaggregation test passed locally. |
Motivation
Upstream the latest prefill code to minimize conflicts without functionality changes
Modifications
Checklist