lightseq icon indicating copy to clipboard operation
lightseq copied to clipboard

Question about beam search.

Open smallv0221 opened this issue 5 years ago • 1 comments

Here is the code in step 3 of select_beam_rough_topk(). image The idx equals to left_idx. Which equals to block_start + threadIdx.x. Then it can not cover all the index in vocab_size. And the variable iter in this loop is not used in loop body. How could this loop select all the candidates token with logits bigger than s_topk.

smallv0221 avatar Aug 31 '21 03:08 smallv0221

idx will change at each loop's end。 https://github.com/bytedance/lightseq/blob/a5844a287f08f3190438b2bfbab15bf5c0eb525d/lightseq/inference/kernels/transformerKernels.cc.cu#L160

Taka152 avatar Aug 31 '21 06:08 Taka152