-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Add EngineFragment #3120
base: main
Are you sure you want to change the base?
Add EngineFragment #3120
Conversation
…ager # Conflicts: # python/sglang/srt/openai_api/adapter.py
# Conflicts: # python/sglang/srt/managers/detokenizer_manager.py
# Conflicts: # python/sglang/srt/entrypoints/engine.py # python/sglang/srt/managers/generation_manager.py # python/sglang/srt/managers/tokenizer_manager.py
# Conflicts: # python/sglang/srt/entrypoints/engine.py # python/sglang/srt/entrypoints/http_server.py # python/sglang/srt/managers/scheduler.py
…into feat/separate_comm
traceback.print_exc() | ||
raise | ||
|
||
fragment.shutdown() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR modifies shutdown()
. Should we assert something to check shutdown()
is appropriately implemented? For example, we may check allocated cuda memory.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IIRC last month I added it because, otherwise without shutdown, the process would run forever, possibly because there is a while-true running if the shutdown is not triggered, then Verl training scripts can never end.
The shutdown in std mode kills the whole process tree, thus fully release memory. On the other hand, this SPMD one does not seem to release memory. However, it seems that the primary use case of SPMD, e.g. Verl training, does not care about this, because shutdown is only called (if any) at the end of whole training.
Motivation
With refactor PRs before this one, adding SPMD logic is quite short:
EngineFragment
class (for SPMD). Both EngineFragment and Engine extends EngineBase to ensure consistent API.Modifications
Checklist