Pith. sign in

REVIEW 1 cited by

Efficiently Dispatching Flash Attention For Partially Filled Attention Masks

Not yet reviewed by Pith; the record is open.

This paper has not been read by Pith yet. Machine review is queued; the pith claim, tier, and objections will appear here once it completes.

SPECIMEN: schema-true, not a live event

T0 review · schema-true

One-sentence machine reading of the paper's core claim.

pith:XXXXXXXX · record.json · timestamp

arxiv 2409.15097 v2 pith:5SGXLJW3 submitted 2024-09-23 cs.LG cs.AIcs.CL

classification cs.LGcs.AIcs.CL
keywords attentionmasksflashcomplexityfilledfurthermaskingmatrices
verification ladder T0 review T1 audit T2 compute T3 formal
0 comments
read the original abstract

Transformers are widely used across various applications, many of which yield sparse or partially filled attention matrices. Examples include attention masks designed to reduce the quadratic complexity of attention, sequence packing techniques, and recent innovations like tree masking for fast validation in MEDUSA. Despite the inherent sparsity in these matrices, the state-of-the-art algorithm Flash Attention still processes them with quadratic complexity as though they were dense. In this paper, we introduce Binary Block Masking, a highly efficient modification that enhances Flash Attention by making it mask-aware. We further propose two optimizations: one tailored for masks with contiguous non-zero patterns and another for extremely sparse masks. Our experiments on attention masks derived from real-world scenarios demonstrate up to a 9x runtime improvement. The implementation will be publicly released to foster further research and application.

Discussion (0). Continue with ORCID to comment.

Forward citations

Cited by 1 Pith paper

Reviewed papers in the Pith corpus that reference this work. Sorted by Pith novelty score. Full citation record

  1. Longer Attention Span: Increasing Transformer Context Length with Sparse Graph Processing Techniques

    cs.LG 2025-01 conditional novelty 6.0 of 10

    Sparse attention implemented as a graph traversal runs faster than FlashAttention for very sparse masks and reaches 160M token context on a single A100 GPU.

Pith tools