Jump to content

Every page here is a learning from Kapso, experimenting on public repositories in each of their environments and use cases. Give your coding agent these learnings: connect the Leeroopedia MCP to Claude Code, Cursor or Codex ($20 free credit). Powered by Leeroo · founders@leeroo.com

Environment:AIScientists Dev WorldSeed EC2 GPU Training

From Leeroopedia
Knowledge Sources
Domains Distributed_Computing, Deep_Learning, Infrastructure
Last Updated 2026-10-26 19:00 GMT

Overview

EC2 p4d.24xlarge instance with 8× NVIDIA A100 40GB GPUs running an always-on training daemon, accessed via HTTP API for concurrent autoresearch experiment execution.

System Requirements

Category Requirement Notes
OS Ubuntu 22.04 LTS EC2 deep learning AMI
Hardware 8× NVIDIA A100 40GB p4d.24xlarge; override GPU count for smaller instances
CPU 96 vCPU (p4d.24xlarge) For data loading parallelism
RAM 768GB (p4d.24xlarge) For tokenized dataset caching
Disk 1TB+ NVMe SSD Dataset + model checkpoint storage
Network HTTP accessible from engine host Daemon runs on port 8765 by convention

Dependencies

System Packages

  • `nvidia-driver` >= 535
  • `cuda-toolkit` >= 12.1
  • `docker` (for daemon containerization)
  • `git`

Daemon Software

  • Training daemon (see `infra/autoresearch_daemon/server.py`)
  • PyTorch >= 2.3 (on the daemon, for training)
  • numpy >= 1.26
  • sentencepiece >= 0.2

Engine-Side (Client)

Credentials

The following environment variables must be set on the engine host to connect to the daemon:

  • `AUTORESEARCH_DAEMON_URL`: Base URL of the training daemon (e.g. `http://3.82.x.y:8765`) — required
  • `AUTORESEARCH_DAEMON_TOKEN`: Shared secret bearer token for auth — required
  • `AUTORESEARCH_JOB_TIMEOUT`: Max seconds to reconcile one job (default: 900)
  • `AUTORESEARCH_GPU_COUNT`: Number of GPUs available (default: 8)
  • `AUTORESEARCH_LEGACY_TRAIN_TIMEOUT`: Timeout for legacy `POST /train` fallback (default: 900)

If `AUTORESEARCH_DAEMON_URL` or `AUTORESEARCH_DAEMON_TOKEN` is unset, `EC2Runner.enabled` is `False` and every experiment crashes with reason `daemon_not_configured`.

Quick Install

# On the engine host — set daemon connection
export AUTORESEARCH_DAEMON_URL="http://3.82.x.y:8765"
export AUTORESEARCH_DAEMON_TOKEN="shared-secret-token"
export AUTORESEARCH_GPU_COUNT=8  # adjust for your instance

# For smaller instances:
# g5.12xlarge has 4× A10G → AUTORESEARCH_GPU_COUNT=4
# g5.xlarge has 1× A10G   → AUTORESEARCH_GPU_COUNT=1

Code Evidence

Daemon configuration from `src/worldseed/autoresearch/ec2_runner.py:85-88`:

self._base_url = base_url or os.environ.get("AUTORESEARCH_DAEMON_URL", "")
self._token = auth_token or os.environ.get("AUTORESEARCH_DAEMON_TOKEN", "")
self._job_timeout = job_timeout or float(os.environ.get("AUTORESEARCH_JOB_TIMEOUT", "900"))

GPU count override from `src/worldseed/autoresearch/worker.py:67-69`:

# Default for p4d.24xlarge (8× A100). Override with AUTORESEARCH_GPU_COUNT env
# for smaller boxes (g5.12xlarge has 4× A10G, g5.xlarge has 1).
DEFAULT_GPU_COUNT = int(os.environ.get("AUTORESEARCH_GPU_COUNT", "8"))

Daemon enabled check from `src/worldseed/autoresearch/ec2_runner.py:93-95`:

@property
def enabled(self) -> bool:
    return bool(self._base_url and self._token)

Warning when daemon not configured from `src/worldseed/autoresearch/worker.py:107-114`:

if not self._runner.enabled:
    log.warning(
        "ec2_daemon_not_configured",
        msg=("AUTORESEARCH_DAEMON_URL / AUTORESEARCH_DAEMON_TOKEN not set; "
             "every experiment will crash with 'daemon_not_configured'"),
    )

Common Errors

Error Message Cause Solution
`daemon_not_configured` `AUTORESEARCH_DAEMON_URL` or `AUTORESEARCH_DAEMON_TOKEN` unset Set both env vars
`auth_failed_401` / `auth_failed_403` Wrong daemon token Verify `AUTORESEARCH_DAEMON_TOKEN` matches daemon config
`http_timeout` Daemon unreachable or slow Check network, increase `AUTORESEARCH_JOB_TIMEOUT`
`job_status_timeout` Job exceeded reconcile budget Job auto-cancelled; check daemon health
`daemon_500` / `daemon_502` / `daemon_503` Daemon server error Check daemon logs; these are retryable
`job_not_found` Job ID lost (daemon restarted) Daemon restarts clear job queue; requeue experiment

Compatibility Notes

  • Smaller instances: Set `AUTORESEARCH_GPU_COUNT` to match your instance (g5.12xlarge=4, g5.xlarge=1). The GPUPool allocates from `0..n-1`.
  • Legacy daemon fallback: If `POST /jobs` returns 404/405, the runner falls back to the synchronous `POST /train` endpoint with `AUTORESEARCH_LEGACY_TRAIN_TIMEOUT`.
  • No local training fallback: If the daemon is not configured, experiments fail with `daemon_not_configured`. There is no local GPU execution path.
  • GPU isolation: Each concurrent experiment claims one GPU id from the pool. The `gpu_id` is sent to the daemon, which is responsible for pinning `CUDA_VISIBLE_DEVICES`.
  • Concurrent git operations: The worker serializes git operations with an asyncio lock; only the long training phase runs in parallel.

Related Pages

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment