Skip to content

Commit 64f4907

Browse files
committed
Additional selection criteria scaling factor to take into account overhead in non-default code path.
1 parent 8cac3b7 commit 64f4907

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

aten/src/ATen/cuda/tunable/TunableOp.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,12 @@ class TunableOp {
327327
auto s_stddev = s.stddev();
328328
// Assume normal distribution.
329329
// Solution with smallest mean + 2*sigma will be a better solution
330-
if ((s._mean + 2*s_stddev) < (min_duration_ms + 2*min_stddev_ms)) {
330+
// Additionally, assume there is 15% overhead in the non-default code path.
331+
auto alpha = 1.0;
332+
if (i != 0 || i != op_names_.size()) { // Default is first and last solution tested
333+
alpha = 1.15;
334+
}
335+
if (alpha*(s._mean + 2*s_stddev) < (min_duration_ms + 2*min_stddev_ms)) {
331336
TUNABLE_LOG3("├──found better instance id=", i, ". " , s._mean, "ms. ", op_names_[i],
332337
" min ", s._min,
333338
" max ", s._max,

0 commit comments

Comments
 (0)