---
id: pr-flash-attention-2515
repo: Dao-AILab/flash-attention
pr: 2515
title: Fix ZeroDivisionError in num_splits_heuristic for empty Q workloads
author: shivam2199
date: '2026-05-13'
url: https://github.com/Dao-AILab/flash-attention/pull/2515
source_category: upstream-code
architectures:
- sm90
tags:
- FA3
- FA4
- attention_kv
- benchmark_test
- compiler_runtime
- cute
- hopper
- scheduler_autotune
- varlen
techniques:
- autotuning
- tile-scheduling
hardware_features:
- hopper
kernel_types:
- attention
- compiler
- scheduler
languages:
- cuda-cpp
- cute-dsl
captured_at: '2026-05-16'
status: merged
merge_sha: 484b9813f57814023387e91aab0364beaad096c8
inclusion_reason: Treat scheduler/autotune configs as shape-specific evidence; replay benchmark shapes before generalizing.
changed_paths:
- flash_attn/cute/interface.py
- tests/cute/test_flash_attn.py
artifact_dir: evidence/pull-bundles/flash-attention/gh-2515
head_ref_oid: 2f08a17771f6f9c81f51fae9114a81ae7fc061ef
---
# Fix ZeroDivisionError in num_splits_heuristic for empty Q workloads

- Repository: `Dao-AILab/flash-attention`
- PR: [2515](https://github.com/Dao-AILab/flash-attention/pull/2515)
- Decision: `Treat scheduler/autotune configs as shape-specific evidence; replay benchmark shapes before generalizing.`
- Reason: Treat scheduler/autotune configs as shape-specific evidence; replay benchmark shapes before generalizing.

## Changed Paths

- `flash_attn/cute/interface.py`
- `tests/cute/test_flash_attn.py`

## Evidence Bundle

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