SGLang multi-node: auto-negotiated dist_init port can collide with pre-allocated engine ports
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 72/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 静か
- 技術スタック
- python
調査の方向性
angelspec/inference/factory.py の _prepare_sgl_engines から始め、Step 2 と Step 2.5 を併せて読み、続いて SglEngine.init を追って port と dist_init_addr がどのように割り当てられるかを確認します。特にデフォルト値が 10000 から始まる場合に、multi-node SGLang パスで自動ネゴシエーションされた dist-init ポートが事前に割り当てられた engine ポートと重複しないことを確認します。
索引モデルが issue の本文から書いたものです。
説明
In _prepare_sgl_engines (angelspec/inference/factory.py), Step 2 picks a free port for dist_init_addr starting from the default start_port=10000:
https://github.com/Tencent/AngelSpec/blob/main/angelspec/inference/factory.py#L288-L295
ip, port = ray.get(
[head_engine.get_node_ip.remote(), head_engine.find_free_port.remote()],
timeout=120,
)
find_free_port only probes ports; it never reserves them. Step 2.5 then restarts its sequential allocation at the literal next_start = 10000 without accounting for the port just handed out:
https://github.com/Tencent/AngelSpec/blob/main/angelspec/inference/factory.py#L297-L309
next_start = 10000
for i in range(num_engines):
port = ray.get(engines[i].find_free_port.remote(start_port=next_start, consecutive=2), ...)
pre_allocated_ports[i] = port
next_start = port + 2
On a fresh node, Step 2 returns 10000 and Step 2.5 immediately hands engine 0 (which is the replica-0 head on the same node) ports 10000/10001. SglEngine.init then sets port=10000, nccl_port=10001, and dist_init_addr="<same-ip>:10000" — the head node is told to bind its server port and its dist-init TCPStore on the same port. The Step 2.5 comment says "allocate sequentially so engines on the same node never collide", but the Step 2 allocation is invisible to that sequencer.
The vLLM path avoids this by reusing the head's pre-allocated port as the dist-init port rather than drawing a second untracked port. Possible fixes: allocate the dist-init port from the same sequential allocator (e.g. run Step 2 after Step 2.5 using next_start, or advance next_start past the negotiated dist-init port). Only affects sglang_nnodes > 1 with auto-negotiated addr.
- 主要言語
- Python
- スター
- 460
- フォーク
- 40
- 平均マージ
- 1時間 4分
- マージ済み PR(30日)
- 4
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
Tencent/AngelSpec のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
-
難易度 4/5 3〜5日 初心者へのやさしさ 52/100
-
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
-
難易度 4/5 3〜5日 初心者へのやさしさ 55/100
-
enhancement
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
Tencent/AngelSpec の issue をすべて見る
似ている issue
-
ui
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
accepted
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
future-agi/future-agi#5070 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
juandresrodca/AdminForge#69 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
deepset-ai/haystack-integrations#817 ·
メンテナーはふだん 12 日以内に返信
-
[Bug]: test_remote_realpath_uses_argument_vector fails on Windows with Python 3.13+ (ntpath.isabs)対応中かも @gouyu-hou が今日担当しました。 オープンtriage/confirmed
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
agentscope-ai/agentscope#4397 ·
メンテナーはふだん 2 日以内に返信