1. 20 Jan, 2020 1 commit
  2. 14 Jan, 2020 2 commits
  3. 11 Jan, 2020 2 commits
    • [REFACTOR][IR] Allow Module to store BaseFunc. (#4678) · 3d52a99c
      Under the unified IR. We will allow a single IRModule
      to store different function variants, such as relay::Function,
      ExternFunc, and low-level function.
      
      This PR changes relay::Function -> BaseFunc in the module file
      to support multiple function variants.
      Tianqi Chen committed
    • [REFACTOR][IR] Initialize Unified IR Expr Data Structure (#4673) · 12e51e6c
      This PR moves a few base types from relay and low-level Expr into the ir sub-folder.
      These classes will serve as a common type system across the stack.
      
      Rationale:
      
      - PrimExpr for low-level expressions
      - RelayExpr for advanced features, including Function definition.
      - Introduce BaseFunc to host all functions, including future PrimFunc(low-level expr functions, subject to discussion).
      
      This is a minimum change we can do to unify the classes into a common hierarchy.
      The main data structure that are variant specific will still be kept in the sub-namespaces.
      We only include classes that is needed to allow a common Module class.
      - BaseFunc
      - GlobalVar
      - Type definition part of ADT
      
      We will only need the BaseFunc and their checked_type to decide the calling convention
      across the function variants.
      Tianqi Chen committed
  4. 04 Jan, 2020 2 commits
    • [REFACTOR] TVM_REGISTER_API -> TVM_REGISTER_GLOBAL (#4621) · 81523604
      TVM_REGSISTER_API is an alias of TVM_REGISTER_GLOBAL.
      In the spirit of simplify redirections, this PR removes
      the original TVM_REGISTER_API macro and directly use TVM_REGISTER_GLOBAL.
      
      This type of refactor will also simplify the IDE navigation tools
      such as FFI navigator to provide better code reading experiences.
      
      Move EnvFunc's definition to node.
      Tianqi Chen committed
    • [REFACTOR][TYPE] Remove un-necessary var sub-field in GlobalTypeVar and TypeVar (#4615) · 24e6fcb6
      Currently, we use a tvm::Var to represent a placeholder for shapes in generic types.
      This is not necessary for GlobalTypeVar(as we never parameterize by shape var),
      and is a bit twisted for TypeVar.
      
      As we move to a unified type system, we want to break the dependency
      from the base TypeVar(which is shared across the languages) from the expression.
      Note that it is fine for TensorType to depend on Expr.
      
      One alternative solution to embed the Var would be to introduce a TypeVarExpr,
      which can wrap a TypeVar as Expr. However, this new alternative won't be
      natural until we migrate the type to the global scope.
      
      Lucikly, we have not yet start to depend on the shape parameterization heavily yet.
      
      This PR removes the tvm::Var from the typevars. We will follow up with another
      PR to migrate the types to a base location. After that, we should be able to
      use the more elegant approach via TypeVarExpr.
      Tianqi Chen committed
  5. 31 Dec, 2019 1 commit
    • [REFACTOR][OBJECT] Consoldiate NodePtr/Ref/Hash/Equal to Object (#4603) · a8c36921
      * [REFACTOR][OBJECT] Consoldiate NodePtr/Ref/Hash/Equal and macros to Object.
      
      Historically, we have classes like NodePtr/Ref/HashEqual.
      After unified object protocol, these names are just alias of the object counterpart.
      Moreover, there are helper macros defined over the places for defining these object.
      
      This PR consoldiate the terminologies into the corresponding ones
      in the Object system so we have a clean and consistent API moving forward.
      
      * Update include/tvm/attrs.h
      
      Co-Authored-By: Wei Chen <ipondering.weic@gmail.com>
      
      * fix compilation
      
      Co-authored-by: Wei Chen <ipondering.weic@gmail.com>
      Tianqi Chen committed
  6. 24 Nov, 2019 1 commit
  7. 01 Aug, 2019 1 commit
    • [Relay] Strict mode in pattern matching (#3620) · 331585f4
      * add fatal
      
      lint
      
      lint
      
      lint
      
      do
      
      make completeness check an error
      
      lint
      
      remove fatal
      
      * fix test
      
      * reset parser file
      
      * remove unneeded import
      
      * Update python/tvm/relay/adt.py
      
      Co-Authored-By: Steven S. Lyubomirsky <slyubomirsky@gmail.com>
      
      * Update include/tvm/relay/adt.h
      
      Co-Authored-By: Steven S. Lyubomirsky <slyubomirsky@gmail.com>
      
      * Eliminate trailing whitespace (my fault)
      雾雨魔理沙 committed
  8. 03 Jul, 2019 1 commit
    • [Relay] Continuation Passing Style (#3456) · d1eb1229
      * save
      
      add
      
      me find type checker problem
      
      save
      
      save
      
      lint
      
      do
      
      lint
      
      reset ti
      
      add some doc
      
      add failed test case
      
      add recursion for cps
      
      add recursion for cps
      
      fix pytest
      
      lint
      
      save
      
      fix test error
      
      lint
      
      save
      
      fix error
      
      * fix rebase
      
      * fix
      
      * fix test
      
      * lint
      
      * lint
      
      * restore rewriteannotationops
      
      * do
      雾雨魔理沙 committed