Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

gather_trajectory_groups / gather_trajectories leave sibling rollouts running after a failure

Đang mở Phù hợp với người mới
#1,144 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

@salma2vec đang làm issue này rồi.

Từ ngày 22/10/2026.

  • #1145 của @salma2vec — đang mở

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
78/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
python
Lĩnh vực
backend

Hướng nghiên cứu

Tìm các phần triển khai gather_trajectory_groups và gather_trajectories, rồi đọc cách chúng sử dụng asyncio.gather và xử lý max_exceptions. Thêm các bài kiểm thử async có trọng tâm cho trường hợp một rollout thất bại cùng lúc có một rollout anh em bị chặn ở cả hai điểm vào. Công việc hoàn tất khi luồng ngoại lệ hủy các rollout anh em và chờ chúng kết thúc, trong khi các lỗi được dung thứ và việc hủy task đang chờ vẫn hoạt động như mô tả.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

gather_trajectory_groups and gather_trajectories run their rollouts through asyncio.gather. When a rollout raises past max_exceptions, asyncio.gather re-raises that exception immediately, but it does not cancel the other awaitables, which keep running. The caller sees the failure and moves on (or the training step aborts), while the remaining rollouts keep calling the inference server, the environment and any after_each judge (e.g. RULER) with no owner. This is the same lifecycle gap as #1140, in the other gather entry points.

Reproduced on main at 5f0c1fb, Python 3.12, no model or service:

import asyncio
import art

async def main():
    entered, release = asyncio.Event(), asyncio.Event()
    effects = []

    async def slow_rollout():
        entered.set()
        await release.wait()
        effects.append("finished after gather raised")
        return art.TrajectoryGroup([art.Trajectory(reward=1)])

    async def failed_rollout():
        await entered.wait()
        raise RuntimeError("rollout failed")

    try:
        await art.gather_trajectory_groups([failed_rollout(), slow_rollout()], pbar_desc=None)
    except RuntimeError as error:
        print("gather raised:", error)
    release.set()
    await asyncio.sleep(0.1)
    print(effects)

asyncio.run(main())

Output:

gather raised: rollout failed
['finished after gather raised']

Expected: []. When the gather raises, the other rollouts should already be cancelled and awaited. gather_trajectories behaves the same way.

The tolerated-failure path (max_exceptions not exceeded) and cancellation of the awaiting task are fine today. asyncio.gather does propagate cancellation to its children; only the exception path leaks.

Ngôn ngữ chính
Python
Star
10.8k
Fork
1k
Merge trung bình
12 giờ 33 phút
Pull request đã merge (30 ngày)
126

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của OpenPipe/ART

Tất cả issue của OpenPipe/ART

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.