Skip to content

Commit 5a673d4

Browse files
committed
Finalize profiler preshuffle with tolerances
1 parent 35f8a85 commit 5a673d4

File tree

2 files changed

+4
-84
lines changed

2 files changed

+4
-84
lines changed

profiler/include/profiler/profile_gemm_universal_preshuffle_impl.hpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
#include "ck/library/utility/host_tensor_generator.hpp"
2121
#include "ck/library/utility/literals.hpp"
2222
#include "ck/library/reference_tensor_operation/cpu/reference_gemm.hpp"
23+
#include "profiler/common.hpp"
2324

2425
namespace ck {
2526
namespace profiler {
@@ -337,8 +338,8 @@ bool profile_gemm_universal_preshuffle_impl(int do_verification,
337338
is_same_v<CDataType, f8_t>)
338339
{
339340
std::string msg = "Error: Incorrect results!";
340-
double rtol = 1e-1;
341-
double atol = 1e-1;
341+
double rtol = get_rtol<CDataType>();
342+
double atol = get_atol<CDataType>();
342343
pass = pass & ck::utils::check_err(
343344
c_m_n_device_result, c_m_n_host_result, msg, rtol, atol);
344345
}

profiler/include/profiler/profile_grouped_conv_fwd_outelementop_impl.hpp

Lines changed: 1 addition & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -5,92 +5,11 @@
55
#include "ck/library/reference_tensor_operation/cpu/reference_conv_fwd.hpp"
66
#include "ck/library/utility/device_memory.hpp"
77
#include "ck/library/utility/host_tensor_generator.hpp"
8+
#include "profiler/common.hpp"
89

910
namespace ck {
1011
namespace profiler {
1112

12-
template <typename DataType>
13-
inline constexpr double get_rtol()
14-
{
15-
if constexpr(std::is_same_v<DataType, float>)
16-
{
17-
return 1e-3;
18-
}
19-
else if constexpr(std::is_same_v<DataType, double>)
20-
{
21-
return 1e-6;
22-
}
23-
else if constexpr(std::is_same_v<DataType, ck::half_t>)
24-
{
25-
return 1e-3;
26-
}
27-
else if constexpr(std::is_same_v<DataType, ck::bhalf_t>)
28-
{
29-
return 5e-2;
30-
}
31-
else if constexpr(std::is_same_v<DataType, int32_t>)
32-
{
33-
return 1e-1;
34-
}
35-
else if constexpr(std::is_same_v<DataType, int8_t>)
36-
{
37-
return 1e-1;
38-
}
39-
else if constexpr(std::is_same_v<DataType, ck::f8_t>)
40-
{
41-
return 1e-1; // 240 and 224 are acceptable
42-
}
43-
else if constexpr(std::is_same_v<DataType, ck::bf8_t>)
44-
{
45-
return 1.5e-1; // 57344 and 49152 are acceptable
46-
}
47-
else
48-
{
49-
return 1e-3;
50-
}
51-
}
52-
53-
template <typename DataType>
54-
inline constexpr double get_atol()
55-
{
56-
if constexpr(std::is_same_v<DataType, float>)
57-
{
58-
return 1e-3;
59-
}
60-
else if constexpr(std::is_same_v<DataType, double>)
61-
{
62-
return 1e-6;
63-
}
64-
else if constexpr(std::is_same_v<DataType, ck::half_t>)
65-
{
66-
return 1e-3;
67-
}
68-
else if constexpr(std::is_same_v<DataType, ck::bhalf_t>)
69-
{
70-
return 5e-2;
71-
}
72-
else if constexpr(std::is_same_v<DataType, int32_t>)
73-
{
74-
return 1e-1;
75-
}
76-
else if constexpr(std::is_same_v<DataType, int8_t>)
77-
{
78-
return 1e-1;
79-
}
80-
else if constexpr(std::is_same_v<DataType, ck::f8_t>)
81-
{
82-
return 16.1; // 240 and 224 are acceptable
83-
}
84-
else if constexpr(std::is_same_v<DataType, ck::bf8_t>)
85-
{
86-
return 8192.1; // 57344 and 49152 are acceptable
87-
}
88-
else
89-
{
90-
return 1e-3;
91-
}
92-
}
93-
9413
template <ck::index_t NDimSpatial,
9514
typename InLayout,
9615
typename WeiLayout,

0 commit comments

Comments
 (0)