AndrewZhaoLuo commented on a change in pull request #10170:
URL: https://github.com/apache/tvm/pull/10170#discussion_r801057640



##########
File path: src/runtime/contrib/sort/sort.cc
##########
@@ -446,6 +446,20 @@ 
TVM_REGISTER_GLOBAL("tvm.contrib.sort.topk").set_body([](TVMArgs args, TVMRetVal
     } else {
       LOG(FATAL) << "Unsupported output dtype: " << out_dtype;
     }
+  } else if (data_dtype == "int8") {

Review comment:
       what about uint8 dtypes?

##########
File path: tests/python/relay/test_pass_fake_quantization_to_integer.py
##########
@@ -434,6 +434,21 @@ def test_fake_quantize_concat():
     compare_fq_to_int(out, inputs_np)
 
 
[email protected]("k", [0, 1, 5])
[email protected]("axis", [0, -1, 1])
[email protected]("is_ascend", [True, False])
+def test_fake_quantize_topk(k, axis, is_ascend):
+    x = relay.var("x", shape=[20, 100], dtype="int8")
+    zero = relay.const(0)
+
+    x = relay.qnn.op.dequantize(x, relay.const(2.0), zero)
+    op = relay.topk(x, k, axis, "values", is_ascend, "float32")
+    op = relay.qnn.op.quantize(op, relay.const(2.0), zero, out_dtype="int8")

Review comment:
       probably also want uint8




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