mbaret commented on a change in pull request #8423:
URL: https://github.com/apache/tvm/pull/8423#discussion_r679288384



##########
File path: src/relay/backend/aot_executor_codegen.cc
##########
@@ -468,7 +468,14 @@ class AOTExecutorCodegen : public ExprVisitor {
     Target target;
 
     // Handle external function
-    if (func->GetAttr<String>(attr::kCompiler).defined()) {
+    // TODO(@Mousius): Move this to relying only on Target attributes rather 
than kCompiler

Review comment:
       Let's track this with an issue.

##########
File path: src/relay/backend/aot_executor_codegen.cc
##########
@@ -468,7 +468,14 @@ class AOTExecutorCodegen : public ExprVisitor {
     Target target;
 
     // Handle external function
-    if (func->GetAttr<String>(attr::kCompiler).defined()) {
+    // TODO(@Mousius): Move this to relying only on Target attributes rather 
than kCompiler
+    auto external_compiler = func->GetAttr<String>(attr::kCompiler).defined();

Review comment:
       either bool or 'is_external_compiler'

##########
File path: tests/python/relay/test_external_codegen.py
##########
@@ -17,7 +17,9 @@
 """Unit tests for graph partitioning."""

Review comment:
       The changes in this file relate more to adding aot support rather than 
the hooks explicitly. You could consider breaking this out into a separate PR.

##########
File path: tests/python/relay/test_additional_target_hooks.py
##########
@@ -0,0 +1,92 @@
+# 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.
+"""Unit tests for graph partitioning."""

Review comment:
       Fix

##########
File path: tests/python/relay/test_additional_target_hooks.py
##########
@@ -0,0 +1,92 @@
+# 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.
+"""Unit tests for graph partitioning."""
+import sys
+import numpy as np
+import pytest
+
+import tvm
+import tvm.relay.testing
+import tvm.relay.transform
+
+from tvm import relay
+from test_external_codegen import (
+    set_external_func_attr,
+    check_vm_result,
+    check_aot_executor_result,
+    check_graph_executor_result,

Review comment:
       Move to utils if possible

##########
File path: src/target/target_kind.cc
##########
@@ -431,6 +431,9 @@ TVM_REGISTER_TARGET_KIND("hybrid", kDLCPU)  // line break
 
 TVM_REGISTER_TARGET_KIND("composite", 
kDLCPU).add_attr_option<Array<Target>>("devices");
 
+TVM_REGISTER_TARGET_KIND("test", kDLCPU)
+    .set_attr<String>("relay_to_tir", "target.test.tir_lowering");
+

Review comment:
       If anyone knows a temporary way to register this as part of the test, 
that'd be preferred.




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