ArchCoder/Openenv
PyTorch Debug Env ๐ฅ
A complete OpenEnv environment for the Meta PyTorch Hackathon where an AI agent investigates and diagnoses broken PyTorch training jobs.
Quick Start
from openenv import AutoEnv, AutoAction
env = AutoEnv.from_env("ArchCoder/pytorch-debug-env")
Action = AutoAction.from_env("ArchCoder/pytorch-debug-env")
with env.sync() as client:
result = client.reset(task_id="easy")
action = Action(
current_hypothesis={
"bug_type": "missing_zero_grad",
"affected_file": "train.py",
"confidence": 0.7
},
commit_diagnosis=False
)
step_result = client.step(action)API Endpoints
Tasks
Each difficulty draws from multiple bug templates, so repeated runs do not recycle the same exact failure.
Reward Structure
- Hypothesis delta (60%) โ reward for improving your bug hypothesis each step
- Investigation (20%) โ reward for inspecting the right files
- Final diagnosis (20%) โ accuracy of committed diagnosis vs ground truth
Scores range from 0.0 to 1.0. Partial credit for correct bug category on hard tasks.
Investigation Actions
reveal_file: reveal a file from the synthetic repoextend_loss_curve: reveal more loss-curve pointsextend_gpu_profile: reveal more GPU profile pointsreveal_log_chunk: append additional training log linesrun_diagnostic: expose a diagnostic summary report
Reproducibility
Use SEED to make scenario selection and artifacts deterministic across runs:
set SEED=42
python inference.pyBaseline Scores
Run inference.py with a fixed SEED to record your baseline scores. The script prints per-task [END] lines with the final rewards.
Example template (fill after running):
Environment State
Each episode provides a synthetic PyTorch repo with:
- Source files (
train.py,model/,data/,config/) - Loss curves and GPU memory profiles
- Training logs with realistic noise and red herrings
The agent reveals files progressively across up to 5โ6 steps, refining its hypothesis before committing a final diagnosis.
Author
Priyansh Saxena โ IIIT Gwalior
