[Bugfix][ROCm][DSv4.1] Disable SWA bounded replay on ROCm (#57906)

Signed-off-by: Fangzhou Ai <fangzhou.ai@amd.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Fangzhou Ai
2026-09-21 10:29:14 +00:00
committed by GitHub
co-authored by Cursor
parent 0b7f11a1ee
commit 04c1f4a407
+9
View File
@@ -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,