Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support min_p sampling parameter #2420

Merged
merged 14 commits into from
Sep 9, 2024
Merged

support min_p sampling parameter #2420

merged 14 commits into from
Sep 9, 2024

Conversation

irexyc
Copy link
Collaborator

@irexyc irexyc commented Sep 4, 2024

support min_p sampling option

#1745

@lvhan028 lvhan028 added the enhancement New feature or request label Sep 4, 2024
@@ -23,27 +23,29 @@

namespace turbomind {

struct DynamicDecodeCommonArgs {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Like struct AttentionParam, struct ModelParam, let's use struct DecodeParam

template<typename T>
void invokeTopPSort(TopPSortParams& params, cudaStream_t stream);

struct TopPMinPFilterParams {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

struct TopPMinPFilterParams is a subset of struct TopPSortPrams except the float* min_ps.
Can we merge them together?

float thread_sum = s_sum;
topk_tmp_id_buf += batch_id * stride;
for (int i = tid; i < k; i += BLOCK_SIZE) {
sorted_logits[i] = s_val2[i] / thread_sum;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems that top-k doesn't use the 1e-6f eps like top-p does?

@lvhan028 lvhan028 merged commit 8e478d4 into InternLM:main Sep 9, 2024
9 checks passed
@josephrocca
Copy link

Very excited to test this - thank you! 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants