-
Notifications
You must be signed in to change notification settings - Fork 332
unify mma gemm #727
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
unify mma gemm #727
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| #pragma once | ||
|
|
||
| #include "gemm_mma.h" | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Verification agent 🧩 Analysis chainConfirm CUTLASS_DEVICE availability via gemm_mma.h If gemm_mma.h doesn’t include cutlass/cutlass.h (or otherwise define CUTLASS_DEVICE), these wrappers may fail to compile on some TU orders. Please verify. Run: 🏁 Script executed: #!/bin/bash
set -euo pipefail
# Locate gemm_mma.h and verify it (or its includes) define CUTLASS_DEVICE
fd -a gemm_mma.h
rg -n -C2 'CUTLASS_DEVICE' $(fd -a gemm_mma.h || true)
# As a fallback, ensure cutlass/cutlass.h is pulled somewhere above these wrappers
rg -n -C2 'include\s*<cutlass/cutlass\.h>' src || trueLength of output: 189 Let's drill into 🏁 Script executed: #!/bin/bash
set -euo pipefail
# Locate gemm_mma.h
file=$(fd -a gemm_mma.h)
echo "Inspecting includes in $file:"
rg -n '^#\s*include' "$file"
echo -e "\nSearching for CUTLASS_DEVICE definition in the repo:"
rg -n '#\s*define\s*CUTLASS_DEVICE' -C2 .
echo -e "\nSearching for any inclusion of cutlass/cutlass.h (quotes or brackets):"
rg -n 'include\s*[<"]cutlass/cutlass.h[>"]' -C2 .Length of output: 763 Ensure CUTLASS_DEVICE is defined in gemm_mma.h Please update #include <cutlass/cutlass.h> // for CUTLASS_DEVICEor by otherwise defining 🤖 Prompt for AI Agents |
||
|
|
||
| namespace tl { | ||
|
|
||
| template <int M, int N, int K, int num_warp_m, int num_warp_n, bool trans_A, | ||
| bool trans_B, bool clear_accum, int lda, int ldb, int offset_a, | ||
| int offset_b, typename A_type, typename B_type, typename C_type> | ||
| CUTLASS_DEVICE void gemm_ss(A_type *pA, B_type *pB, C_type *accum) { | ||
| using MMA = | ||
| cute::tl_mma::GemmTensorOp<M, N, K, num_warp_m, num_warp_n, trans_A, | ||
| trans_B, clear_accum, lda, ldb, offset_a, | ||
| offset_b, A_type, B_type, C_type>; | ||
| MMA::body(pA, pB, accum); | ||
| } | ||
|
|
||
| template <int M, int N, int K, int num_warp_m, int num_warp_n, bool trans_A, | ||
| bool trans_B, bool clear_accum, int lda, int ldb, int offset_a, | ||
| int offset_b, typename A_type, typename B_type, typename C_type> | ||
| CUTLASS_DEVICE void gemm_rs(A_type *pA, B_type *pB, C_type *accum) { | ||
| using MMA = | ||
| cute::tl_mma::GemmTensorOp<M, N, K, num_warp_m, num_warp_n, trans_A, | ||
| trans_B, clear_accum, lda, ldb, offset_a, | ||
| offset_b, A_type, B_type, C_type>; | ||
| MMA::body_rs(pA, pB, accum); | ||
| } | ||
|
|
||
| template <int M, int N, int K, int num_warp_m, int num_warp_n, bool trans_A, | ||
| bool trans_B, bool clear_accum, int lda, int ldb, int offset_a, | ||
| int offset_b, typename A_type, typename B_type, typename C_type> | ||
| CUTLASS_DEVICE void gemm_sr(A_type *pA, B_type *pB, C_type *accum) { | ||
| using MMA = | ||
| cute::tl_mma::GemmTensorOp<M, N, K, num_warp_m, num_warp_n, trans_A, | ||
| trans_B, clear_accum, lda, ldb, offset_a, | ||
| offset_b, A_type, B_type, C_type>; | ||
| MMA::body_sr(pA, pB, accum); | ||
| } | ||
|
|
||
| } // namespace tl | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,40 @@ | ||
| #pragma once | ||
|
|
||
| #include "gemm_mma.h" | ||
|
|
||
| namespace tl { | ||
|
|
||
| template <int M, int N, int K, int num_warp_m, int num_warp_n, bool trans_A, | ||
| bool trans_B, bool clear_accum, int lda, int ldb, int offset_a, | ||
| int offset_b, typename A_type, typename B_type, typename C_type> | ||
| CUTLASS_DEVICE void gemm_ss(A_type *pA, B_type *pB, C_type *accum) { | ||
| using MMA = | ||
| cute::tl_mma::GemmTensorOp<M, N, K, num_warp_m, num_warp_n, trans_A, | ||
| trans_B, clear_accum, lda, ldb, offset_a, | ||
| offset_b, A_type, B_type, C_type>; | ||
| MMA::body(pA, pB, accum); | ||
| } | ||
|
|
||
| template <int M, int N, int K, int num_warp_m, int num_warp_n, bool trans_A, | ||
| bool trans_B, bool clear_accum, int lda, int ldb, int offset_a, | ||
| int offset_b, typename A_type, typename B_type, typename C_type> | ||
| CUTLASS_DEVICE void gemm_rs(A_type *pA, B_type *pB, C_type *accum) { | ||
| using MMA = | ||
| cute::tl_mma::GemmTensorOp<M, N, K, num_warp_m, num_warp_n, trans_A, | ||
| trans_B, clear_accum, lda, ldb, offset_a, | ||
| offset_b, A_type, B_type, C_type>; | ||
| MMA::body_rs(pA, pB, accum); | ||
| } | ||
|
|
||
| template <int M, int N, int K, int num_warp_m, int num_warp_n, bool trans_A, | ||
| bool trans_B, bool clear_accum, int lda, int ldb, int offset_a, | ||
| int offset_b, typename A_type, typename B_type, typename C_type> | ||
| CUTLASS_DEVICE void gemm_sr(A_type *pA, B_type *pB, C_type *accum) { | ||
| using MMA = | ||
| cute::tl_mma::GemmTensorOp<M, N, K, num_warp_m, num_warp_n, trans_A, | ||
| trans_B, clear_accum, lda, ldb, offset_a, | ||
| offset_b, A_type, B_type, C_type>; | ||
| MMA::body_sr(pA, pB, accum); | ||
| } | ||
|
|
||
| } // namespace tl | ||
oraluben marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,40 @@ | ||
| #pragma once | ||
|
|
||
| #include "gemm_mma.h" | ||
|
|
||
| namespace tl { | ||
|
|
||
| template <int M, int N, int K, int num_warp_m, int num_warp_n, bool trans_A, | ||
| bool trans_B, bool clear_accum, int lda, int ldb, int offset_a, | ||
| int offset_b, typename A_type, typename B_type, typename C_type> | ||
| CUTLASS_DEVICE void gemm_ss(A_type *pA, B_type *pB, C_type *accum) { | ||
| using MMA = | ||
| cute::tl_mma::GemmTensorOp<M, N, K, num_warp_m, num_warp_n, trans_A, | ||
| trans_B, clear_accum, lda, ldb, offset_a, | ||
| offset_b, A_type, B_type, C_type>; | ||
| MMA::body(pA, pB, accum); | ||
| } | ||
|
|
||
| template <int M, int N, int K, int num_warp_m, int num_warp_n, bool trans_A, | ||
| bool trans_B, bool clear_accum, int lda, int ldb, int offset_a, | ||
| int offset_b, typename A_type, typename B_type, typename C_type> | ||
| CUTLASS_DEVICE void gemm_rs(A_type *pA, B_type *pB, C_type *accum) { | ||
| using MMA = | ||
| cute::tl_mma::GemmTensorOp<M, N, K, num_warp_m, num_warp_n, trans_A, | ||
| trans_B, clear_accum, lda, ldb, offset_a, | ||
| offset_b, A_type, B_type, C_type>; | ||
| MMA::body_rs(pA, pB, accum); | ||
| } | ||
|
|
||
| template <int M, int N, int K, int num_warp_m, int num_warp_n, bool trans_A, | ||
| bool trans_B, bool clear_accum, int lda, int ldb, int offset_a, | ||
| int offset_b, typename A_type, typename B_type, typename C_type> | ||
| CUTLASS_DEVICE void gemm_sr(A_type *pA, B_type *pB, C_type *accum) { | ||
| using MMA = | ||
| cute::tl_mma::GemmTensorOp<M, N, K, num_warp_m, num_warp_n, trans_A, | ||
| trans_B, clear_accum, lda, ldb, offset_a, | ||
| offset_b, A_type, B_type, C_type>; | ||
| MMA::body_sr(pA, pB, accum); | ||
| } | ||
|
|
||
| } // namespace tl |
Uh oh!
There was an error while loading. Please reload this page.