-
Notifications
You must be signed in to change notification settings - Fork 30.6k
feat: err when unsupported attn impl is set w/ --continuous_batching
#40618
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
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
84f892e
feat: err when unsupported attn impl is set w/ `--continuous_batching`
McPatate 88bc48a
refactor: move defaults and support list to CB code
McPatate de490f6
feat: add action item in error msg
McPatate 87817c3
fix(serve): add default attn implementation
McPatate a2b348d
feat(serve): add log when `attn_implementation` is `None`
McPatate 2421a89
feat: raise Exception when attn_implementation is not supported by CB
McPatate b69e38f
revert: raise Exception when attn_implementation is not supported
McPatate File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -483,6 +483,19 @@ def __init__(self, args: ServeArguments): | |
# Store and process input arguments | ||
self.args = args | ||
self.use_continuous_batching = self.args.continuous_batching | ||
if self.use_continuous_batching: | ||
default_attn_impl = ContinuousBatchingManager.default_attention_implementation() | ||
# checking if attn_implementation is supported by continuous batching | ||
if self.args.attn_implementation is None: | ||
self.args.attn_implementation = default_attn_impl # default to sdpa_paged | ||
logger.info(f"No attn_implementation passed, defaulting to {default_attn_impl}") | ||
supported_attn_impl = ContinuousBatchingManager.supported_attention_implementations() | ||
if self.args.attn_implementation not in supported_attn_impl: | ||
raise ValueError( | ||
f"Continuous batching only supports {supported_attn_impl} as attn_implementation, got " | ||
f"{self.args.attn_implementation}" | ||
f"Try setting `--attn_implementation={default_attn_impl}`" | ||
) | ||
Comment on lines
+486
to
+498
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. wdy about putting this directly in CB's api? would be better in general + we can automatically add |
||
self.enable_cors = self.args.enable_cors | ||
|
||
if self.args.default_seed is not None: | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
here if attn impelmeention not supported, you can try to map it to the correct ones?
Because for sdpa eager and flash, its easy to map: prefix with paged|
But up to you !