Implementation:AIScientists Dev WorldSeed AutoresearchWorker
| Knowledge Sources | |
|---|---|
| Domains | Research_Automation, Distributed_Computing |
| Last Updated | 2026-10-26 18:00 GMT |
Overview
Concrete async training worker that drains the pending experiment queue, creates git branches, acquires GPUs from a pool, dispatches training to a remote EC2 daemon, and creates experiment entities with results.
Description
The AutoresearchWorker class runs as a single asyncio task. Each dequeued item (ExperimentRequest or VerifyRequest) is spawned as its own task, claiming one GPU from a `GPUPool`.
Flow for ExperimentRequest:
- Create `experiment/{agent}/{exp_id}` git branch from baseline
- Write agent's `train_gpt.py` payload, commit (under git lock)
- Acquire GPU from pool
- POST source + gpu_id to EC2 daemon, parse `val_loss`
- Create `experiment` entity, bump corpus counters
- Emit `experiment_completed` / `experiment_crashed`
- Release GPU
Flow for VerifyRequest:
- Read `train_gpt.py` at the paper's `method_commit` via `git show`
- Acquire GPU → POST source → parse val_loss
- Compare to `expected_val_loss` within `VERIFY_TOLERANCE = 0.02`
- Transition paper to `under_review` (within) or `contested` (outside)
Key constants: `EXPERIMENT_BUDGET_SEC = 600`, `DEFAULT_GPU_COUNT = 8`, `VERIFY_MAX_ATTEMPTS = 3`, `EXPERIMENT_INFRA_MAX_ATTEMPTS = 2`.
Usage
Import this class to run the training worker. Started by the autoresearch scene initialization as a background asyncio task.
Code Reference
Source Location
- Repository: WorldSeed
- File: src/worldseed/autoresearch/worker.py
Signature
class AutoresearchWorker:
def __init__(
self,
store: StateStore,
event_log: EventLog,
recorder: RunRecorder | NullRecorder | None = None,
runner: EC2Runner | None = None,
gpu_count: int = DEFAULT_GPU_COUNT,
) -> None: ...
def start(self) -> None: ...
def stop(self) -> None: ...
EXPERIMENT_BUDGET_SEC = 600
VERIFY_TOLERANCE = 0.02
VERIFY_MAX_ATTEMPTS = 3
DEFAULT_GPU_COUNT = 8
Import
from worldseed.autoresearch.worker import AutoresearchWorker
Related Pages
Implements Principle
- Principle:AIScientists_Dev_WorldSeed_Experiment_Execution
- Principle:AIScientists_Dev_WorldSeed_Paper_Verification
Requires Environment
- Environment:AIScientists_Dev_WorldSeed_Python_3_11_Engine
- Environment:AIScientists_Dev_WorldSeed_EC2_GPU_Training
- Environment:AIScientists_Dev_WorldSeed_Baseline_Training
- Environment:AIScientists_Dev_WorldSeed_Autoresearch_Agent_Runtime