-
Notifications
You must be signed in to change notification settings - Fork 1.2k
feat(router): add max_batch_size #1542
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
Conversation
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
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.
LGTM, thanks !
@@ -279,6 +279,11 @@ struct Args { | |||
#[clap(default_value = "20", long, env)] | |||
max_waiting_tokens: usize, | |||
|
|||
/// Enforce a maximum number of requests per batch | |||
/// Specific flag for hardware targets that do not support unpadded inference |
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.
'unpadded inference' is a bit unclear to me, but I suppose it corresponds to other configurations.
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.
Unpadded = Flash attention "varlen" (which means requests are stacked linearly without requiring padding tokens).
Padded:
input_ids = [
[3, 53, 63],
[0, 0, 234],
]
Unpadded:
input_ids = [3, 53, 63, 234] + [0, 3, 4] (seqlengths)
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.
Look much better thana my PR
Some hardware require a maximum batch size.
Some hardware require a maximum batch size.