tqchen commented on pull request #7945:
URL: https://github.com/apache/tvm/pull/7945#issuecomment-829551076


   @csullivan to followup on your points. I agree that a decision about output 
aliasing can be a big undertaking to mark in the IR itself. The way that the 
current PR structured it is as follows:
   
   - K0 The reshape only property is a property with respect to the function 
itself, without breaching into the property of the phyiscal execution
   - K1 The graph execution generator takes that property to generate eliding.
   
   Note that majority part of the property marking in K0 more strict than C1, 
due to the reason that aliasing info breaches the semantics while K0 is 
considered as an annotation of the function property, the backend can still 
choose to implement reshape only function by actually running the code or alias 
them together.
   
   K1 have to happen at some time point, and can be both target and operation 
dependent. Given that right now the memory planning and executions are coupled 
at the graph runtime codegen, the current change to the graph runtime is 
consistent with that choice. 
   
   As we start to factor out more of memory alloca and execution into seperate 
passes, I agree that introducing physical specific annotations  would then make 
sense since the decisions will then be passed across a few stages.
   
   The target dependence of K1 is indeed something worth thinking about. Given 
that the current graph planner already assumes flat memory, my assumption is 
that a separate planning and execution generator will be needed for the N-D 
case, where we can skip this choice for now(note that the reshape only is a 
property tag rather than a tag that enforces the execution).
   
   Back to the general topic of aliasing memory. I think that problem would be 
a bigger decision indeeds deserves an RFC and more in-depth thoughts(I don't 
think marking aliasing in the graph directly is the right approach as you said 
it changes the semantics of the graph in an early stage). This PR is mainly 
intended as a incremental improvement to the graph executor that is handle the 
case of reshape in a consistent way as VM in the case of flat memory scenario. 
   
   


-- 
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:
us...@infra.apache.org


Reply via email to