• Stefy Lanza (nextime / spora )'s avatar
    write songs with a model the server cannot hold in its own interpreter · da82cb71
    Stefy Lanza (nextime / spora ) authored
    ACE-Step generates a whole track -- style prompt, sung lyrics, a length in
    seconds -- and it ships a package pinning transformers 4.50 and spacy 3.8.4.
    spacy 3.8.4 publishes no cp313 wheel, so this is not a stack the server would
    rather not hold: it is one that cannot be installed on the server's
    interpreter. It gets a python 3.12 venv of its own and an HTTP service in it,
    driven the way CrisperWhisper, Canary and pyannote are. Built on the first
    request to such a model, so a model that is configured and never called costs
    nothing; `uv venv` covers the hosts that have python3.12 without ensurepip.
    
    Three upstream details that fail silently rather than loudly:
    
    * the pipeline resolves its own dtype as `bfloat16 if dtype == "bfloat16" else
      float32`, so asking it for float16 quietly doubles the VRAM. ACE_PIPELINE_DTYPE
      is read after that switch, so precision goes through there instead.
    * constructing the pipeline loads NOTHING -- it reads the checkpoints on the
      first call. coderai measures a model's footprint as the free-VRAM delta
      across the load, and that window closes when the worker reports healthy, so
      a lazy load would measure ~0 GB and eviction would treat a resident 3.5B
      model as free. The service loads before answering /health.
    * `quantized=True` does not quantize: it loads a separate int4wo export from
      the same directory layout. Missing, that is a FileNotFoundError minutes into
      a load, so the worker names the file it wants first.
    
    The handle cached in the manager exposes cleanup(), which is what eviction
    calls, and here it stops the worker -- the only thing that frees its VRAM.
    
    `duration` and `cfg_coef` are shared with MusicGen and default to 10s/3.0,
    which would make every ACE-Step call a 10-second clip at a guidance it is not
    tuned for. The branch reads which fields the client actually SENT, so an
    omitted one gets ACE-Step's default and an explicit `duration: 10` still means
    10. `lyrics` and `steps` become declared fields: both branches already read
    `steps` off the request, where only extra="allow" was letting it through.
    
    The venv is ~6.4 GB, so the default image does not carry it and --with-acestep
    bakes it in -- copying the dev venv when there is one, building it when there
    is not. Ubuntu 22.04's system python is 3.10, so a baked 3.12 venv also needs
    a relocatable interpreter bundled beside it, like the 3.10 venvs.
    
    Verified on a 3090: healthy after ~3.5 min, 8.5 GB VRAM, a real 48 kHz stereo
    WAV from a 10s/12-step request. Suite at its 15-failure baseline, 5292 passed.
    Co-Authored-By: 's avatarClaude Opus 5 <noreply@anthropic.com>
    Claude-Session: https://claude.ai/code/session_014T3rZnLhydX9QqUcfBbqLu
    da82cb71
test_acestep_worker.py 7.91 KB