Skip to content

Conversation

@LJ-underdog
Copy link
Contributor

@LJ-underdog LJ-underdog commented Jan 16, 2026

Proposed changes

This PR adds a new tile size configuration for async pipeline operations in the FMHA (Fused Multi-Head Attention) forward pass implementation. The changes introduce support for a 64x128 tile configuration for specific head dimension scenarios and adjust the sequence tuning logic to accommodate this new tile size.
Changes:

Modified sequence tuning logic to include tile size 64 as a special case alongside the maximum tile size
Added filtering logic to exclude 64-size tiles for non-async pipelines with 128x128 head dimensions
Introduced a new 64x128x32 tile size configuration with compute unit constraint for 128x128 head dimensions

Checklist

Please put an x into the boxes that apply. You can also fill these out after creating the PR. If you're not sure, please don't hesitate to ask.

  • I have added tests relevant to the introduced functionality, and the unit tests are passing locally
  • I have added the test to REGRESSION_TESTS list defined at the top of CMakeLists.txt in tests/CMakeLists.txt, IF the test takes more than 30 seconds to run.
  • I have added inline documentation which enables the maintainers with understanding the motivation
  • I have removed the stale documentation which is no longer relevant after this pull request
  • (If this change is user-facing) I have added release notes which provide the end users with a brief summary of the improvement from this pull request
  • I have run clang-format on all changed files
  • Any dependent changes have been merged

Discussion

If this is a relatively large or complex change, feel free to start a discussion by explaining why you chose the solution you did and what alternatives you considered

@LJ-underdog
Copy link
Contributor Author

LJ-underdog commented Jan 16, 2026

Performance` improve 30% on gfx950 when block_num <= cu_num

`./bin/tile_example_fmha_fwd -h=8 -d=128 -s=512 -kname=1 -v=1
[fp16|batch|bhsd] b:2, h:8/8, s:512/512, d:128/128, scale_s:0.0883883, bias:n, p_drop:0, lse:0, qscale:n, mask:n, v:r, fmha_fwd_d128_fp16_batch_b128x64x32x128x16x128_r4x1x1_r4x1x1_w32x32x16_w32x32x16_qr_async_trload_vr_npad_nlogits_nbias_nmask_nlse_ndropout_nskip_nqscale_trload_nsink, 0.020 ms, 109.11 TFlops, 426.21 GB/s, valid:y

./bin/tile_example_fmha_fwd -h=8 -d=128 -s=512 -kname=1 -v=1
[fp16|batch|bhsd] b:2, h:8/8, s:512/512, d:128/128, scale_s:0.0883883, bias:n, p_drop:0, lse:0, qscale:n, mask:n, v:r, fmha_fwd_d128_fp16_batch_b64x128x32x128x32x128_r4x1x1_r4x1x1_w16x16x32_w16x16x16_qr_async_vr_psddv_nlogits_nbias_nmask_nlse_ndropout_nskip_nqscale_ntrload_nsink, 0.015 ms, 143.74 TFlops, 561.49 GB/s, valid:y`

@LJ-underdog LJ-underdog requested a review from Copilot January 16, 2026 03:34
Copy link
Contributor

Copilot AI left a comment

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 adds a new tile size configuration for async pipeline operations in the FMHA (Fused Multi-Head Attention) forward pass implementation. The changes introduce support for a 64x128 tile configuration for specific head dimension scenarios and adjust the sequence tuning logic to accommodate this new tile size.

Changes:

  • Modified sequence tuning logic to include tile size 64 as a special case alongside the maximum tile size
  • Added filtering logic to exclude 64-size tiles for non-async pipelines with 128x128 head dimensions
  • Introduced a new 64x128x32 tile size configuration with compute unit constraint for 128x128 head dimensions

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

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.

2 participants