Files
shinyobjectz 775469dbac raea cloud render farm: one render split across Modal GPUs, a bench of every GPU kind, and an agent box on a Fly Sprite
deploy/modal/farm.py (app raea-farm) serves sdk/cloud's jobs protocol on many GPUs. A raea render to a video or a folder is probed on one GPU (frame 0 and the manifest), timed on 8 frames, then split into contiguous runs on as many GPUs as pay for their start (a start at most a fifth of the work, farm_plan.gpus_for), with an optional price ceiling (max_usd, exit 3). Video runs are H.264 parts that the coordinator joins by stream copy while it renders the sound on its CPU; Blender scenes (Cycles on OptiX) split the same way and encode their parts on their own GPUs. raea asks for T4, A10, then L4 (its frames are bound by the CPU); Blender asks for L40S, RTX PRO 6000, then L4 (the most samples a dollar). GPUs render without the clipping check, with 4 cores and 16 GiB, a 2 s idle window (at 60 s a job billed several times its GPU work), shader and kernel caches on the volume, and raea's models from the raea-models volume (deploy/modal/models.sh). Each job's log ends with its bill per container.

bench/gpus.py runs raea (edit.tsx, Solari, clip check on and off) and Blender's Open Data benchmark on every Modal GPU kind at once; bench/results holds the 11-17 run and bench/report.py prints its tables. deploy/sprites/box.sh puts raea, the ACP agents and the server on a Sprite with its renders sent to the farm; it reads the org only from ~/.config/raea-cloud/sprites.env and refuses orgs listed under private/cloud. The client and offload.ts pass gpus, gpu and max_usd.

Checked: test/farm_plan.py (7, stand-in GPUs) passes; test/farm.ts against the deployed farm returned edit.tsx as 90 frames at 1080p in 70 s on a T4, and Blender's classroom as 20 frames at 1080p and 256 samples on up to 10 GPUs (frames 3.1x faster than on one).
2026-11-17 19:52:34 -08:00

47 lines
1.9 KiB
Python

# bench/results/*.json as the cost tables in docs/cloud-render.md: python3 bench/report.py from sdk/cloud.
# Prices are a container of 4 cores and 16 GiB (what the farm gives each GPU) at Modal's list price.
import glob
import json
import os
import re
import sys
sys.path.insert(0, os.path.join(os.path.dirname(os.path.abspath(__file__)), "..", "deploy", "modal"))
import prices # noqa: E402
HERE = os.path.dirname(os.path.abspath(__file__))
ORDER = ["none", "T4", "L4", "A10", "L40S", "RTX-PRO-6000", "A100-40GB", "H100"]
def ms(r, name):
x = r["raea"].get(name) or {}
lines = x.get("out") if isinstance(x.get("out"), list) else [x.get("out") or ""]
for l in lines:
m = re.search(r"\(([\d.]+) ms a frame", l)
if m:
return float(m.group(1))
return None
rows = {}
for f in glob.glob(os.path.join(HERE, "results", "*.json")):
r = json.load(open(f))
if not r.get("error"):
rows[r["kind"]] = r
print("| GPU | $/h (4 cores, 16 GiB) | cold start | Cycles samples/min (monster, junkshop, classroom) | classroom samples per $ | edit.tsx ms/frame (clip check on, off) | Solari ms/frame (on, off) | $ per 1,000 Solari frames |")
print("|---|---|---|---|---|---|---|---|")
for k in [k for k in ORDER if k in rows]:
r = rows[k]
hour = prices.per_hour("" if k == "none" else k, 8 if k == "none" else 4, 16)
spm = r["blender"].get("samples_per_minute") or {}
per_dollar = spm.get("classroom", 0) * 60 / hour if spm else 0
sol = ms(r, "solari-noclip")
name = "CPU only (8 cores)" if k == "none" else k
print(
f"| {name} | ${hour:.2f} | {r['start']:.0f} s | {spm.get('monster', 0):,.0f}, {spm.get('junkshop', 0):,.0f}, {spm.get('classroom', 0):,.0f} "
f"| {per_dollar:,.0f} | {ms(r, 'edit') or 0:,.0f}, {ms(r, 'edit-noclip') or 0:,.0f} | {ms(r, 'solari') or 0:.0f}, {sol or 0:.0f} "
f"| ${(sol or 0) / 1000 * 1000 * hour / 3600:.3f} |"
)