prain: span profiler with flame graphs (PRAIN_PROFILE: engine step, every model module, MoE route/plan/copy/round, call counts; python -m prain.profile); prain web --host

This commit is contained in:
2026-10-29 08:39:28 +01:00
parent bb42ea3802
commit 0f3911afb5
8 changed files with 444 additions and 32 deletions
+7
View File
@@ -61,6 +61,13 @@ class Cli(TmpCase):
main(["serve", config, "/models/m", "--", "--max-num-seqs=4"])
execvp.assert_not_called()
def test_web_binds_the_host_it_is_given(self):
with mock.patch("prain.web.serve") as web:
main(["web", "--port", "8081"])
self.assertEqual(web.call_args.kwargs["host"], "127.0.0.1")
main(["web", "--host", "0.0.0.0"])
self.assertEqual(web.call_args.kwargs["host"], "0.0.0.0")
def test_synth_sim_and_tune(self):
hf = self.write("config.json", json.dumps(GEMMA4))
trace = os.path.join(self.dir, "trace.jsonl.gz")