[Bugfix] Make DSV4 sparse MLA work end-to-end for plain decode, MTP, and DSpark (#51538)

This commit is contained in:
Gabriel Wu
2026-08-15 07:01:32 -07:00
committed by GitHub
parent ac2ae8798c
commit 97388c44f9
20 changed files with 797 additions and 120 deletions
+16 -2
View File
@@ -91,6 +91,16 @@ from .utils import request_memory
logger = init_logger(__name__)
def _num_workspace_lanes(vllm_config: VllmConfig, use_v2_model_runner: bool) -> int:
spec_config = vllm_config.speculative_config
return (
2
if use_v2_model_runner and spec_config is not None and spec_config.use_dspark()
else 1
)
if TYPE_CHECKING:
from vllm.device_allocator.sleep_mode_backend import SleepModeBackend
from vllm.model_executor.model_loader.tensorizer import TensorizerConfig
@@ -402,9 +412,13 @@ class Worker(WorkerBase):
else:
raise RuntimeError(f"Unsupported device type: {self.device_config.device}")
# Initialize workspace manager
# DSpark target and draft CUDA graphs retain workspace views concurrently.
num_ubatches = 2 if self.vllm_config.parallel_config.enable_dbo else 1
init_workspace_manager(self.device, num_ubatches)
init_workspace_manager(
self.device,
num_ubatches,
_num_workspace_lanes(self.vllm_config, self.use_v2_model_runner),
)
# Construct the model runner
if self.use_v2_model_runner: