[Bug] TorchBackend.all_gather_base references nonexistent self.has_allgather_base and all_gather_coalesced only waits reqs[-1] / crashes on Gloo & non-member ranks

オープン
#9,193 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 2 日以内に返信

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
68/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
python, pytorch

調査の方向性

Start with deepspeed/comm/torch.py, focusing on TorchBackend.all_gather_base() and TorchBackend.all_gather_coalesced(). Run the provided three-rank Gloo reproduction to confirm the missing-attribute and non-member-rank failures. Done means all_gather_base() uses a valid capability check, and all_gather_coalesced() safely handles unsupported groups or backends and waits for every relevant request.

索引モデルが issue の本文から書いたものです。

説明

Summary

In deepspeed/comm/torch.py:468,481-503:

  1. TorchBackend.all_gather_base() (line 468): Checks if self.has_allgather_base:, an attribute never initialized in TorchBackend.__init__, unconditionally raising AttributeError.
  2. TorchBackend.all_gather_coalesced() (lines 490-502):
    • Calls get_coalescing_manager unconditionally even when group does not include the current rank (NON_GROUP_MEMBER -> AttributeError: 'int' object has no attribute '_get_backend') or on Gloo (_coalescing_manager unsupported).
    • Waits/returns only reqs[-1] instead of waiting on all handles in reqs (or the coalescing manager work handle).
Affected Location
  • Repository: deepspeedai/DeepSpeed (master, deepspeed/comm/torch.py:468,481-503)
Minimal Standalone Reproduction

3-rank Gloo group with subgroup pg01 = dist.new_group([0, 1]):

  • all_gather_base raises AttributeError: ... has no attribute 'has_allgather_base' on all ranks.
  • all_gather_coalesced(..., group=pg01) raises AttributeError on non-member rank 2 ('int' object has no attribute '_get_backend').
Suggested Fix
  1. Replace self.has_allgather_base with self.has_all_gather_into_tensor() (or check hasattr(torch.distributed.distributed_c10d, "_all_gather_base")).
  2. Guard all_gather_coalesced for NON_GROUP_MEMBER and backend support, and wait on all handles in reqs when async_op=False.
主要言語
Python
スター
43.3k
フォーク
5.1k
平均マージ
5日 10時間
マージ済み PR(30日)
85

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

deepspeedai/DeepSpeed のほかの issue

deepspeedai/DeepSpeed の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。