-
Notifications
You must be signed in to change notification settings - Fork 256
WMMA support for batched_gemm_reduce #3332
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
base: develop
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,10 +1,14 @@ | ||
| # Copyright (c) Advanced Micro Devices, Inc., or its affiliates. | ||
| # SPDX-License-Identifier: MIT | ||
|
|
||
| # ONLY XDL_KERNELS | ||
| # ONLY XDL_AND_WMMA_KERNELS | ||
| add_instance_library(device_batched_gemm_reduce_instance | ||
| device_batched_gemm_reduce_xdl_cshuffle_f16_f16_f16_f32_f32_gmk_gkn_gmn_instance.cpp | ||
| device_batched_gemm_reduce_xdl_cshuffle_f16_f16_f16_f32_f32_gmk_gnk_gmn_instance.cpp | ||
| device_batched_gemm_reduce_xdl_cshuffle_f16_f16_f16_f32_f32_gkm_gkn_gmn_instance.cpp | ||
| device_batched_gemm_reduce_xdl_cshuffle_f16_f16_f16_f32_f32_gkm_gnk_gmn_instance.cpp | ||
| device_batched_gemm_reduce_wmma_cshuffle_v3_f16_f16_f16_f32_f32_gmk_gkn_gmn_instance.cpp | ||
| device_batched_gemm_reduce_wmma_cshuffle_v3_f16_f16_f16_f32_f32_gmk_gnk_gmn_instance.cpp | ||
| device_batched_gemm_reduce_wmma_cshuffle_v3_f16_f16_f16_f32_f32_gkm_gkn_gmn_instance.cpp | ||
| device_batched_gemm_reduce_wmma_cshuffle_v3_f16_f16_f16_f32_f32_gkm_gnk_gmn_instance.cpp | ||
| ) |
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,67 @@ | ||
| // Copyright (c) Advanced Micro Devices, Inc., or its affiliates. | ||
| // SPDX-License-Identifier: MIT | ||
|
|
||
| #include <iostream> | ||
|
|
||
| #include "profiler/profile_batched_gemm_reduce_impl.hpp" | ||
|
|
||
| int main() | ||
| { | ||
| using Row = ck::tensor_layout::gemm::RowMajor; | ||
| using Col = ck::tensor_layout::gemm::ColumnMajor; | ||
|
|
||
| int M = 512; | ||
| int N = 256; | ||
| int K = 128; | ||
|
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. I don't know about what typical use cases are for these instances, but is it worth checking irregular/small sizes to make sure all the edgecases work properly? |
||
|
|
||
| int BatchCount = 3; | ||
|
|
||
| bool pass = true; | ||
|
|
||
| pass = pass && ck::profiler::profile_batched_gemm_reduce_impl<ck::half_t, | ||
| ck::half_t, | ||
| ck::half_t, | ||
| float, | ||
| Row, | ||
| Row, | ||
| Row>( | ||
| true, 1, false, false, M, N, K, K, N, N, BatchCount); | ||
|
|
||
| pass = pass && ck::profiler::profile_batched_gemm_reduce_impl<ck::half_t, | ||
| ck::half_t, | ||
| ck::half_t, | ||
| float, | ||
| Row, | ||
| Col, | ||
| Row>( | ||
| true, 1, false, false, M, N, K, K, K, N, BatchCount); | ||
|
|
||
| pass = pass && ck::profiler::profile_batched_gemm_reduce_impl<ck::half_t, | ||
| ck::half_t, | ||
| ck::half_t, | ||
| float, | ||
| Col, | ||
| Row, | ||
| Row>( | ||
| true, 1, false, false, M, N, K, M, N, N, BatchCount); | ||
|
|
||
| pass = pass && ck::profiler::profile_batched_gemm_reduce_impl<ck::half_t, | ||
| ck::half_t, | ||
| ck::half_t, | ||
| float, | ||
| Col, | ||
| Col, | ||
| Row>( | ||
| true, 1, false, false, M, N, K, M, K, N, BatchCount); | ||
|
|
||
| if(pass) | ||
| { | ||
| std::cout << "test BatchedGEMM+Reduce fp16 WMMA: Pass" << std::endl; | ||
| return 0; | ||
| } | ||
| else | ||
| { | ||
| std::cout << "test BatchedGEMM+Reduce fp16 WMMA: Fail" << std::endl; | ||
| return -1; | ||
| } | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this use a GTest suite like the other tests?