DCP supports hybrid attention (#40996)

Signed-off-by: YanXu <yancey.yx@alibaba-inc.com>
Signed-off-by: Jingyi Yang <girasoleyang@gmail.com>
Co-authored-by: Jingyi Yang <girasoleyang@gmail.com>
This commit is contained in:
Yan Xu
2026-07-09 21:34:45 -07:00
committed by GitHub
co-authored by Jingyi Yang
parent 2d814a0082
commit 95ed0feaa5
26 changed files with 783 additions and 125 deletions
@@ -19,6 +19,7 @@ class AttentionLayerBase(ABC):
"""
impl: "AttentionImpl"
supports_dcp: bool = True
@abstractmethod
def get_attn_backend(self) -> type[AttentionBackend]:
@@ -22,6 +22,7 @@ class MambaBase(AttentionLayerBase):
# Contains the KV cache (mamba state) for the layer
# in the shape specified by `self.get_state_shape`.
kv_cache: tuple[torch.Tensor, ...]
supports_dcp: bool = False
@abstractmethod
def get_state_shape(self) -> Iterable[tuple[int, ...]]: