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

Split communication logic from computation logic into orchestrator #3118

Closed
wants to merge 138 commits into from

Conversation

fzyzcjy
Copy link
Collaborator

@fzyzcjy fzyzcjy commented Jan 25, 2025

Motivation

Currently, the managers do both communication (e.g. "send to another process using mq") and computation (e.g. "do the detokenization"). This PR separates them.

Moreover, by doing this refactor, adding SPMD logic would be a bit easier and cleaner.

Modifications

Checklist

# Conflicts:
#	python/sglang/srt/entrypoints/engine.py
#	python/sglang/srt/entrypoints/http_server.py
#	python/sglang/srt/managers/scheduler.py
@yangw1234
Copy link

LGTM except on minor comment.

Copy link
Collaborator

@shanyu-sys shanyu-sys left a comment

Choose a reason for hiding this comment

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

Others LGTM

Comment on lines -1496 to +1366
self.send_to_detokenizer.send_pyobj(
self.on_generation_output(
Copy link
Collaborator

@shanyu-sys shanyu-sys Feb 24, 2025

Choose a reason for hiding this comment

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

Shall we check self.on_generation_output before using it? e.g. Add an error message if self.on_generation_output is None.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It seems Scheduler class is an internal implementation detail and not user-facing API, so I personally feel both adding and not adding is OK.

@fzyzcjy
Copy link
Collaborator Author

fzyzcjy commented Feb 26, 2025

After discussing with Lianmin, now I know there is no need to follow implementation requirements in e.g. 2736. Thus I spent several hours writing a new PR #3852, and this one is deprecated.

@fzyzcjy fzyzcjy closed this Feb 26, 2025
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.

5 participants