1. 22 Oct, 2019 1 commit
  2. 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
  3. 20 Oct, 2019 1 commit
  4. 18 Oct, 2019 1 commit
  5. 17 Oct, 2019 1 commit
  6. 16 Oct, 2019 2 commits
  7. 15 Oct, 2019 1 commit
    • [RFC][RUNTIME] Introduce new object protocol. (#4115) · a0bd3786
      * [RUNTIME] Introduce new object protocol.
      
      This PR introduces a new object protocol to unify the node and object.
      We also updated the existing runtime::vm code to make use of the new system.
      
      Update to the node will be done in a follow up PR.
      
      Other changes:
      
      - Remove object related code in json serializer as that code logic was not complete
        and we have a separate serializer for VM, can revisit later.
      
      * address review  comment
      
      * Fix the child slot logic
      Tianqi Chen committed
  8. 11 Oct, 2019 1 commit
  9. 10 Oct, 2019 1 commit
  10. 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
  11. 06 Oct, 2019 1 commit
  12. 03 Oct, 2019 1 commit
  13. 02 Oct, 2019 1 commit
  14. 01 Oct, 2019 1 commit
    • [TOPI]Add op argwhere (#3994) · fa4d3ec6
      * Add op argwhere
      
      * Move shape func to _algorithm.py
      
      * Add lint rule
      
      * Raise exception if rank is not supportted
      
      * move argwhere to transform
      
      * Add argwhere example
      
      * Fix lint
      
      * Add 1-d support
      
      * cleanup
      
      * Add more dtype support
      
      * CR comment
      
      * Improve error message
      
      * Docs
      
      * raise exception
      Wei Chen committed
  15. 29 Sep, 2019 1 commit
    • [Relay] Move prelude to text format (#3939) · 2dac17d8
      * Fix parser
      
      * Doc fix
      
      * Add module utility functions necessary for prelude
      
      * Implement prelude in text format
      
      * Remove programmatically constructed prelude defs
      
      * Fix 0-arity type conses in pretty printer and test
      
      * Make prelude loading backwards-compatible
      
      * Fix patterns
      
      * Improve some prelude defs
      
      * Fix `ImportFromStd`
      
      It needs to also follow the "add unchecked, add checked" pattern
      
      * Lint roller
      
      * Woops
      
      * Address feedback
      
      * Fix `test_list_constructor` VM test
      
      * Fix `test_adt.py` failures
      Logan Weber committed
  16. 25 Sep, 2019 3 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
    • Expose llvm.nearbyint intrinsic. This is a faster alternate to rounding. (#4001) · 17c2c0a1
      * Expose llvm.nearbyint intrinsic. This is a faster alternate to rounding.
      
      Summary:
      
      Test Plan:
      
      Reviewers:
      
      Subscribers:
      
      Tasks:
      
      Tags:
      
      * Added python binding. Added test.
      
      Summary:
      
      Test Plan:
      
      Reviewers:
      
      Subscribers:
      
      Tasks:
      
      Tags:
      Kimish Patel 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
  17. 24 Sep, 2019 2 commits
  18. 22 Sep, 2019 2 commits
  19. 20 Sep, 2019 2 commits
  20. 12 Sep, 2019 2 commits
  21. 11 Sep, 2019 1 commit
  22. 09 Sep, 2019 1 commit
  23. 06 Sep, 2019 1 commit
    • [Relay] Add ADTs to text format (#3863) · ca0292d8
      * Getting closer to having ADT defs
      
      * ADT defs working probly
      
      * Match parsing basipally done
      
      * came to earth in a silver chrome UFO
      
      * match finished?
      
      * All tests but newest are passing
      
      * ADT constructors work
      
      now cleanup?
      
      * Cleanup round 1
      
      * Cleanup round 2
      
      * Cleanup round 3
      
      * Cleanup round 4
      
      * Cleanup round 6
      
      * Cleanup round 7
      
      * Lil grammar fix
      
      * Remove ANTLR Java files
      
      * Lint roller
      
      * Lint roller
      
      * Address feedback
      
      * Test completeness in match test
      
      * Remove unused imports
      
      * Lint roller
      
      * Switch to Rust-style ADT syntax
      
      * Lil fix
      
      * Add dummy `extern type` handler
      
      * Add type arg to test
      
      * Update prelude semantic version
      
      * Repair test
      
      * Fix graph var handling in match
      
      * Revert 's/graph_equal/is_unifiable' change
      Logan Weber committed
  24. 05 Sep, 2019 2 commits
  25. 04 Sep, 2019 1 commit
  26. 03 Sep, 2019 2 commits
  27. 01 Sep, 2019 2 commits
    • [Relay][Any] Add shape func for dynamic shape (#3606) · eef35a57
      * init shape func in interpreter and vm compiler
      
      * Update interpreter
      
      * fix
      
      * lint
      
      * lint
      
      * fix
      
      * remove hack
      
      * update
      
      * fix
      
      * fix
      
      * update
      
      * address comments & update for shape_of
      
      * fix lint
      
      * update
      
      * fix hybrid
      
      * lint
      
      * fix bug & add take shape func
      
      * lint
      
      * lint
      
      * update
      
      * fix flaky test
      
      * add todo
      Haichen Shen committed
    • [Relay] Bitserial ops (#3844) · d08c74ca
      * Added arm_cpu NHWC schedules.
      
      * Fixed kernel shape legalization.
      
      * Added bitserial ops to relay.
      
      * Snapshot and more missing files.
      
      * Added dense testing.
      
      * Added tests
      
      * Added ASF header to new files.
      
      * cc lint
      
      * Pylint change.
      
      * pylint fixes.
      
      * Change arm legalize test.
      
      * Added assert check to arm legalize.
      
      * Added better documentation, fixed some bad style
      
      * Reverted arm conv2d nhwc changes.
      Josh Fromm committed
  28. 31 Aug, 2019 1 commit
  29. 30 Aug, 2019 1 commit
  30. 23 Aug, 2019 1 commit