#19607·TensorRT-LLM

[Bug]: 1.3.0rc27/rc28 containers: singleton MPI_Comm_spawn fails with MPI_ERR_UNKNOWN on hosts with long names (Open MPI 5 truncates the singleton name)

Author: dmitry-tokarev-nvCreated Sep 23, 2026Updated Sep 23, 2026
LabelsInfra

System Info

  • Containers: nvcr.io/nvidia/tensorrt-llm/release:1.3.0rc27 (amd64 and arm64) and 1.3.0rc28 (amd64 checked).
  • Both ship HPC-X v2.50 (/opt/hpcx/VERSION). /opt/hpcx/ompi points to Open MPI v5.0.10rc2. rc26 defaulted to Open MPI 4.1.9a1.
  • mpi4py 3.1.5.
  • No GPU is needed. The failure reproduces on a CPU-only host.

Who can help?

The upstream fix, open-mpi/ompi#14398, is by @tongyuantongyu.

Information

  • The official example scripts
  • My own modified scripts

Tasks

  • An officially supported task in the examples folder (such as GLUE/SQuAD, ...)
  • My own task or dataset (give details below)

Reproduction

A singleton MPI.COMM_SELF.Spawn fails when the hostname is long. TensorRT-LLM's MpiPoolSession starts its workers this way, through mpi4py.futures.MPIPoolExecutor. The container's own Python and mpi4py are enough to show it:

bash
IMG=nvcr.io/nvidia/tensorrt-llm/release:1.3.0rc27
SPAWN='
import sys
from mpi4py import MPI
child = "from mpi4py import MPI; p = MPI.Comm.Get_parent(); p.send(7, dest=0); p.Disconnect()"
comm = MPI.COMM_SELF.Spawn(sys.executable, args=["-c", child], maxprocs=1)
print("spawned child sent", comm.recv(source=0))
comm.Disconnect()
'
for n in 30 46; do
  echo "hostname length $n:"
  docker run --rm --user 1000:1000 -e HOME=/tmp \
    --hostname "$(printf 'h%.0s' $(seq 1 $n))" \
    --entrypoint python3 "$IMG" -c "$SPAWN" 2>&1 | tail -1
done

Output, the same on amd64 and arm64:

hostname length 30:
spawned child sent 7
hostname length 46:
mpi4py.MPI.Exception: MPI_ERR_UNKNOWN: unknown error

The command runs as a non-root user, because Open MPI 5 refuses to start its runtime as root, which is a different error.

Expected behavior

MPI.COMM_SELF.Spawn from a singleton works regardless of the hostname length, as it did with Open MPI 4 in rc26.

actual behavior

The spawn fails with MPI_ERR_UNKNOWN when the hostname length plus the number of digits in the process ID exceeds 37. Measured with a 2-digit process ID: a 35-character hostname spawns, and a 36-character one fails. With a 5-digit process ID, 32 spawns and 33 fails. An MPIPoolExecutor pool fails the same way.

In Kubernetes, the hostname is the pod name, which can have up to 63 characters. So on many pods, TensorRT-LLM cannot start its workers from a single process. Dynamo's CI runs in pods with 46- and 50-character names, and its arm64 job failed this way.

additional notes

Root cause, in Open MPI itself:

  1. For a singleton, MPI_Comm_spawn starts a prte daemon in start_dvm() (ompi/dpm/dpm.c), and passes the singleton's name as --singleton OMPI_PRINT_ID(OMPI_PROC_MYID).
  2. ompi_pmix_print_id() formats "%s.%u" into a buffer of OPAL_PRINT_NAME_ARGS_MAX_SIZE, which is 50 bytes in v5.0.10.
  3. The singleton's namespace is singleton.<hostname>.<pid>, so a long name is truncated. prte then registers a different namespace and rank, and rejects the singleton when it connects.

Status upstream:

  • Fixed by open-mpi/ompi#14398 (main), open-mpi/ompi#14402 (v6.0.x) and open-mpi/ompi#14409 (v5.0.x). The fix raises the buffer to PMIX_MAX_NSLEN + 12.
  • No release carries it yet. v5.0.11 was tagged before the fix and still has the 50-byte buffer.
  • Mellanox/ompi's v5.0.x_hpcx branch includes the fix since Mellanox/ompi#61 (merged 2026-09-19).
  • 1.3.0rc28 still ships HPC-X v2.50 with Open MPI v5.0.10rc2, and a 36-character hostname fails there as well.

Request: ship an HPC-X build that includes the fix, or backport the upstream commit while building the container, the way #18907 backports an Open MPI commit for ARM64.

Workarounds until then:

  • Set PMIX_HOSTNAME to a short value in a process that no MPI launcher started. PMIx uses it instead of the real hostname, and the spawn then works. Processes that mpirun or prte start get PMIX_HOSTNAME from the launcher, so they keep the real name. Dynamo does this with a startup hook in ai-dynamo/dynamo#15060 (container/deps/trtllm/_dynamo_pmix_hostname.py).
  • Start the process under mpirun -n 1, which avoids the singleton path.
  • On amd64, Open MPI 4.1.9a1 is still in the container at /opt/hpcx/ompi4, and it spawns with a 50-character hostname. On arm64 this is not an option, because the container's libtorch_cpu.so needs ompi_mpi_short_float, which only Open MPI 5 defines.

Internal tracking: NVBug 6722913.

Before submitting a new issue...

  • Make sure you already searched for relevant issues, and checked the documentation and examples for answers to frequently asked questions.