Skip to content

Commit af3e988

Browse files
committed
Removed TaskExtraction node
1 parent 7b4d35e commit af3e988

File tree

3 files changed

+0
-66
lines changed

3 files changed

+0
-66
lines changed

include/tvm/meta_schedule/integration.h

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -145,38 +145,6 @@ class MetaScheduleContext : public runtime::ObjectRef {
145145
void ExitWithScope();
146146
};
147147

148-
/**************** TaskExtraction ****************/
149-
150-
/*!
151-
* \brief An integration context for task extraction
152-
*/
153-
class TaskExtractionNode : public MetaScheduleContextNode {
154-
public:
155-
/*! \brief The extracted tasks */
156-
Array<ExtractedTask> tasks{nullptr};
157-
158-
void VisitAttrs(AttrVisitor* v) { v->Visit("tasks", &tasks); }
159-
160-
// Inherited from base class
161-
Optional<ObjectRef> Query(runtime::String task_name, IRModule mod, Target target,
162-
Optional<Array<IRModule>> dispatched) final;
163-
164-
static constexpr const char* _type_key = "meta_schedule.TaskExtraction";
165-
TVM_DECLARE_FINAL_OBJECT_INFO(TaskExtractionNode, MetaScheduleContextNode);
166-
};
167-
168-
/*!
169-
* \brief Managed reference to TaskExtractionNode
170-
* \sa TaskExtractionNode
171-
*/
172-
class TaskExtraction : public MetaScheduleContext {
173-
public:
174-
/*! \brief The path to a cache file storing extracted tasks */
175-
TaskExtraction();
176-
TVM_DEFINE_MUTABLE_NOTNULLABLE_OBJECT_REF_METHODS(TaskExtraction, MetaScheduleContext,
177-
TaskExtractionNode);
178-
};
179-
180148
/**************** ApplyHistoryBest ****************/
181149

182150
/*!

python/tvm/meta_schedule/integration.py

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -179,17 +179,6 @@ def __exit__(self, ptype, value, trace) -> None:
179179
_ffi_api.MetaScheduleContextExitScope(self) # type: ignore # pylint: disable=no-member
180180

181181

182-
@register_object("meta_schedule.TaskExtraction")
183-
class TaskExtraction(MetaScheduleContext):
184-
"""An integration context for task extraction"""
185-
186-
tasks: List[ExtractedTask]
187-
"""The extracted tasks"""
188-
189-
def __init__(self) -> None:
190-
self.__init_handle_by_constructor__(_ffi_api.TaskExtraction) # type: ignore # pylint: disable=no-member
191-
192-
193182
@register_object("meta_schedule.ApplyHistoryBest")
194183
class ApplyHistoryBest(MetaScheduleContext):
195184
"""An integration context that allows application of historically best record from database"""

src/meta_schedule/integration.cc

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -94,25 +94,6 @@ Optional<ObjectRef> MetaScheduleContext::QueryInsideWithScope(
9494
return NullOpt;
9595
}
9696

97-
/**************** TaskExtraction ****************/
98-
99-
TaskExtraction::TaskExtraction() {
100-
ObjectPtr<TaskExtractionNode> n = make_object<TaskExtractionNode>();
101-
n->tasks = Array<ExtractedTask>();
102-
data_ = n;
103-
}
104-
105-
Optional<ObjectRef> TaskExtractionNode::Query(runtime::String task_name, IRModule mod,
106-
Target target, Optional<Array<IRModule>> dispatched) {
107-
ICHECK(dispatched.defined());
108-
ICHECK_EQ(dispatched.value().size(), 1);
109-
IRModule prim_mod = dispatched.value()[0];
110-
ICHECK(HasOnlyOneFunction<tir::PrimFunc>(prim_mod)) << prim_mod;
111-
ICHECK(HasOnlyOneFunction<relay::Function>(mod)) << mod;
112-
tasks.push_back(ExtractedTask(task_name, mod, target, {prim_mod}));
113-
return NullOpt;
114-
}
115-
11697
/**************** ApplyHistoryBest ****************/
11798

11899
ApplyHistoryBest::ApplyHistoryBest(Database database) {
@@ -158,7 +139,6 @@ class MetaScheduleContextInternal {
158139

159140
TVM_REGISTER_NODE_TYPE(ExtractedTaskNode);
160141
TVM_REGISTER_OBJECT_TYPE(MetaScheduleContextNode);
161-
TVM_REGISTER_NODE_TYPE(TaskExtractionNode);
162142
TVM_REGISTER_NODE_TYPE(ApplyHistoryBestNode);
163143

164144
TVM_REGISTER_GLOBAL("meta_schedule.ExtractedTask")
@@ -176,9 +156,6 @@ TVM_REGISTER_GLOBAL("meta_schedule.MetaScheduleContextQueryInsideWithScope")
176156
.set_body_typed(MetaScheduleContext::QueryInsideWithScope);
177157
TVM_REGISTER_GLOBAL("meta_schedule.MetaScheduleContextQuery")
178158
.set_body_method<MetaScheduleContext>(&MetaScheduleContextNode::Query);
179-
TVM_REGISTER_GLOBAL("meta_schedule.TaskExtraction").set_body_typed([]() -> TaskExtraction {
180-
return TaskExtraction();
181-
});
182159
TVM_REGISTER_GLOBAL("meta_schedule.ApplyHistoryBest")
183160
.set_body_typed([](Database database) -> ApplyHistoryBest {
184161
return ApplyHistoryBest(database);

0 commit comments

Comments
 (0)