krishnaraj36 commented on code in PR #13450:
URL: https://github.com/apache/tvm/pull/13450#discussion_r1064827225


##########
src/relay/collage/gather_partition_specs.cc:
##########
@@ -103,6 +101,38 @@ BYOCStyle BYOCFusionStyleForCompiler(const String& 
compiler) {
   }
 }
 
+/*!
+ * \brief Returns the fusion style for /p compiler.
+ */
+BYOCStyle BYOCFusionStyleForCompiler(const String& compiler) {
+  tvm::transform::PassContext ctxt = tvm::transform::PassContext::Current();
+  std::string config_key = "relay.collage.byoc_fusion_style";
+  std::string compiler_id = compiler;
+  Optional<Array<String>> byoc_configs = ctxt->GetConfig(config_key, 
Optional<Array<String>>());
+  if (!byoc_configs.defined()) {
+    return DefaultBYOCFusionStyleForCompiler(compiler);
+  }
+  BYOCStyle byoc_fusion_style = kNoFusionBYOCStyle;
+  for (auto config_ : byoc_configs.value()) {
+    std::string byoc_str = static_cast<std::string>(config_);
+    std::string byoc_compiler = byoc_str.substr(0, byoc_str.find(".", 0));
+    if (byoc_compiler == compiler) {
+      std::string fusion_name = byoc_str.substr(byoc_str.find(".", 0) + 1, 
byoc_str.size());

Review Comment:
   Its good idea, I have defined generic string split function in utils.cc 
file, we can call direct for this purpose.



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