slyubomirsky commented on code in PR #14394:
URL: https://github.com/apache/tvm/pull/14394#discussion_r1148451866


##########
src/relax/op/op.cc:
##########
@@ -292,7 +349,10 @@ RELAY_REGISTER_OP("relax.invoke_closure")
     .set_num_inputs(2)
     .add_argument("closure", "Expr", "The VMClosure.")
     .add_argument("args", "Tuple", "The captured variables.")
-    .set_attr<FInferStructInfo>("FInferStructInfo", 
InferStructInfoInvokeClosure);
+    .set_attr<FInferStructInfo>("FInferStructInfo", 
InferStructInfoInvokeClosure)
+    // TODO: This might be another case where we would want a macro or even 
use an attr.
+    // It may depend on the particulars of the closure
+    .set_attr<Bool>("FPurity", Bool(false));

Review Comment:
   Here is an example where using a simple boolean for indicating the purity of 
an op might not work out. I don't know if there is any way to figure out 
whether a given VM closure is pure or not. 
   
   Alternatively, if we take the view that we should not track purity past a 
certain point in compilation (e.g., by the time we get rid of dataflow blocks), 
maybe this is less of an issue.



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