-
Notifications
You must be signed in to change notification settings - Fork 291
Conv3D FWD BWD WRW fp16 fp32 client examples #559
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
Merged
Merged
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
369638f
Conv3d bwd weight client example.
195db44
Update year in license
f0b96d0
Convolution bwd data 3D fp16/fp32 client example.
3c0fcc5
Client example for convnd fwd fp16 fp32
daa1c99
clang-format
3af2f64
Merge branch 'develop' into aosewski/conv3d_example
bb692de
Review remarks.
98c0a91
Fix compiler err.
1356d89
Merge branch 'develop' into aosewski/conv3d_example
aosewski 5724dd1
Merge branch 'develop' into aosewski/conv3d_example
034c162
Update data layout to standard one.
862982a
Add conv 3d fwd NDHWGC instances
b40861c
clang-format
ecacb72
Conv3d fwd NDHWGC instances.
a7ee6cb
Merge remote-tracking branch 'origin/develop' into aosewski/conv3d_ex…
1086ece
Merge branch 'develop' into aosewski/conv3d_example
aosewski 155fd05
Merge branch 'develop' into aosewski/conv3d_example
aosewski db752f7
Merge branch 'develop' into aosewski/conv3d_example
aosewski fa40005
Merge branch 'develop' into aosewski/conv3d_example
zjing14 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,7 @@ | ||
| add_executable(client_grouped_conv2d_bwd_weight grouped_conv2d_bwd_weight.cpp) | ||
| target_link_libraries(client_grouped_conv2d_bwd_weight PRIVATE composable_kernel::device_operations) | ||
| add_executable(client_grouped_conv2d_bwd_weight_fp16 grouped_conv2d_bwd_weight_fp16.cpp) | ||
| add_executable(client_grouped_conv3d_bwd_weight_fp16 grouped_conv3d_bwd_weight_fp16.cpp) | ||
| add_executable(client_grouped_conv3d_bwd_weight_fp32 grouped_conv3d_bwd_weight_fp32.cpp) | ||
|
|
||
| target_link_libraries(client_grouped_conv2d_bwd_weight_fp16 PRIVATE composable_kernel::device_operations) | ||
| target_link_libraries(client_grouped_conv3d_bwd_weight_fp16 PRIVATE composable_kernel::device_operations) | ||
| target_link_libraries(client_grouped_conv3d_bwd_weight_fp32 PRIVATE composable_kernel::device_operations) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
client_example/11_grouped_conv_bwd_weight/grouped_conv2d_bwd_weight_fp16.cpp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| // SPDX-License-Identifier: MIT | ||
| // Copyright (c) 2018-2023, Advanced Micro Devices, Inc. All rights reserved. | ||
|
|
||
| #include "common.hpp" | ||
|
|
||
| #include "ck/ck.hpp" | ||
| #include "ck/tensor_operation/gpu/device/tensor_layout.hpp" | ||
|
|
||
| using InDataType = ck::half_t; | ||
| using WeiDataType = ck::half_t; | ||
| using OutDataType = ck::half_t; | ||
|
|
||
| using InLayout = ck::tensor_layout::convolution::GNHWC; | ||
| using WeiLayout = ck::tensor_layout::convolution::GKYXC; | ||
| using OutLayout = ck::tensor_layout::convolution::GNHWK; | ||
|
|
||
| static constexpr ck::index_t NumDimSpatial = 2; | ||
| static constexpr ck::index_t G = 32; | ||
| static constexpr ck::index_t N = 256; | ||
| static constexpr ck::index_t K = 192; | ||
| static constexpr ck::index_t C = 192; | ||
| static constexpr ck::index_t Y = 3; | ||
| static constexpr ck::index_t X = 3; | ||
| static constexpr ck::index_t Hi = 28; | ||
| static constexpr ck::index_t Wi = 28; | ||
| static constexpr ck::index_t Ho = 28; | ||
| static constexpr ck::index_t Wo = 28; | ||
|
|
||
| int main() | ||
| { | ||
| return run_grouped_conv_bwd_weight<NumDimSpatial, | ||
| InDataType, | ||
| WeiDataType, | ||
| OutDataType, | ||
| InLayout, | ||
| WeiLayout, | ||
| OutLayout>( | ||
| G, N, K, C, {Hi, Wi}, {Y, X}, {Ho, Wo}, {1, 1}, {1, 1}, {1, 1}, {1, 1}) | ||
| ? EXIT_SUCCESS | ||
| : EXIT_FAILURE; | ||
| } | ||
53 changes: 53 additions & 0 deletions
53
client_example/11_grouped_conv_bwd_weight/grouped_conv3d_bwd_weight_fp16.cpp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,53 @@ | ||
| // SPDX-License-Identifier: MIT | ||
| // Copyright (c) 2018-2023, Advanced Micro Devices, Inc. All rights reserved. | ||
|
|
||
| #include "common.hpp" | ||
|
|
||
| #include "ck/ck.hpp" | ||
| #include "ck/tensor_operation/gpu/device/tensor_layout.hpp" | ||
|
|
||
| using InDataType = ck::half_t; | ||
| using WeiDataType = ck::half_t; | ||
| using OutDataType = ck::half_t; | ||
|
|
||
| using InLayout = ck::tensor_layout::convolution::GNDHWC; | ||
| using WeiLayout = ck::tensor_layout::convolution::GKZYXC; | ||
| using OutLayout = ck::tensor_layout::convolution::GNDHWK; | ||
|
|
||
| static constexpr ck::index_t NumDimSpatial = 3; | ||
| static constexpr ck::index_t G = 8; | ||
| static constexpr ck::index_t N = 64; | ||
| static constexpr ck::index_t K = 128; | ||
| static constexpr ck::index_t C = 128; | ||
| static constexpr ck::index_t Z = 3; | ||
| static constexpr ck::index_t Y = 3; | ||
| static constexpr ck::index_t X = 3; | ||
| static constexpr ck::index_t Di = 28; | ||
| static constexpr ck::index_t Hi = 28; | ||
| static constexpr ck::index_t Wi = 3; | ||
| static constexpr ck::index_t Do = 28; | ||
| static constexpr ck::index_t Ho = 28; | ||
| static constexpr ck::index_t Wo = 3; | ||
|
|
||
| int main() | ||
| { | ||
| return run_grouped_conv_bwd_weight<NumDimSpatial, | ||
| InDataType, | ||
| WeiDataType, | ||
| OutDataType, | ||
| InLayout, | ||
| WeiLayout, | ||
| OutLayout>(G, | ||
| N, | ||
| K, | ||
| C, | ||
| {Di, Hi, Wi}, | ||
| {Z, Y, X}, | ||
| {Do, Ho, Wo}, | ||
| {1, 1, 1}, | ||
| {1, 1, 1}, | ||
| {1, 1, 1}, | ||
| {1, 1, 1}) | ||
| ? EXIT_SUCCESS | ||
| : EXIT_FAILURE; | ||
| } |
53 changes: 53 additions & 0 deletions
53
client_example/11_grouped_conv_bwd_weight/grouped_conv3d_bwd_weight_fp32.cpp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,53 @@ | ||
| // SPDX-License-Identifier: MIT | ||
| // Copyright (c) 2018-2023, Advanced Micro Devices, Inc. All rights reserved. | ||
|
|
||
| #include "common.hpp" | ||
|
|
||
| #include "ck/ck.hpp" | ||
| #include "ck/tensor_operation/gpu/device/tensor_layout.hpp" | ||
|
|
||
| using InDataType = float; | ||
| using WeiDataType = float; | ||
| using OutDataType = float; | ||
|
|
||
| using InLayout = ck::tensor_layout::convolution::GNDHWC; | ||
| using WeiLayout = ck::tensor_layout::convolution::GKZYXC; | ||
| using OutLayout = ck::tensor_layout::convolution::GNDHWK; | ||
|
|
||
| static constexpr ck::index_t NumDimSpatial = 3; | ||
| static constexpr ck::index_t G = 8; | ||
| static constexpr ck::index_t N = 64; | ||
| static constexpr ck::index_t K = 128; | ||
| static constexpr ck::index_t C = 128; | ||
| static constexpr ck::index_t Z = 3; | ||
| static constexpr ck::index_t Y = 3; | ||
| static constexpr ck::index_t X = 3; | ||
| static constexpr ck::index_t Di = 28; | ||
| static constexpr ck::index_t Hi = 28; | ||
| static constexpr ck::index_t Wi = 3; | ||
| static constexpr ck::index_t Do = 28; | ||
| static constexpr ck::index_t Ho = 28; | ||
| static constexpr ck::index_t Wo = 3; | ||
|
|
||
| int main() | ||
| { | ||
| return run_grouped_conv_bwd_weight<NumDimSpatial, | ||
| InDataType, | ||
| WeiDataType, | ||
| OutDataType, | ||
| InLayout, | ||
| WeiLayout, | ||
| OutLayout>(G, | ||
| N, | ||
| K, | ||
| C, | ||
| {Di, Hi, Wi}, | ||
| {Z, Y, X}, | ||
| {Do, Ho, Wo}, | ||
| {1, 1, 1}, | ||
| {1, 1, 1}, | ||
| {1, 1, 1}, | ||
| {1, 1, 1}) | ||
| ? EXIT_SUCCESS | ||
| : EXIT_FAILURE; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| add_executable(client_conv3d_bwd_data_fp16 conv3d_bwd_data_fp16.cpp) | ||
| add_executable(client_conv3d_bwd_data_fp32 conv3d_bwd_data_fp32.cpp) | ||
|
|
||
| target_link_libraries(client_conv3d_bwd_data_fp16 PRIVATE composable_kernel::device_operations) | ||
| target_link_libraries(client_conv3d_bwd_data_fp32 PRIVATE composable_kernel::device_operations) |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.