From a447955acad919a6902d65f0af2d4f76c0335ed3 Mon Sep 17 00:00:00 2001 From: Wentao Ye <44945378+yewentao256@users.noreply.github.com> Date: Tue, 25 Aug 2026 20:38:48 -0400 Subject: [PATCH] [Kimi Bug] Fix k3 torch.AcceleratorError: CUDA error: an illegal memory access was encountered (#53773) Signed-off-by: yewentao256 --- vllm/v1/worker/gpu/cudagraph_utils.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/vllm/v1/worker/gpu/cudagraph_utils.py b/vllm/v1/worker/gpu/cudagraph_utils.py index 7ae6d74818..f271adc7ec 100644 --- a/vllm/v1/worker/gpu/cudagraph_utils.py +++ b/vllm/v1/worker/gpu/cudagraph_utils.py @@ -845,6 +845,8 @@ def _teardown_profiling_state(runner: "GPUModelRunner") -> None: """Release the profiling KV cache and captured graphs while keeping model weights, so the real ``initialize_kv_cache`` starts from a clean slate.""" torch.accelerator.synchronize() + if hasattr(runner.model_state, "_mamba_ctx"): + runner.model_state._mamba_ctx = None if hasattr(runner, "kv_caches"): runner.kv_caches.clear() if hasattr(runner, "attn_groups"):