vllm.model_executor.layers.attention.rswa_attention
¶
Classes:
-
RSWAAttention–Attention layer whose KV cache is managed by
RSWAManager.
RSWAAttention
¶
Bases: Attention
Attention layer whose KV cache is managed by RSWAManager.
Drop-in replacement for the standard Attention layer when the model is
configured with Reference Sliding Window Attention (R-SWA,
rswa_window > 0). The actual masking logic lives in the attention
backend (FlexAttention or FA4 mask_mod); this layer only overrides
get_kv_cache_config so the KV cache manager instantiates RSWAManager
(instead of FullAttentionManager) and can therefore evict "gap" blocks
to keep per-request KV memory bounded at O(prefix + window).