[Perf] DSv4.1: Bound encoder BCG metadata memory (#44963)
This commit is contained in:
@@ -2951,7 +2951,7 @@ class DeepseekV4AttnBackend(
|
||||
self, forward_batch: ForwardBatch
|
||||
):
|
||||
max_seq_len = forward_batch.max_seq_len_override or self.MAX_SEQ_LEN_FOR_CAPTURE
|
||||
if self.token_to_kv_pool.request_window is None and self.low_ratios == (1, 2):
|
||||
if self.low_ratios == (1, 2):
|
||||
graph_context_limit = _prefill_graph_max_seq_len()
|
||||
if graph_context_limit is not None:
|
||||
max_seq_len = min(max_seq_len, graph_context_limit)
|
||||
@@ -2965,7 +2965,7 @@ class DeepseekV4AttnBackend(
|
||||
self.enable_decoder_swa_bounded_replay
|
||||
and forward_batch.forward_mode.is_extend_without_speculative()
|
||||
)
|
||||
if self.token_to_kv_pool.request_window is None and self.low_ratios == (1, 2):
|
||||
if self.low_ratios == (1, 2):
|
||||
self._share_bcg_low_ratio_index_buffers(self.forward_metadata.core_metadata)
|
||||
self.forward_metadata.prefill_graph_tail = with_tail
|
||||
self.tail_forward_metadata = (
|
||||
@@ -3041,7 +3041,7 @@ class DeepseekV4AttnBackend(
|
||||
max_seq_len = (
|
||||
metadata_batch.max_seq_len_override or self.MAX_SEQ_LEN_FOR_CAPTURE
|
||||
)
|
||||
if self.token_to_kv_pool.request_window is None and self.low_ratios == (1, 2):
|
||||
if self.low_ratios == (1, 2):
|
||||
graph_context_limit = _prefill_graph_max_seq_len()
|
||||
if graph_context_limit is not None:
|
||||
max_seq_len = min(max_seq_len, graph_context_limit)
|
||||
|
||||
Reference in New Issue
Block a user