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

   > Perhaps one way to make it more clear is to rename LowerVMBuiltin to 
LowerRuntimeBuiltin, which have clear indication that that is a pass which 
takes charge of lowering all implementaitons of runtime builtin functions.
   
   I like this idea, but I don't think we should move the definition of the 
legalized form into the `LowerRuntimeBuiltin`.  What if we were to instead add 
a new attribute, which has the same signature as `FLegalize`, but would be 
applied at the later point.  This would allow `LowerRuntimeBuiltin` to replace 
anything that has the `FLowerBuiltin` attribute, and wouldn't require a 
distinction between different levels of `FLegalize`.
   
   That would also allow `FLowerBuiltin` to only run after `ToNonDataflow`, and 
to be implemented in terms of impure functions.  By constrast, since 
`FLegalize` may replace a call within a dataflow block, the implementation 
cannot be in terms of an impure call.
   
   > One can also envision in future we have a codegen approach to get a view 
function that get inlined which is not needed in the VM approach.
   
   I like this idea, and have been toying around with some TIR implementations. 
 The key limitation at the moment is the inability to construct and return a 
new `NDArray` if required.  (Similar to the difficulties in returning a string 
that are blocking https://github.com/apache/tvm/pull/16836 and 
https://github.com/apache/tvm/pull/17103.)


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to