[Bug] TorchDist.allgather splits Tensor vs non-Tensor into incompatible collectives and crashes on variable-shape tensors across ranks
Los mantenedores suelen responder en 1 día
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 38/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Estancado
- Área
- backend, distributed-systems
Línea de trabajo
Start at tensorrt_llm/_torch/distributed/communicator.py in TorchDist.allgather, and compare it with MPIDist.allgather. Run the issue’s two-rank Gloo reproduction for heterogeneous payload kinds and variable-shape tensors; the fix is done when both cases complete without a collective mismatch, hang, or Gloo abort.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Summary
In tensorrt_llm/_torch/distributed/communicator.py:1553-1566 (TorchDist.allgather, commit 350ca54f4533013b42ae49ab6517d19961115666), unlike its sibling MPIDist.allgather(obj) (which uniformly serializes arbitrary Python objects via pickle), TorchDist.allgather(obj) branches on local isinstance(obj, torch.Tensor):
if isinstance(obj, torch.Tensor):
output_list = [torch.empty_like(obj) for _ in range(self.world_size)]
dist.all_gather(output_list, obj)
return output_list
elif vote_pg is not None:
return self._cuda_allgather_object(obj, vote_pg)
else:
obj_list = [None] * self.world_size
dist.all_gather_object(obj_list, obj)
return obj_list
This causes two failures when used as a drop-in counterpart to MPIDist.allgather:
- Cross-rank deadlock / C++ abort on
TensorvsNone(or heterogeneous objects): If rank 0 passes atorch.Tensorand rank 1 passesNone, rank 0 entersdist.all_gatherwhile rank 1 entersdist.all_gather_object, aborting C++ Gloo withgloo::EnforceNotMet(op.nread == op.preamble.nbytes) or hanging indefinitely. - Abort on variable-shape
torch.Tensorpayloads across ranks:[torch.empty_like(obj) for _ in range(world_size)]assumes every rank holds the exact same tensor shape and dtype. When tensor lengths differ across ranks (whichMPIDist.allgathersupports seamlessly), C++ Gloo aborts withop.nread == op.preamble.nbytes.
Affected Location
- Repository:
NVIDIA/TensorRT-LLM(350ca54f4533013b42ae49ab6517d19961115666, present atHEAD) - File & lines:
tensorrt_llm/_torch/distributed/communicator.py:1553-1566(TorchDist.allgather)
Minimal Standalone Reproduction
import datetime, torch, torch.distributed as dist
# Two ranks initialized with dist.init_process_group("gloo", ...):
# Case 1 (heterogeneous payload): rank 0 calls td.allgather(torch.tensor([1, 2])), rank 1 calls td.allgather(None)
# Case 2 (variable shape): rank 0 calls td.allgather(torch.arange(2)), rank 1 calls td.allgather(torch.arange(5))
Observed output under 2-rank Gloo spawn:
libc++abi: terminating due to uncaught exception of type gloo::EnforceNotMet: [enforce fail at .../gloo/transport/uv/pair.cc:253] op.nread == op.preamble.nbytes.
Suggested Fix
Either keep TorchDist.allgather(obj) consistent with MPIDist.allgather(obj) via all_gather_object (with a dedicated typed method or explicit uniform-tensor precondition when tensor-only fast-path all_gather is requested), or agree on shape/kind across ranks before choosing dist.all_gather vs dist.all_gather_object.
- Lenguaje dominante
- Python
- Estrellas
- 15.2k
- Forks
- 3k
- Merge medio
- 2 d 21 h
- PR fusionados (30 d)
- 477
Preparar el entorno
Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de NVIDIA/TensorRT-LLM
-
Bug: AttributeError: 'GptOssConfig' object has no attribute 'rope_scaling_factor' with transformers >= 5.xPosiblemente ocupada @NimaVaziri la tomó hoy. AbiertoPytorch
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
NVIDIA/TensorRT-LLM#23406 ·
Los mantenedores suelen responder en 1 día
-
Inference runtime Windows
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
NVIDIA/TensorRT-LLM#23394 ·
Los mantenedores suelen responder en 1 día
-
[Bug]: MMLU subsampling changes when evaluators are interleavedPosiblemente ocupada @LeNeLeNeWo la tomó hace 1 día. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
NVIDIA/TensorRT-LLM#23273 ·
Los mantenedores suelen responder en 1 día
-
Trace-replay Pareto window includes the drain when sessions finish out of admission orderPosiblemente ocupada @sbeierle la tomó hace 3 días. AbiertoTesting
Dificultad 2/5 1-3 horas Aptitud para principiantes 86/100
NVIDIA/TensorRT-LLM#23077 ·
Los mantenedores suelen responder en 1 día
-
LongBench V2 blog command breaks on inline comments after continuationsPosiblemente ocupada @ddlw la tomó hace 25 días. AbiertoDoc
Dificultad 1/5 Menos de una hora Aptitud para principiantes 91/100
NVIDIA/TensorRT-LLM#21879 ·
Los mantenedores suelen responder en 1 día
Todos los issues de NVIDIA/TensorRT-LLM
Issues similares
-
[Resource]: SpaicelyAbiertoresource-submission validation-passed
Dificultad 1/5 Menos de una hora Aptitud para principiantes 68/100
hesreallyhim/awesome-claude-code#3875 · 1 comentario ·
-
[Bug]: Ajax Pro login issueAbiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 77/100
bvis/aegis-hass#725 ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 67/100
datasektionen/cashflow#468 ·
-
dont call alembic upgrade until we check whether or not the cache DB has an alembic version stampAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Los mantenedores suelen responder en 1 día
-
#1643 unrecoverable split: 1 digest with a 403 — two earlier captures of the same URL are real 200sAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
Robin-IA/Congressional-Letters-Dev#1684 ·
Los mantenedores suelen responder en 1 día