未验证 提交 8f4ac6b5 编写于 作者: J jiangcheng 提交者: GitHub

optimize topk op through limit SortTopK kernel entrance, test=develop (#30403)

上级 bfb8a642
...@@ -150,7 +150,8 @@ class TopkV2OpCUDAKernel : public framework::OpKernel<T> { ...@@ -150,7 +150,8 @@ class TopkV2OpCUDAKernel : public framework::OpKernel<T> {
if (k > input_width) k = input_width; if (k > input_width) k = input_width;
if ((input_width <= 1024 || k >= 128 || k == input_width)) { if (((input_width <= 1024 && input_height <= 2048) || k >= 128 ||
k == input_width)) {
if (SortTopk<T>(dev_ctx, &trans_input, input_width, input_height, k, if (SortTopk<T>(dev_ctx, &trans_input, input_width, input_height, k,
&trans_out, &trans_ind, largest)) { &trans_out, &trans_ind, largest)) {
// last step, tranpose back the indices and output // last step, tranpose back the indices and output
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册