rafzi commented on PR #11880:
URL: https://github.com/apache/tvm/pull/11880#issuecomment-1166356065

   @manupa-arm Thank you for your swift feedback.
   
   Do you mean something like this?
   
   ```
   
transform::PassContext::Current()->GetConfig<PackedFunc>("tir.usmp.algo.custom")
   ```
   
   Unfortunately that would not work with TVMC out-of-the-box, because it only 
maps these config types:
   
   
https://github.com/apache/tvm/blob/main/python/tvm/driver/tvmc/pass_config.py#L150
   
   However we could work around that as follows:
   
   ```
   Optional<String> opt_custom_algo = 
transform::PassContext::Current()->GetConfig<String>("tir.usmp.algo.custom");
   if (opt_custom_algo) {
     String algo_func_name = "tir.usmp.algo." + opt_custom_algo.value();
     const runtime::PackedFunc* pfAlgo = runtime::Registry::Get(algo_func_name);
     // ...
   } else {
     // existing map lookup
   }
   ```
   
   That way we only interact with packed functions when the user explicitly 
requested it.


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