Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions tensorrt_llm/commands/serve.py
Original file line number Diff line number Diff line change
Expand Up @@ -605,6 +605,16 @@ def launch_visual_gen_server(
visual_gen_args: Optional validated VisualGenArgs for model configuration.
metadata_server_cfg: Optional metadata server configuration.
"""
# Only global rank 0 serves HTTP; in external multi-rank launch ranks > 0
# must become workers before binding, else every rank on a multi-GPU node
# races the same port and all but one die EADDRINUSE. VisualGen() on a
# worker rank never returns (sys.exit in __init__).
from tensorrt_llm._torch.visual_gen.executor import _detect_external_launch
ext = _detect_external_launch()
if ext is not None and ext[0] != 0:
VisualGen(model=model, args=visual_gen_args)
return

# Reserve the listening (host, port) by binding the socket *before*
# constructing the VisualGen pipeline, then hand the bound socket to
# uvicorn. VisualGen initialization can take many minutes; if we deferred
Expand Down
Loading