Skip to content

[Feature] Add attention mask support #536

Description

@ShunyuYao

Checklist

Motivation

Is it possible to support attention mask in the attention process? attention mask is now widely supported in diffusers and comfyui and can be really helpful in lots of circumustances.

Related resources

In the implentation of attention process in Diffuerses, scaled_dot_product_attention function support attention mask option.
def scaled_dot_product_attention(query: Tensor, key: Tensor, value: Tensor, attn_mask: Optional[Tensor] = None, dropout_p: float = 0.0, is_causal: bool = False, scale: Optional[float] = None, enable_gqa: bool = False) -> Tensor: ...

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions