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_ROCM
Commits
646b8e5c
Commit
646b8e5c
authored
Nov 07, 2024
by
Andriy Roshchenko
Browse files
Verify 38_grouped_conv_bwd_data_multiple_d on floating point numbers
parent
405fdaec
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
91 additions
and
4 deletions
+91
-4
example/38_grouped_conv_bwd_data_multiple_d/common.hpp
example/38_grouped_conv_bwd_data_multiple_d/common.hpp
+2
-2
example/38_grouped_conv_bwd_data_multiple_d/grouped_conv_bwd_data_xdl_fp16.cpp
...nv_bwd_data_multiple_d/grouped_conv_bwd_data_xdl_fp16.cpp
+1
-0
example/38_grouped_conv_bwd_data_multiple_d/grouped_conv_bwd_data_xdl_fp16_comp_bf8_fp8.cpp
...ultiple_d/grouped_conv_bwd_data_xdl_fp16_comp_bf8_fp8.cpp
+1
-0
example/38_grouped_conv_bwd_data_multiple_d/run_grouped_conv_bwd_data_example.inc
...bwd_data_multiple_d/run_grouped_conv_bwd_data_example.inc
+87
-2
No files found.
example/38_grouped_conv_bwd_data_multiple_d/common.hpp
View file @
646b8e5c
...
...
@@ -40,8 +40,8 @@ using BF8 = ck::bf8_t;
struct
ExecutionConfig
final
{
bool
do_verification
=
true
;
int
init_method
=
1
;
bool
time_kernel
=
tru
e
;
int
init_method
=
2
;
bool
time_kernel
=
fals
e
;
};
#define DefaultConvParams \
...
...
example/38_grouped_conv_bwd_data_multiple_d/grouped_conv_bwd_data_xdl_fp16.cpp
View file @
646b8e5c
...
...
@@ -10,6 +10,7 @@ using AccDataType = FP32;
using
CShuffleDataType
=
FP16
;
using
DsDataType
=
ck
::
Tuple
<>
;
using
InDataType
=
FP16
;
using
VerifyDataType
=
FP16
;
// is used for selection of check tolerances
using
OutLayout
=
ck
::
tensor_layout
::
convolution
::
GNHWK
;
using
WeiLayout
=
ck
::
tensor_layout
::
convolution
::
GKYXC
;
...
...
example/38_grouped_conv_bwd_data_multiple_d/grouped_conv_bwd_data_xdl_fp16_comp_bf8_fp8.cpp
View file @
646b8e5c
...
...
@@ -12,6 +12,7 @@ using DsDataType = ck::Tuple<>;
using
InDataType
=
FP16
;
using
AComputeType
=
BF8
;
using
BComputeType
=
FP8
;
using
VerifyDataType
=
BF8
;
// is used for selection of check tolerances
using
OutLayout
=
ck
::
tensor_layout
::
convolution
::
GNHWK
;
using
WeiLayout
=
ck
::
tensor_layout
::
convolution
::
GKYXC
;
...
...
example/38_grouped_conv_bwd_data_multiple_d/run_grouped_conv_bwd_data_example.inc
View file @
646b8e5c
// SPDX-License-Identifier: MIT
// Copyright (c) 2018-2023, Advanced Micro Devices, Inc. All rights reserved.
template
<
typename
DataType
>
inline
__host__
__device__
constexpr
double
get_rtol
()
{
if
constexpr
(
std
::
is_same_v
<
DataType
,
float
>
)
{
return
1
e
-
3
;
}
else
if
constexpr
(
std
::
is_same_v
<
DataType
,
double
>
)
{
return
1
e
-
6
;
}
else
if
constexpr
(
std
::
is_same_v
<
DataType
,
ck
::
half_t
>
)
{
return
1
e
-
3
;
}
else
if
constexpr
(
std
::
is_same_v
<
DataType
,
ck
::
bhalf_t
>
)
{
return
5
e
-
2
;
}
else
if
constexpr
(
std
::
is_same_v
<
DataType
,
int32_t
>
)
{
return
1
e
-
1
;
}
else
if
constexpr
(
std
::
is_same_v
<
DataType
,
int8_t
>
)
{
return
1
e
-
1
;
}
else
if
constexpr
(
std
::
is_same_v
<
DataType
,
ck
::
f8_t
>
)
{
return
1
;
}
else
if
constexpr
(
std
::
is_same_v
<
DataType
,
ck
::
bf8_t
>
)
{
return
1
;
}
else
{
return
1
e
-
3
;
}
}
template
<
typename
DataType
>
inline
__host__
__device__
constexpr
double
get_atol
()
{
if
constexpr
(
std
::
is_same_v
<
DataType
,
float
>
)
{
return
1
e
-
3
;
}
else
if
constexpr
(
std
::
is_same_v
<
DataType
,
double
>
)
{
return
1
e
-
6
;
}
else
if
constexpr
(
std
::
is_same_v
<
DataType
,
ck
::
half_t
>
)
{
return
1
e
-
3
;
}
else
if
constexpr
(
std
::
is_same_v
<
DataType
,
ck
::
bhalf_t
>
)
{
return
5
e
-
2
;
}
else
if
constexpr
(
std
::
is_same_v
<
DataType
,
int32_t
>
)
{
return
1
e
-
1
;
}
else
if
constexpr
(
std
::
is_same_v
<
DataType
,
int8_t
>
)
{
return
1
e
-
1
;
}
else
if
constexpr
(
std
::
is_same_v
<
DataType
,
ck
::
f8_t
>
)
{
return
1
;
}
else
if
constexpr
(
std
::
is_same_v
<
DataType
,
ck
::
bf8_t
>
)
{
return
1
;
}
else
{
return
1
e
-
3
;
}
}
bool
run_conv_bwd_data
(
const
ExecutionConfig
&
config
,
const
ck
::
utils
::
conv
::
ConvParam
&
conv_params
,
...
...
@@ -27,7 +108,7 @@ bool run_conv_bwd_data(const ExecutionConfig& config,
wei
.
GenerateTensorValue
(
GeneratorTensor_2
<
WeiDataType
>
{
-
5
,
5
});
break
;
default
:
out
.
GenerateTensorValue
(
GeneratorTensor_3
<
OutDataType
>
{
0.
0
,
1.0
});
out
.
GenerateTensorValue
(
GeneratorTensor_3
<
OutDataType
>
{
-
0.
5
,
0.5
});
wei
.
GenerateTensorValue
(
GeneratorTensor_3
<
WeiDataType
>
{
-
0.5
,
0.5
});
}
...
...
@@ -138,7 +219,11 @@ bool run_conv_bwd_data(const ExecutionConfig& config,
in_device_buf
.
FromDevice
(
in_device
.
mData
.
data
());
return
ck
::
utils
::
check_err
(
in_device
.
mData
,
in_host
.
mData
);
return
ck
::
utils
::
check_err
(
in_device
.
mData
,
in_host
.
mData
,
"Error: Incorrect results!"
,
get_rtol
<
VerifyDataType
>
(),
get_atol
<
VerifyDataType
>
());
}
return
true
;
...
...
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