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
b019d839
Commit
b019d839
authored
Sep 27, 2023
by
Bartlomiej Wroblewski
Browse files
Fix the computation of error threshold
parent
762d30bf
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
2 deletions
+6
-2
profiler/include/profiler/profile_contraction_impl.hpp
profiler/include/profiler/profile_contraction_impl.hpp
+6
-2
No files found.
profiler/include/profiler/profile_contraction_impl.hpp
View file @
b019d839
...
...
@@ -136,7 +136,7 @@ int profile_contraction_impl(ck::index_t do_verification,
std
::
cout
<<
"found "
<<
op_ptrs
.
size
()
<<
" instances"
<<
std
::
endl
;
using
AccDataType
=
typename
std
::
conditional
<
std
::
is_same
<
DataType
,
F64
>::
value
,
F64
,
F32
>::
type
;
typename
std
::
conditional
<
std
::
is_same
<
Compute
DataType
,
F64
>::
value
,
F64
,
F32
>::
type
;
// Run reference op
if
(
do_verification
)
...
...
@@ -285,7 +285,11 @@ int profile_contraction_impl(ck::index_t do_verification,
{
e_device_buf
.
FromDevice
(
e_m_n_device_result
.
mData
.
data
());
double
threshold
=
nelems_k
*
std
::
numeric_limits
<
AccDataType
>::
epsilon
();
// Both the kernel and the reference use `AccDataType`, so an absolute error of both
// of them is bounded by `nelems_k * std::numeric_limits<AccDataType>::epsilon()`.
// Comparing one to another can result in an absolute error as high as twice that
// value.
double
threshold
=
2
*
nelems_k
*
std
::
numeric_limits
<
AccDataType
>::
epsilon
();
// TODO: Add a generic solution in CK.
if
constexpr
(
ck
::
is_same_v
<
DataType
,
ck
::
bhalf_t
>
)
{
...
...
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