---
id: pr-flash-attention-1182
repo: Dao-AILab/flash-attention
pr: 1182
title: Add seqused_q in fwd / bwd and seqused_k in bwd in hopper FA.
author: ipiszy
date: '2024-09-16'
url: https://github.com/Dao-AILab/flash-attention/pull/1182
source_category: upstream-code
architectures:
- sm90
tags:
- arch_pipeline
- attention_kv
- hopper
techniques:
- async-copy
- epilogue-fusion
- pipeline-stages
hardware_features:
- hopper
- tma
kernel_types:
- attention
- runtime
languages:
- cuda-cpp
captured_at: '2026-05-16'
status: merged
merge_sha: af314d400663fe895199b0586a9f1f718b1d7b79
inclusion_reason: 'Extract the architecture assumption first: SM target, TMA/WGMMA/tcgen path, cluster use, and pipeline stages.'
changed_paths:
- flash_attn/bert_padding.py
- flash_attn/flash_blocksparse_attention.py
- flash_attn/models/bert.py
- hopper/epilogue_bwd_sm90_tma.hpp
- hopper/flash.h
- hopper/flash_api.cpp
- hopper/flash_attn_interface.py
- hopper/flash_bwd_launch_template.h
- hopper/flash_bwd_postprocess_kernel.h
- hopper/flash_bwd_preprocess_kernel.h
- hopper/flash_fwd_launch_template.h
- hopper/mainloop_bwd_sm90_tma_gmma_ws.hpp
- hopper/test_flash_attn.py
- tests/test_flash_attn.py
- tests/test_rotary.py
- tests/test_util.py
artifact_dir: evidence/pull-bundles/flash-attention/gh-1182
head_ref_oid: 8cbc8a042f128efc0fae94e678762bdff789a43d
---
# Add seqused_q in fwd / bwd and seqused_k in bwd in hopper FA.

- Repository: `Dao-AILab/flash-attention`
- PR: [1182](https://github.com/Dao-AILab/flash-attention/pull/1182)
- Decision: `Extract the architecture assumption first: SM target, TMA/WGMMA/tcgen path, cluster use, and pipeline stages.`
- Reason: Extract the architecture assumption first: SM target, TMA/WGMMA/tcgen path, cluster use, and pipeline stages.

## Changed Paths

- `flash_attn/bert_padding.py`
- `flash_attn/flash_blocksparse_attention.py`
- `flash_attn/models/bert.py`
- `hopper/epilogue_bwd_sm90_tma.hpp`
- `hopper/flash.h`
- `hopper/flash_api.cpp`
- `hopper/flash_attn_interface.py`
- `hopper/flash_bwd_launch_template.h`
- `hopper/flash_bwd_postprocess_kernel.h`
- `hopper/flash_bwd_preprocess_kernel.h`
- `hopper/flash_fwd_launch_template.h`
- `hopper/mainloop_bwd_sm90_tma_gmma_ws.hpp`
- `hopper/test_flash_attn.py`
- `tests/test_flash_attn.py`
- `tests/test_rotary.py`
- `tests/test_util.py`

## Evidence Bundle

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