update code
(cherry picked from commit 1453150a0bdf2cce425e9e2da83ef16b8e8f2859)
This commit is contained in:
@@ -263,9 +263,21 @@ def validate_deepseek_v41_features(server_args: ServerArgs) -> None:
|
|||||||
from sglang.srt.model_executor.cuda_graph_config import Backend, Phase, with_phase
|
from sglang.srt.model_executor.cuda_graph_config import Backend, Phase, with_phase
|
||||||
|
|
||||||
prefill_graph = cfg.cuda_graph_config.prefill
|
prefill_graph = cfg.cuda_graph_config.prefill
|
||||||
if prefill_graph.backend != Backend.DISABLED and prefill_graph.max_seq_len is None:
|
cp_breakable_prefill = (
|
||||||
# The captured low-ratio indexer scores a static context width; 16k
|
cfg.enable_prefill_cp
|
||||||
# keeps it inside the candidate window at under 1 ms per layer.
|
and cfg.cp_strategy == "interleave"
|
||||||
|
and cfg.tp_size > 1
|
||||||
|
and prefill_graph.backend == Backend.BREAKABLE
|
||||||
|
)
|
||||||
|
if (
|
||||||
|
prefill_graph.backend != Backend.DISABLED
|
||||||
|
and prefill_graph.max_seq_len is None
|
||||||
|
and not cp_breakable_prefill
|
||||||
|
):
|
||||||
|
# The non-CP captured low-ratio indexer scores a static context width.
|
||||||
|
# CP BCG runs these sources eagerly with live prefix metadata, so this
|
||||||
|
# default would only force long-prefix CP batches back to eager.
|
||||||
|
# Explicit max_seq_len values still constrain both paths.
|
||||||
declare_resolution(
|
declare_resolution(
|
||||||
server_args,
|
server_args,
|
||||||
"validate_deepseek_v41_features",
|
"validate_deepseek_v41_features",
|
||||||
|
|||||||
@@ -1580,8 +1580,12 @@ class DeepseekV4AttnBackend(
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def low_ratio_prefill_graph(self) -> bool:
|
def low_ratio_prefill_graph(self) -> bool:
|
||||||
|
"""Whether ratio-1/2 sources use captured projections and indexer metadata."""
|
||||||
return (
|
return (
|
||||||
bool(self.low_ratios) and _has_dense_fp4_indexer() and _is_sm100_or_newer()
|
bool(self.low_ratios)
|
||||||
|
and _has_dense_fp4_indexer()
|
||||||
|
and _is_sm100_or_newer()
|
||||||
|
and get_parallel().attn_cp_size == 1
|
||||||
)
|
)
|
||||||
|
|
||||||
def can_run_prefill_cuda_graph(self, forward_batch: ForwardBatch) -> bool:
|
def can_run_prefill_cuda_graph(self, forward_batch: ForwardBatch) -> bool:
|
||||||
|
|||||||
@@ -1336,9 +1336,9 @@ class PrefillCudaGraphRunner(BaseCudaGraphRunner):
|
|||||||
batch_max_context_len=batch_max_context_len,
|
batch_max_context_len=batch_max_context_len,
|
||||||
):
|
):
|
||||||
return False
|
return False
|
||||||
if getattr(self, "enable_cp_bcg_capture", False) and is_cp_active(
|
if getattr(self, "enable_cp_bcg_capture", False):
|
||||||
forward_batch
|
if not is_cp_active(forward_batch):
|
||||||
):
|
return False
|
||||||
assert self.prefill_cp_bcg_input is not None
|
assert self.prefill_cp_bcg_input is not None
|
||||||
if (
|
if (
|
||||||
self.prefill_cp_bcg_input.select_replay_bucket_for_batch(
|
self.prefill_cp_bcg_input.select_replay_bucket_for_batch(
|
||||||
|
|||||||
Reference in New Issue
Block a user