tqchen commented on a change in pull request #7152:
URL: https://github.com/apache/tvm/pull/7152#discussion_r552855040



##########
File path: include/tvm/runtime/packed_func.h
##########
@@ -442,13 +447,17 @@ class TVMPODValue_ {
  protected:
   friend class TVMArgsSetter;
   friend class TVMRetValue;
+  friend class TVMMovableArgValue_;
   TVMPODValue_() : type_code_(kTVMNullptr) {}
-  TVMPODValue_(TVMValue value, int type_code) : value_(value), 
type_code_(type_code) {}
+  TVMPODValue_(TVMValue value, int type_code, const std::string& 
prefix_message = "")
+      : value_(value), type_code_(type_code), prefix_message_(prefix_message) 
{}
 
   /*! \brief The value */
   TVMValue value_;
   /*! \brief the type code */
   int type_code_;
+  /*! \brief Message to prefix any error message with */
+  std::string prefix_message_;

Review comment:
       Adding String to each of the argument is a big overhead. We certainly 
don't want to construct such an error message for each function call even if no 
error is presented.
   
   Instead, it might be good to think about alternatives. E.g. trying to be 
able to catch the errors in FFI functions and add name to the trace.

##########
File path: include/tvm/ir/transform.h
##########
@@ -414,6 +414,65 @@ TVM_DLL Pass
 CreateModulePass(const runtime::TypedPackedFunc<IRModule(IRModule, 
PassContext)>& pass_func,
                  int opt_level, String name, Array<runtime::String> required);
 
+class ModulePassNode : public PassNode {

Review comment:
       Additionally, this could be something that we can add back once the 
packed func land




----------------------------------------------------------------
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:
[email protected]


Reply via email to