From 7c560a67fb7adb4978b3c2bdb6bb9f4bcbfa9a06 Mon Sep 17 00:00:00 2001 From: Vuong Hoang Date: Fri, 24 Apr 2026 17:30:09 -0700 Subject: [PATCH] stacks/qwen3-tts: target=production + user=root + correct HF model id MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Three fixes from the first deploy attempt on irv-ml1: - build.target=production. Upstream Dockerfile is multistage; the last stage `cpu-base` was selected by default, producing a CPU-only image with no flash-attn and `torch ... whl/cpu`. - user: "0:0". Upstream image declares USER appuser but writes runtime state under /root (mode 0700). appuser cannot traverse /root, so /v1/voices 500s on PermissionError. Run as root to sidestep. - QWEN3_TTS_MODEL=Qwen/Qwen3-TTS-12Hz-1.7B-CustomVoice. The bare `1.7B` id we had isn't a real HF identifier; upstream publishes -CustomVoice / -Base variants of each size. Use -CustomVoice so `voice="clone:"` works. Tag bumped to v2 to keep the v1 cpu image distinguishable in the local registry. After: all 5 verify steps pass, GPU synthesis ~5s for 3-4s of audio, three contrasting English `instructions` produce three distinct hashes — emotion steering actually works (unlike CosyVoice's English path). --- stacks/qwen3-tts/.env.example | 18 ++++++++++++------ stacks/qwen3-tts/compose.yaml | 13 +++++++++++++ 2 files changed, 25 insertions(+), 6 deletions(-) diff --git a/stacks/qwen3-tts/.env.example b/stacks/qwen3-tts/.env.example index f83b86a..62cc29b 100644 --- a/stacks/qwen3-tts/.env.example +++ b/stacks/qwen3-tts/.env.example @@ -6,8 +6,10 @@ QWEN3_TTS_SHA=10323ce778c48a75dbda93d0a4891983fb371f58 # Local image tag — bump when you change build context to force a -# fresh layer build. -QWEN3_TTS_TAG=v1 +# fresh layer build. v2 = first GPU build (target=production); v1 +# was the accidental CPU-only image (last stage of upstream's +# multi-stage Dockerfile). +QWEN3_TTS_TAG=v2 # ── network ────────────────────────────────────────────────────────── # Host port (container listens on 8880 internally). @@ -23,10 +25,14 @@ QWEN3_TTS_BIND=0.0.0.0 # more VRAM); `pytorch` = bare pytorch path. QWEN3_TTS_BACKEND=official -# Model variant. 1.7B = flagship, 6–8 GB VRAM with bfloat16, best -# quality + control. 0.6B = lightweight, ~2–3 GB VRAM, faster, slightly -# less expressive. -QWEN3_TTS_MODEL=Qwen/Qwen3-TTS-12Hz-1.7B +# Model variant. Upstream publishes four checkpoints on HF: +# Qwen/Qwen3-TTS-12Hz-1.7B-CustomVoice — flagship, voice cloning +# Qwen/Qwen3-TTS-12Hz-1.7B-Base — flagship, no cloning +# Qwen/Qwen3-TTS-12Hz-0.6B-CustomVoice — lightweight, voice cloning +# Qwen/Qwen3-TTS-12Hz-0.6B-Base — lightweight, no cloning +# 1.7B = ~6–8 GB VRAM bfloat16, best quality. 0.6B = ~2–3 GB. +# Use -CustomVoice for `voice="clone:"` to work. +QWEN3_TTS_MODEL=Qwen/Qwen3-TTS-12Hz-1.7B-CustomVoice # Warm the model on container start so the first synthesis request # doesn't pay the load latency. Adds ~30 s to startup. Recommended. diff --git a/stacks/qwen3-tts/compose.yaml b/stacks/qwen3-tts/compose.yaml index 1cd4592..ff02623 100644 --- a/stacks/qwen3-tts/compose.yaml +++ b/stacks/qwen3-tts/compose.yaml @@ -29,9 +29,22 @@ services: build: context: https://github.com/groxaxo/Qwen3-TTS-Openai-Fastapi.git#${QWEN3_TTS_SHA} dockerfile: Dockerfile + # Upstream Dockerfile defines five stages — without an explicit + # target, buildkit picks the LAST named stage (`cpu-base`) and + # produces a CPU-only image with no GPU torch + onnxruntime + # (not -gpu). Pin to `production` to get the CUDA stack with + # flash-attn that the model actually needs. + target: production container_name: qwen3-tts restart: unless-stopped runtime: nvidia + # Upstream image declares `USER appuser` (uid 1000) but writes + # state under /root (mode 0700) — appuser can't traverse it, so + # /v1/voices and any FS-touching endpoint 500s. The model loads + # only because warmup happens in an early root phase. Pin to root + # so all paths are reachable. Files written into the host bind + # mounts become root-owned; that's fine for restic + sudo reads. + user: "0:0" ports: - "${QWEN3_TTS_BIND:-0.0.0.0}:${QWEN3_TTS_PORT}:8880" environment: