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
8e8ae66d
Commit
8e8ae66d
authored
Jul 18, 2022
by
Chao Liu
Browse files
clean
parent
0e81cc18
Changes
27
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
155 additions
and
165 deletions
+155
-165
example/06_conv2d_fwd_bias_relu/conv2d_fwd_bias_relu_xdl_fp16.cpp
...06_conv2d_fwd_bias_relu/conv2d_fwd_bias_relu_xdl_fp16.cpp
+12
-13
example/07_conv2d_fwd_bias_relu_add/conv2d_fwd_bias_relu_add_xdl_fp16.cpp
...d_fwd_bias_relu_add/conv2d_fwd_bias_relu_add_xdl_fp16.cpp
+12
-13
example/09_convnd_fwd/convnd_fwd_common.hpp
example/09_convnd_fwd/convnd_fwd_common.hpp
+28
-29
example/09_convnd_fwd/convnd_fwd_xdl_bf16.cpp
example/09_convnd_fwd/convnd_fwd_xdl_bf16.cpp
+1
-1
example/09_convnd_fwd/convnd_fwd_xdl_fp16.cpp
example/09_convnd_fwd/convnd_fwd_xdl_fp16.cpp
+1
-1
example/09_convnd_fwd/convnd_fwd_xdl_fp32.cpp
example/09_convnd_fwd/convnd_fwd_xdl_fp32.cpp
+1
-1
example/09_convnd_fwd/convnd_fwd_xdl_fp64.cpp
example/09_convnd_fwd/convnd_fwd_xdl_fp64.cpp
+1
-1
example/09_convnd_fwd/convnd_fwd_xdl_int8.cpp
example/09_convnd_fwd/convnd_fwd_xdl_int8.cpp
+1
-1
example/17_convnd_bwd_data/convnd_bwd_data_common.hpp
example/17_convnd_bwd_data/convnd_bwd_data_common.hpp
+12
-13
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/20_convnd_bwd_weight/convnd_bwd_weight_common.hpp
example/20_convnd_bwd_weight/convnd_bwd_weight_common.hpp
+28
-29
example/20_convnd_bwd_weight/convnd_bwd_weight_xdl_bf16.cpp
example/20_convnd_bwd_weight/convnd_bwd_weight_xdl_bf16.cpp
+1
-1
example/20_convnd_bwd_weight/convnd_bwd_weight_xdl_fp16.cpp
example/20_convnd_bwd_weight/convnd_bwd_weight_xdl_fp16.cpp
+1
-1
library/include/ck/library/utility/convolution_host_tensor_descriptor_helper.hpp
...ary/utility/convolution_host_tensor_descriptor_helper.hpp
+3
-6
library/include/ck/library/utility/convolution_parameter.hpp
library/include/ck/library/utility/convolution_parameter.hpp
+17
-17
library/src/utility/convolution_parameter.cpp
library/src/utility/convolution_parameter.cpp
+21
-21
profiler/include/profile_conv_bwd_data_impl.hpp
profiler/include/profile_conv_bwd_data_impl.hpp
+1
-1
profiler/include/profile_conv_bwd_weight_impl.hpp
profiler/include/profile_conv_bwd_weight_impl.hpp
+1
-1
profiler/include/profile_conv_fwd_impl.hpp
profiler/include/profile_conv_fwd_impl.hpp
+1
-2
profiler/src/profile_conv_bwd_data.cpp
profiler/src/profile_conv_bwd_data.cpp
+11
-12
No files found.
example/06_conv2d_fwd_bias_relu/conv2d_fwd_bias_relu_xdl_fp16.cpp
View file @
8e8ae66d
...
@@ -101,8 +101,7 @@ void print_helper_msg()
...
@@ -101,8 +101,7 @@ void print_helper_msg()
<<
std
::
endl
;
<<
std
::
endl
;
}
}
ck
::
tensor_operation
::
device
::
ConvParams
ck
::
utils
::
conv
::
ConvParam
parse_conv_params
(
int
num_dim_spatial
,
int
arg_idx
,
char
*
const
argv
[])
parse_conv_params
(
int
num_dim_spatial
,
int
arg_idx
,
char
*
const
argv
[])
{
{
const
ck
::
index_t
N
=
std
::
stoi
(
argv
[
arg_idx
++
]);
const
ck
::
index_t
N
=
std
::
stoi
(
argv
[
arg_idx
++
]);
const
ck
::
index_t
K
=
std
::
stoi
(
argv
[
arg_idx
++
]);
const
ck
::
index_t
K
=
std
::
stoi
(
argv
[
arg_idx
++
]);
...
@@ -145,16 +144,16 @@ parse_conv_params(int num_dim_spatial, int arg_idx, char* const argv[])
...
@@ -145,16 +144,16 @@ parse_conv_params(int num_dim_spatial, int arg_idx, char* const argv[])
input_right_pads
[
i
]
=
std
::
stoi
(
argv
[
arg_idx
++
]);
input_right_pads
[
i
]
=
std
::
stoi
(
argv
[
arg_idx
++
]);
}
}
return
ck
::
tensor_operation
::
device
::
ConvParam
s
{
num_dim_spatial
,
return
ck
::
utils
::
conv
::
ConvParam
{
num_dim_spatial
,
N
,
N
,
K
,
K
,
C
,
C
,
filter_spatial_lengths
,
filter_spatial_lengths
,
input_spatial_lengths
,
input_spatial_lengths
,
conv_filter_strides
,
conv_filter_strides
,
conv_filter_dilations
,
conv_filter_dilations
,
input_left_pads
,
input_left_pads
,
input_right_pads
};
input_right_pads
};
}
}
}
// namespace
}
// namespace
...
@@ -168,7 +167,7 @@ int main(int argc, char* argv[])
...
@@ -168,7 +167,7 @@ int main(int argc, char* argv[])
bool
time_kernel
=
false
;
bool
time_kernel
=
false
;
int
num_dim_spatial
=
2
;
int
num_dim_spatial
=
2
;
ck
::
tensor_operation
::
device
::
ConvParam
s
params
{
ck
::
utils
::
conv
::
ConvParam
params
{
2
,
128
,
256
,
192
,
{
3
,
3
},
{
71
,
71
},
{
2
,
2
},
{
1
,
1
},
{
1
,
1
},
{
1
,
1
}};
2
,
128
,
256
,
192
,
{
3
,
3
},
{
71
,
71
},
{
2
,
2
},
{
1
,
1
},
{
1
,
1
},
{
1
,
1
}};
if
(
argc
==
1
)
if
(
argc
==
1
)
...
...
example/07_conv2d_fwd_bias_relu_add/conv2d_fwd_bias_relu_add_xdl_fp16.cpp
View file @
8e8ae66d
...
@@ -98,8 +98,7 @@ void print_helper_msg()
...
@@ -98,8 +98,7 @@ void print_helper_msg()
<<
std
::
endl
;
<<
std
::
endl
;
}
}
ck
::
tensor_operation
::
device
::
ConvParams
ck
::
utils
::
conv
::
ConvParam
parse_conv_params
(
int
num_dim_spatial
,
int
arg_idx
,
char
*
const
argv
[])
parse_conv_params
(
int
num_dim_spatial
,
int
arg_idx
,
char
*
const
argv
[])
{
{
const
ck
::
index_t
N
=
std
::
stoi
(
argv
[
arg_idx
++
]);
const
ck
::
index_t
N
=
std
::
stoi
(
argv
[
arg_idx
++
]);
const
ck
::
index_t
K
=
std
::
stoi
(
argv
[
arg_idx
++
]);
const
ck
::
index_t
K
=
std
::
stoi
(
argv
[
arg_idx
++
]);
...
@@ -142,16 +141,16 @@ parse_conv_params(int num_dim_spatial, int arg_idx, char* const argv[])
...
@@ -142,16 +141,16 @@ parse_conv_params(int num_dim_spatial, int arg_idx, char* const argv[])
input_right_pads
[
i
]
=
std
::
stoi
(
argv
[
arg_idx
++
]);
input_right_pads
[
i
]
=
std
::
stoi
(
argv
[
arg_idx
++
]);
}
}
return
ck
::
tensor_operation
::
device
::
ConvParam
s
{
num_dim_spatial
,
return
ck
::
utils
::
conv
::
ConvParam
{
num_dim_spatial
,
N
,
N
,
K
,
K
,
C
,
C
,
filter_spatial_lengths
,
filter_spatial_lengths
,
input_spatial_lengths
,
input_spatial_lengths
,
conv_filter_strides
,
conv_filter_strides
,
conv_filter_dilations
,
conv_filter_dilations
,
input_left_pads
,
input_left_pads
,
input_right_pads
};
input_right_pads
};
}
}
}
// anonymous namespace
}
// anonymous namespace
...
@@ -165,7 +164,7 @@ int main(int argc, char* argv[])
...
@@ -165,7 +164,7 @@ int main(int argc, char* argv[])
bool
time_kernel
=
false
;
bool
time_kernel
=
false
;
int
num_dim_spatial
=
2
;
int
num_dim_spatial
=
2
;
ck
::
tensor_operation
::
device
::
ConvParam
s
params
{
ck
::
utils
::
conv
::
ConvParam
params
{
2
,
128
,
256
,
192
,
{
3
,
3
},
{
71
,
71
},
{
2
,
2
},
{
1
,
1
},
{
1
,
1
},
{
1
,
1
}};
2
,
128
,
256
,
192
,
{
3
,
3
},
{
71
,
71
},
{
2
,
2
},
{
1
,
1
},
{
1
,
1
},
{
1
,
1
}};
if
(
argc
==
1
)
if
(
argc
==
1
)
...
...
example/09_convnd_fwd/convnd_fwd_common.hpp
View file @
8e8ae66d
...
@@ -35,8 +35,7 @@ void print_helper_msg()
...
@@ -35,8 +35,7 @@ void print_helper_msg()
<<
std
::
endl
;
<<
std
::
endl
;
}
}
ck
::
tensor_operation
::
device
::
ConvParams
ck
::
utils
::
conv
::
ConvParam
parse_conv_params
(
int
num_dim_spatial
,
int
arg_idx
,
char
*
const
argv
[])
parse_conv_params
(
int
num_dim_spatial
,
int
arg_idx
,
char
*
const
argv
[])
{
{
const
ck
::
index_t
N
=
std
::
stoi
(
argv
[
arg_idx
++
]);
const
ck
::
index_t
N
=
std
::
stoi
(
argv
[
arg_idx
++
]);
const
ck
::
index_t
K
=
std
::
stoi
(
argv
[
arg_idx
++
]);
const
ck
::
index_t
K
=
std
::
stoi
(
argv
[
arg_idx
++
]);
...
@@ -79,16 +78,16 @@ parse_conv_params(int num_dim_spatial, int arg_idx, char* const argv[])
...
@@ -79,16 +78,16 @@ parse_conv_params(int num_dim_spatial, int arg_idx, char* const argv[])
input_right_pads
[
i
]
=
std
::
stoi
(
argv
[
arg_idx
++
]);
input_right_pads
[
i
]
=
std
::
stoi
(
argv
[
arg_idx
++
]);
}
}
return
ck
::
tensor_operation
::
device
::
ConvParam
s
{
num_dim_spatial
,
return
ck
::
utils
::
conv
::
ConvParam
{
num_dim_spatial
,
N
,
N
,
K
,
K
,
C
,
C
,
filter_spatial_lengths
,
filter_spatial_lengths
,
input_spatial_lengths
,
input_spatial_lengths
,
conv_filter_strides
,
conv_filter_strides
,
conv_filter_dilations
,
conv_filter_dilations
,
input_left_pads
,
input_left_pads
,
input_right_pads
};
input_right_pads
};
}
}
// FIXME: current implementation only support NCHW/NHWC layout
// FIXME: current implementation only support NCHW/NHWC layout
...
@@ -106,7 +105,7 @@ template <ck::index_t NDimSpatial,
...
@@ -106,7 +105,7 @@ template <ck::index_t NDimSpatial,
int
run_conv_fwd
(
bool
do_verification
,
int
run_conv_fwd
(
bool
do_verification
,
int
init_method
,
int
init_method
,
bool
time_kernel
,
bool
time_kernel
,
const
ck
::
tensor_operation
::
device
::
ConvParam
s
&
param
s
,
const
ck
::
utils
::
conv
::
ConvParam
&
conv_
param
,
const
InElementOp
&
in_element_op
,
const
InElementOp
&
in_element_op
,
const
WeiElementOp
&
wei_element_op
,
const
WeiElementOp
&
wei_element_op
,
const
OutElementOp
&
out_element_op
)
const
OutElementOp
&
out_element_op
)
...
@@ -149,16 +148,16 @@ int run_conv_fwd(bool do_verification,
...
@@ -149,16 +148,16 @@ int run_conv_fwd(bool do_verification,
auto
argument
=
conv
.
MakeArgument
(
static_cast
<
InDataType
*>
(
in_device_buf
.
GetDeviceBuffer
()),
auto
argument
=
conv
.
MakeArgument
(
static_cast
<
InDataType
*>
(
in_device_buf
.
GetDeviceBuffer
()),
static_cast
<
WeiDataType
*>
(
wei_device_buf
.
GetDeviceBuffer
()),
static_cast
<
WeiDataType
*>
(
wei_device_buf
.
GetDeviceBuffer
()),
static_cast
<
OutDataType
*>
(
out_device_buf
.
GetDeviceBuffer
()),
static_cast
<
OutDataType
*>
(
out_device_buf
.
GetDeviceBuffer
()),
param
s
.
N_
,
conv_
param
.
N_
,
param
s
.
K_
,
conv_
param
.
K_
,
param
s
.
C_
,
conv_
param
.
C_
,
param
s
.
input_spatial_lengths_
,
conv_
param
.
input_spatial_lengths_
,
param
s
.
filter_spatial_lengths_
,
conv_
param
.
filter_spatial_lengths_
,
param
s
.
GetOutputSpatialLengths
(),
conv_
param
.
GetOutputSpatialLengths
(),
param
s
.
conv_filter_strides_
,
conv_
param
.
conv_filter_strides_
,
param
s
.
conv_filter_dilations_
,
conv_
param
.
conv_filter_dilations_
,
param
s
.
input_left_pads_
,
conv_
param
.
input_left_pads_
,
param
s
.
input_right_pads_
,
conv_
param
.
input_right_pads_
,
in_element_op
,
in_element_op
,
wei_element_op
,
wei_element_op
,
out_element_op
);
out_element_op
);
...
@@ -172,8 +171,8 @@ int run_conv_fwd(bool do_verification,
...
@@ -172,8 +171,8 @@ int run_conv_fwd(bool do_verification,
float
avg_time
=
invoker
.
Run
(
argument
,
StreamConfig
{
nullptr
,
time_kernel
});
float
avg_time
=
invoker
.
Run
(
argument
,
StreamConfig
{
nullptr
,
time_kernel
});
std
::
size_t
flop
=
param
s
.
GetFlops
();
std
::
size_t
flop
=
conv_
param
.
GetFlops
();
std
::
size_t
num_btype
=
param
s
.
GetByte
<
InDataType
,
WeiDataType
,
OutDataType
>
();
std
::
size_t
num_btype
=
conv_
param
.
GetByte
<
InDataType
,
WeiDataType
,
OutDataType
>
();
float
tflops
=
static_cast
<
float
>
(
flop
)
/
1.E9
/
avg_time
;
float
tflops
=
static_cast
<
float
>
(
flop
)
/
1.E9
/
avg_time
;
float
gb_per_sec
=
num_btype
/
1.E6
/
avg_time
;
float
gb_per_sec
=
num_btype
/
1.E6
/
avg_time
;
...
@@ -197,10 +196,10 @@ int run_conv_fwd(bool do_verification,
...
@@ -197,10 +196,10 @@ int run_conv_fwd(bool do_verification,
auto
ref_argument
=
ref_conv
.
MakeArgument
(
in
,
auto
ref_argument
=
ref_conv
.
MakeArgument
(
in
,
wei
,
wei
,
out_host
,
out_host
,
param
s
.
conv_filter_strides_
,
conv_
param
.
conv_filter_strides_
,
param
s
.
conv_filter_dilations_
,
conv_
param
.
conv_filter_dilations_
,
param
s
.
input_left_pads_
,
conv_
param
.
input_left_pads_
,
param
s
.
input_right_pads_
,
conv_
param
.
input_right_pads_
,
in_element_op
,
in_element_op
,
wei_element_op
,
wei_element_op
,
out_element_op
);
out_element_op
);
...
...
example/09_convnd_fwd/convnd_fwd_xdl_bf16.cpp
View file @
8e8ae66d
...
@@ -66,7 +66,7 @@ int main(int argc, char* argv[])
...
@@ -66,7 +66,7 @@ int main(int argc, char* argv[])
bool
time_kernel
=
false
;
bool
time_kernel
=
false
;
int
num_dim_spatial
=
2
;
int
num_dim_spatial
=
2
;
ck
::
tensor_operation
::
device
::
ConvParam
s
params
{
ck
::
utils
::
conv
::
ConvParam
params
{
2
,
128
,
256
,
192
,
{
3
,
3
},
{
71
,
71
},
{
2
,
2
},
{
1
,
1
},
{
1
,
1
},
{
1
,
1
}};
2
,
128
,
256
,
192
,
{
3
,
3
},
{
71
,
71
},
{
2
,
2
},
{
1
,
1
},
{
1
,
1
},
{
1
,
1
}};
if
(
argc
==
1
)
if
(
argc
==
1
)
...
...
example/09_convnd_fwd/convnd_fwd_xdl_fp16.cpp
View file @
8e8ae66d
...
@@ -66,7 +66,7 @@ int main(int argc, char* argv[])
...
@@ -66,7 +66,7 @@ int main(int argc, char* argv[])
bool
time_kernel
=
false
;
bool
time_kernel
=
false
;
int
num_dim_spatial
=
2
;
int
num_dim_spatial
=
2
;
ck
::
tensor_operation
::
device
::
ConvParam
s
params
{
ck
::
utils
::
conv
::
ConvParam
params
{
2
,
128
,
256
,
192
,
{
3
,
3
},
{
71
,
71
},
{
2
,
2
},
{
1
,
1
},
{
1
,
1
},
{
1
,
1
}};
2
,
128
,
256
,
192
,
{
3
,
3
},
{
71
,
71
},
{
2
,
2
},
{
1
,
1
},
{
1
,
1
},
{
1
,
1
}};
if
(
argc
==
1
)
if
(
argc
==
1
)
...
...
example/09_convnd_fwd/convnd_fwd_xdl_fp32.cpp
View file @
8e8ae66d
...
@@ -66,7 +66,7 @@ int main(int argc, char* argv[])
...
@@ -66,7 +66,7 @@ int main(int argc, char* argv[])
bool
time_kernel
=
false
;
bool
time_kernel
=
false
;
int
num_dim_spatial
=
2
;
int
num_dim_spatial
=
2
;
ck
::
tensor_operation
::
device
::
ConvParam
s
params
{
ck
::
utils
::
conv
::
ConvParam
params
{
2
,
128
,
256
,
192
,
{
3
,
3
},
{
71
,
71
},
{
2
,
2
},
{
1
,
1
},
{
1
,
1
},
{
1
,
1
}};
2
,
128
,
256
,
192
,
{
3
,
3
},
{
71
,
71
},
{
2
,
2
},
{
1
,
1
},
{
1
,
1
},
{
1
,
1
}};
if
(
argc
==
1
)
if
(
argc
==
1
)
...
...
example/09_convnd_fwd/convnd_fwd_xdl_fp64.cpp
View file @
8e8ae66d
...
@@ -66,7 +66,7 @@ int main(int argc, char* argv[])
...
@@ -66,7 +66,7 @@ int main(int argc, char* argv[])
bool
time_kernel
=
false
;
bool
time_kernel
=
false
;
int
num_dim_spatial
=
2
;
int
num_dim_spatial
=
2
;
ck
::
tensor_operation
::
device
::
ConvParam
s
params
{
ck
::
utils
::
conv
::
ConvParam
params
{
2
,
128
,
256
,
192
,
{
3
,
3
},
{
71
,
71
},
{
2
,
2
},
{
1
,
1
},
{
1
,
1
},
{
1
,
1
}};
2
,
128
,
256
,
192
,
{
3
,
3
},
{
71
,
71
},
{
2
,
2
},
{
1
,
1
},
{
1
,
1
},
{
1
,
1
}};
if
(
argc
==
1
)
if
(
argc
==
1
)
...
...
example/09_convnd_fwd/convnd_fwd_xdl_int8.cpp
View file @
8e8ae66d
...
@@ -66,7 +66,7 @@ int main(int argc, char* argv[])
...
@@ -66,7 +66,7 @@ int main(int argc, char* argv[])
bool
time_kernel
=
false
;
bool
time_kernel
=
false
;
int
num_dim_spatial
=
2
;
int
num_dim_spatial
=
2
;
ck
::
tensor_operation
::
device
::
ConvParam
s
params
{
ck
::
utils
::
conv
::
ConvParam
params
{
2
,
128
,
256
,
192
,
{
3
,
3
},
{
71
,
71
},
{
2
,
2
},
{
1
,
1
},
{
1
,
1
},
{
1
,
1
}};
2
,
128
,
256
,
192
,
{
3
,
3
},
{
71
,
71
},
{
2
,
2
},
{
1
,
1
},
{
1
,
1
},
{
1
,
1
}};
if
(
argc
==
1
)
if
(
argc
==
1
)
...
...
example/17_convnd_bwd_data/convnd_bwd_data_common.hpp
View file @
8e8ae66d
...
@@ -18,8 +18,7 @@
...
@@ -18,8 +18,7 @@
#include "ck/library/utility/convolution_host_tensor_descriptor_helper.hpp"
#include "ck/library/utility/convolution_host_tensor_descriptor_helper.hpp"
#include "ck/library/reference_tensor_operation/cpu/reference_conv_bwd_data.hpp"
#include "ck/library/reference_tensor_operation/cpu/reference_conv_bwd_data.hpp"
ck
::
tensor_operation
::
device
::
ConvParams
ck
::
utils
::
conv
::
ConvParam
parse_conv_params
(
int
num_dim_spatial
,
int
arg_idx
,
char
*
const
argv
[])
parse_conv_params
(
int
num_dim_spatial
,
int
arg_idx
,
char
*
const
argv
[])
{
{
const
ck
::
index_t
N
=
std
::
stoi
(
argv
[
arg_idx
++
]);
const
ck
::
index_t
N
=
std
::
stoi
(
argv
[
arg_idx
++
]);
const
ck
::
index_t
K
=
std
::
stoi
(
argv
[
arg_idx
++
]);
const
ck
::
index_t
K
=
std
::
stoi
(
argv
[
arg_idx
++
]);
...
@@ -62,16 +61,16 @@ parse_conv_params(int num_dim_spatial, int arg_idx, char* const argv[])
...
@@ -62,16 +61,16 @@ parse_conv_params(int num_dim_spatial, int arg_idx, char* const argv[])
input_right_pads
[
i
]
=
std
::
stoi
(
argv
[
arg_idx
++
]);
input_right_pads
[
i
]
=
std
::
stoi
(
argv
[
arg_idx
++
]);
}
}
return
ck
::
tensor_operation
::
device
::
ConvParam
s
{
num_dim_spatial
,
return
ck
::
utils
::
conv
::
ConvParam
{
num_dim_spatial
,
N
,
N
,
K
,
K
,
C
,
C
,
filter_spatial_lengths
,
filter_spatial_lengths
,
input_spatial_lengths
,
input_spatial_lengths
,
conv_filter_strides
,
conv_filter_strides
,
conv_filter_dilations
,
conv_filter_dilations
,
input_left_pads
,
input_left_pads
,
input_right_pads
};
input_right_pads
};
}
}
void
print_helper_msg
()
void
print_helper_msg
()
...
@@ -106,7 +105,7 @@ template <ck::index_t NDimSpatial,
...
@@ -106,7 +105,7 @@ template <ck::index_t NDimSpatial,
int
run_conv_bwd_data
(
bool
do_verification
,
int
run_conv_bwd_data
(
bool
do_verification
,
int
init_method
,
int
init_method
,
bool
time_kernel
,
bool
time_kernel
,
const
ck
::
tensor_operation
::
device
::
ConvParam
s
&
conv_param
,
const
ck
::
utils
::
conv
::
ConvParam
&
conv_param
,
const
InElementOp
&
in_element_op
,
const
InElementOp
&
in_element_op
,
const
WeiElementOp
&
wei_element_op
,
const
WeiElementOp
&
wei_element_op
,
const
OutElementOp
&
out_element_op
)
const
OutElementOp
&
out_element_op
)
...
...
example/17_convnd_bwd_data/convnd_bwd_data_xdl_fp16.cpp
View file @
8e8ae66d
...
@@ -66,7 +66,7 @@ int main(int argc, char* argv[])
...
@@ -66,7 +66,7 @@ int main(int argc, char* argv[])
bool
time_kernel
=
false
;
bool
time_kernel
=
false
;
int
num_dim_spatial
=
2
;
int
num_dim_spatial
=
2
;
ck
::
tensor_operation
::
device
::
ConvParam
s
params
{
ck
::
utils
::
conv
::
ConvParam
params
{
2
,
128
,
256
,
256
,
{
3
,
3
},
{
71
,
71
},
{
2
,
2
},
{
1
,
1
},
{
1
,
1
},
{
1
,
1
}};
2
,
128
,
256
,
256
,
{
3
,
3
},
{
71
,
71
},
{
2
,
2
},
{
1
,
1
},
{
1
,
1
},
{
1
,
1
}};
if
(
argc
==
1
)
if
(
argc
==
1
)
...
...
example/20_convnd_bwd_weight/convnd_bwd_weight_common.hpp
View file @
8e8ae66d
...
@@ -35,8 +35,7 @@ void print_helper_msg()
...
@@ -35,8 +35,7 @@ void print_helper_msg()
<<
"split_k"
<<
std
::
endl
;
<<
"split_k"
<<
std
::
endl
;
}
}
ck
::
tensor_operation
::
device
::
ConvParams
ck
::
utils
::
conv
::
ConvParam
parse_conv_params
(
int
num_dim_spatial
,
int
arg_idx
,
char
*
const
argv
[])
parse_conv_params
(
int
num_dim_spatial
,
int
arg_idx
,
char
*
const
argv
[])
{
{
const
ck
::
index_t
N
=
std
::
stoi
(
argv
[
arg_idx
++
]);
const
ck
::
index_t
N
=
std
::
stoi
(
argv
[
arg_idx
++
]);
const
ck
::
index_t
K
=
std
::
stoi
(
argv
[
arg_idx
++
]);
const
ck
::
index_t
K
=
std
::
stoi
(
argv
[
arg_idx
++
]);
...
@@ -79,16 +78,16 @@ parse_conv_params(int num_dim_spatial, int arg_idx, char* const argv[])
...
@@ -79,16 +78,16 @@ parse_conv_params(int num_dim_spatial, int arg_idx, char* const argv[])
input_right_pads
[
i
]
=
std
::
stoi
(
argv
[
arg_idx
++
]);
input_right_pads
[
i
]
=
std
::
stoi
(
argv
[
arg_idx
++
]);
}
}
return
ck
::
tensor_operation
::
device
::
ConvParam
s
{
num_dim_spatial
,
return
ck
::
utils
::
conv
::
ConvParam
{
num_dim_spatial
,
N
,
N
,
K
,
K
,
C
,
C
,
filter_spatial_lengths
,
filter_spatial_lengths
,
input_spatial_lengths
,
input_spatial_lengths
,
conv_filter_strides
,
conv_filter_strides
,
conv_filter_dilations
,
conv_filter_dilations
,
input_left_pads
,
input_left_pads
,
input_right_pads
};
input_right_pads
};
}
}
// FIXME: current implementation only support NCHW/NHWC layout
// FIXME: current implementation only support NCHW/NHWC layout
...
@@ -106,7 +105,7 @@ template <ck::index_t NDimSpatial,
...
@@ -106,7 +105,7 @@ template <ck::index_t NDimSpatial,
int
run_conv_bwd_weight
(
bool
do_verification
,
int
run_conv_bwd_weight
(
bool
do_verification
,
int
init_method
,
int
init_method
,
bool
time_kernel
,
bool
time_kernel
,
const
ck
::
tensor_operation
::
device
::
ConvParam
s
&
param
s
,
const
ck
::
utils
::
conv
::
ConvParam
&
conv_
param
,
const
InElementOp
&
in_element_op
,
const
InElementOp
&
in_element_op
,
const
WeiElementOp
&
wei_element_op
,
const
WeiElementOp
&
wei_element_op
,
const
OutElementOp
&
out_element_op
,
const
OutElementOp
&
out_element_op
,
...
@@ -153,16 +152,16 @@ int run_conv_bwd_weight(bool do_verification,
...
@@ -153,16 +152,16 @@ int run_conv_bwd_weight(bool do_verification,
auto
argument
=
conv
.
MakeArgument
(
static_cast
<
InDataType
*>
(
in_device_buf
.
GetDeviceBuffer
()),
auto
argument
=
conv
.
MakeArgument
(
static_cast
<
InDataType
*>
(
in_device_buf
.
GetDeviceBuffer
()),
static_cast
<
WeiDataType
*>
(
wei_device_buf
.
GetDeviceBuffer
()),
static_cast
<
WeiDataType
*>
(
wei_device_buf
.
GetDeviceBuffer
()),
static_cast
<
OutDataType
*>
(
out_device_buf
.
GetDeviceBuffer
()),
static_cast
<
OutDataType
*>
(
out_device_buf
.
GetDeviceBuffer
()),
param
s
.
N_
,
conv_
param
.
N_
,
param
s
.
K_
,
conv_
param
.
K_
,
param
s
.
C_
,
conv_
param
.
C_
,
param
s
.
input_spatial_lengths_
,
conv_
param
.
input_spatial_lengths_
,
param
s
.
filter_spatial_lengths_
,
conv_
param
.
filter_spatial_lengths_
,
param
s
.
output_spatial_lengths_
,
conv_
param
.
output_spatial_lengths_
,
param
s
.
conv_filter_strides_
,
conv_
param
.
conv_filter_strides_
,
param
s
.
conv_filter_dilations_
,
conv_
param
.
conv_filter_dilations_
,
param
s
.
input_left_pads_
,
conv_
param
.
input_left_pads_
,
param
s
.
input_right_pads_
,
conv_
param
.
input_right_pads_
,
in_element_op
,
in_element_op
,
wei_element_op
,
wei_element_op
,
out_element_op
,
out_element_op
,
...
@@ -178,8 +177,8 @@ int run_conv_bwd_weight(bool do_verification,
...
@@ -178,8 +177,8 @@ int run_conv_bwd_weight(bool do_verification,
float
avg_time
=
invoker
.
Run
(
argument
,
StreamConfig
{
nullptr
,
time_kernel
});
float
avg_time
=
invoker
.
Run
(
argument
,
StreamConfig
{
nullptr
,
time_kernel
});
std
::
size_t
flop
=
param
s
.
GetFlops
();
std
::
size_t
flop
=
conv_
param
.
GetFlops
();
std
::
size_t
num_btype
=
param
s
.
GetByte
<
InDataType
,
WeiDataType
,
OutDataType
>
();
std
::
size_t
num_btype
=
conv_
param
.
GetByte
<
InDataType
,
WeiDataType
,
OutDataType
>
();
float
tflops
=
static_cast
<
float
>
(
flop
)
/
1.E9
/
avg_time
;
float
tflops
=
static_cast
<
float
>
(
flop
)
/
1.E9
/
avg_time
;
...
@@ -206,10 +205,10 @@ int run_conv_bwd_weight(bool do_verification,
...
@@ -206,10 +205,10 @@ int run_conv_bwd_weight(bool do_verification,
auto
ref_argument
=
ref_conv
.
MakeArgument
(
in
,
auto
ref_argument
=
ref_conv
.
MakeArgument
(
in
,
wei_host_result
,
wei_host_result
,
out
,
out
,
param
s
.
conv_filter_strides_
,
conv_
param
.
conv_filter_strides_
,
param
s
.
conv_filter_dilations_
,
conv_
param
.
conv_filter_dilations_
,
param
s
.
input_left_pads_
,
conv_
param
.
input_left_pads_
,
param
s
.
input_right_pads_
,
conv_
param
.
input_right_pads_
,
InElementOp
{},
InElementOp
{},
WeiElementOp
{},
WeiElementOp
{},
OutElementOp
{});
OutElementOp
{});
...
...
example/20_convnd_bwd_weight/convnd_bwd_weight_xdl_bf16.cpp
View file @
8e8ae66d
...
@@ -70,7 +70,7 @@ int main(int argc, char* argv[])
...
@@ -70,7 +70,7 @@ int main(int argc, char* argv[])
bool
time_kernel
=
false
;
bool
time_kernel
=
false
;
int
num_dim_spatial
=
2
;
int
num_dim_spatial
=
2
;
ck
::
tensor_operation
::
device
::
ConvParam
s
params
{
ck
::
utils
::
conv
::
ConvParam
params
{
2
,
32
,
256
,
1024
,
{
3
,
3
},
{
14
,
14
},
{
2
,
2
},
{
1
,
1
},
{
1
,
1
},
{
1
,
1
}};
2
,
32
,
256
,
1024
,
{
3
,
3
},
{
14
,
14
},
{
2
,
2
},
{
1
,
1
},
{
1
,
1
},
{
1
,
1
}};
ck
::
index_t
split_k
=
4
;
ck
::
index_t
split_k
=
4
;
...
...
example/20_convnd_bwd_weight/convnd_bwd_weight_xdl_fp16.cpp
View file @
8e8ae66d
...
@@ -69,7 +69,7 @@ int main(int argc, char* argv[])
...
@@ -69,7 +69,7 @@ int main(int argc, char* argv[])
bool
time_kernel
=
false
;
bool
time_kernel
=
false
;
int
num_dim_spatial
=
2
;
int
num_dim_spatial
=
2
;
ck
::
tensor_operation
::
device
::
ConvParam
s
params
{
ck
::
utils
::
conv
::
ConvParam
params
{
2
,
32
,
256
,
1024
,
{
3
,
3
},
{
14
,
14
},
{
2
,
2
},
{
1
,
1
},
{
1
,
1
},
{
1
,
1
}};
2
,
32
,
256
,
1024
,
{
3
,
3
},
{
14
,
14
},
{
2
,
2
},
{
1
,
1
},
{
1
,
1
},
{
1
,
1
}};
ck
::
index_t
split_k
=
4
;
ck
::
index_t
split_k
=
4
;
...
...
library/include/ck/library/utility/convolution_host_tensor_descriptor_helper.hpp
View file @
8e8ae66d
...
@@ -12,8 +12,7 @@ namespace utils {
...
@@ -12,8 +12,7 @@ namespace utils {
namespace
conv
{
namespace
conv
{
template
<
typename
InLayout
>
template
<
typename
InLayout
>
HostTensorDescriptor
HostTensorDescriptor
get_input_host_tensor_descriptor
(
const
ck
::
utils
::
conv
::
ConvParam
&
param
)
get_input_host_tensor_descriptor
(
const
ck
::
tensor_operation
::
device
::
ConvParams
&
param
)
{
{
if
constexpr
(
ck
::
is_same_v
<
InLayout
,
ck
::
tensor_layout
::
convolution
::
NWC
>
||
if
constexpr
(
ck
::
is_same_v
<
InLayout
,
ck
::
tensor_layout
::
convolution
::
NWC
>
||
ck
::
is_same_v
<
InLayout
,
ck
::
tensor_layout
::
convolution
::
NHWC
>
||
ck
::
is_same_v
<
InLayout
,
ck
::
tensor_layout
::
convolution
::
NHWC
>
||
...
@@ -48,8 +47,7 @@ get_input_host_tensor_descriptor(const ck::tensor_operation::device::ConvParams&
...
@@ -48,8 +47,7 @@ get_input_host_tensor_descriptor(const ck::tensor_operation::device::ConvParams&
}
}
template
<
typename
WeiLayout
>
template
<
typename
WeiLayout
>
HostTensorDescriptor
HostTensorDescriptor
get_weight_host_tensor_descriptor
(
const
ck
::
utils
::
conv
::
ConvParam
&
param
)
get_weight_host_tensor_descriptor
(
const
ck
::
tensor_operation
::
device
::
ConvParams
&
param
)
{
{
if
constexpr
(
ck
::
is_same_v
<
WeiLayout
,
ck
::
tensor_layout
::
convolution
::
KXC
>
||
if
constexpr
(
ck
::
is_same_v
<
WeiLayout
,
ck
::
tensor_layout
::
convolution
::
KXC
>
||
ck
::
is_same_v
<
WeiLayout
,
ck
::
tensor_layout
::
convolution
::
KYXC
>
||
ck
::
is_same_v
<
WeiLayout
,
ck
::
tensor_layout
::
convolution
::
KYXC
>
||
...
@@ -84,8 +82,7 @@ get_weight_host_tensor_descriptor(const ck::tensor_operation::device::ConvParams
...
@@ -84,8 +82,7 @@ get_weight_host_tensor_descriptor(const ck::tensor_operation::device::ConvParams
}
}
template
<
typename
OutLayout
>
template
<
typename
OutLayout
>
HostTensorDescriptor
HostTensorDescriptor
get_output_host_tensor_descriptor
(
const
ck
::
utils
::
conv
::
ConvParam
&
param
)
get_output_host_tensor_descriptor
(
const
ck
::
tensor_operation
::
device
::
ConvParams
&
param
)
{
{
if
constexpr
(
ck
::
is_same_v
<
OutLayout
,
ck
::
tensor_layout
::
convolution
::
NWK
>
||
if
constexpr
(
ck
::
is_same_v
<
OutLayout
,
ck
::
tensor_layout
::
convolution
::
NWK
>
||
ck
::
is_same_v
<
OutLayout
,
ck
::
tensor_layout
::
convolution
::
NHWK
>
||
ck
::
is_same_v
<
OutLayout
,
ck
::
tensor_layout
::
convolution
::
NHWK
>
||
...
...
library/include/ck/library/utility/convolution_parameter.hpp
View file @
8e8ae66d
...
@@ -11,22 +11,22 @@
...
@@ -11,22 +11,22 @@
#include "ck/ck.hpp"
#include "ck/ck.hpp"
namespace
ck
{
namespace
ck
{
namespace
tensor_operation
{
namespace
utils
{
namespace
device
{
namespace
conv
{
struct
ConvParam
s
struct
ConvParam
{
{
ConvParam
s
();
ConvParam
();
ConvParam
s
(
ck
::
index_t
n_dim
,
ConvParam
(
ck
::
index_t
n_dim
,
ck
::
index_t
n_batch
,
ck
::
index_t
n_batch
,
ck
::
index_t
n_out_channels
,
ck
::
index_t
n_out_channels
,
ck
::
index_t
n_in_channels
,
ck
::
index_t
n_in_channels
,
const
std
::
vector
<
ck
::
index_t
>&
filters_len
,
const
std
::
vector
<
ck
::
index_t
>&
filters_len
,
const
std
::
vector
<
ck
::
index_t
>&
input_len
,
const
std
::
vector
<
ck
::
index_t
>&
input_len
,
const
std
::
vector
<
ck
::
index_t
>&
strides
,
const
std
::
vector
<
ck
::
index_t
>&
strides
,
const
std
::
vector
<
ck
::
index_t
>&
dilations
,
const
std
::
vector
<
ck
::
index_t
>&
dilations
,
const
std
::
vector
<
ck
::
index_t
>&
left_pads
,
const
std
::
vector
<
ck
::
index_t
>&
left_pads
,
const
std
::
vector
<
ck
::
index_t
>&
right_pads
);
const
std
::
vector
<
ck
::
index_t
>&
right_pads
);
ck
::
index_t
num_dim_spatial_
;
ck
::
index_t
num_dim_spatial_
;
ck
::
index_t
N_
;
ck
::
index_t
N_
;
...
@@ -71,8 +71,8 @@ struct ConvParams
...
@@ -71,8 +71,8 @@ struct ConvParams
}
}
};
};
}
// namespace
device
}
// namespace
conv
}
// namespace
tensor_operation
}
// namespace
utils
}
// namespace ck
}
// namespace ck
std
::
ostream
&
operator
<<
(
std
::
ostream
&
os
,
const
ck
::
tensor_operation
::
device
::
ConvParam
s
&
p
);
std
::
ostream
&
operator
<<
(
std
::
ostream
&
os
,
const
ck
::
utils
::
conv
::
ConvParam
&
p
);
library/src/utility/convolution_parameter.cpp
View file @
8e8ae66d
...
@@ -5,19 +5,19 @@
...
@@ -5,19 +5,19 @@
#include "ck/library/utility/io.hpp"
#include "ck/library/utility/io.hpp"
namespace
ck
{
namespace
ck
{
namespace
tensor_operation
{
namespace
utils
{
namespace
device
{
namespace
conv
{
ConvParam
s
::
ConvParam
s
(
ck
::
index_t
n_dim
,
ConvParam
::
ConvParam
(
ck
::
index_t
n_dim
,
ck
::
index_t
n_batch
,
ck
::
index_t
n_batch
,
ck
::
index_t
n_out_channels
,
ck
::
index_t
n_out_channels
,
ck
::
index_t
n_in_channels
,
ck
::
index_t
n_in_channels
,
const
std
::
vector
<
ck
::
index_t
>&
filters_len
,
const
std
::
vector
<
ck
::
index_t
>&
filters_len
,
const
std
::
vector
<
ck
::
index_t
>&
input_len
,
const
std
::
vector
<
ck
::
index_t
>&
input_len
,
const
std
::
vector
<
ck
::
index_t
>&
strides
,
const
std
::
vector
<
ck
::
index_t
>&
strides
,
const
std
::
vector
<
ck
::
index_t
>&
dilations
,
const
std
::
vector
<
ck
::
index_t
>&
dilations
,
const
std
::
vector
<
ck
::
index_t
>&
left_pads
,
const
std
::
vector
<
ck
::
index_t
>&
left_pads
,
const
std
::
vector
<
ck
::
index_t
>&
right_pads
)
const
std
::
vector
<
ck
::
index_t
>&
right_pads
)
:
num_dim_spatial_
(
n_dim
),
:
num_dim_spatial_
(
n_dim
),
N_
(
n_batch
),
N_
(
n_batch
),
K_
(
n_out_channels
),
K_
(
n_out_channels
),
...
@@ -38,7 +38,7 @@ ConvParams::ConvParams(ck::index_t n_dim,
...
@@ -38,7 +38,7 @@ ConvParams::ConvParams(ck::index_t n_dim,
static_cast
<
ck
::
index_t
>
(
input_right_pads_
.
size
())
!=
num_dim_spatial_
)
static_cast
<
ck
::
index_t
>
(
input_right_pads_
.
size
())
!=
num_dim_spatial_
)
{
{
throw
(
throw
(
std
::
runtime_error
(
"ConvParam
s
::ConvParam
s
: "
std
::
runtime_error
(
"ConvParam::ConvParam: "
"parameter size is different from number of declared dimensions!"
));
"parameter size is different from number of declared dimensions!"
));
}
}
...
@@ -55,17 +55,17 @@ ConvParams::ConvParams(ck::index_t n_dim,
...
@@ -55,17 +55,17 @@ ConvParams::ConvParams(ck::index_t n_dim,
}
}
}
}
ConvParam
s
::
ConvParam
s
()
ConvParam
::
ConvParam
()
:
ConvParam
s
::
ConvParam
s
(
2
,
128
,
256
,
192
,
{
3
,
3
},
{
71
,
71
},
{
2
,
2
},
{
1
,
1
},
{
1
,
1
},
{
1
,
1
})
:
ConvParam
::
ConvParam
(
2
,
128
,
256
,
192
,
{
3
,
3
},
{
71
,
71
},
{
2
,
2
},
{
1
,
1
},
{
1
,
1
},
{
1
,
1
})
{
{
}
}
std
::
vector
<
ck
::
index_t
>
ConvParam
s
::
GetOutputSpatialLengths
()
const
std
::
vector
<
ck
::
index_t
>
ConvParam
::
GetOutputSpatialLengths
()
const
{
{
return
output_spatial_lengths_
;
return
output_spatial_lengths_
;
}
}
std
::
size_t
ConvParam
s
::
GetFlops
()
const
std
::
size_t
ConvParam
::
GetFlops
()
const
{
{
// 2 * N * K * C * <output spatial lengths product> * <filter spatial lengths product>
// 2 * N * K * C * <output spatial lengths product> * <filter spatial lengths product>
return
static_cast
<
std
::
size_t
>
(
2
)
*
N_
*
K_
*
C_
*
return
static_cast
<
std
::
size_t
>
(
2
)
*
N_
*
K_
*
C_
*
...
@@ -79,13 +79,13 @@ std::size_t ConvParams::GetFlops() const
...
@@ -79,13 +79,13 @@ std::size_t ConvParams::GetFlops() const
std
::
multiplies
<
std
::
size_t
>
());
std
::
multiplies
<
std
::
size_t
>
());
}
}
}
// namespace
device
}
// namespace
conv
}
// namespace
tensor_operation
}
// namespace
utils
}
// namespace ck
}
// namespace ck
std
::
ostream
&
operator
<<
(
std
::
ostream
&
os
,
const
ck
::
tensor_operation
::
device
::
ConvParam
s
&
p
)
std
::
ostream
&
operator
<<
(
std
::
ostream
&
os
,
const
ck
::
utils
::
conv
::
ConvParam
&
p
)
{
{
os
<<
"ConvParam
s
{"
os
<<
"ConvParam {"
<<
"
\n
num_dim_spatial: "
<<
p
.
num_dim_spatial_
<<
"
\n
N: "
<<
p
.
N_
<<
"
\n
K: "
<<
p
.
K_
<<
"
\n
num_dim_spatial: "
<<
p
.
num_dim_spatial_
<<
"
\n
N: "
<<
p
.
N_
<<
"
\n
K: "
<<
p
.
K_
<<
"
\n
C: "
<<
p
.
C_
<<
"
\n
filter_spatial_lengths: "
<<
p
.
filter_spatial_lengths_
<<
"
\n
C: "
<<
p
.
C_
<<
"
\n
filter_spatial_lengths: "
<<
p
.
filter_spatial_lengths_
<<
"
\n
input_spatial_lengths: "
<<
p
.
input_spatial_lengths_
<<
"
\n
input_spatial_lengths: "
<<
p
.
input_spatial_lengths_
...
...
profiler/include/profile_conv_bwd_data_impl.hpp
View file @
8e8ae66d
...
@@ -58,7 +58,7 @@ bool profile_conv_bwd_data_impl(int do_verification,
...
@@ -58,7 +58,7 @@ bool profile_conv_bwd_data_impl(int do_verification,
int
init_method
,
int
init_method
,
bool
do_log
,
bool
do_log
,
bool
time_kernel
,
bool
time_kernel
,
const
ck
::
tensor_operation
::
device
::
ConvParam
s
&
conv_param
)
const
ck
::
utils
::
conv
::
ConvParam
&
conv_param
)
{
{
using
InElementOp
=
ck
::
tensor_operation
::
element_wise
::
PassThrough
;
using
InElementOp
=
ck
::
tensor_operation
::
element_wise
::
PassThrough
;
using
WeiElementOp
=
ck
::
tensor_operation
::
element_wise
::
PassThrough
;
using
WeiElementOp
=
ck
::
tensor_operation
::
element_wise
::
PassThrough
;
...
...
profiler/include/profile_conv_bwd_weight_impl.hpp
View file @
8e8ae66d
...
@@ -63,7 +63,7 @@ bool profile_conv_bwd_weight_impl(int do_verification,
...
@@ -63,7 +63,7 @@ bool profile_conv_bwd_weight_impl(int do_verification,
int
init_method
,
int
init_method
,
bool
do_log
,
bool
do_log
,
bool
time_kernel
,
bool
time_kernel
,
const
ck
::
tensor_operation
::
device
::
ConvParam
s
&
conv_param
,
const
ck
::
utils
::
conv
::
ConvParam
&
conv_param
,
ck
::
index_t
split_k
)
ck
::
index_t
split_k
)
{
{
using
InElementOp
=
ck
::
tensor_operation
::
element_wise
::
PassThrough
;
using
InElementOp
=
ck
::
tensor_operation
::
element_wise
::
PassThrough
;
...
...
profiler/include/profile_conv_fwd_impl.hpp
View file @
8e8ae66d
...
@@ -25,7 +25,6 @@
...
@@ -25,7 +25,6 @@
namespace
ck
{
namespace
ck
{
namespace
profiler
{
namespace
profiler
{
// FIXME: only support NCHW and NHWC layout, need to be more general
template
<
ck
::
index_t
NDimSpatial
,
template
<
ck
::
index_t
NDimSpatial
,
typename
InLayout
,
typename
InLayout
,
typename
WeiLayout
,
typename
WeiLayout
,
...
@@ -37,7 +36,7 @@ bool profile_conv_fwd_impl(int do_verification,
...
@@ -37,7 +36,7 @@ bool profile_conv_fwd_impl(int do_verification,
int
init_method
,
int
init_method
,
bool
do_log
,
bool
do_log
,
bool
time_kernel
,
bool
time_kernel
,
const
ck
::
tensor_operation
::
device
::
ConvParam
s
&
conv_param
)
const
ck
::
utils
::
conv
::
ConvParam
&
conv_param
)
{
{
const
auto
in_desc
=
ck
::
utils
::
conv
::
get_input_host_tensor_descriptor
<
InLayout
>
(
conv_param
);
const
auto
in_desc
=
ck
::
utils
::
conv
::
get_input_host_tensor_descriptor
<
InLayout
>
(
conv_param
);
const
auto
wei_desc
=
ck
::
utils
::
conv
::
get_weight_host_tensor_descriptor
<
WeiLayout
>
(
conv_param
);
const
auto
wei_desc
=
ck
::
utils
::
conv
::
get_weight_host_tensor_descriptor
<
WeiLayout
>
(
conv_param
);
...
...
profiler/src/profile_conv_bwd_data.cpp
View file @
8e8ae66d
...
@@ -51,8 +51,7 @@ static void print_helper_msg()
...
@@ -51,8 +51,7 @@ static void print_helper_msg()
<<
std
::
endl
;
<<
std
::
endl
;
}
}
ck
::
tensor_operation
::
device
::
ConvParams
ck
::
utils
::
conv
::
ConvParam
parse_conv_params
(
int
num_dim_spatial
,
int
arg_idx
,
char
*
const
argv
[])
parse_conv_params
(
int
num_dim_spatial
,
int
arg_idx
,
char
*
const
argv
[])
{
{
const
ck
::
index_t
N
=
std
::
stoi
(
argv
[
arg_idx
++
]);
const
ck
::
index_t
N
=
std
::
stoi
(
argv
[
arg_idx
++
]);
const
ck
::
index_t
K
=
std
::
stoi
(
argv
[
arg_idx
++
]);
const
ck
::
index_t
K
=
std
::
stoi
(
argv
[
arg_idx
++
]);
...
@@ -95,16 +94,16 @@ parse_conv_params(int num_dim_spatial, int arg_idx, char* const argv[])
...
@@ -95,16 +94,16 @@ parse_conv_params(int num_dim_spatial, int arg_idx, char* const argv[])
input_right_pads
[
i
]
=
std
::
stoi
(
argv
[
arg_idx
++
]);
input_right_pads
[
i
]
=
std
::
stoi
(
argv
[
arg_idx
++
]);
}
}
return
ck
::
tensor_operation
::
device
::
ConvParam
s
{
num_dim_spatial
,
return
ck
::
utils
::
conv
::
ConvParam
{
num_dim_spatial
,
N
,
N
,
K
,
K
,
C
,
C
,
filter_spatial_lengths
,
filter_spatial_lengths
,
input_spatial_lengths
,
input_spatial_lengths
,
conv_filter_strides
,
conv_filter_strides
,
conv_filter_dilations
,
conv_filter_dilations
,
input_left_pads
,
input_left_pads
,
input_right_pads
};
input_right_pads
};
}
}
}
// namespace
}
// namespace
...
...
Prev
1
2
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