Skip to content

[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) #19607

Closed

Description

@dmitry-tokarev-nv

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:

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:

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 chore: OPS-8654 bump trtllm to v1.3.0rc27 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.

Activity

  1. added
    Infra
    on Sep 23, 2026
  2. chzblych commented on Sep 28, 2026

    @chzblych
    Collaborator

    @dmitry-tokarev-nv TRT-LLM also uses the PMIX_HOSTNAME workaround in our CI testing (https://github.com/NVIDIA/TensorRT-LLM/blob/main/jenkins/L0_Test.groovy#L5561).

    However, we decided not to set this env variable by default in our release container, as there were concerns about how it might be interpreted or consumed by other user applications.

    Instead, we documented the workaround as a known limitation in https://github.com/NVIDIA/TensorRT-LLM/blob/main/docs/source/installation/installation-guide.md#known-limitations.

    Since the root cause is an upstream OpenMPI issue rather than a TRT-LLM issue, I’m going to close this ticket.

    We don’t have a strong preference for a specific OpenMPI version. In general, TRT-LLM will use the OpenMPI version shipped with the base NGC PyTorch image, where v5 came in through the NGC PyTorch 26.08 base image update.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Infra

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions