---
id: pr-flash-attention-2224
repo: Dao-AILab/flash-attention
pr: 2224
title: '[CuTe,Flex] varlen blocksparsity'
author: reubenconducts
date: '2026-05-07'
url: https://github.com/Dao-AILab/flash-attention/pull/2224
source_category: upstream-code
architectures:
- sm100
tags:
- cute
techniques: []
hardware_features: []
kernel_types:
- attention
languages:
- cute-dsl
captured_at: '2026-05-16'
status: merged
merge_sha: 25b451eca0c55313c76e04b9c35c39943ff0d8c1
inclusion_reason: Search-matched CUDA kernel optimization PR; materialize diff/source before synthesis.
changed_paths:
- flash_attn/cute/block_sparse_utils.py
- flash_attn/cute/block_sparsity.py
- flash_attn/cute/compute_block_sparsity.py
- flash_attn/cute/flash_fwd_sm100.py
- flash_attn/cute/flash_fwd_sm90.py
- flash_attn/cute/interface.py
- flash_attn/cute/seqlen_info.py
- tests/cute/benchmark_block_sparsity.py
- tests/cute/mask_mod_definitions.py
- tests/cute/test_block_sparsity.py
- tests/cute/test_mask_mod.py
- tests/cute/test_mask_mod_varlen.py
artifact_dir: evidence/pull-bundles/flash-attention/gh-2224
head_ref_oid: a8b8251e4705de223ea81e8d96506d9ff51080c8
---
# [CuTe,Flex] varlen blocksparsity

- Repository: `Dao-AILab/flash-attention`
- PR: [2224](https://github.com/Dao-AILab/flash-attention/pull/2224)
- 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/block_sparse_utils.py`
- `flash_attn/cute/block_sparsity.py`
- `flash_attn/cute/compute_block_sparsity.py`
- `flash_attn/cute/flash_fwd_sm100.py`
- `flash_attn/cute/flash_fwd_sm90.py`
- `flash_attn/cute/interface.py`
- `flash_attn/cute/seqlen_info.py`
- `tests/cute/benchmark_block_sparsity.py`
- `tests/cute/mask_mod_definitions.py`
- `tests/cute/test_block_sparsity.py`
- `tests/cute/test_mask_mod.py`
- `tests/cute/test_mask_mod_varlen.py`

## Evidence Bundle

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