You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by GitBox <gi...@apache.org> on 2021/10/08 16:07:11 UTC

[GitHub] [tvm] mbs-octoml commented on a change in pull request #9190: Initial Implementation of TIRToRuntime Target hook

mbs-octoml commented on a change in pull request #9190:
URL: https://github.com/apache/tvm/pull/9190#discussion_r725135145



##########
File path: src/relay/backend/contrib/example_target_hooks/target.cc
##########
@@ -0,0 +1,39 @@
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+#include <tvm/relay/transform.h>
+#include <tvm/target/target.h>
+
+namespace tvm {
+
+namespace relay {
+namespace contrib {
+namespace example_target_hooks {
+tvm::transform::Pass RelayToTIR();
+runtime::Module TIRToRuntime(IRModule mod, Target target);
+}  // namespace example_target_hooks
+}  // namespace contrib
+}  // namespace relay
+
+TVM_REGISTER_TARGET_KIND("example_target_hook", kDLCPU)

Review comment:
       nit: example_target_kind
   And maybe a comment -- 'here we register blah blah'.

##########
File path: src/driver/driver_api.cc
##########
@@ -401,12 +401,21 @@ std::pair<IRModule, IRModule> SplitDevHostFuncs(IRModule mod_mixed, const Target
   auto opt_mixed = transform::Sequential(mixed_pass_list);
   mod_mixed = opt_mixed(std::move(mod_mixed));
 
+  // We make an assumption here that the overriden host target

Review comment:
       Heads up that @mikepapadim is working here in #9103

##########
File path: src/driver/driver_api.cc
##########
@@ -401,12 +401,21 @@ std::pair<IRModule, IRModule> SplitDevHostFuncs(IRModule mod_mixed, const Target
   auto opt_mixed = transform::Sequential(mixed_pass_list);
   mod_mixed = opt_mixed(std::move(mod_mixed));
 
+  // We make an assumption here that the overriden host target
+  // can be used alongside the default host codegen based on device type
+  // this is so the correct code generator is used later instead of overriding the target.
+  // We need better support for inserting multiple kDLCPU targets as our current options
+  // are kDeviceKernelLaunch or not

Review comment:
       sigh. we'll get there.




-- 
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: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org