From 04c1f4a407962a37d01b573f3a2aba91dd2ed3a9 Mon Sep 17 00:00:00 2001 From: Fangzhou Ai <31551580+Fangzhou-Ai@users.noreply.github.com> Date: Mon, 21 Sep 2026 06:29:14 -0400 Subject: [PATCH] [Bugfix][ROCm][DSv4.1] Disable SWA bounded replay on ROCm (#57906) Signed-off-by: Fangzhou Ai Co-authored-by: Cursor --- vllm/models/deepseek_v41/attention.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/vllm/models/deepseek_v41/attention.py b/vllm/models/deepseek_v41/attention.py index bf645a8f15..1e25704dd8 100644 --- a/vllm/models/deepseek_v41/attention.py +++ b/vllm/models/deepseek_v41/attention.py @@ -531,6 +531,15 @@ class DeepseekV4Attention(nn.Module, AttentionLayerBase, ABC): "instead." ) swa_bounded_replay = False + if swa_bounded_replay and current_platform.is_rocm(): + logger.warning_once( + "SWA bounded replay is off on ROCm (the sparse SWA metadata " + "builders forward replay_start, but the window clamp it relies " + "on lives in the FlashInfer and FlashMLA prefill kernels, so " + "the padded slots fault); the sliding-window cache takes part " + "in prefix caching instead." + ) + swa_bounded_replay = False self.swa_cache_layer = DeepseekV4SWACache( head_dim=self.head_dim, window_size=self.window_size,