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/01/29 16:32:25 UTC

[GitHub] [tvm] mbrookhart commented on pull request #7368: Refactor Dynamic to Static

mbrookhart commented on pull request #7368:
URL: https://github.com/apache/tvm/pull/7368#issuecomment-769910029


   > Since you always run `PrepareArgs` when you find a dynamic op, I'd run `PrepareArgs` here
   > 
   > https://github.com/apache/tvm/blob/384714b58ed374cb1e385142b5dc4128041c945c/src/relay/transforms/dynamic_to_static.cc#L209
   
   I tried this early on, unfortunately, PrepareArgs ends up making a copy of the IR to do type inference, and then we end up with two different versions of input variables depending on whether or not the op that uses them has a dynamic op before it or not, this breaks several unit tests.
   
   To fix it, I would need to do infer_type/constant folding on every op during traversal, but without incremental type inference, that's impossibly slow. This is a middle ground that fixes the problem without too much of a performance hit.


----------------------------------------------------------------
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.

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