Skip to content
This repository was archived by the owner on Apr 28, 2023. It is now read-only.

Commit 7a909c3

Browse files
committed
Supress warnings during the autotuner run
Warnings can be emitted during range inference or compilation which are called for each candidate in the autotuning run. The source TC remaining the same, this crease an unnecessary stream of duplicate warnings while the autotuning runs. Use the newly introduced CompilerOptions mechanism to disable warnings during the autotuning process. Note that this process returns the mapping options rather than a compiled object, forcing the caller to explicitly compile with these options and get the warnings if necessary.
1 parent 3bbf8d8 commit 7a909c3

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

tc/autotuner/autotuner-inl.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
#include "tc/core/tensor.h"
3030
#include "tc/core/utils/math.h"
3131
#include "tc/lang/canonicalize.h"
32+
#include "tc/utils/compiler_options.h"
3233

3334
namespace tc {
3435
namespace autotune {
@@ -74,6 +75,9 @@ void TuningHarness<Backend>::stopAfterCurrentIteration() {
7475
template <typename Backend>
7576
template <typename SearchStrategy>
7677
void TuningHarness<Backend>::doCompile(SearchStrategy& searchStrategy) {
78+
CompilerOptions supressWarningsOptions;
79+
supressWarningsOptions.emitWarnings = false;
80+
7781
// Atomically fetch and add the next job until there are no jobs left
7882
while (true) {
7983
auto current = currentCompilationJob_.fetch_add(1);
@@ -93,7 +97,7 @@ void TuningHarness<Backend>::doCompile(SearchStrategy& searchStrategy) {
9397
LOG_LINE_BY_LINE(INFO, ssInfo);
9498
}
9599
pExecutor = tc::detail::compile<Backend>(
96-
tcTree_, inputs_.begin()->second, options);
100+
tcTree_, inputs_.begin()->second, options, supressWarningsOptions);
97101
LOG_IF(INFO, FLAGS_debug_tuner) << "[COMPILE] Done compilation";
98102
} catch (const std::exception& e) {
99103
LOG(WARNING) << "[TUNER][COMPILE] failed compilation: " << e.what();

0 commit comments

Comments
 (0)