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

Add EngineFragment #3120

Open
wants to merge 178 commits into
base: main
Choose a base branch
from
Open

Conversation

fzyzcjy
Copy link
Collaborator

@fzyzcjy fzyzcjy commented Jan 25, 2025

Motivation

With refactor PRs before this one, adding SPMD logic is quite short:

  • Add a EngineFragment class (for SPMD). Both EngineFragment and Engine extends EngineBase to ensure consistent API.
  • Add SpmdOrchestrator, which is very short glue to call tokenizer, scheduler, detokenizer etc.

Modifications

Checklist

traceback.print_exc()
raise

fragment.shutdown()
Copy link
Contributor

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.

Copy link
Collaborator Author

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.

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.

4 participants