fix(webrtc): reap checkpoint download workers#371
Open
gtong-nv wants to merge 1 commit into
Open
Conversation
Signed-off-by: Gangzheng Tong <gtong@nvidia.com>
Collaborator
Author
|
/ok to test 5c22865 |
Contributor
Greptile SummaryThis PR adds child-process cleanup to the WebRTC shutdown path. The main changes are:
Confidence Score: 4/5The shutdown cleanup needs one fix before merging.
flashdreams/flashdreams/serving/webrtc/bootstrap.py Important Files Changed
Reviews (1): Last reviewed commit: "fix(webrtc): reap checkpoint download wo..." | Re-trigger Greptile |
| ) | ||
| child.kill() | ||
| for child in survivors: | ||
| child.join() |
Contributor
There was a problem hiding this comment.
When a checkpoint download child survives terminate() and cannot be reaped after kill(), this unbounded join() can keep rank 0 inside cleanup forever. The later send_exit_signal() never runs, so worker ranks blocked in the distributed wait loop can remain alive after Ctrl+C.
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.
Summary
Ctrl+C.terminate()tokill().Problem
WebRTC startup preloads model checkpoints before the server begins accepting sessions. Sharded Hugging Face checkpoints are downloaded using multiprocessing workers. If the server is interrupted during this startup phase, the server rank can exit while those workers continue downloading as orphan processes re-parented to PID 1.
Implementation
The shared WebRTC bootstrap now performs child-process cleanup in its shutdown
finallypath for both the serving rank and distributed worker ranks. Cleanup:Rank 0 still sends the distributed exit signal even if child-process cleanup raises an error.
Testing
pytest flashdreams/tests/test_webrtc_serving.py flashdreams/tests/test_webrtc_manager.py flashdreams/tests/test_webrtc_bootstrap.py -q— 10 passedtycheck for the changed files — passedThe repository-wide pre-commit type hook still reports the existing unresolved optional
flip_evaluatorimport inflashdreams/flashdreams/quality/clip_compare.py; this is unrelated to this change.