[None][fix] trtllm-serve VisualGen: bind HTTP port only on rank 0 in multi-rank launch - #16049
Conversation
…multi-rank launch In external multi-rank launch (torchrun/srun), launch_visual_gen_server binds the HTTP socket before constructing VisualGen, but rank>0 processes only exit into worker mode inside VisualGen.__init__. On a multi-GPU node every local rank races to bind the same host:port and all but one die with EADDRINUSE, so no server comes up. This is a regression from NVIDIA#14355 (nvbugs/6143883), which moved the bind ahead of pipeline construction to reserve the port during the minutes-long init. Detect external launch first and let rank>0 construct VisualGen (which runs the worker loop and never returns) without touching the port; rank 0 and single-node keep the early-bind behavior. Signed-off-by: Yiyun Lu <55233584+luyiyun1021@users.noreply.github.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe ChangesVisualGen Rank Gating
Estimated code review effort: 2 (Simple) | ~10 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
/bot run --disable-fail-fast |
|
PR_Github #58622 [ run ] triggered by Bot. Commit: |
|
PR_Github #58622 [ run ] completed with state
|
|
/bot run --disable-fail-fast |
|
PR_Github #58680 [ run ] triggered by Bot. Commit: |
|
PR_Github #58680 [ run ] completed with state |
Summary by CodeRabbit
Description
In external multi-rank launch (
torchrun/srun),launch_visual_gen_serverbinds the HTTP socket before constructingVisualGen, but rank>0 processes only exit into worker mode insideVisualGen.__init__. On a multi-GPU node every local rank therefore races to bind the samehost:portand all but one die withEADDRINUSE, so no server ever becomes ready. This is a regression from #14355 (nvbugs/6143883), which moved the bind ahead of the minutes-long pipeline init to reserve the port; that is correct for a single server rank but makes every rank bind under multi-rank-per-node launch.Fix: before the early bind, detect external launch and let rank>0 construct
VisualGen(which dispatches to the worker loop and never returns) and return without touching the port. Rank 0 and single-node (mp.Process) keep the early-bind behavior unchanged.Test Coverage
Verified on a 16-GPU (4 nodes × 4) LTX-2 distributed serve on GB200 (NVFP4, cfg2 × ulysses8, VAE-parallel 8): before the fix all 16 ranks fail with
[Errno 98] Address already in use; after the fix rank 0 binds, ranks 1-15 become workers, and the server reachesApplication startup completeand serves generations.PR Checklist
PR description clearly explains what and why.
PR Follows TRT-LLM CODING GUIDELINES.
Test cases are provided for new code paths.
Any new dependencies have been scanned for license and vulnerabilities.
CODEOWNERS updated if ownership changes.
Documentation updated as needed.
Update tava architecture diagram if significant design change.
Please check this after reviewing the above items as appropriate for this PR.
GitHub Bot Help
To see a list of available CI bot commands, please comment
/bot help.