Historical tool output | archived output | JSONL line 6097 | 2026-09-08T01:29:21.212Z === speculator.py 100-160 === self.use_fused_multi_step_decode = False return if not self.advance_draft_positions: self.use_fused_multi_step_decode = True return unsupported_backends = sorted( { attn_group.backend.get_name() for attn_groups in self.attn_groups for attn_group in attn_groups if not attn_group.supports_draft_decode_metadata_update } ) self.use_fused_multi_step_decode = not unsupported_backends if unsupported_backends: logger.info_once( "Fused multi-step draft decode is not supported by attention " "backend(s) %s; falling back to rebuilding attention metadata " "between draft steps.", ", ".join(unsupported_backends), ) def init_cudagraph_manager(self, cudagraph_mode: CUDAGraphMode) -> None: # Initialize cudagraph manager for draft prefill (draft position 0). self.prefill_cudagraph_manager = SpeculatorCudaGraphManager( self.vllm_config, self.device, cudagraph_mode, self.num_speculative_steps + 1, ) # PIECEWISE cudagraphs are not supported for draft decodes. if cudagraph_mode.decode_mode() == CUDAGraphMode.FULL: cudagraph_mode = CUDAGraphMode.FULL_DECODE_ONLY else: cudagraph_mode = CUDAGraphMode.NONE # Initialize cudagraph manager for draft decodes (draft positions > 0). self.decode_cudagraph_manager = SpeculatorCudaGraphManager( self.vllm_config, self.device, cudagraph_mode, decode_query_len=1, ) def capture(self) -> None: logger.info("Capturing model for speculator...") # Reset indices to zeros to prevent stale values from prior # dummy runs to cause out-of-bounds indexing during capture. self.last_token_indices.zero_() self.idx_mapping.zero_() # Capture the prefill routine (model forward + compute_logits + # sample). # For FULL graphs, the entire routine is recorded as one graph. # For PIECEWISE, only the model's compiled regions are captured # and the rest (compute_logits, gumbel_sample) runs eagerly. # Draft prefill reuses the target model's attention metadata at # runtime, so capture builds its dummy metadata through the target === 哪个文件 === /usr/local/lib/python3.12/dist-packages/vllm/v1/worker/gpu/spec_decode/autoregressive/speculator.py /usr/local/lib/python3.12/dist-packages/vllm/v1/worker/gpu/spec_decode/autoregressive/__pycache__/speculator.cpython-312.pyc