Files
esh-pfi-infrastructure/stacks/ace-step/compose.yaml
T
vh d2ed7671d7 ace-step: patch upstream infer-api + missing runtime deps + cache mount
Three upstream gaps surfaced once /generate was actually exercised:

  1. infer-api.py builds an 18-arg positional tuple but the pipeline
     expects 24 — first missing arg is `format`, so audio_duration
     shifts into format's slot and the pipeline calls len() on an
     int. Ship a patched copy of infer-api.py and COPY over upstream's
     in the Dockerfile. Also handle empty lora_name_or_path -> "none"
     (empty string trips HF Hub's repo-id validator).
  2. torchcodec + ffmpeg are required by the WAV save path but neither
     is in upstream requirements.txt. Without them every /generate
     runs to completion and then 500s at write-time.
  3. ACE-Step caches checkpoints at /root/.cache/ace-step/checkpoints
     (HARDCODED, not honored by HF_HOME). Mount our persistent dir
     there so the ~7 GB model survives container recreates.

Bench on A6000 (cached model, lo-fi hip hop, 60-step euler/apg):
  10s @ 27 steps -> 9.4s  (0.94x)
  30s @ 60 steps -> 11.2s (0.37x, ~2.7x realtime)
  60s @ 60 steps -> 14.8s (0.24x, ~4x realtime)
2026-04-28 09:42:07 -07:00

75 lines
3.3 KiB
YAML

# ACE-Step 1.5 — open-source music generation foundation model
# (April 2026). Hybrid diffusion + LLM architecture, Apache 2.0.
# ~50-80 s for a 4-minute song on A6000; under 4 GB VRAM at idle,
# ~10-12 GB during inference. Beats YuE / DiffRhythm on the
# speed/coherence trade.
#
# We launch upstream's REST API (`infer-api.py`) instead of the
# default `gui.py` (Gradio). The REST surface is what we'll point
# clients + automation at; Gradio is dev-time eye candy.
#
# Image is built locally from upstream's repo via docker buildx git
# context, same pattern as fish-s2.
#
# All tunables live in .env — edit that, not this file.
services:
ace-step:
image: local/ace-step:${ACE_STEP_TAG}
build:
# Build from local Dockerfile (not upstream's git context) — we
# ship a patched Dockerfile that fixes upstream's torch/cu126
# resolution bug. Playbook uploads Dockerfile alongside this
# compose.yaml.
context: .
dockerfile: Dockerfile
args:
ACE_STEP_REF: ${ACE_STEP_SHA}
container_name: ace-step
restart: unless-stopped
runtime: nvidia
ports:
# Container default for infer-api.py is 8000 (hardcoded
# uvicorn.run(host=0.0.0.0, port=8000) — no flags). Map host
# ACE_STEP_PORT to it.
- "${ACE_STEP_BIND:-0.0.0.0}:${ACE_STEP_PORT}:8000"
environment:
- NVIDIA_VISIBLE_DEVICES=${ACE_STEP_GPU_DEVICES:-1}
# ACE_OUTPUT_DIR is read by acestep at generation time — keep
# in sync with the bind mount below.
- ACE_OUTPUT_DIR=/app/outputs
# HF_HOME points the HuggingFace cache at the bind mount so the
# ~5-10 GB checkpoint download survives container recreates.
- HF_HOME=/app/hf_cache
volumes:
# ACE-Step has a HARDCODED checkpoint cache at
# /root/.cache/ace-step/checkpoints — not honored by HF_HOME.
# Mount our persistent dir there so model re-pull doesn't
# happen on every container recreate.
- ${ACE_STEP_CHECKPOINTS_DIR}:/root/.cache/ace-step/checkpoints
- ${ACE_STEP_OUTPUTS_DIR}:/app/outputs
- ${ACE_STEP_LOGS_DIR}:/app/logs
- ${ACE_STEP_CACHE_DIR}:/app/hf_cache
# Override upstream's default `python3 acestep/gui.py` with the
# REST API entry point. infer-api.py self-binds 0.0.0.0:8000 and
# exposes POST /generate + GET /health.
command: ["python3", "infer-api.py"]
healthcheck:
# /health is the cheapest signal infer-api.py exposes — returns
# 200 as soon as the FastAPI app is up. The pipeline lazy-loads
# on first /generate, so /health says "process alive" not
# "model warm". Good enough for a liveness signal; first
# /generate has the ~30-60 s warmup baked in.
test: ["CMD-SHELL", "python3 -c \"import urllib.request,sys; sys.exit(0 if urllib.request.urlopen('http://127.0.0.1:8000/health', timeout=5).status==200 else 1)\""]
interval: 30s
timeout: 10s
retries: 3
# First boot pulls ACE-Step checkpoint (~5-10 GB) into HF cache.
start_period: 600s
labels:
- homepage.group=AI Systems
- homepage.name=ACE-Step
- homepage.icon=mdi-music-note-eighth
- homepage.description=Open-source music generation — 4-min song in ~60s, lyrics + style prompts (irv-ml1)
- homepage.href=http://10.100.79.3:${ACE_STEP_PORT}