Revert DSv4 eager workspace reuse (#52836)

Signed-off-by: Woosuk Kwon <woosuk@inferact.ai>
Co-authored-by: OpenAI Codex <codex@openai.com>
This commit is contained in:
Woosuk Kwon
2026-08-18 17:02:59 -07:00
committed by GitHub
co-authored by OpenAI Codex
parent a9f4afb66f
commit f1178f3a06
15 changed files with 30 additions and 354 deletions
-20
View File
@@ -72,7 +72,6 @@ from vllm.models.common.ops.sequence_parallel import (
sp_shard,
)
from vllm.models.deepseek_v4.attention import DeepseekV4Attention
from vllm.models.deepseek_v4.eager_scratch import DeepseekV4EagerScratchPool
from vllm.models.deepseek_v4.nvidia.flashinfer_sparse import (
DeepseekV4FlashInferMLAAttention,
DeepseekV4FlashInferSM120Attention,
@@ -815,7 +814,6 @@ class DeepseekV4DecoderLayer(nn.Module):
prefix,
topk_indices_buffer: torch.Tensor | None = None,
aux_stream_list: list[torch.cuda.Stream] | None = None,
eager_scratch_pool: DeepseekV4EagerScratchPool | None = None,
):
super().__init__()
@@ -829,7 +827,6 @@ class DeepseekV4DecoderLayer(nn.Module):
prefix=f"{prefix}.attn",
topk_indices_buffer=topk_indices_buffer,
aux_stream_list=aux_stream_list,
eager_scratch_pool=eager_scratch_pool,
)
if self.use_sequence_parallel:
self.attn.wo_b.reduce_results = False
@@ -1017,22 +1014,6 @@ class DeepseekV4Model(nn.Module, EagleModelMixin):
# (compressor kv_score, indexer.weights_proj, indexer.compressor
# kv_score). fused_wqa_wkv stays on the default stream.
aux_stream_list = [torch.cuda.Stream() for _ in range(3)]
padded_heads = _select_dsv4_attn_cls(vllm_config).get_padded_num_q_heads(
config.num_attention_heads // get_tensor_model_parallel_world_size()
)
self.eager_scratch_pool: DeepseekV4EagerScratchPool | None = None
if not vllm_config.parallel_config.use_ubatching:
# TODO: support dbo if needed
# this requires the buffer to have ubatch dim
self.eager_scratch_pool = DeepseekV4EagerScratchPool(
vllm_config.scheduler_config.max_num_batched_tokens,
padded_heads,
config.head_dim,
config.index_n_heads,
config.index_head_dim,
config.index_topk,
current_platform.device_type,
)
# Reserved topk indices buffer for all Indexer layers to reuse.
self.topk_indices_buffer = torch.empty(
@@ -1058,7 +1039,6 @@ class DeepseekV4Model(nn.Module, EagleModelMixin):
prefix=prefix,
topk_indices_buffer=self.topk_indices_buffer,
aux_stream_list=aux_stream_list,
eager_scratch_pool=self.eager_scratch_pool,
),
prefix=f"{prefix}.layers",
)