manupa-arm commented on a change in pull request #8509:
URL: https://github.com/apache/tvm/pull/8509#discussion_r785916930



##########
File path: include/tvm/ir/module.h
##########
@@ -349,6 +350,9 @@ class IRModuleNode : public Object {
    */
   std::unordered_set<String> import_set_;
   friend class IRModule;
+
+ public:
+  void ExtractPrimFuncConstants(tir::PrimFunc func);

Review comment:
       I thought we were agreeing to centralize the constants when we add the 
PrimFunc to the IRModule -- thus PrimFunc could exist before the IRModule.
   
   Moreover, there are scenarios where PrimFuncs are moved to different 
IRModules (e.g. per-target IRModule). We could keep that movement simpler and 
update the IRModule when such a move occurs.
   
   Our preference was always has been to stick the constants as 
PrimFunc/BaseFunc attrs and move them later for IRModule for codegen -- as 
requested in the RFC discussion. This cross-referencing of constants is to aid 
the lowering flow to runtime.Modules. 
   
   Imposing a restriction of "we should make sure that the constants are always 
stored in the IRModule attributes" -- will also create a restriction of 
PrimFuncs cannot be created without an IRModule.
   
   I ll let @d-smirnov elaborate further on this.




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