Question about GPT topk sampling
It seem GPT topk sampling decoding strategy only support k = 1, 2, 4. I dont understand the design here. And is there anyway to use other value for GPT topk sampling decoding like k=50?
I think FT supports k = 50. Have you tried it?
I tried k=3 and got an error. I tracked the error here.

I used FT 3.1 by the way.
Please refer the latest code here https://github.com/NVIDIA/FasterTransformer/blob/main/fastertransformer/cuda/topk_kernels.cu#L762, which support at most 64. The constraint is caused by the template. You can also add the k value you need directly.
Thanks! Directly adding CASE_K(50); solved my problem. But I'm still a little confused about the design here because I see you have another topk kernel called topK_kernelLauncher which accepts general K values.
It uses TopK_2<T> instead of TopK<T, MAX_K> so it has no constraint. So why set constraint for topK_sampling_kernel_kernelLauncher and not for topK_kernelLauncher.
General case would be slower.
Close this bug because it is inactivated. Feel free to re-open this issue if you still have any problem.