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



##########
File path: include/tvm/ir/module.h
##########
@@ -56,11 +56,14 @@ class IRModuleNode : public Object {
   Map<GlobalTypeVar, TypeData> type_definitions;
   /*! \brief The source map for the module. */
   parser::SourceMap source_map;
+  /*! \brief The names of external functions for func registry */
+  Array<String> ext_func_names;

Review comment:
       Hi @zhiics , no worries and hope you had a good holiday :) 
   
   I actually went down on a path to create a CSourceMetadata module that could 
encapsulate c-source modules and which in-turn could get encapsulated again by 
the current metadata module if some of the external function require constant 
offloading -- I think that could be decided based on the fact whether the 
external module implements "get_const_vars" and that has non-zero constant 
size. I think if dont have constants that the external module requires to 
offload metadata module, we dont need to create the current metadata module.
   
   Summarizing, Im thinking of having two layers of metadata modules:
   
   dsoModule1      dsoModule2
   |                              |
   |                              |
    ----         |          -----
                  |
    C-Source metadata module                      non-dso module (e.g., acl)
                  |                                                    (that 
needs constant offloading)
                  |                                                             
             |
                    ------------------------| 
------------------------------------
                                                 |
                                       Metadata module
   
   Thus, the first layer can hold the func registry (currently its implemented 
in both codegen_c_host and codegen_llvm). I think it could be just live in the 
C-source metadata module that can get compiled along with other DSOExportable 
modules. **I will put and RFC with a different PR to implement this change**. 
This way we also get to use the init process to do certain initialization for 
the BYOC external device.




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