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

   MasterJH5574 I'm not sure if that would be the best test cases to add, for a 
couple of reasons.
   
   1. I fully expect there to be differences between the previous single-pass 
of `StaticPlanBlockMemory` and the new 2-pass sequence of `SPBM -> 
KillAfterLastUse`, due to cases that aren't handled by the static memory 
planning.  (e.g. Failure to de-allocate buffers that are aliased using 
`R.reshape`, or dynamic buffers.)
   
   2. Writing a test on the application of both passes in sequence assumes that 
the passes are used adjacently in the lowering flow.  This is already not the 
case, as `RewriteCUDAGraph` and `LowerAllocTensor` occur between the two.
   
   That said, I think it would be good to add tests verifying that the memory 
planning does still have the intended reduction of memory use.  I think the 
best way to do this would be to monitor the allocations/deallocations and 
verifying that they occur in the correct order.  The allocations could be 
captured by overriding `"vm.builtin.alloc_storage"`, but deallocations occur 
based on the reference-counter in `NDArray`.  Do you know of a good way to 
capture/track those deallocations?


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