lhutton1 commented on PR #11208:
URL: https://github.com/apache/tvm/pull/11208#issuecomment-1279165680

   Hi @zhaoyang-star, thanks for taking a look, its great to see this pass 
being used elsewhere. The pass currently expects the input to be a module of 
primitive functions so I would suggest running `AnnotateUsedMemory` after 
`FuseOps` similar to:
   ```
   mod = relay.transform.InferType()(mod)
   mod = relay.transform.FuseOps()(mod)
   mod = relay.transform.InferType()(mod)
   mod = relay.transform.ToANormalForm()(mod)
   mod = relay.transform.InferType()(mod)
   mod = AnnotateUsedMemory()(mod)
   ```
   
   I did try running your example locally with the above change and this 
produced the relevant `used_memory` annotations. However, it looks like there 
is an issue while building the module after having run the `AnnotateUsedMemory` 
pass. Without digging too much into it I would suspect it's because this pass 
wasn't considered for the graph executor; only for the AOT executor. I believe 
changes similar to #11091 would be needed in the graph executor to support 
A-normal form. Hope this helps :)


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