Spaces:
Running on Zero
Running on Zero
test(smoke): add gpu smoke for minimum generate path
Browse files- tests/test_smoke_gpu.py +51 -0
tests/test_smoke_gpu.py
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""GPU smoke tests — skipped by default. Opt in with: pytest -m gpu
|
| 2 |
+
|
| 3 |
+
Generates the minimum-viable songs end-to-end through the real ACE-Step
|
| 4 |
+
pipeline. Run before each release tag.
|
| 5 |
+
|
| 6 |
+
Skipped automatically in CI by the pyproject ``addopts = -m 'not gpu'``
|
| 7 |
+
default. Requires:
|
| 8 |
+
|
| 9 |
+
- ``ace-step`` installed (Apple Silicon fork on Mac, upstream on CUDA)
|
| 10 |
+
- First run downloads ACE-Step 1.5 XL SFT weights (~16 GB) into the HF cache
|
| 11 |
+
- A real MPS / CUDA device — CPU inference is functionally untested
|
| 12 |
+
"""
|
| 13 |
+
|
| 14 |
+
from __future__ import annotations
|
| 15 |
+
|
| 16 |
+
import os
|
| 17 |
+
from pathlib import Path
|
| 18 |
+
|
| 19 |
+
import pytest
|
| 20 |
+
|
| 21 |
+
pytestmark = pytest.mark.gpu
|
| 22 |
+
|
| 23 |
+
|
| 24 |
+
def test_generate_minimum_song(tmp_path):
|
| 25 |
+
"""Smallest end-to-end: 5 s instrumental drone, seed=1."""
|
| 26 |
+
os.environ.setdefault("ACE_MODEL_PATH", "ACE-Step/ACE-Step-v1.5-XL-SFT")
|
| 27 |
+
|
| 28 |
+
from backend import ACEStepStudioBackend
|
| 29 |
+
|
| 30 |
+
b = ACEStepStudioBackend()
|
| 31 |
+
out_path, meta = b.dispatch(
|
| 32 |
+
mode="generate",
|
| 33 |
+
params={
|
| 34 |
+
"prompt": "test tone, simple drone",
|
| 35 |
+
"lyrics": "[intro] tone",
|
| 36 |
+
"duration_s": 5,
|
| 37 |
+
"instrumental": True,
|
| 38 |
+
"seed": 1,
|
| 39 |
+
"loras": [],
|
| 40 |
+
"advanced": {},
|
| 41 |
+
"lm": {},
|
| 42 |
+
"dcw": {},
|
| 43 |
+
},
|
| 44 |
+
)
|
| 45 |
+
assert Path(out_path).exists()
|
| 46 |
+
assert Path(out_path).stat().st_size > 0
|
| 47 |
+
assert meta["mode"] == "generate"
|
| 48 |
+
assert meta["seed"] == 1
|
| 49 |
+
# Wall time should be < 5 min even on first cold run + 16 GB weight download.
|
| 50 |
+
# Subsequent runs should be < 30 s on M5 Max.
|
| 51 |
+
assert meta["wall_seconds"] > 0
|