---
id: pr-flash-attention-1942
repo: Dao-AILab/flash-attention
pr: 1942
title: Block Sparsity and Flex Attention mask mod support
author: reubenconducts
date: '2025-10-21'
url: https://github.com/Dao-AILab/flash-attention/pull/1942
source_category: upstream-code
architectures:
- sm100
tags:
- benchmark kernel
- sm80
techniques: []
hardware_features: []
kernel_types:
- attention
languages:
- cuda-cpp
captured_at: '2026-05-16'
status: merged
merge_sha: 143b0ba20df0aca7d968d8ef5852ed10fe09caab
inclusion_reason: Search-matched CUDA kernel optimization PR; materialize diff/source before synthesis.
changed_paths:
- flash_attn/cute/benchmark_mask_mod.py
- flash_attn/cute/block_sparsity.py
- flash_attn/cute/flash_fwd.py
- flash_attn/cute/interface.py
- flash_attn/cute/mask.py
- flash_attn/cute/mask_definitions.py
- tests/cute/test_flash_attn.py
- tests/cute/test_mask_mod.py
artifact_dir: evidence/pull-bundles/flash-attention/gh-1942
head_ref_oid: d28e6a85225a4e544efd5e090d180b6059b27179
---
# Block Sparsity and Flex Attention mask mod support

- Repository: `Dao-AILab/flash-attention`
- PR: [1942](https://github.com/Dao-AILab/flash-attention/pull/1942)
- Decision: `Search-matched CUDA kernel optimization PR; materialize diff/source before synthesis.`
- Reason: Search-matched CUDA kernel optimization PR; materialize diff/source before synthesis.

## Changed Paths

- `flash_attn/cute/benchmark_mask_mod.py`
- `flash_attn/cute/block_sparsity.py`
- `flash_attn/cute/flash_fwd.py`
- `flash_attn/cute/interface.py`
- `flash_attn/cute/mask.py`
- `flash_attn/cute/mask_definitions.py`
- `tests/cute/test_flash_attn.py`
- `tests/cute/test_mask_mod.py`

## Evidence Bundle

`evidence/pull-bundles/flash-attention/gh-1942`
