File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -713,6 +713,16 @@ def launch_visual_gen_server(
713713 visual_gen_args: Optional validated VisualGenArgs for model configuration.
714714 metadata_server_cfg: Optional metadata server configuration.
715715 """
716+ # Only global rank 0 serves HTTP; in external multi-rank launch ranks > 0
717+ # must become workers before binding, else every rank on a multi-GPU node
718+ # races the same port and all but one die EADDRINUSE. VisualGen() on a
719+ # worker rank never returns (sys.exit in __init__).
720+ from tensorrt_llm ._torch .visual_gen .executor import _detect_external_launch
721+ ext = _detect_external_launch ()
722+ if ext is not None and ext [0 ] != 0 :
723+ VisualGen (model = model , args = visual_gen_args )
724+ return
725+
716726 # Reserve the listening (host, port) by binding the socket *before*
717727 # constructing the VisualGen pipeline, then hand the bound socket to
718728 # uvicorn. VisualGen initialization can take many minutes; if we deferred
You can’t perform that action at this time.
0 commit comments