Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions .github/workflows/base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ on:
- "official-templates/base/Dockerfile"
- "official-templates/pytorch/docker-bake.hcl"
- "official-templates/pytorch/Dockerfile"
- "official-templates/autoresearch/docker-bake.hcl"
- "official-templates/autoresearch/Dockerfile"
- "official-templates/shared/**"
workflow_dispatch:

Expand Down Expand Up @@ -43,6 +45,47 @@ jobs:
official-templates/base/docker-bake.hcl
push: true

build-autoresearch:
needs: build-base
if: always() && (needs.build-base.result == 'success' || needs.build-base.result == 'skipped')
runs-on: blacksmith-8vcpu-ubuntu-2204
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Check if build is needed
uses: tj-actions/changed-files@v46
id: changes
with:
files_yaml: |
autoresearch:
- 'official-templates/shared/**'
- 'official-templates/base/**'
- 'official-templates/autoresearch/**'
Comment on lines +64 to +66

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Rebuild autoresearch after base image changes

The build-autoresearch change detector only watches official-templates/shared/** and official-templates/autoresearch/**, so when official-templates/base/** changes this workflow still runs build-base but skips rebuilding autoresearch. That leaves runpod/autoresearch:* tags on older base layers (including missed base fixes) until an unrelated autoresearch/shared edit happens. Add base template paths to this filter so dependent images rebuild whenever their base is rebuilt.

Useful? React with 👍 / 👎.


- name: Setup Docker
if: steps.changes.outputs.autoresearch_any_changed == 'true'
uses: ./.github/actions/docker-setup
id: setup
with:
dockerhub-username: ${{ secrets.DOCKERHUB_USERNAME }}
dockerhub-token: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build autoresearch images
if: steps.changes.outputs.autoresearch_any_changed == 'true'
uses: docker/bake-action@v6
env:
BUILDX_BAKE_ENTITLEMENTS_FS: 0
RELEASE_SUFFIX: ${{ steps.setup.outputs.release-suffix }}
with:
source: .
files: |
official-templates/shared/versions.hcl
official-templates/autoresearch/docker-bake.hcl
push: true

build-pytorch:
needs: build-base
# always() forces job run even if the dependant is skipped (but not if it failed)
Expand Down
15 changes: 15 additions & 0 deletions official-templates/autoresearch/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
ARG BASE_IMAGE=non-existing
FROM ${BASE_IMAGE}

# Clone autoresearch into workspace
ARG AUTORESEARCH_REF=master
RUN git clone --branch ${AUTORESEARCH_REF} --depth 1 \
https://github.com/runpod/autoresearch.git /workspace/autoresearch

WORKDIR /workspace/autoresearch

# Install Python dependencies
RUN uv sync

# Download data and train tokenizer (~2 min)
RUN uv run prepare.py
41 changes: 41 additions & 0 deletions official-templates/autoresearch/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
### Runpod AutoResearch

**Pre-configured environment for [autoresearch](https://github.com/runpod/autoresearch), Karpathy's autonomous ML research loop.**

An AI coding agent autonomously runs ML experiments: it modifies `train.py`, trains for 5 minutes, checks if val_bpb improved, keeps or discards, and repeats. ~100 experiments overnight on a single GPU.

### What's included

- **Zero setup**: Dependencies installed, data prepared, ready to go on launch.
- **GPU accelerated**: Full CUDA 12.8 support with PyTorch 2.9.1.
- **Agent ready**: SSH in, connect your coding agent, and start experimenting.

### Getting started

1. Launch a pod with this template
2. Connect your coding agent (Claude Code, Cursor, etc.) via SSH
3. Tell the agent:
```
Read /workspace/autoresearch/program.md and let's kick off a new experiment!
```

### GPU recommendations

| GPU | VRAM | Notes |
|-----|------|-------|
| RTX 4090 | 24 GB | Budget option. Smaller optimal model size. |
| A40 | 48 GB | Good middle ground. |
| A100 80GB | 80 GB | Plenty of room for larger models. |
| H100 | 80 GB | Fastest. What Karpathy used. |

The 5-minute fixed time budget means cheaper GPUs work fine — you get a different optimal model size. Results are comparable within the same GPU type.

### Available images

- Ubuntu 22.04: `runpod/autoresearch:1.0.2-cuda1281-ubuntu2204`
- Ubuntu 24.04: `runpod/autoresearch:1.0.2-cuda1281-ubuntu2404`

### Links

- [autoresearch repo](https://github.com/runpod/autoresearch) (Runpod fork)
- [Original repo](https://github.com/karpathy/autoresearch) by Karpathy
42 changes: 42 additions & 0 deletions official-templates/autoresearch/docker-bake.hcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Autoresearch template
# Builds on runpod/base with CUDA 12.8.1 (matches torch cu128 wheels)

variable "AUTORESEARCH_BUILDS" {
default = flatten([
for ubuntu in UBUNTU_VERSIONS : {
ubuntu_version = ubuntu.version
ubuntu_name = ubuntu.name
}
])
}

group "default" {
targets = [
for build in AUTORESEARCH_BUILDS :
"autoresearch-${build.ubuntu_name}"
]
}

target "autoresearch-base" {
context = "official-templates/autoresearch"
dockerfile = "Dockerfile"
platforms = ["linux/amd64"]
}

target "autoresearch-matrix" {
inherits = ["autoresearch-base"]

matrix = {
build = AUTORESEARCH_BUILDS
}

name = "autoresearch-${build.ubuntu_name}"

args = {
BASE_IMAGE = "runpod/base:${RELEASE_VERSION}${RELEASE_SUFFIX}-cuda1281-${build.ubuntu_name}"
}

tags = [
"runpod/autoresearch:${RELEASE_VERSION}${RELEASE_SUFFIX}-cuda1281-${build.ubuntu_name}",
]
}