[Bug] TorchDist.allgather splits Tensor vs non-Tensor into incompatible collectives and crashes on variable-shape tensors across ranks
Maintainer thường phản hồi trong vòng 1 ngày
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 38/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Đình trệ
- Lĩnh vực
- backend, distributed-systems
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- Python
- Star
- 15.2k
- Fork
- 3k
- Merge trung bình
- 2 ngày 21 giờ
- Pull request đã merge (30 ngày)
- 477
Chuẩn bị môi trường
Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của NVIDIA/TensorRT-LLM
-
Bug: AttributeError: 'GptOssConfig' object has no attribute 'rope_scaling_factor' with transformers >= 5.xCó thể đã có người làm @NimaVaziri đã nhận hôm nay. Đang mởPytorch
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
NVIDIA/TensorRT-LLM#23406 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Inference runtime Windows
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
NVIDIA/TensorRT-LLM#23394 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[Bug]: MMLU subsampling changes when evaluators are interleavedCó thể đã có người làm @LeNeLeNeWo đã nhận 1 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
NVIDIA/TensorRT-LLM#23273 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Trace-replay Pareto window includes the drain when sessions finish out of admission orderCó thể đã có người làm @sbeierle đã nhận 3 ngày trước. Đang mởTesting
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
NVIDIA/TensorRT-LLM#23077 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
LongBench V2 blog command breaks on inline comments after continuationsCó thể đã có người làm @ddlw đã nhận 25 ngày trước. Đang mởDoc
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 91/100
NVIDIA/TensorRT-LLM#21879 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của NVIDIA/TensorRT-LLM
Issue tương tự
-
bug(operator): VolterraOperator built inside jax.jit with a concrete decay raises TracerBoolConversionErrorCó thể đã có người làm @jejjohnson đã nhận hôm nay. Đang mởtype:bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
jejjohnson/integrix#144 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
finos/ai-governance-framework#459 ·
-
slurm: a case outcome nested too deep crashes status/collect instead of reading as no outcomeĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
autowarefoundation/autoware_carla_scenario#2963 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
freelawproject/litigant-portal#1307 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
type/bug
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 86/100
h2oai/h2o-llmstudio#1163 ·
Maintainer thường phản hồi trong vòng 1 ngày