Provide an offline engine API#1567
Merged
merrymercy merged 18 commits intosgl-project:mainfrom Oct 7, 2024
Merged
Conversation
57f9cd8 to
94346ea
Compare
Collaborator
|
I think |
Collaborator
Author
|
@zhyncs oh i mean |
Collaborator
Author
|
@zhyncs i can do the async gen in the next PR |
Ying1123
reviewed
Oct 5, 2024
Ying1123
reviewed
Oct 5, 2024
1bfd171 to
c080de1
Compare
merrymercy
reviewed
Oct 6, 2024
merrymercy
requested changes
Oct 6, 2024
Ying1123
reviewed
Oct 6, 2024
37 tasks
Ying1123
reviewed
Oct 6, 2024
3d92605 to
34a6c2e
Compare
merrymercy
reviewed
Oct 6, 2024
005e5e0 to
b18b447
Compare
merrymercy
reviewed
Oct 6, 2024
merrymercy
approved these changes
Oct 6, 2024
66d5402 to
22c7e3e
Compare
Collaborator
Author
|
Please don't merge now. Consistency test is failing on H100 in CI, but passing on my A100 |
1a49352 to
61f17a2
Compare
merrymercy
reviewed
Oct 7, 2024
merrymercy
reviewed
Oct 7, 2024
merrymercy
reviewed
Oct 7, 2024
merrymercy
approved these changes
Oct 7, 2024
|
hey guys i'm getting the AttributeError: module 'sglang' has no attribute 'Engine' on sgl '0.3.2' still not in prod ? |
Collaborator
Author
|
@imadoualid the changes should be in the main HEAD if you can build from source. |
22 tasks
timethink
pushed a commit
to timethink/sglang
that referenced
this pull request
Mar 9, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Motivation
This PR is to support "Add APIs for using the inference engine in a single script without launching a separate server" in #1487. This is a simplified version of #1127 @JianyuZhan where I reuse most of the existing code.
Modifications
Context
The current SRT server consists of an HTTP server and the SRT engine.
HTTP server and Tokenizer Manager are both running in the main process, but there is no way to decouple them and only instantiate Tokenizer Manager.
Decouple SRT engine and HTTP server
This PR introduces SRT engine by decoupling
launch_servertolaunch_serverandlaunch_engine.launch_server:launch_engine+ HTTP server creation, used by SRT Runtime and standalone server.launch_engine: SRT Engine creation, used by SRT engine.New public API:
EngineUplift Engine to the top level, so users can easily call with
sgl.EngineEngine Usage Example
Same settings as vllm but use SRT Engine.
Discussion
One caveat is that we construct
ServerArgs, but the HTTP server related args will not be used. I think this is ok because ServerArgs is the superset of Engine Args, so it can cover everything.Testing
Add
test_srt_engine.py, which runs batch inference and assert the answer.TODO
Checklist