From 6d1292ef111c88b8d691457199b7900d857b2622 Mon Sep 17 00:00:00 2001 From: zhangkaihuo Date: Thu, 25 May 2023 15:24:46 +0800 Subject: [PATCH] Using a sorting method may achieve better performance. (#54045) --- paddle/phi/kernels/gpu/top_k_kernel.cu | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/paddle/phi/kernels/gpu/top_k_kernel.cu b/paddle/phi/kernels/gpu/top_k_kernel.cu index a791812432a..bef328ec21a 100644 --- a/paddle/phi/kernels/gpu/top_k_kernel.cu +++ b/paddle/phi/kernels/gpu/top_k_kernel.cu @@ -102,7 +102,7 @@ void TopkKernel(const Context& dev_ctx, // The conclusion is drawn from the data through multiple sets of // statistics - if (input_width >= 128 && k >= input_width * 0.75) { + if (input_width >= 128 && k >= input_width * 0.25) { auto* ctx = reinterpret_cast(&dev_ctx); if (phi::funcs::SortTopk(*ctx, input, -- GitLab