import logging
import tvm
+from tvm.autotvm.task.dispatcher import DispatchContext, FallbackContext
from .task import create
from .topi_integration import TaskExtractEnv
build_thread.start()
build_thread.join()
relay.backend.compile_engine.get().clear()
+ # Clear the warning message cache in FallbackContext
+ if isinstance(DispatchContext.current, FallbackContext):
+ DispatchContext.current.memory = {}
+ DispatchContext.warning_messages = set()
logger.disabled = old_state
#include <memory>
#include "../../target/source/codegen_source_base.h"
+#include "compile_engine.h"
#include "utils.h"
namespace tvm {
targets_ = targets;
target_host_ = target_host;
BuildRelay(mod, params_);
+ // Clear compile engine so that tuning schedules can be changed between runs. See issue #6096.
+ CompileEngine::Global()->Clear();
}
protected:
};
/*! \brief The global compile engine */
-const CompileEngine& CompileEngine::Global() {
+CompileEngine& CompileEngine::Global() {
// intentionally allocate raw pointer to avoid
// free during destructuion.
static CompileEngine* inst = new CompileEngine(make_object<CompileEngineImpl>());
CompileEngineNode* operator->() { return static_cast<CompileEngineNode*>(get_mutable()); }
using ContainerType = CompileEngineNode;
/*! \brief The global compile engine. */
- TVM_DLL static const CompileEngine& Global();
+ TVM_DLL static CompileEngine& Global();
};
/*!