Skip to content

FlashAttentionBackend only supports head sizes supported by xformers #3359

@declark1

Description

@declark1

FlashAttentionBackend currently only supports head sizes supported by XFormersBackend, specifically [64, 80, 96, 112, 128, 256]. Is there any reason to only support these head sizes with flash attention? If not, I can open a PR to remove this constraint (flash should support all dimensions up to 256) so that smaller models or those with unsupported head sizes can be used with vLLM w/flash attention.

suppored_head_sizes = PagedAttentionImpl.get_supported_head_sizes()
if head_size not in suppored_head_sizes:
    raise ValueError(
        f"Head size {head_size} is not supported by PagedAttention. "
        f"Supported head sizes are: {suppored_head_sizes}.")

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions