From 439f336212227833e126526d3c5f3ef3968dfbf5 Mon Sep 17 00:00:00 2001 From: Nick Hill Date: Mon, 27 Jul 2026 03:41:27 +0100 Subject: [PATCH] [Core] Fix gpu<->cpu syncs in MRV2 mamba_hybrid.py (#49736) Signed-off-by: Nick Hill Co-authored-by: Benjamin Chislett --- vllm/v1/worker/gpu/model_states/mamba_hybrid.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/vllm/v1/worker/gpu/model_states/mamba_hybrid.py b/vllm/v1/worker/gpu/model_states/mamba_hybrid.py index d04400afae..03447c3cfa 100644 --- a/vllm/v1/worker/gpu/model_states/mamba_hybrid.py +++ b/vllm/v1/worker/gpu/model_states/mamba_hybrid.py @@ -101,12 +101,12 @@ class MambaHybridModelState(DefaultModelState): def add_request(self, req_index: int, new_req_data: NewRequestData) -> None: super().add_request(req_index, new_req_data) # Must reset the speculative acceptance count in this idx which could be stale. - self.num_accepted_tokens_gpu[req_index] = 1 + self.num_accepted_tokens_gpu[req_index].fill_(1) if self._align_mode: # Seed the running state block from the resumed/prefilled position. - self._mamba_state_idx_gpu[req_index] = ( - new_req_data.num_computed_tokens - 1 - ) // self.cache_config.block_size + self._mamba_state_idx_gpu[req_index].fill_( + (new_req_data.num_computed_tokens - 1) // self.cache_config.block_size + ) def _get_mamba_group_info( self, kv_cache_config: KVCacheConfig