File tree 1 file changed +8
-5
lines changed
aten/src/ATen/cuda/tunable
1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -287,20 +287,23 @@ class TunableOp {
287
287
}
288
288
289
289
// for warmup does user set max duration, max iters, or both?
290
- // warmup is allowed to be skipped by setting either iterations or duration to 0
290
+ // warmup is skipped by default, i.e. warmup_iter = 0
291
+ // warmup will be set to the non-zero value of max_warmup_duration
292
+ // or max_warmup_iter
293
+ // if both are non-zero, we take the smaller of the two.
291
294
double max_warmup_duration = ctx->GetMaxWarmupDurationMs ();
292
295
int max_warmup_iter = ctx->GetMaxWarmupIterations ();
293
- int warmup_iter = 1 ; // default
294
- if (max_warmup_duration >= 0 ) {
296
+ int warmup_iter = 0 ; // default
297
+ if (max_warmup_duration > 0 ) {
295
298
int duration_iters = max_warmup_duration / approx_duration;
296
- if (max_warmup_iter >= 0 ) {
299
+ if (max_warmup_iter > 0 ) {
297
300
warmup_iter = std::min (max_warmup_iter, duration_iters);
298
301
}
299
302
else {
300
303
warmup_iter = duration_iters;
301
304
}
302
305
}
303
- else if (max_warmup_iter >= 0 ) {
306
+ else if (max_warmup_iter > 0 ) {
304
307
warmup_iter = max_warmup_iter;
305
308
}
306
309
You can’t perform that action at this time.
0 commit comments