From 7a7dca313750ee75e0f8a2a5442ca5d78e743294 Mon Sep 17 00:00:00 2001 From: historia Date: Wed, 2 Sep 2026 20:46:42 -0400 Subject: feat: reserve 20% vram when running higgs with sglang-omni --- app/tests/test_backends_sglomni.py | 30 ++++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) (limited to 'app/tests/test_backends_sglomni.py') 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.""" -- cgit v1.2.3