Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
gaoqiong
composable_kernel
Commits
06d2c7b1
Commit
06d2c7b1
authored
Jun 28, 2023
by
Jing Zhang
Committed by
root
Jun 28, 2023
Browse files
clean
parents
b27909a0
3b18f1e3
Changes
1000
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
67 additions
and
48 deletions
+67
-48
example/16_gemm_multi_d_multi_reduces/gemm_max_xdl_bf16.cpp
example/16_gemm_multi_d_multi_reduces/gemm_max_xdl_bf16.cpp
+1
-1
example/16_gemm_multi_d_multi_reduces/gemm_max_xdl_fp16.cpp
example/16_gemm_multi_d_multi_reduces/gemm_max_xdl_fp16.cpp
+1
-1
example/16_gemm_multi_d_multi_reduces/gemm_max_xdl_fp32.cpp
example/16_gemm_multi_d_multi_reduces/gemm_max_xdl_fp32.cpp
+1
-1
example/16_gemm_multi_d_multi_reduces/gemm_max_xdl_int4.cpp
example/16_gemm_multi_d_multi_reduces/gemm_max_xdl_int4.cpp
+1
-1
example/16_gemm_multi_d_multi_reduces/gemm_max_xdl_int8.cpp
example/16_gemm_multi_d_multi_reduces/gemm_max_xdl_int8.cpp
+1
-1
example/16_gemm_multi_d_multi_reduces/gemm_mean_meansquare_xdl_bf16.cpp
...m_multi_d_multi_reduces/gemm_mean_meansquare_xdl_bf16.cpp
+1
-1
example/16_gemm_multi_d_multi_reduces/gemm_mean_meansquare_xdl_fp16.cpp
...m_multi_d_multi_reduces/gemm_mean_meansquare_xdl_fp16.cpp
+1
-1
example/16_gemm_multi_d_multi_reduces/gemm_mean_meansquare_xdl_fp32.cpp
...m_multi_d_multi_reduces/gemm_mean_meansquare_xdl_fp32.cpp
+1
-1
example/16_gemm_multi_d_multi_reduces/gemm_reduce_xdl_common.hpp
.../16_gemm_multi_d_multi_reduces/gemm_reduce_xdl_common.hpp
+1
-1
example/17_convnd_bwd_data/CMakeLists.txt
example/17_convnd_bwd_data/CMakeLists.txt
+9
-3
example/17_convnd_bwd_data/convnd_bwd_data_common.hpp
example/17_convnd_bwd_data/convnd_bwd_data_common.hpp
+23
-22
example/17_convnd_bwd_data/convnd_bwd_data_dl_fp16.cpp
example/17_convnd_bwd_data/convnd_bwd_data_dl_fp16.cpp
+1
-1
example/17_convnd_bwd_data/convnd_bwd_data_xdl_fp16.cpp
example/17_convnd_bwd_data/convnd_bwd_data_xdl_fp16.cpp
+1
-1
example/18_batched_gemm_reduce/CMakeLists.txt
example/18_batched_gemm_reduce/CMakeLists.txt
+8
-2
example/18_batched_gemm_reduce/batched_gemm_reduce_xdl_fp16.cpp
...e/18_batched_gemm_reduce/batched_gemm_reduce_xdl_fp16.cpp
+1
-1
example/19_binary_elementwise/broadcast_add_2d_amn_bn.cpp
example/19_binary_elementwise/broadcast_add_2d_amn_bn.cpp
+1
-1
example/19_binary_elementwise/broadcast_add_3d_am_bmnk.cpp
example/19_binary_elementwise/broadcast_add_3d_am_bmnk.cpp
+1
-1
example/19_binary_elementwise/elementwise_add_1d.cpp
example/19_binary_elementwise/elementwise_add_1d.cpp
+1
-1
example/19_binary_elementwise/elementwise_add_4d.cpp
example/19_binary_elementwise/elementwise_add_4d.cpp
+1
-1
example/20_grouped_conv_bwd_weight/CMakeLists.txt
example/20_grouped_conv_bwd_weight/CMakeLists.txt
+11
-5
No files found.
Too many changes to show.
To preserve performance only
1000 of 1000+
files are displayed.
Plain diff
Email patch
example/16_gemm_multi_d_multi_reduces/gemm_max_xdl_bf16.cpp
View file @
06d2c7b1
// SPDX-License-Identifier: MIT
// SPDX-License-Identifier: MIT
// Copyright (c) 2018-202
2
, Advanced Micro Devices, Inc. All rights reserved.
// Copyright (c) 2018-202
3
, Advanced Micro Devices, Inc. All rights reserved.
#include "gemm_reduce_xdl_common.hpp"
#include "gemm_reduce_xdl_common.hpp"
...
...
example/16_gemm_multi_d_multi_reduces/gemm_max_xdl_fp16.cpp
View file @
06d2c7b1
// SPDX-License-Identifier: MIT
// SPDX-License-Identifier: MIT
// Copyright (c) 2018-202
2
, Advanced Micro Devices, Inc. All rights reserved.
// Copyright (c) 2018-202
3
, Advanced Micro Devices, Inc. All rights reserved.
#include "gemm_reduce_xdl_common.hpp"
#include "gemm_reduce_xdl_common.hpp"
...
...
example/16_gemm_multi_d_multi_reduces/gemm_max_xdl_fp32.cpp
View file @
06d2c7b1
// SPDX-License-Identifier: MIT
// SPDX-License-Identifier: MIT
// Copyright (c) 2018-202
2
, Advanced Micro Devices, Inc. All rights reserved.
// Copyright (c) 2018-202
3
, Advanced Micro Devices, Inc. All rights reserved.
#include "gemm_reduce_xdl_common.hpp"
#include "gemm_reduce_xdl_common.hpp"
...
...
example/16_gemm_multi_d_multi_reduces/gemm_max_xdl_int4.cpp
View file @
06d2c7b1
// SPDX-License-Identifier: MIT
// SPDX-License-Identifier: MIT
// Copyright (c) 2018-202
2
, Advanced Micro Devices, Inc. All rights reserved.
// Copyright (c) 2018-202
3
, Advanced Micro Devices, Inc. All rights reserved.
#include "gemm_reduce_xdl_common.hpp"
#include "gemm_reduce_xdl_common.hpp"
...
...
example/16_gemm_multi_d_multi_reduces/gemm_max_xdl_int8.cpp
View file @
06d2c7b1
// SPDX-License-Identifier: MIT
// SPDX-License-Identifier: MIT
// Copyright (c) 2018-202
2
, Advanced Micro Devices, Inc. All rights reserved.
// Copyright (c) 2018-202
3
, Advanced Micro Devices, Inc. All rights reserved.
#include "gemm_reduce_xdl_common.hpp"
#include "gemm_reduce_xdl_common.hpp"
...
...
example/16_gemm_multi_d_multi_reduces/gemm_mean_meansquare_xdl_bf16.cpp
View file @
06d2c7b1
// SPDX-License-Identifier: MIT
// SPDX-License-Identifier: MIT
// Copyright (c) 2018-202
2
, Advanced Micro Devices, Inc. All rights reserved.
// Copyright (c) 2018-202
3
, Advanced Micro Devices, Inc. All rights reserved.
#include "gemm_reduce_xdl_common.hpp"
#include "gemm_reduce_xdl_common.hpp"
...
...
example/16_gemm_multi_d_multi_reduces/gemm_mean_meansquare_xdl_fp16.cpp
View file @
06d2c7b1
// SPDX-License-Identifier: MIT
// SPDX-License-Identifier: MIT
// Copyright (c) 2018-202
2
, Advanced Micro Devices, Inc. All rights reserved.
// Copyright (c) 2018-202
3
, Advanced Micro Devices, Inc. All rights reserved.
#include "gemm_reduce_xdl_common.hpp"
#include "gemm_reduce_xdl_common.hpp"
...
...
example/16_gemm_multi_d_multi_reduces/gemm_mean_meansquare_xdl_fp32.cpp
View file @
06d2c7b1
// SPDX-License-Identifier: MIT
// SPDX-License-Identifier: MIT
// Copyright (c) 2018-202
2
, Advanced Micro Devices, Inc. All rights reserved.
// Copyright (c) 2018-202
3
, Advanced Micro Devices, Inc. All rights reserved.
#include "gemm_reduce_xdl_common.hpp"
#include "gemm_reduce_xdl_common.hpp"
...
...
example/16_gemm_multi_d_multi_reduces/gemm_reduce_xdl_common.hpp
View file @
06d2c7b1
// SPDX-License-Identifier: MIT
// SPDX-License-Identifier: MIT
// Copyright (c) 2018-202
2
, Advanced Micro Devices, Inc. All rights reserved.
// Copyright (c) 2018-202
3
, Advanced Micro Devices, Inc. All rights reserved.
#include <numeric>
#include <numeric>
#include <initializer_list>
#include <initializer_list>
...
...
example/17_convnd_bwd_data/CMakeLists.txt
View file @
06d2c7b1
add_example_executable
(
example_convnd_bwd_data_xdl_fp16 convnd_bwd_data_xdl_fp16.cpp
)
list
(
APPEND gpu_list gfx908 gfx90a gfx940 gfx941 gfx942
)
target_link_libraries
(
example_convnd_bwd_data_xdl_fp16 PRIVATE utility
)
set
(
target 0
)
foreach
(
gpu IN LISTS GPU_TARGETS
)
if
(
gpu IN_LIST gpu_list AND target EQUAL 0
)
add_example_executable
(
example_convnd_bwd_data_xdl_fp16 convnd_bwd_data_xdl_fp16.cpp
)
target_link_libraries
(
example_convnd_bwd_data_xdl_fp16 PRIVATE utility
)
set
(
target 1
)
endif
()
endforeach
()
add_example_executable
(
example_convnd_bwd_data_dl_fp16 convnd_bwd_data_dl_fp16.cpp
)
add_example_executable
(
example_convnd_bwd_data_dl_fp16 convnd_bwd_data_dl_fp16.cpp
)
target_link_libraries
(
example_convnd_bwd_data_dl_fp16 PRIVATE utility
)
target_link_libraries
(
example_convnd_bwd_data_dl_fp16 PRIVATE utility
)
example/17_convnd_bwd_data/convnd_bwd_data_common.hpp
View file @
06d2c7b1
// SPDX-License-Identifier: MIT
// SPDX-License-Identifier: MIT
// Copyright (c) 2018-202
2
, Advanced Micro Devices, Inc. All rights reserved.
// Copyright (c) 2018-202
3
, Advanced Micro Devices, Inc. All rights reserved.
#include <iostream>
#include <iostream>
#include <numeric>
#include <numeric>
...
@@ -81,32 +81,33 @@ int run_conv_bwd_data(bool do_verification,
...
@@ -81,32 +81,33 @@ int run_conv_bwd_data(bool do_verification,
in_device_buf
.
SetZero
();
in_device_buf
.
SetZero
();
// do GEMM
// do GEMM
auto
conv
=
DeviceConvNdBwdDataInstance
{};
auto
conv
=
DeviceConvNdBwdDataInstance
{};
auto
invoker
=
conv
.
MakeInvoker
();
auto
invoker
=
conv
.
MakeInvoker
();
auto
argument
=
conv
.
MakeArgument
(
static_cast
<
InDataType
*>
(
in_device_buf
.
GetDeviceBuffer
()),
auto
argument
=
static_cast
<
WeiDataType
*>
(
wei_device_buf
.
GetDeviceBuffer
()),
conv
.
MakeArgumentPointer
(
static_cast
<
InDataType
*>
(
in_device_buf
.
GetDeviceBuffer
()),
static_cast
<
OutDataType
*>
(
out_device_buf
.
GetDeviceBuffer
()),
static_cast
<
WeiDataType
*>
(
wei_device_buf
.
GetDeviceBuffer
()),
conv_param
.
N_
,
static_cast
<
OutDataType
*>
(
out_device_buf
.
GetDeviceBuffer
()),
conv_param
.
K_
,
conv_param
.
N_
,
conv_param
.
C_
,
conv_param
.
K_
,
conv_param
.
input_spatial_lengths_
,
conv_param
.
C_
,
conv_param
.
filter_spatial_lengths_
,
conv_param
.
input_spatial_lengths_
,
conv_param
.
GetOutputSpatialLengths
(),
conv_param
.
filter_spatial_lengths_
,
conv_param
.
conv_filter_strides_
,
conv_param
.
GetOutputSpatialLengths
(),
conv_param
.
conv_filter_dilations_
,
conv_param
.
conv_filter_strides_
,
conv_param
.
input_left_pads_
,
conv_param
.
conv_filter_dilations_
,
conv_param
.
input_right_pads_
,
conv_param
.
input_left_pads_
,
in_element_op
,
conv_param
.
input_right_pads_
,
wei_element_op
,
in_element_op
,
out_element_op
);
wei_element_op
,
out_element_op
);
if
(
!
conv
.
IsSupportedArgument
(
argument
))
if
(
!
conv
.
IsSupportedArgument
(
argument
.
get
()))
{
{
std
::
cout
<<
"Not support,please check parameters or device"
;
std
::
cout
<<
"Not support,please check parameters or device"
;
return
0
;
return
0
;
}
}
float
ave_time
=
invoker
.
Run
(
argument
,
StreamConfig
{
nullptr
,
time_kernel
});
float
ave_time
=
invoker
.
Run
(
argument
.
get
()
,
StreamConfig
{
nullptr
,
time_kernel
});
std
::
size_t
flop
=
conv_param
.
GetFlops
();
std
::
size_t
flop
=
conv_param
.
GetFlops
();
std
::
size_t
num_btype
=
conv_param
.
GetByte
<
InDataType
,
WeiDataType
,
OutDataType
>
();
std
::
size_t
num_btype
=
conv_param
.
GetByte
<
InDataType
,
WeiDataType
,
OutDataType
>
();
...
...
example/17_convnd_bwd_data/convnd_bwd_data_dl_fp16.cpp
View file @
06d2c7b1
// SPDX-License-Identifier: MIT
// SPDX-License-Identifier: MIT
// Copyright (c) 2018-202
2
, Advanced Micro Devices, Inc. All rights reserved.
// Copyright (c) 2018-202
3
, Advanced Micro Devices, Inc. All rights reserved.
#include "convnd_bwd_data_common.hpp"
#include "convnd_bwd_data_common.hpp"
...
...
example/17_convnd_bwd_data/convnd_bwd_data_xdl_fp16.cpp
View file @
06d2c7b1
// SPDX-License-Identifier: MIT
// SPDX-License-Identifier: MIT
// Copyright (c) 2018-202
2
, Advanced Micro Devices, Inc. All rights reserved.
// Copyright (c) 2018-202
3
, Advanced Micro Devices, Inc. All rights reserved.
#include "convnd_bwd_data_common.hpp"
#include "convnd_bwd_data_common.hpp"
...
...
example/18_batched_gemm_reduce/CMakeLists.txt
View file @
06d2c7b1
add_example_executable
(
example_batched_gemm_reduce_xdl_fp16 batched_gemm_reduce_xdl_fp16.cpp
)
list
(
APPEND gpu_list gfx908 gfx90a gfx940 gfx941 gfx942
)
set
(
target 0
)
foreach
(
gpu IN LISTS GPU_TARGETS
)
if
(
gpu IN_LIST gpu_list AND target EQUAL 0
)
add_example_executable
(
example_batched_gemm_reduce_xdl_fp16 batched_gemm_reduce_xdl_fp16.cpp
)
set
(
target 1
)
endif
()
endforeach
()
example/18_batched_gemm_reduce/batched_gemm_reduce_xdl_fp16.cpp
View file @
06d2c7b1
// SPDX-License-Identifier: MIT
// SPDX-License-Identifier: MIT
// Copyright (c) 2018-202
2
, Advanced Micro Devices, Inc. All rights reserved.
// Copyright (c) 2018-202
3
, Advanced Micro Devices, Inc. All rights reserved.
#include <iostream>
#include <iostream>
#include <numeric>
#include <numeric>
...
...
example/19_binary_elementwise/broadcast_add_2d_amn_bn.cpp
View file @
06d2c7b1
// SPDX-License-Identifier: MIT
// SPDX-License-Identifier: MIT
// Copyright (c) 2018-202
2
, Advanced Micro Devices, Inc. All rights reserved.
// Copyright (c) 2018-202
3
, Advanced Micro Devices, Inc. All rights reserved.
#include <iostream>
#include <iostream>
#include <cstdlib>
#include <cstdlib>
...
...
example/19_binary_elementwise/broadcast_add_3d_am_bmnk.cpp
View file @
06d2c7b1
// SPDX-License-Identifier: MIT
// SPDX-License-Identifier: MIT
// Copyright (c) 2018-202
2
, Advanced Micro Devices, Inc. All rights reserved.
// Copyright (c) 2018-202
3
, Advanced Micro Devices, Inc. All rights reserved.
#include <iostream>
#include <iostream>
#include <cstdlib>
#include <cstdlib>
...
...
example/19_binary_elementwise/elementwise_add_1d.cpp
View file @
06d2c7b1
// SPDX-License-Identifier: MIT
// SPDX-License-Identifier: MIT
// Copyright (c) 2018-202
2
, Advanced Micro Devices, Inc. All rights reserved.
// Copyright (c) 2018-202
3
, Advanced Micro Devices, Inc. All rights reserved.
#include <iostream>
#include <iostream>
#include <cstdlib>
#include <cstdlib>
...
...
example/19_binary_elementwise/elementwise_add_4d.cpp
View file @
06d2c7b1
// SPDX-License-Identifier: MIT
// SPDX-License-Identifier: MIT
// Copyright (c) 2018-202
2
, Advanced Micro Devices, Inc. All rights reserved.
// Copyright (c) 2018-202
3
, Advanced Micro Devices, Inc. All rights reserved.
#include <iostream>
#include <iostream>
#include <cstdlib>
#include <cstdlib>
...
...
example/20_grouped_conv_bwd_weight/CMakeLists.txt
View file @
06d2c7b1
add_custom_target
(
example_grouped_conv_bwd_weight
)
list
(
APPEND gpu_list gfx908 gfx90a gfx940 gfx941 gfx942
)
set
(
target 0
)
foreach
(
gpu IN LISTS GPU_TARGETS
)
if
(
gpu IN_LIST gpu_list AND target EQUAL 0
)
add_custom_target
(
example_grouped_conv_bwd_weight
)
add_example_executable
(
example_grouped_conv_bwd_weight_xdl_fp16 grouped_conv_bwd_weight_xdl_fp16.cpp
)
add_example_executable
(
example_grouped_conv_bwd_weight_xdl_fp16 grouped_conv_bwd_weight_xdl_fp16.cpp
)
add_example_executable
(
example_grouped_conv_bwd_weight_xdl_bf16 grouped_conv_bwd_weight_xdl_bf16.cpp
)
add_example_executable
(
example_grouped_conv_bwd_weight_xdl_bf16 grouped_conv_bwd_weight_xdl_bf16.cpp
)
add_dependencies
(
example_grouped_conv_bwd_weight example_grouped_conv_bwd_weight_xdl_fp16
add_dependencies
(
example_grouped_conv_bwd_weight example_grouped_conv_bwd_weight_xdl_fp16
example_grouped_conv_bwd_weight_xdl_bf16
)
example_grouped_conv_bwd_weight_xdl_bf16
)
set
(
target 1
)
endif
()
endforeach
()
add_custom_target
(
example_grouped_conv_bwd_weight_dl
)
add_custom_target
(
example_grouped_conv_bwd_weight_dl
)
...
...
Prev
1
…
3
4
5
6
7
8
9
10
11
…
50
Next
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment