Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding support for scheduling the epilogue computation when smem_epilogue parameter is true #3581

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

protonu
Copy link
Collaborator

@protonu protonu commented Dec 12, 2024

Refactoring some code and adding some support for smem_epilogue

Copy link
Collaborator

@rdspring1 rdspring1 left a comment

Choose a reason for hiding this comment

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

Here is my transformation helper. It can be used in scheduleMmaResult. Just trying to avoid some merge conflicts.

void HopperMultipleMatmulScheduler::transformLikeMmaOutput(
    TensorView* tv,
    bool is_mma_result) {
  // TODO Add constraints

  auto apply_k_dim_offset = [is_mma_result](int64_t idx) constexpr {
    return (is_mma_result) ? idx - 1 : idx;
  };

  // Original: [..., Mo, No, Mi, Ni]
  tv->split(apply_k_dim_offset(-2), getM(params_->mma_macro));
  tv->split(apply_k_dim_offset(-1), getN(params_->mma_macro));
  // After Split: [..., Mo, No, Mio, Mii, Nio, Nii]
  tv->reorder({{apply_k_dim_offset(-3), apply_k_dim_offset(-2)}});
  // After Reorder: [..., Mo, No, Mio, Nio, Mii, Nii]
  tv->merge(apply_k_dim_offset(-4));
  // After Merge: [..., Mo, No, Mio * Nio, Mii, Nii]
  tv->axis(apply_k_dim_offset(-3))->parallelize(ParallelType::TIDy);
  // After Parallelize: [..., Mo, No, Mio * Nio (TIDy), Mii, Nii]
}

@protonu protonu force-pushed the pbasu_mma_epilogue_hopper_no_smem_epilogue branch from 94f39a1 to be5f18b Compare December 13, 2024 18:41
@protonu protonu force-pushed the pbasu_mma_epilogue_hopper_smem_epilogue branch from b9df449 to aa86b8b Compare December 13, 2024 20:59
@protonu protonu requested a review from rdspring1 December 13, 2024 20:59
@protonu protonu marked this pull request as ready for review December 13, 2024 21:00
@protonu
Copy link
Collaborator Author

protonu commented Dec 13, 2024

!build

@protonu protonu force-pushed the pbasu_mma_epilogue_hopper_no_smem_epilogue branch from 895df0f to 09cb407 Compare December 14, 2024 01:42
@protonu protonu force-pushed the pbasu_mma_epilogue_hopper_smem_epilogue branch from aa86b8b to c0cfa4e Compare December 14, 2024 03:54
@protonu protonu force-pushed the pbasu_mma_epilogue_hopper_smem_epilogue branch from c0cfa4e to af126a1 Compare December 14, 2024 03:55
Base automatically changed from pbasu_mma_epilogue_hopper_no_smem_epilogue to main December 14, 2024 14:46
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