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

[WIP] Add sampler logit processor #2396

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

hongpeng-guo
Copy link

Motivation

This PR tries to support custom logit processors registered by users, so users can easily implement their custom sampling methods without the need to change the sglang code.

Related Issue

#2291

Modifications

Checklist

  • Format your code according to the Contributor Guide.
  • Add unit tests as outlined in the Contributor Guide.
  • Update documentation as needed, including docstrings or example tutorials.

Signed-off-by: Hongpeng Guo <hpguo@anyscale.com>
Signed-off-by: Hongpeng Guo <hpguo@anyscale.com>
@hongpeng-guo hongpeng-guo marked this pull request as draft December 8, 2024 09:39
@hongpeng-guo hongpeng-guo changed the title Add sampler logit processor [WIP] Add sampler logit processor Dec 8, 2024
@merrymercy
Copy link
Contributor

Thanks for taking this. Can you add some end-to-end tests and examples?

@hongpeng-guo
Copy link
Author

Thanks for taking this. Can you add some end-to-end tests and examples?

@merrymercy Thanks for taking a look on this. I am still trying to understand the appropriate layer for the user to register their customized_logit_processor. The goal is to enable customized_logit_processor functionality without requiring changes to the internal sglang codebase. To achieve this, the function registration should occur at the API layer. The customized_logit_processor_fn and custom_params will then be passed from the program driver to the internal modules, such as Sampler and SampleParams.

If the above seems correct, I will try to get it reviewable within this week.

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

Successfully merging this pull request may close these issues.

2 participants