1. 05 Apr, 2020 1 commit
  2. 03 Apr, 2020 2 commits
    • [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
    • [RELAY][FIX] Fix hang in MergeCompilerRegions (#5227) · 54975a3f
      For certain network topologies, MCR could hang.
      This patch fixes that case.
      
      Change-Id: I3edd8a8a6b452b2b838b777720adea22a3b995b4
      mbaret committed
  3. 02 Apr, 2020 1 commit
  4. 01 Apr, 2020 2 commits
    • [RELAY] Fixes to MergeCompilerRegions (#5195) · 04499665
      * [RELAY] Fixed issues with MergeCompilerRegions
      
      This PR addresses a few outstanding issues with
      the implementation of MergeCompilerRegions. In
      particular, it now handles TupleGetItem nodes properly
      and other minor bugs related to region merging have
      been fixed.
      
      Change-Id: I07783afc56183a6f798a510209f23b0a5f252255
      
      * Fixed issue using pre-merged regions
      
      Change-Id: I0a844ac59bda1089ae0c67cef52f0b0c7ab2cbd7
      
      * Removed some debugging logic
      
      Change-Id: Ib6f2eede6f38bbb270073eb8d4c4dc19f60832c6
      
      * Remove default annotations
      
      Change-Id: I9b7696a51c95871491cbea33c40f92ec327e417f
      
      * Annotate default 'if's
      
      Change-Id: I0098bd1bf6788dd6366810dcefa84f1ebbffaab0
      
      * Clang format
      
      Change-Id: I944365cd3080a97a9261f643a8f1efa5a63cf82b
      
      * Use src/dest in merge
      
      Change-Id: Ie43113492bda8f1ce63eaf9615cb645bb9e2ee86
      
      * Fixed partition test
      
      Change-Id: I46f9e349b1a813a9140f7e4f8a2241687e2df73b
      
      * Removed comments
      
      Change-Id: I309afdd1951d7e796e41d13788aa487707e0ac4c
      mbaret committed
    • [RELAY] Partition graph codestyle fixes (#5202) · e46aa333
      * [RELAY] Codestyle fixes for Graph Partitioner
      	*ran through clang-format
      
      * *formatting comments
      
      * *further codestyle changes (after clang-format)
      manupa-arm committed
  5. 31 Mar, 2020 1 commit
    • [RELAY] Re-wrote the Graph Partitioner to support multiple outputs (#5143) · 14ae3a6e
      * [RELAY] Re-wrote the Graph Partitioner to support multiple outputs
      
      Input : A Relay module that have functions with disjoint annotated regions
              using compiler_begin and compiler_end. There could be multiple outputs.
      
      Output : A Relay module with global functions for such disjoint annotated regions
               with calls inserted at the respective location
      
      Dependencies : AnnotatedRegionSet Utility class.
      
      Methodology :
            1) The AnnotatedRegionSet utility class is able to construct a collection of
               nodes that are bound by a give annotation -- here we use compiler_begin
               and compiler_end
            2) Initially, for each function in the module AnnotatedRegionSets are populated.
            3) Then, Vistor pass is traversed until a compiler_end node is encountered
               that belongs to a "region".
            4) When the first compiler_end of a given annotated region is found, a function is
               formed and inserted.
               a) if the region has multiple outputs, a Tuple node (capturing all outputs)
                  is returned.
            5) Thereafter, if we encounter an another output of the same annotated region,
               it is important to note that the function is already formed. Therefore, it will
               lookup the function and add a TupleGetItemNode is inserted.
                a) We will use the location index of "rets" of each "Region" of AnnotatedRegionSet
                   as TupleGetItemNode index.
            6) Therefore, functions will be created for all annotated regions. The name for each
               global function is created using "Region" id and the compiler name.
      
      Change-Id: I1372f02a845b6d3da03b561763e03a378dca263c
      
      * [RELAY] Re-wrote the Graph Partitioner to support multiple outputs
      
          *removed the expected use-case as we are taking broken-down PR approach
          *code style fixes
          *some trivial one liners
      
      * [RELAY] Re-wrote the Graph Partitioner to support multiple outputs
      
          *fixed an implicit copy to a move
      
      * [RELAY] Re-wrote the Graph Partitioner to support multiple outputs
      
          *code style changes for comments
          *renamed test case multiple outputs --> mixed single multiple outputs
              Since the existing test case checks for both single and multiple
              output scenarios
          *added a new test case with conv2d + batch_norm
          *some var name changes in the test
      
      * [RELAY] Re-wrote the Graph Partitioner to support multiple outputs
      
      	*rebased
      manupa-arm committed
  6. 30 Mar, 2020 2 commits
    • [RELAY] Add MergeCompilerRegions pass (#5134) · 02121383
      * [RELAY] Add MergeCompilerRegions pass
      
      This pass is part of the flow to support creating compiler
      regions with multiple outputs. It should be called after
      AnnotateTarget and will merge together regions that share
      the same target to create larger compiler regions that can
      be off-loaded to external codegens.
      
      This pass implements an algorithm to ensure that during the
      merging, no data dependency issues are created. See the tests
      for an example of this case.
      
      Co-authored-by: Ramana Radhakrishnan  <ramana.radhakrishnan@arm.com>
      Co-authored-by: Manupa Karunaratne    <manupa.karunaratne@arm.com>
      
      Change-Id: Ibd99083564608d888482f57c5080109f3eefec88
      
      * [RELAY] Annotate compiler_ends on each edge
      
      This alters the behaviour of the AnnotateTarget
      pass to enforce the property that all compiler
      annotations exist along a single data flow edge.
      Specifically, this means they should have exactly
      one parent and one child.
      
      Change-Id: I0e74803a77767f4f377d17755a13a74a30909797
      
      * Fix comment
      
      * Rebase *Node::make
      
      * Moved block outside for loop
      
      * Code style
      
      * Update make API
      
      * Remove comment
      
      * Remove redundant 'else's
      
      * Make one line
      
      * Fix comment
      
      * RefWrite
      
      * Fix merge ordering
      
      * Add the RFC example as a test
      
      * [FIX] Fixed merging behaviour in AnnotateRegionSet
      
      Deleting items from a list while iterating it seems to
      result in undefined behaviour which sometimes segfaults.
      This makes sure all the item deletion happens separately.
      
      * Added checks
      
      * Move comment
      
      * Update comments
      mbaret committed
  7. 29 Mar, 2020 1 commit
  8. 27 Mar, 2020 2 commits
  9. 24 Mar, 2020 1 commit
    • [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
  10. 23 Mar, 2020 1 commit
  11. 20 Mar, 2020 1 commit
  12. 19 Mar, 2020 1 commit
  13. 18 Mar, 2020 1 commit
  14. 17 Mar, 2020 1 commit
  15. 13 Mar, 2020 1 commit
  16. 12 Mar, 2020 2 commits
    • [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
    • [refactor][relay pass] Separate analysis and transform passes (#5035) · 14ba49c6
      * [refactor][relay pass] Separate analysis and transform passes into different subfolders
      
      * remove pass folder
      Zhi committed