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

Track Refactor Items and Update Guide #4647

Closed
tqchen opened this issue Jan 7, 2020 · 1 comment
Closed

Track Refactor Items and Update Guide #4647

tqchen opened this issue Jan 7, 2020 · 1 comment

Comments

@tqchen
Copy link
Member

tqchen commented Jan 7, 2020

We are in the process of refactoring recently. Some of them are cleanup of legacy code in the new version, some other prepares code changes for #4617

This thread tracks related infra changes and guides to sync the code with the mainline as suggested by @merrymercy . Please feel free to reply to add more suggestions

DataType to runtime

  • Rationale: DataType is a runtime data structure
  • PRs [REFACTOR][DTYPE] Isolate dtype to runtime #4560
  • Rename all old reference of tvm::Type to DataType
  • ExprNode.type -> ExprNode.dtype, Expr.type() -> Expr.dtype()
  • Move type constructors as static function: Int(bits) -> DataType::Int(bits)

Node Object Unification

IRMutator/Visitor Functor Unification

TVM_REGISTER_API -> TVM_REGISTER_GLOBAL

SeqStmt

tir::Call.name -> op

IRPrinter -> ReprPrinter

set_body_typed

// before
TVM_REGISTER_GLOBAL("add")
.set_body_typed<int(int)>([](int x) { return x + 1; }

// after
TVM_REGISTER_GLOBAL("add")
.set_body_typed([](int x) { return x + 1; }

Node suffix Convention

tvm::Expr -> PrimExpr

Relay Type/Module/Op

Unified IR file Reorg

  • Rationale: reorganize code to fit into the new unified ir proposal

New Subfolders and Namespaces

LoweredFunc

TIR uses IRModule as basic unit of transformation instead of LoweredFunc.

ir_pass.h

  • The IRModule->IRModule transformations are moved to tir/transform.h
  • The IRModule->Analaysis result passes are moved to tir/analysis.h

Simplify

BuildConfig

Runtime Misc

Python

tvm.module -> tvm.runtime.module

API changes wrt to runtime.Module #4837

  • tvm.module.load -> tvm.runtime.load_module
  • tvm.module.enabled -> tvm.runtime.enabled
  • tvm.module.system_lib -> tvm.runtime.system_lib

tvm.ir

API changes wrt to tvm.ir #4862

  • tvm.relay.Module -> tvm.IRModule

tvm.target

API change wrt to tvm.target #4872

tvm.te

API change wrt to #4943

  • tvm.create_schedule -> tvm.te.create_schedule
  • tvm.placeholder -> tvm.te.placeholder
  • tvm.compute -> tvm.te.compute
@tqchen
Copy link
Member Author

tqchen commented Jan 7, 2020

cc @merrymercy @Hzfengsy

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant