Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TECompiler] Decouple TE compute and schedule lowering in ScheduleBuilder #10561

Merged
merged 6 commits into from
Mar 11, 2022
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
add public, fix include path convention
  • Loading branch information
masahi committed Mar 11, 2022
commit 0c6d4a603335ae2cba2771e939eff1ddeb98fbe3
7 changes: 4 additions & 3 deletions src/relay/backend/te_compiler_cache.cc
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,13 @@
#include <tvm/relay/expr_functor.h>
#include <tvm/relay/op.h>
#include <tvm/relay/op_attr_types.h>
#include <tvm/relay/op_strategy.h>
#include <tvm/runtime/device_api.h>
#include <tvm/runtime/registry.h>
#include <tvm/te/operation.h>
#include <tvm/te/schedule.h>
#include <tvm/te/schedule_pass.h>
#include <tvm/tir/function.h>
#include <tvm/topi/tags.h>

#include <functional>
Expand All @@ -45,8 +47,6 @@
#include "../../te/operation/create_primfunc.h"
#include "../op/memory/memory.h"
#include "../transforms/pass_utils.h"
#include "tvm/relay/op_strategy.h"
#include "tvm/tir/function.h"
#include "utils.h"

namespace tvm {
Expand Down Expand Up @@ -138,6 +138,7 @@ class LowerToTECompute : public backend::MemoizedExprTranslator<Array<te::Tensor
Array<te::Tensor> outputs = this->VisitExpr(relay_func->body);

candidate_name_ = readable_name_stream_.str();

constexpr static size_t kMaxFuncNameLength = 80;
// WARNING: Please make sure to also update TVM_CRT_MAX_STRLEN_FUNCTION_NAME
// whenever the value of kMaxFuncNameLength changes
Expand Down Expand Up @@ -291,7 +292,7 @@ class LowerToTECompute : public backend::MemoizedExprTranslator<Array<te::Tensor
int LowerToTECompute::const_index = 0;

// Construct a schedule for a given Relay primitive function and target.
class ScheduleBuilder : ExprVisitor {
class ScheduleBuilder : public ExprVisitor {
public:
explicit ScheduleBuilder(Target target) : target_(target) {
// Whether to use auto_scheduler schedule.
Expand Down