feat: add sliding window attention to Continuous Batching#39225
Closed
McPatate wants to merge 8 commits into
Closed
feat: add sliding window attention to Continuous Batching#39225McPatate wants to merge 8 commits into
McPatate wants to merge 8 commits into
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. |
ArthurZucker
left a comment
Collaborator
There was a problem hiding this comment.
Starting to look good!
| @classmethod | ||
| def setUpClass(cls): | ||
| cls.model_name = "mistralai/Mistral-7B-v0.1" | ||
| cls.model = MistralForCausalLM.from_pretrained( |
Collaborator
There was a problem hiding this comment.
AutoModel would be better here with a list of models that have idfferent attention patterns!
415df66 to
e50c56c
Compare
Contributor
|
[For maintainers] Suggested jobs to run (before merge) run-slow: gemma2 |
* fix: use correct `layer_type` name for sliding attn * refactor: return generated request ids when calling `add_requests`
e50c56c to
b6de5bc
Compare
McPatate
commented
Aug 28, 2025
| for state in self.active_requests.values(): | ||
| if state.status == RequestStatus.SPLIT_PENDING_REMAINDER: | ||
| # XXX: when cache is full (len(self.cache._free_blocks) == 0), state can stay on `PREFILLING_SPLIT` we need to take those into account | ||
| if state.status in [RequestStatus.PREFILLING_SPLIT, RequestStatus.SPLIT_PENDING_REMAINDER]: |
Member
Author
There was a problem hiding this comment.
@remi-or don't forget to port this line in your new SWA PR
Collaborator
|
Superseeded by #40688 |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What does this PR do?
Adds Sliding Window Attention to Continuous Batching