strata_bench: skip the agent session when the context is below ~10K instead of sending a request that fails with HTTP 400
This commit is contained in:
1 parent
885f9f7016
commit
cd78501359
2 files changed
+14
-1
No files matched your search
@@ -58,6 +58,7 @@ LONG_MAX_TOKENS = 24
|
||||
AGENT_MAX_TOKENS = 64
|
||||
AGENT_TURNS = 5
|
||||
AGENT_WORDS = 1500
|
||||
AGENT_MIN_CONTEXT = 10240 # the last turn of the session holds about 10K tokens
|
||||
BURST_MAX_TOKENS = 128
|
||||
|
||||
|
||||
@@ -337,6 +338,10 @@ class Suite:
|
||||
return turns
|
||||
|
||||
def run_agent(self):
|
||||
if self.ctx and self.ctx < AGENT_MIN_CONTEXT:
|
||||
self.out["skipped"]["agent"] = f"context {self.ctx} is below ~10K"
|
||||
self.log(f"agent: skipped: context {self.ctx} is below ~10K")
|
||||
return
|
||||
self.log(f"agent: a session of {AGENT_TURNS + 1} turns with four tools, x {self.runs} runs")
|
||||
sessions = []
|
||||
for run in range(self.runs):
|
||||
@@ -575,6 +580,7 @@ def collect_machine(base: str, key: str, cfg: dict | None) -> dict:
|
||||
n_ctx = None
|
||||
for d in models.get("data") or []:
|
||||
n_ctx = (d.get("meta") or {}).get("n_ctx") or n_ctx
|
||||
n_ctx = n_ctx or (props.get("default_generation_settings") or {}).get("n_ctx")
|
||||
return {
|
||||
"gpu": gpu_names, "gpu_vram_mib": vram_mib, "gpu_driver": (local["gpus"][0].get("driver") if local["gpus"] else local.get("rocm_driver")),
|
||||
"cuda": local.get("cuda"), "cpu": static.get("cpu_name") or cpu_name(), "cpu_cores": static.get("cores"),
|
||||
|
||||
@@ -147,7 +147,14 @@ class SuiteTests(unittest.TestCase):
|
||||
self.srv.ctx = 8192
|
||||
out = self.suite(ctx=8192, runs=1, want_long=True).run()
|
||||
self.assertIn("4K", out["prompts"])
|
||||
self.assertEqual(set(out["skipped"]), {"16K", "32K"})
|
||||
self.assertEqual(set(out["skipped"]), {"16K", "32K", "agent"})
|
||||
self.assertIn("below ~10K", out["skipped"]["agent"])
|
||||
self.assertEqual(out["agent"], {}) # no request was sent for the agent session
|
||||
|
||||
def test_agent_runs_when_the_context_fits_it(self):
|
||||
out = self.suite(ctx=16384, runs=1).run()
|
||||
self.assertNotIn("agent", out["skipped"])
|
||||
self.assertTrue(out["agent"]["sessions"])
|
||||
|
||||
def test_failures_are_reported_not_hidden(self):
|
||||
self.srv.fail_after = 3 # warm-up and calibration succeed, then every request fails
|
||||
|
||||
Reference in new issue
Block a user