-
Notifications
You must be signed in to change notification settings - Fork 1.2k
[0.9.1][bugfix] fix deepseek memory bug #1551
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -350,6 +350,7 @@ def __init__(self, vllm_config: VllmConfig, device: torch.device): | |
| self.torchair_graph_enabled = ascend_config.torchair_graph_config.enabled and self.vllm_config.model_config.use_mla | ||
| self.use_cached_npu_graph = ascend_config.torchair_graph_config.use_cached_graph | ||
| self.torchair_graph_batch_sizes = ascend_config.torchair_graph_config.graph_batch_sizes | ||
| self.use_ring_mla = ascend_config.chunked_prefill_for_mla | ||
|
|
||
| if ascend_config.torchair_graph_config.graph_batch_sizes_init: | ||
| self.init_torchair_graph_batch_sizes() | ||
|
|
@@ -908,11 +909,14 @@ def _process_reqs( | |
| else: | ||
| attn_state = AscendAttentionState.PrefillCacheHit | ||
|
|
||
| attn_mask = self._make_attention_mask(seq_lens=seq_lens, | ||
| query_lens=num_scheduled_tokens, | ||
| position=positions, | ||
| attn_state=attn_state) | ||
| self.attn_mask = attn_mask | ||
| # NOTE: when use ring_mla, attn_mask don't need to generate here. | ||
| if not self.use_ring_mla or attn_state == AscendAttentionState.PrefillNoCache: | ||
| attn_mask = self._make_attention_mask( | ||
|
Collaborator
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. Can a compressed mask be used? If the sequence is too long, it might cause memory waste here. Refer #1100
Collaborator
Author
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. ringmla's mask size is equal to chunksize, it won't cause memory waste. |
||
| seq_lens=seq_lens, | ||
| query_lens=num_scheduled_tokens, | ||
| position=positions, | ||
| attn_state=attn_state) | ||
| self.attn_mask = attn_mask | ||
| self.attn_state = attn_state # type: ignore | ||
|
|
||
| extra_builder_kwargs = {} | ||
|
|
||
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.
Should we consider which scheduler is be using?