Lunderberg commented on code in PR #16642:
URL: https://github.com/apache/tvm/pull/16642#discussion_r1505082724


##########
python/tvm/relax/transform/transform.py:
##########
@@ -463,6 +463,16 @@ def KillAfterLastUse() -> tvm.ir.transform.Pass:
     return _ffi_api.KillAfterLastUse()  # type: ignore
 
 
+def ComputePrimValue() -> tvm.ir.transform.Pass:
+    """Compute all R.prim_value instances

Review Comment:
   I was thinking an even simpler heuristic: All PrimFuncs are impure, unless 
explicitly annotated otherwise.  In this case, since the functions are being 
generated in a manner that requires purity, it could also provide the 
annotation.
   
   For long-term, agreed, it would be good to have the TIR-level purity 
analysis.  I think I'd weaken the condition you mentioned slightly: A function 
is impure if it writes to a buffer that it didn't itself allocate.



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