1. 01 Nov, 2019 1 commit
    • [NODE][REFACTOR] Rename IRFunctor->NodeFunctor, use func pointer (#4247) · 9a3d2ec9
      * [NODE][REFACTOR] Rename IRFunctor->NodeFunctor, use function pointer for dispatching.
      
      Previously we used std::function for the functor dispatching.
      It introduces additional overhead and problems during dll destruction(of std::function).
      
      This PR changes the std::function to function pointers.
      This change a bit restrictions around the set_dispatch that we can get around,
      but will improve the general efficiency by reducing one level of indirection in the std::function.
      We also no longer need special marcos to register functions to the Functor.
      Tianqi Chen committed
  2. 30 Oct, 2019 1 commit
  3. 25 Oct, 2019 1 commit
  4. 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
  5. 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
  6. 09 Oct, 2019 1 commit
    • [TVM] Rewrite simplification rule to eliminate unnecessary conditionals. (#4076) · f2abd9f6
      The current bounds checking infrastructure inserts checks like:
      
      ```
      for (i, 0, bounds[n]) {
        if (likely(i < bounds[n]) {
           ...
        }
      }
      ```
      
      into the TVM IR which is currently not removed by simplification infrastructure.
      This is a little unclean, as these are trivially true since for a loop var `i`
      with a given min and extent, we are guaranteed that `i >= min` and `i < min +
      extent`. Thus, we can insert these checks into the IR and use them to eliminate
      trivial bounds checks early on.
      Andrew Tulloch committed
  7. 08 Oct, 2019 1 commit
  8. 25 Sep, 2019 2 commits
    • [ARITH] Refactor to use explicit div/mod functions instead of operators. (#4000) · f0079a57
      * [ARITH] Use explicit div/mod functions instead of operators.
      
      * fix pooling case
      Tianqi Chen committed
    • Changes to make tensorize work. These changes also fix the previously broken test. (#3981) · b410df8c
      * Changes to make tensorize work. These changes also fix the previously
      broken test.
      
      Summary:
      Tensorize was breaking  for a few reasons.
      1)
      Assert at: src/op/tensorize.cc:234 CHECK(is_one(e.region[j]->extent))
      In some cases this cannot be proven, e.g.:
      expected shape=[16, 4], given region=[range(min=((ax1.outer*16)/16), ext=(((((ax1.outer*16) + 15)/16) + 1) - ax1.outer)), range(min=((k.outer*4)/4), ext=(((((k.outer*4) + 3)/4) + 1) - k.outer)), range(min=0, ext=16), range(min=0, ext=4)]
      The unprovable one is: ext=(((((ax1.outer*16) + 15)/16) + 1) - ax1.outer)).
      This can be simplified but it is not because to simplify divide, it must
      prove ax1.outer > 0 and since it is var it cannot. The fix for this to
      just find all the vars in expr in relace them with some const value.
      
      2) Equivalence between tensorized expr and one being asked to tensorize. For example,
      the error would be.
      TVMError: Check failed: Equal(lhs, rhs):
      Failed to match the compute with TensorIntrin tensor_intrin's declaration
      provided= reduce(combiner=comm_reducer(result=[(x + y)], lhs=[x], rhs=[y], identity_element=[(int16)0]), source=[(int16(data(k))*int16(kernel(((((((((k.outer.outer*64) + (k.outer.inner*2)) + k)/2)*128) + i) - (k.outer.inner*128)) - (k.outer.outer*4096)), ((((k.outer.outer*64) + (k.outer.inner*2)) + k) % 2))))], axis=[iter_var(k, range(min=0, ext=2))], where=(bool)1, value_index=0),
      intrin=  reduce(combiner=comm_reducer(result=[(x + y)], lhs=[x], rhs=[y], identity_element=[(int16)0]), source=[(int16(data(k))*int16(kernel(i, k)))], axis=[iter_var(k, range(min=0, ext=2))], where=(bool)1, value_index=0)
      Difference is mainly in the source part:
      source=[(int16(data(k))*int16(kernel(((((((((k.outer.outer*64) + (k.outer.inner*2)) + k)/2)*128) + i) - (k.outer.inner*128)) - (k.outer.outer*4096)), ((((k.outer.outer*64) + (k.outer.inner*2)) + k) % 2))))]
      source=[(int16(data(k))*int16(kernel(i, k)))], axis=[iter_var(k, range(min=0, ext=2))]
      This was not being simpifiled due to compute_intrin_iter_space (map for
      iter var to range) not containing leaf iter vars.
      
      3) Here it fails with:
      Check failed: is_one(Simplify(value->shape[i])): Argument b_buffer shape mismatch[16, 4] vs [(((((ax1.outer*16) + 15)/16) + 1) - ax1.outer), (((((k.outer*4) + 3)/4) + 1) - k.outer), 16, 4]
      This is in buffer binding where it thinks expected and buffer bound
      shape is different. Although if we could simplify expr, this would not
      be the case.
      
      Test Plan:
      On skylake avx512 machine:
      python tests/python/contrib/test_gemm_acc16.py
      
      Reviewers:
      
      Subscribers:
      
      Tasks:
      
      Tags:
      
      * Implemented bounded analyzer which traverses tree and for reduce/for
      statements binds the bound of the analyzer. Later this is used to
      simplify expressions. Inspired from ir_mutator_with_analyzer
      
      Summary:
      
      Test Plan:
      
      Reviewers:
      
      Subscribers:
      
      Tasks:
      
      Tags:
      
      * Addressed comments.
      
      Summary:
      
      Test Plan:
      
      Reviewers:
      
      Subscribers:
      
      Tasks:
      
      Tags:
      
      * Added ASF header + define macro for the header file: TVM_ARITHMETIC_IR_VISITOR_WITH_ANALYZER_H_
      Some lint fixes as well.
      
      * Relax the assumption that dom_map must always contain all leaf itervars.
      
      Summary:
      
      Test Plan:
      
      Reviewers:
      
      Subscribers:
      
      Tasks:
      
      Tags:
      
      * Disable copy constructor and move to raw ptr.
      
      Summary:
      
      Test Plan:
      
      Reviewers:
      
      Subscribers:
      
      Tasks:
      
      Tags:
      Kimish Patel committed
  9. 24 Sep, 2019 1 commit
  10. 20 Sep, 2019 1 commit
  11. 19 Sep, 2019 1 commit
  12. 13 Sep, 2019 1 commit
  13. 23 Aug, 2019 1 commit
  14. 13 Aug, 2019 1 commit
  15. 25 Jul, 2019 1 commit
  16. 21 Jul, 2019 1 commit
  17. 18 Jul, 2019 1 commit
  18. 13 Jul, 2019 1 commit
  19. 11 Jul, 2019 1 commit
  20. 07 Jul, 2019 2 commits
  21. 06 Jul, 2019 1 commit
  22. 01 Jul, 2019 3 commits
  23. 30 Jun, 2019 1 commit
  24. 29 Jun, 2019 1 commit
  25. 18 Jun, 2019 1 commit
  26. 13 Jun, 2019 1 commit
  27. 04 Jun, 2019 1 commit
  28. 03 Jun, 2019 1 commit
  29. 27 May, 2019 1 commit
  30. 24 May, 2019 1 commit
  31. 23 May, 2019 1 commit
  32. 09 May, 2019 1 commit
    • [Relay][Runtime] Implementation of Relay VM (#2889) · 4332b0aa
      * Implement the virtual machine
      
      Co-Authored-By: wweic <ipondering.weic@gmail.com>
      
      * Fix rebase build issues
      
      * Reorganize vm.py and fix allocator bug
      
      * Remove compiler
      
      * Remove tests
      
      * Remove backend/vm/vm.cc too
      
      * Fix docs
      
      * Fix doc
      
      * Fix doc
      
      * Add vm docs
      
      * Remove change to dead_code.cc
      
      * Remove Relay logging
      
      * Remove reduce
      
      * Update include/tvm/runtime/vm.h
      
      Co-Authored-By: jroesch <roeschinc@gmail.com>
      
      * Reformat
      
      * Update include/tvm/runtime/vm.h
      
      Co-Authored-By: jroesch <roeschinc@gmail.com>
      
      * Address feedback
      
      * Update include/tvm/runtime/vm.h
      
      Co-Authored-By: jroesch <roeschinc@gmail.com>
      
      * Apply suggestions from code review
      
      Co-Authored-By: jroesch <roeschinc@gmail.com>
      
      * Fix a couple outstanding comments
      
      * Last couple comments
      
      * Update include/tvm/runtime/vm.h
      
      Co-Authored-By: jroesch <roeschinc@gmail.com>
      
      * Address code review feedback
      
      * Fix final comment
      
      * Address comments
      
      * Error reporting and example
      
      * add Const
      
      * Explicitly delete copy assignment operator
      
      * Fix rebase
      
      * Pass 3rd arg to fusion
      Jared Roesch committed
  33. 04 May, 2019 1 commit
  34. 26 Apr, 2019 1 commit
  35. 16 Apr, 2019 1 commit
  36. 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