mirror of
https://github.com/mw00/project-maya.git
synced 2026-12-03 19:04:50 +07:00
[PR #406] tools/agent_bench.py: a benchmark shaped like coding agents - several long conversations at once against a running server #514
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
mw00/project-maya#514
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/mw00/project-maya/pull/406
Author: @somnergy
Created: 10/23/2026
Status: 🔄 Open
Base:
main← Head:pr/agent-bench📝 Commits (1)
084249etools/agent_bench.py: a benchmark shaped like coding agents, several conversations at once against a running server📊 Changes
4 files changed (+842 additions, -2 deletions)
View changed files
📝
CONTRIBUTING.md(+5 -2)➕
docs/AGENT_BENCH.md(+79 -0)➕
tools/agent_bench.py(+518 -0)➕
tools/test_agent_bench.py(+240 -0)📄 Description
Summary
./maya.sh --benchanswers "how fast is one request on this PC": three short questions and two cold prompt reads, one at a time. Coding agents load a server differently - several long conversations at once, each turn appending a tool result or a message to an ever longer history - and the settings that only matter under that load (--parallel, the expert tiers, the batched decode, reading a prompt between decode steps, a system prompt kept for the next conversation) show nothing in--bench.This adds
tools/agent_bench.py, a scripted agent workload against a running server, fixed by--seedso two settings, two builds or two machines get exactly the same requests:--clientsconversations at once (default 4) sharing a few long system prompts (30K / 8K / 4K tokens), then turns of new text (64 tokens to 64K, 80% under 2K) asking for 32-1024-token answers, with 2-20 s think time between an answer and the next turn;--burst-clients 0for none), and compaction when a conversation outgrows--max-context;--ban autoknows GLM-5.3-Flash by the served model's name), so every run writes the same tokens.Requests are streamed and timed by the client, so it works against any OpenAI-compatible server. It reports aggregate output tokens/s, requests in flight, per-request decode (first token to last, what an agent sees), time to first token, latency (median and p90), decode by context length and reads by new tokens (the server's
timingswhen it sends them). Against a Maya server it adds each request's VRAM hit and the expert tiers' readings fromGET /metrics.compareprints mean +- sd per label and marks differences beyond twice their standard error.Standard library only.
docs/AGENT_BENCH.mddescribes the workload and how to read it;CONTRIBUTING.mdpoints speed reports and pull requests for several conversations at it.Example
One run, to show the output (not an A/B): 2x NVIDIA RTX PRO 5000 72GB Blackwell (PCIe 5.0 x8 each, no P2P), Intel Core Ultra 9 285K (24 cores), 96 GB DDR5, driver 615.71.09, CUDA 13.4; GLM-5.3-Flash Maya-L (IQ3_S / IQ4_XS experts, ~85% in VRAM, the rest pinned in RAM with the CPU lane),
--parallel 8,--max-context 524288.python tools/agent_bench.py run --clients 4 --duration 600 --warmup 120against a server that had already served other conversations for 35 minutes (so its caches were warm; an A/B starts a fresh server per run):The p10 decode (half the median) is what a conversation gets while another one's prompt is being read; a one-request benchmark cannot show it. With the same workload on the same machine (the server-side replay from the closed #389, fresh server per run, no cold bursts), MTP drafting in the batched steps (#385's
MAYA_GLM_MULTI_MTP=1, here with a local change that lends the draft layer's VRAM to the trunk while drafting is off) moved the per-request decode median by +4% at 4 conversations (drafting windows only at 2 or fewer running,MAYA_GLM_MULTI_MTP_MAX=2) and by -17% at 8 (the defaultMAYA_GLM_MULTI_MTP_MAX=4; one run each, run-to-run spread 2-3%) - a sign flip that only a multi-conversation run shows.Tests
tools/test_agent_bench.py(picked up by the tools job): the plan is the same for a seed and differs for another; sizes and schedule; texts are fixed and a restart shares only the system prompt; compaction; the summary's window, rates, bins and in-flight count; server read times preferred over time to first token; errors counted, not measured; the comparison's marks; the end-token choice; and two short runs against a fake streaming server, with and without/metrics. 14 tests, ~7 s, no GPU.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.