You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by GitBox <gi...@apache.org> on 2021/12/07 19:16:21 UTC

[GitHub] [tvm] joshherr227 opened a new pull request #9674: Pass bisection tool using pass_instrument infrastructure

joshherr227 opened a new pull request #9674:
URL: https://github.com/apache/tvm/pull/9674


   This tool allows the user to bisect a run of passes via the tvm pass instrumentation infrastructure. 
   Invocation is:
   
   ```
   from tvm.relay.debug import PassBisection
   with tvm.transform.PassContext(instruments=[PassBisection(limit=N)]):
           ...
   ```
   
   In addition to the python debugging tool, an additional member has been added to PassInfoNode in order to facilitate prioritizing passes that MUST run in order for Relay/TIR to compile. That is, passes marked with the new run_always flag will ALWAYS run, regardless of the limit. Below is a list of the passes that were marked with this new attribute.
   
   ["sequential",
    "InferType",
    "LowerTE",
    "LowerTensorExpr",
    "FuseOps",
    "PlanDevices",
    "PlanDevicesCore",
    "BindTarget",
    "Filter",
    "FoldConstant",
    "DynamicToStatic",
    "SimplifyInference",
    "tir.LowerIntrin",
    "tir.LowerTVMBuiltin",
    "tir.Simplify",
    "tir.MakePackedAPI",
    "tir.VectorizeLoop",
    "tir.StorageFlatten",
    "tir.StorageFlattener",
    "tir.StorageFlatten_impl",
    "tir.BufferShapeLegalize",
    "tir.BufferStrideLegalize"]
   
   These passes were arrived at via trial and error compiling a resnet50 caffe model until it ran with limit=1 (only the first pass runs). It may  not be exhaustive.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [tvm] joshherr-quic commented on pull request #9674: Pass bisection tool using pass_instrument infrastructure

Posted by GitBox <gi...@apache.org>.
joshherr-quic commented on pull request #9674:
URL: https://github.com/apache/tvm/pull/9674#issuecomment-995223214


   @mbs-octoml I went ahead and stripped the instrumentation down to just print debug info..


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [tvm] jroesch commented on pull request #9674: Pass bisection tool using pass_instrument infrastructure

Posted by GitBox <gi...@apache.org>.
jroesch commented on pull request #9674:
URL: https://github.com/apache/tvm/pull/9674#issuecomment-1016912073


   @joshherr-quic @mbs-octoml can you update this one, CI is red, thanks!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [tvm] masahi commented on pull request #9674: Pass bisection tool using pass_instrument infrastructure

Posted by GitBox <gi...@apache.org>.
masahi commented on pull request #9674:
URL: https://github.com/apache/tvm/pull/9674#issuecomment-1030361338


   cc @mbs-octoml 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [tvm] joshherr-quic closed pull request #9674: Pass bisection tool using pass_instrument infrastructure

Posted by GitBox <gi...@apache.org>.
joshherr-quic closed pull request #9674:
URL: https://github.com/apache/tvm/pull/9674


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [tvm] joshherr-quic commented on pull request #9674: Pass bisection tool using pass_instrument infrastructure

Posted by GitBox <gi...@apache.org>.
joshherr-quic commented on pull request #9674:
URL: https://github.com/apache/tvm/pull/9674#issuecomment-989125714


   > Personally I've found just letting compilation run and looking at the debug dump (eg using TVM_LOG_DEBUG="DEFAULT=1") is enough to help me find where things have gone off the rails. However I can see having a hard stop would also be valuable.
   > 
   > The required vs optional distinction is probably going to be fragile, especially since passes often build on each other. But tackling that issue is a design problem on its own (eg can me label passes with 'requires' and have a pass list validation or completion step to 'resolve interpass dependencies'). Would you consider dumbing down this instrument to simply count passes and not try to take on the opt vs req distinction?
   > 
   > Thanks!
   
   That fragility is something I was worried about as well. I think it makes sense to tackle that in a separate PR. I'll go ahead and limit this code to just printing debug info.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [tvm] mbs-octoml commented on a change in pull request #9674: Pass bisection tool using pass_instrument infrastructure

Posted by GitBox <gi...@apache.org>.
mbs-octoml commented on a change in pull request #9674:
URL: https://github.com/apache/tvm/pull/9674#discussion_r765154986



##########
File path: python/tvm/relay/debug.py
##########
@@ -42,3 +43,52 @@ def _debug_interp(*args):
     print("--------------")
     print("--------------")
     _debugger_init(ist.current_expr, ist.stack)
+
+
+@pass_instrument
+class PassBisection:

Review comment:
       nit: probably because I'm contaminated by 'git bisect', but 'AtMost' seems a better term than 'Bisect' which suggests a search.
   
   




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org