MCPcopy
hub / github.com/NVIDIA/TensorRT-LLM / mpi_rank

Function mpi_rank

tensorrt_llm/_utils.py:540–547  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

538
539
540def mpi_rank():
541 if mpi_disabled():
542 try:
543 return torch.distributed.get_rank()
544 except ValueError:
545 # Fallback: return 0 when MPI is absent (Ray / Slurm PMIx)
546 return 0
547 return mpi_comm().Get_rank() if ENABLE_MULTI_DEVICE else 0
548
549
550def global_mpi_rank():

Calls 2

mpi_disabledFunction · 0.85
mpi_commFunction · 0.70