[PCP][DCP] Enable PCP+DCP on sparse-MLA models (#56157)
Signed-off-by: patryk.saffer <patryk.saffer@blc-login-1.blc1.mistralcompute.ai> Signed-off-by: patryk.saffer <patryk.saffer@blc-login-0.blc1.mistralcompute.ai> Signed-off-by: PatrykSaffer <patryk.saffer@mistral.ai> Signed-off-by: Lucas Wilkinson <lwilkins@redhat.com> Co-authored-by: patryk.saffer <patryk.saffer@blc-login-1.blc1.mistralcompute.ai> Co-authored-by: patryk.saffer <patryk.saffer@blc-login-0.blc1.mistralcompute.ai> Co-authored-by: Lucas Wilkinson <lwilkins@redhat.com> Co-authored-by: Patryk Saffer <PatrykSaffer@users.noreply.github.com> Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
co-authored by
patryk.saffer
patryk.saffer
Lucas Wilkinson
Patryk Saffer
Claude Fable 5.1
parent
72d4d83157
commit
ebe1dec2da
@@ -420,6 +420,9 @@ class MLAAttention(nn.Module, AttentionLayerBase):
|
||||
"""
|
||||
|
||||
supports_dense_mha_prefill: ClassVar[bool] = True
|
||||
# Under PCP+DCP only the decode rows carry an LSE; the base forward
|
||||
# merges a full-batch LSE, so subclasses opt in with their own forward.
|
||||
supports_pcp_dcp: ClassVar[bool] = False
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
@@ -660,6 +663,10 @@ class MLAAttention(nn.Module, AttentionLayerBase):
|
||||
|
||||
_COMPUTE_PREFILL_METADATA_KERNEL.register_warmup()
|
||||
|
||||
if self.use_pcp and self.impl.dcp_world_size > 1 and not self.supports_pcp_dcp:
|
||||
raise NotImplementedError(
|
||||
f"{type(self).__name__} does not support PCP+DCP."
|
||||
)
|
||||
self.dcp_manager: MLADCPManager | None = None
|
||||
if self.impl.dcp_world_size > 1:
|
||||
query_dtype = (
|
||||
|
||||
Reference in New Issue
Block a user