1. 07 Apr, 2020 2 commits
    • [uTVM][Runtime] Introduce Virtual Memory Allocator to CRT (#5124) · e11a6092
      * initial crt_memory and memory leak fix in graph_runtime
      
      Change-Id: I0f79f909a04d1c677aabb80f202f0612c5ce7f2a
      
      * fix memory leak
      
      Change-Id: I37104c09e28112b1974fa2b064c809d0a8d686c3
      
      * clean up
      
      Change-Id: I039b12015a1d56c8f4120867cd5a5292da34f3e3
      
      * implement vrealloc
      
      Change-Id: I35800470bcbfcf96652494f359711cb4c2d34398
      
      * allocate from stack memory for most of the variables
      
      Change-Id: I72071289843fff4031c0df8796868a0b9fbc57ee
      
      * allocate from stack memory for all of the variables
      
      Change-Id: I32dba85ac1660c77f51c2d0d8ab6436ed0c01c74
      
      * lint
      
      Change-Id: If12cd240685d7791fc60bc0cfb66389cdc186b73
      
      * lint
      
      Change-Id: I7c9d90c11b60b8edda2427ebd189ebe535af2100
      
      * facilitate the growth of TVM_CRT_MAX_NDIM
      
      Change-Id: I939fa43027a5c7529c5c7c6bd8d6e6beb91b7581
      
      * extend test coverage of vmalloc
      
      Change-Id: Ie4ff6b64fdfe6810836cf8fd44dace82a20c4581
      
      * lint
      
      Change-Id: Ibf3c06619ef296df5c49f3945cb6428777781d69
      
      * move logging.h to src
      
      * fix an error in macOS
      
      * remove logging.h
      
      * use cflags for gcc
      
      * fix compilation error
      Liangfu Chen committed
    • [Relay][OP] Add fast_erf implementation (#5241) · f5b02fdb
      * add fast erf
      
      * doc
      
      * lint
      
      * fix
      
      * fix indent
      Haichen Shen committed
  2. 06 Apr, 2020 1 commit
  3. 05 Apr, 2020 2 commits
    • [Relay][Topi][AutoTVM] Winograd support for Conv3D (#5186) · 02eb1833
      * Functional conv3d winograd working.
      
      * Formatted python code.
      
      * registered conv3d winograd compute and started adding relay without_weight_transform operator.
      
      * Add topi testing for conv3d winograd.
      
      * Format file.
      
      * small tweak to unrolling to prevent build sticking.
      
      * Refactoring convolution ops in relay.
      
      * Refactored relay convolutions.
      
      * Bug fixes.
      
      * Fixed static bug in convolution.
      
      * Added conv3d alter op layout and related support.
      
      * Bug fixes and testing done.
      
      * Fix a few autotvm bugs.
      
      * Drop silly debug print.
      
      * Removed debug_skip_region.
      
      * Add variant of conv3d_winograd that doesn't transform depth.
      
      * initial infrastructure done for depthless conv.
      
      * Fix no_depth schedule bugs.
      
      * automatic topi switching between depth and depthless winograd.
      
      * Fixed bug in schedule.
      
      * lint fixes.
      
      * Removed indents in convolution.cc
      
      * missed a few indents oops.
      
      * fixed flop count.
      
      * One more small tweak.
      
      * Change kernel pack inner axes order.
      
      * Style changes.
      
      * Comment fixes.
      Josh Fromm committed
    • [REFACTOR][TIR] Migrate all low-level passes to the Pass Manager. (#5233) · e63e08fe
      * [REFACTOR][TIR] Migrate all low-level passes to the Pass Manager.
      
      This PR migrates the tvm.lower to return IRModule of PrimFuncs
      instead of the LoweredFuncs.
      
      * Remove LoweredFunc.
      Tianqi Chen committed
  4. 03 Apr, 2020 2 commits
    • [REFACTOR][TIR] Migrate most of low-level build to use the Pass Manager. (#5225) · 75e936e1
      * [REFACTOR][TIR] Migrate most of low-level build to use the Pass Manager.
      
      - SplitHostDevice
      - ThreadSync
      - BindDevice
      - LowerThreadAllreduce
      - Provide a temp fix for printing IRModule with PrimFunc before the formal text printer.
      
      * Address comments, fix tests.
      
      * Fix relay tests
      
      * Explicit move
      Tianqi Chen committed
    • [RELAY] Non-recursive Graph Vistor and Rewriter (#4886) · 7de8a539
      * First pass a defining a non-recursive Graph Vistor and Rewriter
      
      autoformat
      
      remove a currently empty test until testing is solidfied
      
      * Make CalcDep from Dead Code Elimination non-recursive
      
      * Partially working, not passing all tests yet
      
      passes tests when disabling GetExprRefCount, I think I have a bug in visit counting
      
      fix GetExprRefCount
      
      Fix a subtle bug with nested recursive/non-recursive scopes
      
      * Refactor
      
      * improve comments
      
      * respond to review comments on comments
      
      * Fix a problem with default recursion for dataflow nodes
      
      mark DataflowVisitor methods as override
      
      * implement ScopeMutator
      
      * convert forward_rewrite to ScopeMutator, remove DataflowMutator
      
      * rewrite ExprRewriter and convert fast_math to use it
      
      * switch BiasAddSimplifier to ExprRewriter
      
      fix a clang warning
      
      fix cpp lint
      
      fix doc param error
      
      * respond to review comments
      
      * fix a typo in the iterative looping
      
      * add a regression test for GetExprRefCount issue
      
      * Normalize naming
      
      * fix lint
      
      * First pass a defining a non-recursive Graph Vistor and Rewriter
      
      autoformat
      
      remove a currently empty test until testing is solidfied
      
      * Make CalcDep from Dead Code Elimination non-recursive
      
      * Partially working, not passing all tests yet
      
      passes tests when disabling GetExprRefCount, I think I have a bug in visit counting
      
      fix GetExprRefCount
      
      Fix a subtle bug with nested recursive/non-recursive scopes
      
      * Refactor
      
      * improve comments
      
      * respond to review comments on comments
      
      * Fix a problem with default recursion for dataflow nodes
      
      mark DataflowVisitor methods as override
      
      * implement ScopeMutator
      
      * convert forward_rewrite to ScopeMutator, remove DataflowMutator
      
      * rewrite ExprRewriter and convert fast_math to use it
      
      * switch BiasAddSimplifier to ExprRewriter
      
      fix a clang warning
      
      fix cpp lint
      
      fix doc param error
      
      * respond to review comments
      
      * fix a typo in the iterative looping
      
      * add a regression test for GetExprRefCount issue
      
      * Normalize naming
      
      * fix lint
      
      * respond to review comments
      Matthew Brookhart committed
  5. 02 Apr, 2020 6 commits
  6. 01 Apr, 2020 1 commit
  7. 31 Mar, 2020 2 commits
  8. 30 Mar, 2020 1 commit
  9. 29 Mar, 2020 2 commits
  10. 28 Mar, 2020 2 commits
    • [NODE][IR] Introduce StructuralHash for the Unified IR. (#5160) · 497d01d3
      * [NODE][IR] Introduce StructuralHash for the Unified IR.
      
      This PR introduces a new way to handle structural hash for the unified IR.
      
      - Each object can now register an optional SEqualHash function, which
        describes how to reduce its structural equality to sequence of hash values.
      - Optionally, the object can choose to allow labeling of vars(e.g. function parameters)
        by calling DefHash
      - We implemented a non-recursive structural hasher that maintains its own stack
        to traverse te IR.
      
      This PR also improves the hash value property from the previous relay's hash utility.
      In particular, the graph node mode hashs a DAG differently from a tree
      by attaching an unique occurence index to each graph node.
      
      In all of the test cases so far, structural_hash is consistent with structural_equal.
      - if structrual(x, y) then structural_hash(x) == structural_hash(y)
      - if structural_hash(x) == structural_hash(y) then highly likely structural_equal(x, y)
        - hash no collison is found in our testcases.
      
      Ideally we should work on automatically generating these functions in the future.
      
      * Fix cases for EnvFunc and Array dims
      
      * fix testcase
      
      * Update src/node/structural_hash.cc
      
      Co-Authored-By: 雾雨魔理沙 <lolisa@marisa.moe>
      
      Co-authored-by: 雾雨魔理沙 <lolisa@marisa.moe>
      Tianqi Chen committed
    • [NODE][IR] Introduce StructuralEqual Infra for the unified IR. (#5154) · 997a14ed
      * [NODE][IR] Introduce StructuralEqual Infra for the Unified IR.
      
      This PR introduces a new way to handle structural equality
      for both TIR and relay nodes in an extensive way.
      
      - Each object can now register an optional SEqualReduce function, which
        describes how to reduce its structural equality to another instance
        into equality of the children.
      - Optionally, the object can choose to allow remapping of vars(e.g. function parameters)
        by calling DefEqual
      - We implemented a non-recursive structural equality checker that
        recursively traverses the objects and does the structural equality checking.
      
      This PR also fixes a few potential problems in previous relay's AlphaEqual.
      
      - In particular, the new structural equality relation will be communicative.
      - It is can be dangerous to use same_as relation to quickly check equality,
        demonstrated by the following case. (%x, %y) are shared vars between two functions.
      
      - function0: fn (%x, %y) { %x + %y }
      - function1: fn (%y, %x) { %x + %y }
      
      The new structural equal is intented to supersede AlphaEqual and AttrsEqual.
      
      Follow-up PRs should be performed to redirect the existing usages, and removes
      the corresponding implementation.
      
      * Update the rule to distinguish between graph node and non-graph nodes.
      
      * Refactor the test cases to use structural equal.
      
      * address comments
      
      * Mark more relay::Expr as graph node, fix a testcase issue(was bug that was not caught by previous alpha equal)
      
      * Remove unrelated comment
      
      * Fix file comment
      
      * Address review comment
      
      * Relax condition to fit flaky case
      Tianqi Chen committed
  11. 24 Mar, 2020 2 commits
    • [REFACTOR][TIR] Introduce PrimFuncPass. (#5139) · 0a0e58bf
      * [REFACTOR][TIR] Introduce PrimFuncPass.
      
      - Introduce PrimFuncPass
      - Convert one pass to the unified Pass API.
      
      * Address comments
      
      * Fix comments
      Tianqi Chen committed
    • [Relay] GradientCell Relay Pass (#5039) · e6dd8e1e
      * save
      
      * gradient.rly
      
      * fix
      
      * NOT WORKING: gradient cell pass
      
      * test gradient pass
      
      * fixed basic call ops
      
      * more tests
      
      * fix bug
      
      * transform calls to one ones_like zero zero_like
      
      * maintenance stuff
      
      * fix linting
      
      * linting
      
      * linting
      
      * throw default
      
      * remove unrelated changes
      
      * import gradent.rly in pass
      
      * comment
      
      * linting
      
      * remove changes to test files
      
      * move gradient_cell.cc to transforms
      
      * revert change
      
      * update files with new commits
      
      * type
      
      * wrapper function to main outermost function type
      
      * fix linting
      
      * fix unsigned and signed int comparison
      
      * review
      
      * GetConstructor definition in module and change op comparison
      
      * update node instantiations
      
      * increase code readability
      
      Co-authored-by: Marisa Kirisame <lolisa@marisa.moe>
      Andrew Liu committed
  12. 23 Mar, 2020 3 commits
  13. 20 Mar, 2020 2 commits
  14. 18 Mar, 2020 2 commits
  15. 17 Mar, 2020 1 commit
    • [Relay, TF Frontend] Dilation2D operator support (#5033) · 646cfc63
      * update docs for dilation 2d
      
      * dilation2d compute
      
      * dilation2d register
      
      * dilation2d rel compute
      
      * dilation2d strategy
      
      * dilation2d attrs
      
      * dilation2d generic schedule
      
      * dilation2d tf frontend support
      
      * dilation2d tf frontend test case
      
      * dilation2d test cases
      
      * pylint fixes
      
      * add exception for cuda target
      
      * Update docstring
      
      * Update docstring
      
      * change rates to dilations
      
      * removed unused param
      
      * merge master
      
      * Update nn.py
      
      * Update nn.py
      Mahesh Ambule committed
  16. 15 Mar, 2020 2 commits
  17. 14 Mar, 2020 1 commit
    • [TIR] Introduce tir::PrimFunc (#5070) · e0316415
      This PR introduces tir::PrimFunc which will be used as the TIR function
      container in the unified IR.
      
      Also streamlined the function attributes a bit further.
      - All common attributes are under tvm::attr
      - TIR specific attributes are under tvm::tir::attr and comes with a tir prefix
      - Use stl_style for attributes for now
      Tianqi Chen committed
  18. 12 Mar, 2020 2 commits
    • [Bugfix][IR][ATTRS] Fix AttrEqual for Array and StrMap, double (#5054) · 29a3d3a6
      - Use fuzzy comparison for double.
      - Removed the hack for BatchNormAttrs and DictAttr.
      
      Also removed a warning from text printer printing.
      Tianqi Chen committed
    • [REFACTOR] Streamline Function Attr interface. (#5045) · ec86d7f1
      * [REFACTOR] Streamline Function Attr interface.
      
      There has been quite a few recent changes that depends heavily on
      the function attr interface. This PR streamlines that interface by introducing
      two APIs that covers most of the usages.
      
      - GetAttr which gets a typed object for a given key
        - HasNonzeroAttr is a quick helper that calls GetAttr to quickly check an attribute
      - WithAttr that creates a new function object with the given attr
        - The API comes with copy on write optimization to avoid multiple copies
        - We deliberately pick the prefix With(instead of Set) to indicate this
          function does not mutate the original input.
      
      On the python side:
      - We allow read access via func.attrs (which is a DictAttr)
      - func.with_attrs to create a new instance with updated attrs.
      
      We also get rid of the small wrapper functions and make sure the API centered around
      the GetAttr and HasNonzeroAttr interface.
      
      This PR also changes the function construction to follow the new convention.
      
      * Address review comments
      
      * Address review comments
      
      * Fix doxygen path
      Tianqi Chen committed
  19. 11 Mar, 2020 4 commits