comaniac commented on a change in pull request #6222:
URL: https://github.com/apache/incubator-tvm/pull/6222#discussion_r466760151
##########
File path: cmake/config.cmake
##########
@@ -198,6 +198,16 @@ set(USE_DNNL_CODEGEN OFF)
set(USE_ARM_COMPUTE_LIB OFF)
set(USE_ARM_COMPUTE_LIB_GRAPH_RUNTIME OFF)
+# Whether to build with Arm Ethos-N support
+# Possible values:
+# - OFF: disable Arm Ethos-N support
+# - path/to/arm-ethos-N-stack: use a specific version of the
+# Ethos-N driver stack
+set(USE_ETHOSN OFF)
+# If USE_ETHOSN is enabled, use Ethos-N hardware (ON) or
+# software test infrastructure (OFF)
+set(USE_ETHOSN_HW ON)
Review comment:
* This should be OFF by default?
* In terms of naming, it seems to me that `USE_EHTOSN_CODEGEN` and
`USE_ETHOSN_RUNTIME` are better. Otherwise it's a bit confusing to find that
`USE_ETHOSN` actually just means the codegen.
##########
File path: python/tvm/relay/op/contrib/ethosn.py
##########
@@ -0,0 +1,64 @@
+# 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.
+# pylint: disable=invalid-name, unused-argument
+"""Arm(R) Ethos(TM) -N NPU supported operators."""
+import tvm.ir
+from ... import qnn as _qnn
+from . import _ethosn as support
+
+
[email protected]_op_attr("qnn.concatenate", "target.ethos-n")
+def qnn_concatenate(attrs, args):
+ """Check if a concatenate is supported by Ethos-N."""
+ conc = _qnn.op.concatenate(*args, **attrs)
+ if not support.concatenate(conc):
Review comment:
You might need a checker for functions from `support`. It's possible
that users forget to enable ETHOSN which will result in miss registration.
##########
File path: src/relay/backend/contrib/ethosn/capabilities.h
##########
@@ -0,0 +1,57 @@
+/*
+ * 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.
+ */
+
+#ifndef TVM_RELAY_BACKEND_CONTRIB_ETHOSN_CAPABILITIES_H_
+#define TVM_RELAY_BACKEND_CONTRIB_ETHOSN_CAPABILITIES_H_
+
+#include <vector>
+
+static std::vector<char> targets[3] = {
Review comment:
`targets` is too vague and common. What's this for? You should rename it
with a better name and put this vector in a proper namespace.
----------------------------------------------------------------
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]