Lunderberg commented on PR #16595:
URL: https://github.com/apache/tvm/pull/16595#issuecomment-1955860414

   > Does this affect the result? If a weight transformation depends on some 
values like `R.zeros`, such transformation will no longer be lifted if 
`R.zeros` is not lifted, maybe better we can check such dependency
   
   Good question, and this case should be handled, by allowing zero-param 
operators to potentially appear in both functions.  (See [this unit 
test](https://github.com/apache/tvm/pull/16595/files#diff-0164f466641405b90811062a983b85caf8118561d094a7c89515922d1c34044fR822)
 for how this looks in practice.)  While the case isn't ever explicitly 
handled, it instead results from the overall lifting.
   
   1. Add every variables binding that doesn't require runtime parameters to 
the lifted `transform_params` function.
   2. For every variable binding that is present in `transform_params` and 
depends on the model weights, replace with the output from `transform_params`.
   3. Run dead-code elimination on both functions.
   
   Since the zero-param operators don't depend on runtime parameters, they 
appear in the `transform_params`.  Since the zero-param operators don't depend 
on the model weights, they aren't replaced in the original function.  If they 
are only required in one of the two functions, then the dead-code elimination 
will remove them from the other.


-- 
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-unsubscr...@tvm.apache.org

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

Reply via email to