Skip to content

Conversation

@linqun
Copy link
Contributor

@linqun linqun commented Jan 11, 2026

Proposed changes

  1. Add base class GridwiseGemm_xdl_cshuffle_base for all gridwise_gemm_xdl classes.
    • to select correct LDS layout and epilogue behavior , three additional parameters is added.
    • ForceNaiveLdsLayout: disable XOR based LDS layout when it is true
    • DirectLoad: pipeline only use directload, we need force naive layout and ignore any padding on gfx9
    • IsMxGemm: epilogue has two addtional dimensions
  2. Move all LDS descriptor layout related fucntion to base class, including
    • GetABlockDescriptor_AK0PerBlock_MPerBlock_AK1
    • GetBBlockDescriptor_BK0PerBlock_NPerBlock_BK1
    • GetCShuffleBlockDescriptor_MBlock_MPerBlock_NBlock_NPerBlock
  3. Move several LDS related helper funtions to base class, including
    • GetSharedMemoryNumberOfByte
    • GetABlockDescriptor_AKB_AK0PerBlock_MPerBlock_AK1
    • GetBBlockDescriptor_BKB_BK0PerBlock_NPerBlock_BK1
    • GetCBlockDescriptor_MBlock_NXdlPerWave_MWaveMPerXdl_NBlock_NXdlPerWave_NWaveNPerXdl
  4. Move all c epilogue related code to base class, and 4 kind of implementation are provided
    • RunEpilogueNoShuffle
    • RunEpilogue
    • RunMultiDEpilogue
    • RunMoeEpilogue

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

It is port from internal repo PR#186, the major purpose it is to reduce duplicated code.

@linqun linqun force-pushed the qlin/gridwise_common branch from 4ca94c7 to 66dda6c Compare January 11, 2026 02:33
1. Add base class GridwiseGemm_xdl_cshuffle_base for all gridwise_gemm_xdl classes.
- to select correct LDS layout and epilogue behavior , three additional parameters is added.
- ForceNaiveLdsLayout: disable XOR based LDS layout when it is true
- DirectLoad: pipeline only use directload, we need force naive layout and ignore any padding on gfx9
- IsMxGemm: epilogue has two addtional dimensions
2. Move all LDS descriptor layout related fucntion to base class, including
- GetABlockDescriptor_AK0PerBlock_MPerBlock_AK1
- GetBBlockDescriptor_BK0PerBlock_NPerBlock_BK1
- GetCShuffleBlockDescriptor_MBlock_MPerBlock_NBlock_NPerBlock
3. Move several LDS related helper funtions to base class, including
- GetSharedMemoryNumberOfByte
- GetABlockDescriptor_AKB_AK0PerBlock_MPerBlock_AK1
- GetBBlockDescriptor_BKB_BK0PerBlock_NPerBlock_BK1
- GetCBlockDescriptor_MBlock_NXdlPerWave_MWaveMPerXdl_NBlock_NXdlPerWave_NWaveNPerXdl
4. Move all c epilogue related code to base class, and 4 kind of implementation are provided
- RunEpilogueNoShuffle
- RunEpilogue
- RunMultiDEpilogue
- RunMoeEpilogue
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