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 2022/02/04 17:54:44 UTC

[GitHub] [tvm] sfvaroglu opened a new pull request #10170: [FQ2I] Add topk/dyn.topk to FQ2I

sfvaroglu opened a new pull request #10170:
URL: https://github.com/apache/tvm/pull/10170


   This PR adds limited topk/dyn.topk support to FQ2I. Only values are supported as output. Indices tbd.


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



[GitHub] [tvm] mbrookhart merged pull request #10170: [FQ2I] Add topk to FQ2I

Posted by GitBox <gi...@apache.org>.
mbrookhart merged pull request #10170:
URL: https://github.com/apache/tvm/pull/10170


   


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



[GitHub] [tvm] AndrewZhaoLuo commented on a change in pull request #10170: [FQ2I] Add topk to FQ2I

Posted by GitBox <gi...@apache.org>.
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)
 
 
+@pytest.mark.parametrize("k", [0, 1, 5])
+@pytest.mark.parametrize("axis", [0, -1, 1])
+@pytest.mark.parametrize("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: commits-unsubscribe@tvm.apache.org

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



[GitHub] [tvm] sfvaroglu commented on pull request #10170: [FQ2I] Add topk/dyn.topk to FQ2I

Posted by GitBox <gi...@apache.org>.
sfvaroglu commented on pull request #10170:
URL: https://github.com/apache/tvm/pull/10170#issuecomment-1030218912


   @mbrookhart  @AndrewZhaoLuo Please review.


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