1. 20 Jan, 2020 1 commit
  2. 19 Jan, 2020 1 commit
    • [REFACTOR] Establish tir (#4740) · cf59b206
      TIR is the new namespace for low-level IR
      for tensor-level optimizations and loop transformations.
      
      This PR establishes the namespace and files.
      
      - 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
      Tianqi Chen committed
  3. 17 Jan, 2020 1 commit
  4. 15 Jan, 2020 1 commit
  5. 14 Jan, 2020 1 commit
  6. 11 Jan, 2020 1 commit
    • [REFACTOR][IR] Unified IR Primitive Op and Registry (#4687) · d8f06020
      This PR migrates relay's Op into the ir folder.
      Op and its registry provides an useful mechanism to
      store any attribute meta-data of an operator include
      function signatures, lowering rules, side effect etc.
      
      These features are not only useful for Relay, but also needed in the low-level IR.
      At the current moment, intrinsic functions in the low-level IR are simply
      represented by a string. This means we cannot type-check the low-level IR
      when the type does not meet the constraint, nor can we obtain further
      information such as side-effect and read write relation of these intrinsics
      wrt to arguments.
      
      Op will be used as the way to handle primitive ops(in DL terminology)
      (builtin intrinsics or in compiler terminology).
      We will perform follow-up refactors to make low-level CallNode
      take Op as the function argument.
      Tianqi Chen committed
  7. 08 Jan, 2020 1 commit
    • [REFACTOR][IR] Add Node suffix to low-level IR nodes (#4649) · f4c5f93b
      * [REFACTOR][IR] Variable -> VarNode
      
      * [REFACTOR][IR] Add/Sub/Mul/Div -> AddNode/SubNode etc.
      
      * [REFACTOR][IR] Min/Max/FloorDiv/FloorMod -> MinNode/MaxNode etc.
      
      * [REFACTOR][IR] EQ/NE/LT/LE/GT/GE/Select -> EQNode/NENode etc.
      
      * [REFACTOR][IR] Add Node suffix to Select/Call/Load/Ramp/Shuffle/Let
      
      * [REFACTOR][IR] Add node suffix to IntImm/UIntImm/FloatImm/StringImm
      
      * [REFACTOR][IR] Add Node suffix to Any, AttrStmt, AssertStmt
      
      * [REFACTOR][IR] Add Node suffix to Store/Provide/Allocate/Free
      
      * [REFACTOR][IR] Add Node suffix to ProducerConsumer
      
      * Fix lint
      
      * style updates, test fixes
      Tianqi Chen committed
  8. 04 Jan, 2020 3 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] Unified IR base types. (#4616) · 1ecd3ee2
      This PR moves a few base types from relay to the ir sub-folder.
      These types will serve as a common type system across the stack.
      
      Notably, we want to be able to use the same FuncType for all function signatures.
      I tried to make a minimum move to bring the necessary dependencies for a FuncType.
      We can discuss what additional things we want to move as a follow-up.
      
      Notably, because the TensorType will have a dependency on low-level Expr,
      we will need to break the type.h into two files and introduce a
      tensor_type.h(or leave them in relay for now).
      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
  9. 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
  10. 24 Oct, 2019 1 commit
    • [NODE][REFACTOR] Refactor reflection system in node. (#4189) · 78ca6fc8
      * [NODE][REFACTOR] Refactor reflection system in node.
      
      - Removed the old Node, Node is now just an alias of runtime::Object
      - Introduce ReflectionVTable, a new columnar dispatcher to support reflection
        - This allows us to remove vtable from most node objects
        - The VisitAttrs are registered via TVM_RESGITER_NODE_TYPE,
          they are no longer virtual.
      - Consolidated serialization and reflection features into node.
      
      * Explicit type qualification when calling destructor.
      
      * Fix SPIRV, more comments
      Tianqi Chen committed
  11. 21 Oct, 2019 1 commit
    • [REFACTOR][NODE][RUNTIME] Move Node to the new Object protocol. (#4161) · 7895adb2
      * [REFACTOR][NODE][RUNTIME] Move Node to the new Object protocol.
      
      This PR removes the original node system, and make node as a subclass of Object.
      This is a major refactor towards a better unified runtime object system.
      
      List of changes in the refactor:
      
      - We now hide data_ field, use Downcast explicitly to get a sub-class object.
      - Removed the node system FFI in python.
      - Removed the node C API, instead use PackedFunc for list and get attrs.
      - Change relay::Op::set_attr_type_key(attr_key_name) to relay::Op::set_attr_type<AttrType>().
        - This change was necessary because of the new Object registration mechanism.
        - Subsequent changes to the op registrations
        - The change revealed a few previous problems that is now fixed.
      - Patched up a few missing node type registration.
        - Now we will raise an error if we register object that is not registered.
      - The original node.h and container.h are kept in the same location.
      - Calling convention: kObjectHandle now equals the old kNodeHandle, kNodeHandle is removed.
      - IRFunctor now dispatches on ObjectRef.
      - Update to the new type checking API: is_type, derived_from are replaced by IsInstance.
      - Removed .hash member function, instead use C++ convention hasher functors.
      
      * Address review comments
      Tianqi Chen committed
  12. 12 Sep, 2019 1 commit
  13. 10 Jul, 2019 1 commit
    • [Relay][RFC] Implement type checking for Any (#3221) · 3fb84e2b
      * Implement type checking for Any
      
      Remove code generation related changes
      
      Remove compile changes
      
      Remove more
      
      Remove unification hack
      
      Add some code back that was needed, and clean up test
      
      Refactor test cases
      
      WIP
      
      Implement TypeHint AST
      
      Add test case which should fail
      
      Remove unification changes, and fix bug with let rec
      
      Restore unification for shapes
      
      Improve error reporting while debugging
      
      All examples type check
      
      All examples type check
      
      WIP
      
      First version that works with hints, needs clean up
      
      Remove dead code
      
      Tweaks
      
      Remove type hint
      
      Remove unecessary type hint stuff
      
      Remove more type hints
      
      Clean up
      
      Expose Any expression node
      
      Address CR
      
      Fix
      
      Fix solver
      
      Kill unecessary code
      
      Fix
      
      PyLint
      
      Fix
      
      Relocate loops
      
      Fix license and test
      
      Lint again
      
      Lint again
      
      Fix loops
      
      Fix docstring
      
      Fix template error
      
      Fix compiler issue
      
      Fix compile err
      
      Remove more runtime changes
      
      Restore buffer
      
      Fix segfault
      
      Fix
      
      Fix arange
      
      * Address feedback
      
      * Fix typo
      
      * Fix arange
      
      * Fix op level3
      
      * Fix issue with Python wrapper
      Jared Roesch committed
  14. 28 Jun, 2019 1 commit
  15. 08 Apr, 2019 1 commit
    • [HEADER] Add Header to Comply with ASF Release Policy (#2982) · cffb4fba
      * [HEADER] ASF header dir=include
      
      * [HEADER] ASF Header dir=src
      
      * [HEADER] ASF Header -dir=python
      
      * [HEADER] ASF header dir=topi
      
      * [HEADER] ASF Header dir=nnvm
      
      * [HEADER] ASF Header -dir=tutorials
      
      * [HEADER] ASF Header dir=tests
      
      * [HEADER] ASF Header -dir=docker
      
      * fix whitespace
      
      * [HEADER] ASF Header -dir=jvm
      
      * [HEADER] ASF Header -dir=web
      
      * [HEADER] ASF Header --dir=apps
      
      * [HEADER] ASF Header --dir=vta
      
      * [HEADER] ASF Header -dir=go
      
      * temp
      
      * [HEADER] ASF Header --dir=rust
      
      * [HEADER] Add ASF Header --dir=cmake
      
      * [HEADER] ASF Header --dir=docs
      
      * [HEADER] Header for Jenkinsfile
      
      * [HEADER] ASF Header to toml and md
      
      * [HEADER] ASF Header to gradle
      
      * Finalize rat cleanup
      
      * Fix permission
      
      * Fix java test
      
      * temporary remove nnvm onnx test
      Tianqi Chen committed
  16. 16 Feb, 2019 1 commit
    • [Relay] Algebraic data types (#2442) · 2ae3124f
      * First pass on ADTs
      
      * Add doc string for tag field
      
      * Visit constructors in TypeVisitor for TypeData
      
      * Add to description of type call
      
      * Add type call to type solving and unification
      
      * Make type mutator for typecall consistent with others (only create new node if there's a change)
      
      * Ensure kindchecking can handle type calls and typedata
      
      * Fix bad nesting in module constructor
      
      * Correctly construct call in typecall test
      
      * Add call override for ordinary vars (do we want this?)
      
      * Remove generalization hack from type inference because it was breaking ADT constructors
      
      * Check that there are no free type vars in exprs after inferring type
      
      * Free var checks need module because of ADT constructors
      
      * Typecall test can't have unbound type var, make it global
      
      * Uncomment tmap test and remove comments about failing to infer ret type; those work now
      
      * Put in dummy visits for ADTs in graph runtime codegen to placate pylint
      
      * Fix Relay type infer test module constructor
      
      * Mark override for TypeCallNode in type solver
      
      * Ensure free vars check treats patern vars as bound
      
      * Run interpreter in more ADT test cases
      
      * Refactor kind check to return the kind, like typechecking
      
      * Fix invalid typecall in test
      
      * Add kind check to type inference, do not use nulls in func_type_annotation()!
      
      * Redundant whitespace
      
      * Make TypeData a separate kind
      
      * Make ADT handles a separate kind too, document calling convention better
      
      * Remove nats and tree from prelude, move to test, document prelude
      
      * Restore and document nat and tree to prelude, add more tree tests
      
      * Add alpha equality tests for match cases, fix variable binding bug
      
      * Add more kind check tests for ADTs
      
      * Add more tests for finding free or bound vars in match exprs
      
      * Add unification tests for type call
      
      * Update main() for alpha equality tests
      
      * Add simple type inference test cases for match exprs and ADT constructors
      
      * Add more ADT interpreter tests
      
      * Allow incomplete types when typechecking match cases
      
      * Type inference for pattern vars should use the type annotation if it's there
      
      * Two more specific test cases for ADT matching
      
      * Add option ADT to prelude
      
      * Fix broken reference to kind enum
      
      * Fix rebase snags
      
      * Do not attach checked types to constructors
      
      * More docstrings for module fields
      
      * Use proper wrapper for indexing into module type data
      
      * checked_type for constructors is not populated
      
      * Expand type call docstring
      
      * Rename PatternConstructor con field
      
      * Use error reporter for pattern constructor case
      
      * Condense error reporting in kind check, use error reporter
      
      * Expand docstrings and rename ADT fields
      
      * Rename 'option' ADT to 'optional' for consistency with Python
      
      * Add various list iterators and utility functions to prelude
      
      * Add smoke tests for new iterators in prelude
      
      * Add concat to prelude
      
      * Add smoke test for concat
      
      * Correct docstrings in prelude
      
      * Ensure that type defs are written in module initialization
      
      * Various requested renamings
      
      * Correct rebase snags
      
      * Add kind check tests for ref types
      
      * Update the main() for kind checking tests
      Steven S. Lyubomirsky committed
  17. 15 Feb, 2019 1 commit
  18. 25 Jan, 2019 1 commit
  19. 02 Nov, 2018 1 commit
  20. 29 Oct, 2018 1 commit
  21. 27 Oct, 2018 1 commit
  22. 25 Oct, 2018 3 commits
  23. 20 Oct, 2018 1 commit
  24. 18 Oct, 2018 1 commit
  25. 04 Oct, 2018 1 commit
  26. 01 Oct, 2018 1 commit
  27. 29 Sep, 2018 1 commit
  28. 20 Sep, 2018 1 commit
  29. 19 Sep, 2018 1 commit