Skip to content

mha api refactor - #1573

Merged
slippedJim merged 34 commits into
mainfrom
jim/dev/mha_refactor
Dec 16, 2025
Merged

slippedJim merged 34 commits into
mainfrom
jim/dev/mha_refactor

Conversation

@slippedJim

@slippedJim slippedJim commented Dec 5, 2025

Copy link
Copy Markdown
Contributor

Motivation

Technical Details

Upload ASM pre/post processing kernels
Use unified params on all bwd kernels
Refine ASM kernel API

Test Plan

Test Result

Passed smoke test on gfx942 & gfx950
Passed python test on gfx942 & gfx950

Submission Checklist

Copilot AI review requested due to automatic review settings December 5, 2025 10:13
@slippedJim
slippedJim marked this pull request as draft December 5, 2025 10:14

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR refactors the Multi-Head Attention (MHA) backward pass API, consolidating arguments into a unified structure and simplifying the kernel selection and invocation process.

Key Changes

  • Unified MHA backward arguments into a single mha_bwd_args structure that encapsulates stream configuration, data types, and all tensor pointers
  • Introduced new CSV-based kernel configuration files for ASM kernel selection (odo, dqdkdv, dq_convert)
  • Added new C++ implementation for v3 backward pass with heuristic kernel selection

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
op_tests/cpp/mha/compile.py Updated code generation commands for backward pass compilation
op_tests/cpp/mha/benchmark_mha_bwd.cpp Simplified mha_bwd function call with new unified args structure
hsa/gfx942/fmha_v3_fwd/toy_format.hpp Added custom string formatting utility for kernel name generation
hsa/gfx942/fmha_v3_fwd/fmha_v3_fwd.cpp Added forward pass kernel selector with file/kernel name generation
hsa/gfx942/fmha_v3_fwd/aiter_hip_common.h Added common HIP utilities and ASM kernel wrapper classes
hsa/gfx942/fmha_v3_bwd/*.csv Added kernel configuration tables for backward pass kernels
csrc/include/mha_bwd.h Refactored API with new args structure and detailed documentation
csrc/cpp_itfs/fmha_v3_bwd.cpp Implemented new backward pass with heuristic kernel selection logic
aiter/jit/optCompilerConfig.json Updated libmha_bwd configuration to include new source file

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread op_tests/cpp/mha/benchmark_mha_bwd.cpp Outdated
Comment thread hsa/gfx942/fmha_v3_fwd/fmha_v3_fwd.cpp Outdated
Comment thread csrc/cpp_itfs/mha_bwd.cpp
Comment thread csrc/cpp_itfs/fmha_v3_bwd.cpp Outdated
Comment thread csrc/cpp_itfs/fmha_v3_bwd.cpp Outdated
Comment thread csrc/cpp_itfs/fmha_v3_bwd.cpp Outdated
Comment thread csrc/cpp_itfs/fmha_v3_bwd.cpp Outdated
Comment thread csrc/cpp_itfs/fmha_v3_bwd.cpp Outdated
@slippedJim
slippedJim requested a review from Copilot December 10, 2025 09:57

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 19 out of 63 changed files in this pull request and generated 7 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread op_tests/cpp/mha/benchmark_mha_bwd.cpp
Comment thread csrc/py_itfs_cu/asm_mha_bwd.cu
Comment thread csrc/py_itfs_ck/mha_bwd_kernels.cu
Comment thread csrc/cpp_itfs/mha_bwd.cpp
Comment thread csrc/cpp_itfs/fmha_bwd.cpp Outdated
Comment thread csrc/cpp_itfs/fmha_v3_bwd.cpp Outdated
Comment thread csrc/cpp_itfs/fmha_v3_bwd.cpp Outdated
@slippedJim
slippedJim marked this pull request as ready for review December 12, 2025 05:25
@slippedJim
slippedJim requested a review from a team December 12, 2025 05:25
@valarLip valarLip self-assigned this Dec 16, 2025
@slippedJim
slippedJim merged commit d0c313d into main Dec 16, 2025
22 checks passed
@slippedJim
slippedJim deleted the jim/dev/mha_refactor branch December 16, 2025 14:10
zhuyuhua-v pushed a commit that referenced this pull request Dec 17, 2025
* update bwd api

* finish gfx942: need update dqdkdv kernel

* update gfx950 csv

* Apply suggestion from @Copilot

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* remove expired files

* update co file

* update recompiled kernels && fix recompile kernel dispatch

* fix compile config

* update gfx942 pre-post kernel

* fix asm varlen dkv reduction

* remove log

* fix swa on gfx942

* format file

* remove not used files

* add early quit condition for fmha_v3_bwd

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: jingchao <jichen@amd.com>
ZhangLirong-amd pushed a commit that referenced this pull request Dec 29, 2025
* update bwd api

* finish gfx942: need update dqdkdv kernel

* update gfx950 csv

* Apply suggestion from @Copilot

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* remove expired files

* update co file

* update recompiled kernels && fix recompile kernel dispatch

* fix compile config

* update gfx942 pre-post kernel

* fix asm varlen dkv reduction

* remove log

* fix swa on gfx942

* format file

* remove not used files

* add early quit condition for fmha_v3_bwd

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: jingchao <jichen@amd.com>
yuguo68 added a commit to yuguo68/pytorch that referenced this pull request Jan 27, 2026
Summary:
Pull Request resolved: pytorch#172592

update ck to commit ROCm/composable_kernel@292df27
update aiter to commit https://github.com/ROCm/aiter/commits/d3a4a0f1f5c83ee104a612e02447d03b0e38a45b/

changes of caffe2/aten/src/ATen/CMakeLists.txt and caffe2/caffe2/CMakeLists.txt are adopted from pytorch#161759

updated caffe2/aten/src/ATen/native/transformers/hip/flash_attn/ck/launch_kernel_pt.hpp to match the ck version in https://github.com/ROCm/composable_kernel/blob/292df2719f28cd01464d5d059820684790c101da/include/ck_tile/host/kernel_launch.hpp

update aiter fav3 bwd codegen according to changes in ROCm/aiter#1573

update caffe2/aten/src/ATen/native/transformers/hip/flash_attn/ck mha fwd/bwd kernels according to the interfaces in https://github.com/ROCm/composable_kernel/tree/292df2719f28cd01464d5d059820684790c101da/example/ck_tile/01_fmha

Differential Revision: D88991877
yuguo68 added a commit to yuguo68/pytorch that referenced this pull request Jan 27, 2026
Summary:
Pull Request resolved: pytorch#172592

update ck to commit ROCm/composable_kernel@292df27
update aiter to commit https://github.com/ROCm/aiter/commits/d3a4a0f1f5c83ee104a612e02447d03b0e38a45b/

changes of caffe2/aten/src/ATen/CMakeLists.txt and caffe2/caffe2/CMakeLists.txt are adopted from pytorch#161759

updated caffe2/aten/src/ATen/native/transformers/hip/flash_attn/ck/launch_kernel_pt.hpp to match the ck version in https://github.com/ROCm/composable_kernel/blob/292df2719f28cd01464d5d059820684790c101da/include/ck_tile/host/kernel_launch.hpp

update aiter fav3 bwd codegen according to changes in ROCm/aiter#1573

update caffe2/aten/src/ATen/native/transformers/hip/flash_attn/ck mha fwd/bwd kernels according to the interfaces in https://github.com/ROCm/composable_kernel/tree/292df2719f28cd01464d5d059820684790c101da/example/ck_tile/01_fmha

Differential Revision: D88991877
yuguo68 added a commit to yuguo68/pytorch that referenced this pull request Jan 27, 2026
Summary:
Pull Request resolved: pytorch#172592

update ck to commit ROCm/composable_kernel@292df27
update aiter to commit https://github.com/ROCm/aiter/commits/d3a4a0f1f5c83ee104a612e02447d03b0e38a45b/

changes of caffe2/aten/src/ATen/CMakeLists.txt and caffe2/caffe2/CMakeLists.txt are adopted from pytorch#161759

updated caffe2/aten/src/ATen/native/transformers/hip/flash_attn/ck/launch_kernel_pt.hpp to match the ck version in https://github.com/ROCm/composable_kernel/blob/292df2719f28cd01464d5d059820684790c101da/include/ck_tile/host/kernel_launch.hpp

update aiter fav3 bwd codegen according to changes in ROCm/aiter#1573

update caffe2/aten/src/ATen/native/transformers/hip/flash_attn/ck mha fwd/bwd kernels according to the interfaces in https://github.com/ROCm/composable_kernel/tree/292df2719f28cd01464d5d059820684790c101da/example/ck_tile/01_fmha

Differential Revision: D88991877
pytorch-bot Bot pushed a commit to pytorch/pytorch that referenced this pull request Feb 2, 2026
Summary:
Pull Request resolved: #172592

update ck to commit ROCm/composable_kernel@292df27
update aiter to commit https://github.com/ROCm/aiter/commits/d3a4a0f1f5c83ee104a612e02447d03b0e38a45b/

changes of caffe2/aten/src/ATen/CMakeLists.txt and caffe2/caffe2/CMakeLists.txt are adopted from #161759

updated caffe2/aten/src/ATen/native/transformers/hip/flash_attn/ck/launch_kernel_pt.hpp to match the ck version in https://github.com/ROCm/composable_kernel/blob/292df2719f28cd01464d5d059820684790c101da/include/ck_tile/host/kernel_launch.hpp

update aiter fav3 bwd codegen according to changes in ROCm/aiter#1573

update caffe2/aten/src/ATen/native/transformers/hip/flash_attn/ck mha fwd/bwd kernels according to the interfaces in https://github.com/ROCm/composable_kernel/tree/292df2719f28cd01464d5d059820684790c101da/example/ck_tile/01_fmha

Reviewed By: iseeyuan

Differential Revision: D88991877
yuguo68 added a commit to yuguo68/pytorch that referenced this pull request Feb 2, 2026
Summary:
Pull Request resolved: pytorch#172592

update ck to commit ROCm/composable_kernel@292df27
update aiter to commit https://github.com/ROCm/aiter/commits/d3a4a0f1f5c83ee104a612e02447d03b0e38a45b/

changes of caffe2/aten/src/ATen/CMakeLists.txt and caffe2/caffe2/CMakeLists.txt are adopted from pytorch#161759

updated caffe2/aten/src/ATen/native/transformers/hip/flash_attn/ck/launch_kernel_pt.hpp to match the ck version in https://github.com/ROCm/composable_kernel/blob/292df2719f28cd01464d5d059820684790c101da/include/ck_tile/host/kernel_launch.hpp

update aiter fav3 bwd codegen according to changes in ROCm/aiter#1573

update caffe2/aten/src/ATen/native/transformers/hip/flash_attn/ck mha fwd/bwd kernels according to the interfaces in https://github.com/ROCm/composable_kernel/tree/292df2719f28cd01464d5d059820684790c101da/example/ck_tile/01_fmha

Reviewed By: iseeyuan

Differential Revision: D88991877
isuruf pushed a commit to isuruf/pytorch that referenced this pull request Feb 3, 2026
Summary:
update ck to commit ROCm/composable_kernel@fcc9372

update aiter to commit ROCm/aiter@9a469a6

changes of caffe2/aten/src/ATen/CMakeLists.txt and caffe2/caffe2/CMakeLists.txt are adopted from pytorch#161759

updated caffe2/aten/src/ATen/native/transformers/hip/flash_attn/ck/launch_kernel_pt.hpp to match the ck version in https://github.com/ROCm/composable_kernel/blob/292df2719f28cd01464d5d059820684790c101da/include/ck_tile/host/kernel_launch.hpp

update aiter fav3 bwd codegen according to changes in ROCm/aiter#1573

update caffe2/aten/src/ATen/native/transformers/hip/flash_attn/ck mha fwd/bwd kernels according to the interfaces in https://github.com/ROCm/composable_kernel/tree/292df2719f28cd01464d5d059820684790c101da/example/ck_tile/01_fmha

Differential Revision: D88991877

Pull Request resolved: pytorch#172592
Approved by: https://github.com/alugorey, https://github.com/izaitsevfb
radeksm pushed a commit to radeksm/pytorch that referenced this pull request Feb 20, 2026
Summary:
update ck to commit ROCm/composable_kernel@fcc9372

update aiter to commit ROCm/aiter@9a469a6

changes of caffe2/aten/src/ATen/CMakeLists.txt and caffe2/caffe2/CMakeLists.txt are adopted from pytorch#161759

updated caffe2/aten/src/ATen/native/transformers/hip/flash_attn/ck/launch_kernel_pt.hpp to match the ck version in https://github.com/ROCm/composable_kernel/blob/292df2719f28cd01464d5d059820684790c101da/include/ck_tile/host/kernel_launch.hpp

update aiter fav3 bwd codegen according to changes in ROCm/aiter#1573

update caffe2/aten/src/ATen/native/transformers/hip/flash_attn/ck mha fwd/bwd kernels according to the interfaces in https://github.com/ROCm/composable_kernel/tree/292df2719f28cd01464d5d059820684790c101da/example/ck_tile/01_fmha

Differential Revision: D88991877

Pull Request resolved: pytorch#172592
Approved by: https://github.com/alugorey, https://github.com/izaitsevfb
libohao1201 pushed a commit to libohao1201/pytorch that referenced this pull request Mar 2, 2026
Summary:
update ck to commit ROCm/composable_kernel@fcc9372

update aiter to commit ROCm/aiter@9a469a6

changes of caffe2/aten/src/ATen/CMakeLists.txt and caffe2/caffe2/CMakeLists.txt are adopted from pytorch#161759

updated caffe2/aten/src/ATen/native/transformers/hip/flash_attn/ck/launch_kernel_pt.hpp to match the ck version in https://github.com/ROCm/composable_kernel/blob/292df2719f28cd01464d5d059820684790c101da/include/ck_tile/host/kernel_launch.hpp

update aiter fav3 bwd codegen according to changes in ROCm/aiter#1573

update caffe2/aten/src/ATen/native/transformers/hip/flash_attn/ck mha fwd/bwd kernels according to the interfaces in https://github.com/ROCm/composable_kernel/tree/292df2719f28cd01464d5d059820684790c101da/example/ck_tile/01_fmha

Differential Revision: D88991877

Pull Request resolved: pytorch#172592
Approved by: https://github.com/alugorey, https://github.com/izaitsevfb
valarLip pushed a commit that referenced this pull request Mar 18, 2026
* update bwd api

* finish gfx942: need update dqdkdv kernel

* update gfx950 csv

* Apply suggestion from @Copilot

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* remove expired files

* update co file

* update recompiled kernels && fix recompile kernel dispatch

* fix compile config

* update gfx942 pre-post kernel

* fix asm varlen dkv reduction

* remove log

* fix swa on gfx942

* format file

* remove not used files

* add early quit condition for fmha_v3_bwd

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: jingchao <jichen@amd.com>
pragupta pushed a commit to ROCm/pytorch that referenced this pull request Jun 17, 2026
* CK - gfx1250 support (#5)

* Enable ROCM_CK_SDPA build

* [submodule] composable_kernel and aiter update (pytorch#172592)

Summary:
update ck to commit ROCm/composable_kernel@fcc9372

update aiter to commit ROCm/aiter@9a469a6

changes of caffe2/aten/src/ATen/CMakeLists.txt and caffe2/caffe2/CMakeLists.txt are adopted from pytorch#161759

updated caffe2/aten/src/ATen/native/transformers/hip/flash_attn/ck/launch_kernel_pt.hpp to match the ck version in https://github.com/ROCm/composable_kernel/blob/292df2719f28cd01464d5d059820684790c101da/include/ck_tile/host/kernel_launch.hpp

update aiter fav3 bwd codegen according to changes in ROCm/aiter#1573

update caffe2/aten/src/ATen/native/transformers/hip/flash_attn/ck mha fwd/bwd kernels according to the interfaces in https://github.com/ROCm/composable_kernel/tree/292df2719f28cd01464d5d059820684790c101da/example/ck_tile/01_fmha

Differential Revision: D88991877

Pull Request resolved: pytorch#172592
Approved by: https://github.com/alugorey, https://github.com/izaitsevfb

* Added MI450 supports and packages

* Fix misalinged ck api

* Replace aiter with ck for bwd

* [ROCm] Bump AOTriton to 0.11.2b (pytorch#174105)

Notable new features:

* AOTriton 0.11.2b adds gfx1151/1152/1153 support.
* Add precompiled AOTriton runtime for ROCM 7.2
* Match the sliding window attention behavior of `_flash_attention_forward/backward` with CUTLASS backend.

Bug fixes:

* Fixes pytorch#173204. Now all tests in `test/test_varlen_attention.py` are enabled on ROCm

Notes:

This replaces PR pytorch#173820 and pytorch#173469

Pull Request resolved: pytorch#174105
Approved by: https://github.com/jeffdaily

* Fix philox data types for this version of ck

* Update CK to use new gfx1250_pytorch branch

* Add new gfx1250 compile flags for CK

* add --targets to generate and a couple new compile flags

* Remove default USE_ROCM_CK_SDPA

---------

Co-authored-by: blorange-amd <bo.li2@amd.com>
Co-authored-by: Yu Guo <yuguo@meta.com>
Co-authored-by: Xinya Zhang <Xinya.Zhang@amd.com>

* Updated aiter module

* Fixed merged error

* Fixed additional merged error

* Reset USE_ROCM_CK_SDPA config

---------

Co-authored-by: LugoReyes, Andy <Andy.LugoReyes@amd.com>
Co-authored-by: Yu Guo <yuguo@meta.com>
Co-authored-by: Xinya Zhang <Xinya.Zhang@amd.com>
pragupta pushed a commit to ROCm/pytorch that referenced this pull request Jun 19, 2026
* CK - gfx1250 support (#5)

* Enable ROCM_CK_SDPA build

* [submodule] composable_kernel and aiter update (pytorch#172592)

Summary:
update ck to commit ROCm/composable_kernel@fcc9372

update aiter to commit ROCm/aiter@9a469a6

changes of caffe2/aten/src/ATen/CMakeLists.txt and caffe2/caffe2/CMakeLists.txt are adopted from pytorch#161759

updated caffe2/aten/src/ATen/native/transformers/hip/flash_attn/ck/launch_kernel_pt.hpp to match the ck version in https://github.com/ROCm/composable_kernel/blob/292df2719f28cd01464d5d059820684790c101da/include/ck_tile/host/kernel_launch.hpp

update aiter fav3 bwd codegen according to changes in ROCm/aiter#1573

update caffe2/aten/src/ATen/native/transformers/hip/flash_attn/ck mha fwd/bwd kernels according to the interfaces in https://github.com/ROCm/composable_kernel/tree/292df2719f28cd01464d5d059820684790c101da/example/ck_tile/01_fmha

Differential Revision: D88991877

Pull Request resolved: pytorch#172592
Approved by: https://github.com/alugorey, https://github.com/izaitsevfb

* Added MI450 supports and packages

* Fix misalinged ck api

* Replace aiter with ck for bwd

* [ROCm] Bump AOTriton to 0.11.2b (pytorch#174105)

Notable new features:

* AOTriton 0.11.2b adds gfx1151/1152/1153 support.
* Add precompiled AOTriton runtime for ROCM 7.2
* Match the sliding window attention behavior of `_flash_attention_forward/backward` with CUTLASS backend.

Bug fixes:

* Fixes pytorch#173204. Now all tests in `test/test_varlen_attention.py` are enabled on ROCm

Notes:

This replaces PR pytorch#173820 and pytorch#173469

Pull Request resolved: pytorch#174105
Approved by: https://github.com/jeffdaily

* Fix philox data types for this version of ck

* Update CK to use new gfx1250_pytorch branch

* Add new gfx1250 compile flags for CK

* add --targets to generate and a couple new compile flags

* Remove default USE_ROCM_CK_SDPA

---------

Co-authored-by: blorange-amd <bo.li2@amd.com>
Co-authored-by: Yu Guo <yuguo@meta.com>
Co-authored-by: Xinya Zhang <Xinya.Zhang@amd.com>

* Updated aiter module

* Fixed merged error

* Fixed additional merged error

* Reset USE_ROCM_CK_SDPA config

---------

Co-authored-by: LugoReyes, Andy <Andy.LugoReyes@amd.com>
Co-authored-by: Yu Guo <yuguo@meta.com>
Co-authored-by: Xinya Zhang <Xinya.Zhang@amd.com>
pragupta pushed a commit to ROCm/pytorch that referenced this pull request Jun 19, 2026
* CK - gfx1250 support (#5)

* Enable ROCM_CK_SDPA build

* [submodule] composable_kernel and aiter update (pytorch#172592)

Summary:
update ck to commit ROCm/composable_kernel@fcc9372

update aiter to commit ROCm/aiter@9a469a6

changes of caffe2/aten/src/ATen/CMakeLists.txt and caffe2/caffe2/CMakeLists.txt are adopted from pytorch#161759

updated caffe2/aten/src/ATen/native/transformers/hip/flash_attn/ck/launch_kernel_pt.hpp to match the ck version in https://github.com/ROCm/composable_kernel/blob/292df2719f28cd01464d5d059820684790c101da/include/ck_tile/host/kernel_launch.hpp

update aiter fav3 bwd codegen according to changes in ROCm/aiter#1573

update caffe2/aten/src/ATen/native/transformers/hip/flash_attn/ck mha fwd/bwd kernels according to the interfaces in https://github.com/ROCm/composable_kernel/tree/292df2719f28cd01464d5d059820684790c101da/example/ck_tile/01_fmha

Differential Revision: D88991877

Pull Request resolved: pytorch#172592
Approved by: https://github.com/alugorey, https://github.com/izaitsevfb

* Added MI450 supports and packages

* Fix misalinged ck api

* Replace aiter with ck for bwd

* [ROCm] Bump AOTriton to 0.11.2b (pytorch#174105)

Notable new features:

* AOTriton 0.11.2b adds gfx1151/1152/1153 support.
* Add precompiled AOTriton runtime for ROCM 7.2
* Match the sliding window attention behavior of `_flash_attention_forward/backward` with CUTLASS backend.

Bug fixes:

* Fixes pytorch#173204. Now all tests in `test/test_varlen_attention.py` are enabled on ROCm

Notes:

This replaces PR pytorch#173820 and pytorch#173469

Pull Request resolved: pytorch#174105
Approved by: https://github.com/jeffdaily

* Fix philox data types for this version of ck

* Update CK to use new gfx1250_pytorch branch

* Add new gfx1250 compile flags for CK

* add --targets to generate and a couple new compile flags

* Remove default USE_ROCM_CK_SDPA

---------

Co-authored-by: blorange-amd <bo.li2@amd.com>
Co-authored-by: Yu Guo <yuguo@meta.com>
Co-authored-by: Xinya Zhang <Xinya.Zhang@amd.com>

* Updated aiter module

* Fixed merged error

* Fixed additional merged error

* Reset USE_ROCM_CK_SDPA config

---------

Co-authored-by: LugoReyes, Andy <Andy.LugoReyes@amd.com>
Co-authored-by: Yu Guo <yuguo@meta.com>
Co-authored-by: Xinya Zhang <Xinya.Zhang@amd.com>
pragupta pushed a commit to ROCm/pytorch that referenced this pull request Jun 23, 2026
* CK - gfx1250 support (#5)

* Enable ROCM_CK_SDPA build

* [submodule] composable_kernel and aiter update (pytorch#172592)

Summary:
update ck to commit ROCm/composable_kernel@fcc9372

update aiter to commit ROCm/aiter@9a469a6

changes of caffe2/aten/src/ATen/CMakeLists.txt and caffe2/caffe2/CMakeLists.txt are adopted from pytorch#161759

updated caffe2/aten/src/ATen/native/transformers/hip/flash_attn/ck/launch_kernel_pt.hpp to match the ck version in https://github.com/ROCm/composable_kernel/blob/292df2719f28cd01464d5d059820684790c101da/include/ck_tile/host/kernel_launch.hpp

update aiter fav3 bwd codegen according to changes in ROCm/aiter#1573

update caffe2/aten/src/ATen/native/transformers/hip/flash_attn/ck mha fwd/bwd kernels according to the interfaces in https://github.com/ROCm/composable_kernel/tree/292df2719f28cd01464d5d059820684790c101da/example/ck_tile/01_fmha

Differential Revision: D88991877

Pull Request resolved: pytorch#172592
Approved by: https://github.com/alugorey, https://github.com/izaitsevfb

* Added MI450 supports and packages

* Fix misalinged ck api

* Replace aiter with ck for bwd

* [ROCm] Bump AOTriton to 0.11.2b (pytorch#174105)

Notable new features:

* AOTriton 0.11.2b adds gfx1151/1152/1153 support.
* Add precompiled AOTriton runtime for ROCM 7.2
* Match the sliding window attention behavior of `_flash_attention_forward/backward` with CUTLASS backend.

Bug fixes:

* Fixes pytorch#173204. Now all tests in `test/test_varlen_attention.py` are enabled on ROCm

Notes:

This replaces PR pytorch#173820 and pytorch#173469

Pull Request resolved: pytorch#174105
Approved by: https://github.com/jeffdaily

* Fix philox data types for this version of ck

* Update CK to use new gfx1250_pytorch branch

* Add new gfx1250 compile flags for CK

* add --targets to generate and a couple new compile flags

* Remove default USE_ROCM_CK_SDPA

---------

Co-authored-by: blorange-amd <bo.li2@amd.com>
Co-authored-by: Yu Guo <yuguo@meta.com>
Co-authored-by: Xinya Zhang <Xinya.Zhang@amd.com>

* Updated aiter module

* Fixed merged error

* Fixed additional merged error

* Reset USE_ROCM_CK_SDPA config

---------

Co-authored-by: LugoReyes, Andy <Andy.LugoReyes@amd.com>
Co-authored-by: Yu Guo <yuguo@meta.com>
Co-authored-by: Xinya Zhang <Xinya.Zhang@amd.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants