agentscope-ai / agentscope-ai/Trinity-RFT

[monitor] Unify explorer and trainer wandb logging into a single run

Đang mở
#556 3 bình luận 0 reaction 1 người được giao Được @MengsD nhận Xem trên GitHub
Ngôn ngữ chính
Python
Star
701
Fork
79
Merge trung bình
8 giờ 7 phút
Pull request đã merge (30 ngày)
1

Mô tả

### Problem

When monitor_type: wandb is configured, Trinity creates two separate wandb runs — {name}_explorer and {name}_trainer. This makes it harder to correlate
explorer and trainer metrics (e.g., comparing rollout accuracy against actor loss), and clutters the wandb project with twice as many runs.

### Proposed Solution

A primary process in the launcher creates the wandb run, and both Explorer and Trainer join as
secondary writers via wandb.init(id=run_id, resume="allow", mode="shared").

### Planned Changes:
- config.py: Add wandb_run_id field to MonitorConfig (auto-populated by launcher)
- monitor.py: Add init_wandb_primary() / finish_wandb_primary() helpers; modify WandbMonitor to support shared (secondary) mode
- launcher.py: In both(), create the primary run before spawning actors and pass wandb_run_id through config

### Expected Outcome:

- In shared mode, all metrics are prefixed with their role (explorer/ or trainer/), producing two clean top-level sections in the wandb UI
- wandb.define_metric assigns independent step axes (explorer/step and trainer/step) so the two processes' step counters don't conflict
- for standalone mode, explore() and train() standalone entry points should remain unchanged — they would still create their own independent runs since wandb_run_id remains None.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

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.