Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 1 addition & 30 deletions include/tvm/ir/transform.h
Original file line number Diff line number Diff line change
Expand Up @@ -90,16 +90,7 @@ class PassContextNode : public Object {

/*! \brief A list of pass instrument implementations. */
Array<instrument::PassInstrument> instruments;
// TODO(@sunggg): Fix dependency issue in the header file and correct the types
// e.g., relax::trace, relax::database in tvm/relax/tuning_api.h
/*! \brief Trace stack for relax pass infra. */
mutable Array<ObjectRef> trace_stack;
/*! \brief List of passes to be traced. If not defined, make every pass traceable. */
Optional<Map<String, Bool>> make_traceable;
/*! \brief Number of evaluations conducted in the pass pipeline. */
mutable int num_evals{0};
/*! \brief Database for tuning API. */
Optional<ObjectRef> tuning_api_database;

PassContextNode() = default;

/*!
Expand Down Expand Up @@ -138,27 +129,7 @@ class PassContextNode : public Object {
v->Visit("instruments", &instruments);
v->Visit("config", &config);
v->Visit("diag_ctx", &diag_ctx);
v->Visit("trace_stack", &trace_stack);
v->Visit("make_traceable", &make_traceable);
v->Visit("num_evals", &num_evals);
v->Visit("tuning_api_daatabase", &tuning_api_database);
}

Array<ObjectRef> GetTraceStack() { return trace_stack; }
void PushTrace(ObjectRef new_trace) { trace_stack.push_back(new_trace); }
void PopTrace() {
ICHECK(GetTraceStackSize()) << "Trace stack is currently empty. Please double check.";
trace_stack.pop_back();
}
int GetTraceStackSize() { return trace_stack.size(); }
ObjectRef GetCurrentTrace() {
ICHECK(GetTraceStackSize()) << "Trace stack is currently empty. Please double check.";
return trace_stack.back();
}
void SetNumEvals(int _num_evals) { num_evals = _num_evals; }
void IncNumEvals(int _num_evals) { num_evals += _num_evals; }

Optional<ObjectRef> GetTuningAPIDatabase() { return tuning_api_database; }

static constexpr const char* _type_key = "transform.PassContext";
static constexpr bool _type_has_method_sequal_reduce = false;
Expand Down
Loading
Loading