apache / tvm

Open deep learning compiler stack for cpu, gpu and specialized accelerators
https://tvm.apache.org/
Apache License 2.0
11.81k stars 3.48k forks source link

TVM v0.7 Release Note Candidate #6486

Closed ZihengJiang closed 4 years ago

ZihengJiang commented 4 years ago

Overview

v0.7 is brings many major features. The community works together to refactor the internal code base to bring an unified IR code structure with unified IRModule, type system and pass infrastructure. We have also bought many exciting new features, some highlights include:

The community also continues to bring high quality improvements to the existing modules including, but not limited to: better frontend coverage, performance, quantization, uTVM and dynamic shape support.

New Features

Automatic Scheduling (Experimental)

BYOC

Operator Coverage

Quantization

Relay

Runtime and Backend

Rust Support

TIR

TE

TVMC(Experimental)

ZihengJiang commented 4 years ago

Feature Improvement

Accelerator and Microcontroller Support

Arithmetic Analysis

AutoTVM and Graph Tuner

BYOC

Codegen

Dynamism Support

Frontend and User Interface

Relay

ZihengJiang commented 4 years ago

Operator Coverage

Runtime and Backend

Quantization

TE

TIR

ZihengJiang commented 4 years ago

Performance Improvements

Documentation

Bug Fixes

Known Issues

Deprecation

roastduck commented 4 years ago

Maybe we should mention that we have reorganized Python modules, which breaks imports in old codes. If we have other API changes, we should mention them in the release note as well.

tqchen commented 4 years ago

Good point, perhaps we could add some of the python related update guides in https://github.com/apache/incubator-tvm/issues/4647

ZihengJiang commented 4 years ago

I will add an API Changes section before Deprecation. @roastduck @tqchen

ZihengJiang commented 4 years ago

API Changes

DataType to runtime

Node Object Unification

IRMutator/Visitor Functor Unification

TVM_REGISTER_API -> TVM_REGISTER_GLOBAL

SeqStmt

tir::Call.name -> op

IRPrinter -> ReprPrinter

set_body_typed

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



### Node suffix Convention

- Rationale: unify the naming convention throughout the codebase see also https://github.com/apache/incubator-tvm/issues/4648
- PRs https://github.com/apache/incubator-tvm/pull/4649
- Add Node suffix to low level IR nodes
- Add ObjectRef classes to the TIR nodes
 - https://github.com/apache/incubator-tvm/pull/5773
 - https://github.com/apache/incubator-tvm/pull/5778
 - https://github.com/apache/incubator-tvm/pull/5784

### tvm::Expr -> PrimExpr

- Rationale: the low-level expression is renamed to "primitive" expression in order to bring more unifications.
- PR https://github.com/apache/incubator-tvm/pull/4669
-  tvm::Expr -> PrimExpr, ExprHash/ExprEqual->ObjectHash/ObjectEqual, VarExpr->Var

### Relay Type/Module/Op
- Rationale: unify type system, and module across the stack.
- PRs  https://github.com/apache/incubator-tvm/pull/4616 https://github.com/apache/incubator-tvm/pull/4678  https://github.com/apache/incubator-tvm/pull/4699
- tvm/relay/module.h -> tvm/ir/module.h
- relay::Module -> IRModule

### New Subfolders and Namespaces
- ir: Common set of types and IR structures
   - attrs.h -> ir/attrs.h https://github.com/apache/incubator-tvm/pull/4709
- arith: Arithmetic simplification and integer analysis
   - arithmetic.h -> arith/analyzer.h arith/bound.h arith/int_set.h arith/pattern.h 
   - https://github.com/apache/incubator-tvm/pull/4722
- target: Target dependent information and codegen
  - target_info.h -> target/target_info.h https://github.com/apache/incubator-tvm/pull/4721
  - codegen.h -> target/codegen.h https://github.com/apache/incubator-tvm/pull/4742
- te namespace: Tensor expression DSL(compute and schedule)
   - Add namespace to compute/schedule
   - operation.h -> te/operation.h
   - schedule.h -> te/schedule.h
   - schedule_pass.h -> te/schedule_pass.h
   - tensor.h -> te/tensor.h
   -  https://github.com/apache/incubator-tvm/pull/4727, https://github.com/apache/incubator-tvm/pull/4759
- tir namespace: tensor-level IR 
  - lowered_func.h,buffer.h,data_layout.h -> tir/buffer.h,tir/data_layout.h,tir/lowered_func.h
  - ir.h -> tir/expr.h, tir/stmt.h
  - ir_functor_ext.h -> tir/expr_functor.h, tir/stmt_functor.h
  - https://github.com/apache/incubator-tvm/pull/4740

### LoweredFunc
TIR uses IRModule as basic unit of transformation instead of LoweredFunc.
- https://github.com/apache/incubator-tvm/pull/5233

### 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
- Simplify function is removed, use Analyzer in arith/analyzer.h instead
- https://github.com/apache/incubator-tvm/pull/5385

### BuildConfig
- BuildConfig-> PassContext 
https://github.com/apache/incubator-tvm/pull/5668

### Runtime Misc
- ThreadScope::make -> ThreadScope::Create
- StorageScope::make -> StorageScope::Create
- https://github.com/apache/incubator-tvm/pull/5784

### tvm.module -> tvm.runtime.module
API changes wrt to runtime.Module https://github.com/apache/incubator-tvm/pull/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 https://github.com/apache/incubator-tvm/pull/4862
- tvm.relay.Module -> tvm.IRModule

### tvm.target
API change wrt to tvm.target https://github.com/apache/incubator-tvm/pull/4872

### tvm.te

API change wrt to https://github.com/apache/incubator-tvm/pull/4943

- tvm.create_schedule -> tvm.te.create_schedule
- tvm.placeholder -> tvm.te.placeholder
- tvm.compute -> tvm.te.compute