aboutsummaryrefslogtreecommitdiff
path: root/app/tests/test_backends_sglomni.py
diff options
context:
space:
mode:
authorhistoria <historiavg@proton.me>2026-09-02 20:46:42 -0400
committerhistoria <historiavg@proton.me>2026-09-02 20:46:42 -0400
commit7a7dca313750ee75e0f8a2a5442ca5d78e743294 (patch)
tree5847a83a58cf9191ed8268dcde3a85cb0d300b5a /app/tests/test_backends_sglomni.py
parentdfce6c38a9a67ea2760fedae73ee9f5989d52f13 (diff)
downloadtts-audiobook-generator-7a7dca313750ee75e0f8a2a5442ca5d78e743294.tar.gz
feat: reserve 20% vram when running higgs with sglang-omni
Diffstat (limited to 'app/tests/test_backends_sglomni.py')
-rw-r--r--app/tests/test_backends_sglomni.py30
1 files changed, 28 insertions, 2 deletions
diff --git a/app/tests/test_backends_sglomni.py b/app/tests/test_backends_sglomni.py
index 1fd5f5a..ebac500 100644
--- a/app/tests/test_backends_sglomni.py
+++ b/app/tests/test_backends_sglomni.py
@@ -330,10 +330,12 @@ class BuildSpecTests(unittest.TestCase):
self.assertEqual(port_flag, "--port")
self.assertIn(port, str(spec.url))
- def test_spec_omits_config_when_none_needed(self):
+ def test_spec_launches_the_higgs_config(self):
entry = entry_by_key("higgs_audio_v3_tts")
spec = status.build_spec(entry)
- self.assertNotIn("--config", spec.argv)
+ self.assertIn("--config", spec.argv)
+ self.assertEqual(Path(spec.argv[spec.argv.index("--config") + 1]),
+ catalog.config_path(entry))
class GpuCapabilityTests(unittest.TestCase):
@@ -377,6 +379,30 @@ class GpuCapabilityTests(unittest.TestCase):
self.assertIsNone(status.gpu.compute_capability())
+class HiggsConfigTests(unittest.TestCase):
+ """The vendored Higgs config: VRAM headroom and a raised frame cap."""
+
+ def test_config_declares_the_repo_budget_and_frame_cap(self):
+ entry = entry_by_key("higgs_audio_v3_tts")
+ path = catalog.config_path(entry)
+ self.assertIsNotNone(path)
+ self.assertTrue(path.is_file(), f"missing {path}")
+ text = path.read_text(encoding="utf-8")
+ self.assertIn(f"model_path: {entry.repo}", text)
+ # The upstream pipeline budgets 0.98 of the card across its
+ # colocated stages; 0.80 leaves transient-allocation headroom on
+ # 24 GB cards (request-time CUDA OOM at the 0.85 default).
+ self.assertRegex(text, r"gpu_memory_fraction:\s*0\.80")
+ # The engine's 2048-frame default (~27 s at 75 fps) silently
+ # truncates a full 250-word sub-chunk; per-request values are
+ # clamped to this factory cap server-side.
+ self.assertRegex(text, r"max_new_tokens:\s*12288")
+
+ def test_entry_sends_the_raised_frame_cap_per_request(self):
+ entry = entry_by_key("higgs_audio_v3_tts")
+ self.assertEqual(entry.max_new_tokens, 12288)
+
+
class Fp8FallbackTests(unittest.TestCase):
"""FP8-only pipelines fall back to a vendored bf16 config on old GPUs."""