[LLM INFER] top_p_sampling_reject support top_p=0 and custom seed #9202
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
PR types
Bug fixes
PR changes
Others
Description
1.支持传入seed,支持不同batch的top_p val不同。
2.该top_p_sampling_reject算子在TopP的值为0的时候,无出现无法采样成功的问题,返回值不正确。解决办法,在kernel内部进行修改,TopP为0时,采用TopK,同时进行了一版优化,将一些同步与等待消除掉。
3.fix一些之前未测试出来的小bug。