[BUG] Flaky CPU unit tests: port 29500 EADDRINUSE from hardcoded MASTER_PORT colliding with xdist port ranges
Maintainer thường phản hồi trong vòng 2 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
- 67/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Lĩnh vực
- distributed-systems, testing
Hướng nghiên cứu
Start with tests/unit/runtime/zero/test_zero_grad_clip.py and tests/unit/utils/test_groups.py, then compare the re-initialization with the file-store example in test_world_destroy_releases_sequence_parallel_groups. Check the port setup in tests/unit/checkpoint/test_affine_transfer_executor_external_group.py too. Run the affected tests with pytest -n 4; done means these tests avoid port collisions under xdist and pass together.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Describe the bug
cpu-torch-latest failed once on #8966 with an unrelated test:
FAILED unit/utils/test_groups.py::TestGroupCacheTeardown::test_default_destroy_releases_cached_groups[True]
torch.distributed.DistNetworkError: The server socket has failed to listen on any local network address. port: 29500, useIpv6: false, code: -98, name: EADDRINUSE, message: address already in use
Run: https://github.com/deepspeedai/DeepSpeed/actions/runs/44087089094/job/134062944114 (1 failed, 3795 passed). The [False] case passed a few seconds later in the same job.
Cause
Two tests used TCP port 29500 at the same time, on different xdist workers:
tests/unit/runtime/zero/test_zero_grad_clip.pyhardcodesos.environ['MASTER_PORT'] = '29500'and initializes throughenv://. Worker gw1 started it at 13:14:08 and held the port until 13:14:56.- On worker gw0,
get_master_port()returned 29500 fortest_default_destroy_releases_cached_groups[True]at 13:14:04, because gw0's range starts at 29500 and the port was free.get_master_port()only binds the port briefly to check that it is free; the first init of this test uses a file store, so nothing kept the port reserved. After destroying the process group, the test re-initializes withdist.init_distributed(dist_backend="gloo"), withoutinit_method, so it falls back toenv://and opens a TCPStore onMASTER_PORT=29500. By then gw1 held the port.
The failure needs both tests to overlap in time and gw0 to get the bottom of its range, so it is rare. Across the failed cpu-torch-latest, mps and modal jobs of the past month whose logs are still available (110 CPU jobs), this is the only EADDRINUSE.
Other tests with the same risk
tests/unit/checkpoint/test_affine_transfer_executor_external_group.pybuilds its TCPStore on29000 + os.getpid() % 1000, which overlaps gw0's range (29500–30499).tests/accelerator/test_ds_init.pyhardcodesMASTER_PORT=8088. It is outside the unit suite, so it is lower risk.- Several
DistributedTests withinit_distributed = Falseinitialize throughenv://on the harness port, for example intest_hybrid_engine_rollout.pyandcomm/test_dist.py. They are safe unless a hardcoded port collides with them, becauseget_master_port()only checks the port and does not hold it until use.
Suggested fix
test_zero_grad_clip.py: useget_master_port()instead of'29500'.test_groups.py: re-initialize with afile://store, astest_world_destroy_releases_sequence_parallel_groupsin the same class already does.test_affine_transfer_executor_external_group.py: take the port fromget_master_port(), or use aFileStore.
Optionally, keep hardcoded ports out of the xdist ranges, or add a lint check for literal MASTER_PORT values under tests/unit.
Environment: GitHub-hosted CPU runner, pytest -n 4.
This analysis was prepared with AI assistance (GitHub Copilot CLI) from the CI log and the test sources.
- Ngôn ngữ chính
- Python
- Star
- 43.3k
- Fork
- 5.1k
- Merge trung bình
- 5 ngày 10 giờ
- Pull request đã merge (30 ngày)
- 85
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không 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 deepspeedai/DeepSpeed
-
[Bug] DeepSpeedEngine.step leaves _running_engine_step=True permanently on exception, corrupting is_gradient_accumulation_boundary()Có thể đã có người làm @its-amann đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
deepspeedai/DeepSpeed#9190 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
-
[Bug] PipelineEngine._exec_reduce_grads and _exec_optimizer_step leave _force_grad_boundary=True permanently after any exceptionCó thể đã có người làm @bantianyue đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
deepspeedai/DeepSpeed#9183 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
deepspeedai/DeepSpeed#9019 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
-
fp16 `hysteresis: 0` (or negative) makes DynamicLossScaler never lower the loss scale, so every overflowing step is skipped foreverCó thể đã có người làm @damienen đã nhận 26 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
deepspeedai/DeepSpeed#8982 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
[BUG] OneCycle applies the minimum momentum to the first Adam updateCó thể đã có người làm @ai-yang đã nhận 30 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
deepspeedai/DeepSpeed#8951 ·
Maintainer thường phản hồi trong vòng 2 ngày
Tất cả issue của deepspeedai/DeepSpeed
Issue tương tự
-
area/auth comp/agent P3 type/bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
NousResearch/hermes-agent#161417 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 75/100
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
Dao-AILab/flash-attention#3251 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
[New Check]: sqlserver_public_network_access_disabledCó thể đã có người làm @pouria-l đã nhận hôm nay. Đang mởfeature-request status/needs-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
prowler-cloud/prowler#13607 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
external langchain
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 90/100
langchain-ai/docs#8184 ·
Maintainer thường phản hồi trong vòng 1 ngày