---
id: pr-flash-attention-2421
repo: Dao-AILab/flash-attention
pr: 2421
title: '[AMD ROCm] Fix NaN in FMHA BWD when seq_q=0'
author: rocking5566
date: '2026-04-01'
url: https://github.com/Dao-AILab/flash-attention/pull/2421
source_category: upstream-code
architectures:
- sm100
tags:
- attention
- attention kernel
- fmha
techniques: []
hardware_features: []
kernel_types:
- attention
languages:
- cuda-cpp
captured_at: '2026-05-16'
status: merged
merge_sha: b46c5875374de6ace968c775c6d319398ac5ab02
inclusion_reason: Search-matched CUDA kernel optimization PR; materialize diff/source before synthesis.
changed_paths:
- csrc/composable_kernel
- tests/test_flash_attn_ck.py
artifact_dir: evidence/pull-bundles/flash-attention/gh-2421
head_ref_oid: 8f4a3990fe54dbfafb5a9efc37434bca9f84cc7c
---
# [AMD ROCm] Fix NaN in FMHA BWD when seq_q=0

- Repository: `Dao-AILab/flash-attention`
- PR: [2421](https://github.com/Dao-AILab/flash-attention/pull/2421)
- 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

- `csrc/composable_kernel`
- `tests/test_flash_attn_ck.py`

## Evidence Bundle

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