[BugFix][ModelRunner V2] Fix stale attn metadata in speculator prefill cudagraph capture (#48261)

Signed-off-by: Nick Hill <nickhill123@gmail.com>
This commit is contained in:
Nick Hill
2026-07-13 09:39:15 -07:00
committed by GitHub
parent 93e3bc8f30
commit 26587f9519
7 changed files with 72 additions and 108 deletions
+7 -3
View File
@@ -479,7 +479,11 @@ class GPUModelRunner(LoRAModelRunnerMixin):
if isinstance(self.speculator, DraftModelSpeculator):
# HACK(woosuk)
self.speculator.set_attn(
self.model_state, self.kv_cache_config, self.block_tables
self.model_state,
self.kv_cache_config,
self.block_tables,
self.input_buffers,
self.attn_groups,
)
self.kv_caches: list[torch.Tensor] = []
@@ -706,7 +710,7 @@ class GPUModelRunner(LoRAModelRunnerMixin):
start_free_gpu_memory = torch.accelerator.get_memory_info()[0]
with self.maybe_setup_dummy_loras(self.lora_config):
attn_states = self.cudagraph_manager.capture(
self.cudagraph_manager.capture(
self.model,
self.model_state,
self.input_buffers,
@@ -719,7 +723,7 @@ class GPUModelRunner(LoRAModelRunnerMixin):
lora_capture_hook=create_lora_capture_hook(self.lora_config, self),
)
if self.speculator is not None:
self.speculator.capture(attn_states)
self.speculator.capture()
end_time = time.perf_counter()
end_free_gpu_memory = torch.accelerator.get_memory_info()[0]