masahi commented on a change in pull request #9637:
URL: https://github.com/apache/tvm/pull/9637#discussion_r791265798
##########
File path: include/tvm/relay/qnn/attrs.h
##########
@@ -54,6 +55,11 @@ struct RequantizeAttrs : public
tvm::AttrsNode<RequantizeAttrs> {
"value is rounded away from zero at midpoints (for example, -1.5"
"rounds to -2). More context can be found at following gblic manual"
"https://www.gnu.org/software/libc/manual/html_node/Rounding.html.");
+ TVM_ATTR_FIELD(compute_dtype)
+ .set_default("None")
+ .describe(
+ "Specifies the algorithm of requantize calculating. Supported "
Review comment:
`Specifies the data type used during requantize.`
##########
File path: python/tvm/relay/qnn/op/qnn.py
##########
@@ -70,7 +161,9 @@ def requantize(
rounding : string, optional
Defines the rounding direction when the value is midway between two
representable values.
-
+ compute_dtype:
+ Specifies the algorithm of requantize calculating.
Review comment:
Same comment as above
##########
File path: python/tvm/topi/x86/utils.py
##########
@@ -16,8 +16,87 @@
# under the License.
"""Common x86 related utilities"""
import tvm
+import tvm._ffi
+@tvm._ffi.register_func("tvm.topi.x86.utils.target_is_x86")
+def target_is_x86(target):
+ return (
+ target_has_sse41(target)
+ or target_has_sse42(target)
+ or target_has_avx(target)
+ or target_has_avx2(target)
+ or target_has_avx512(target)
+ or target_has_vnni(target)
+ or target
+ in {
+ "k6-2",
+ "x86-64",
+ "atom",
+ "pentium",
+ "nocona",
+ "k8",
+ "i686",
+ "winchip-c6",
+ "prescott",
+ "k6",
+ "athlon-mp",
+ "winchip2",
+ "yonah",
+ "athlon-tbird",
+ "alderlake",
+ "pentium4",
+ "athlon64-sse3",
+ "pentium2",
+ "bonnell",
+ "k8-sse3",
+ "barcelona",
+ "athlon",
+ "c3",
+ "generic",
+ "lakemont",
+ "pentium-mmx",
+ "core2",
+ "pentium3",
+ "btver1",
+ "athlon-fx",
+ "k6-3",
+ "geode",
+ "pentium-m",
+ "i586",
+ "pentium3m",
+ "pentiumpro",
+ "i486",
+ "opteron",
+ "athlon64",
+ "pentium4m",
+ "i386",
+ "opteron-sse3",
+ "amdfam10",
+ "athlon-4",
+ "athlon-xp",
+ "c3-2",
Review comment:
Do we need the level of details? I don't think people would ever specify
these targets... I think sse4.1 - vnni are enough.
##########
File path: python/tvm/topi/x86/utils.py
##########
@@ -16,8 +16,87 @@
# under the License.
"""Common x86 related utilities"""
import tvm
+import tvm._ffi
+@tvm._ffi.register_func("tvm.topi.x86.utils.target_is_x86")
+def target_is_x86(target):
+ return (
+ target_has_sse41(target)
+ or target_has_sse42(target)
+ or target_has_avx(target)
+ or target_has_avx2(target)
+ or target_has_avx512(target)
+ or target_has_vnni(target)
+ or target
+ in {
+ "k6-2",
+ "x86-64",
+ "atom",
+ "pentium",
+ "nocona",
+ "k8",
+ "i686",
+ "winchip-c6",
+ "prescott",
+ "k6",
+ "athlon-mp",
+ "winchip2",
+ "yonah",
+ "athlon-tbird",
+ "alderlake",
+ "pentium4",
+ "athlon64-sse3",
+ "pentium2",
+ "bonnell",
+ "k8-sse3",
+ "barcelona",
+ "athlon",
+ "c3",
+ "generic",
+ "lakemont",
+ "pentium-mmx",
+ "core2",
+ "pentium3",
+ "btver1",
+ "athlon-fx",
+ "k6-3",
+ "geode",
+ "pentium-m",
+ "i586",
+ "pentium3m",
+ "pentiumpro",
+ "i486",
+ "opteron",
+ "athlon64",
+ "pentium4m",
+ "i386",
+ "opteron-sse3",
+ "amdfam10",
+ "athlon-4",
+ "athlon-xp",
+ "c3-2",
Review comment:
Do we need this level of details? I prefer dropping them. I don't think
people would ever specify these targets...
I think sse4.1 - vnni are enough.
##########
File path: src/relay/qnn/op/req_config.cc
##########
@@ -0,0 +1,93 @@
+/*
+ * 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.
+ */
+
+/*!
+ * \file src/relay/qnn/op/req_config.cc
+ * \brief QNN requantize config.
+ */
+
+#include "./req_config.h"
Review comment:
Rename these files (`req_config.h` and `req_config.cc`)
--
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]