bench(inference): agentic workload (1000-ctx/100-resp) prefill measurement#187
Open
ohdearquant wants to merge 1 commit into
Open
bench(inference): agentic workload (1000-ctx/100-resp) prefill measurement#187ohdearquant wants to merge 1 commit into
ohdearquant wants to merge 1 commit into
Conversation
…ement Adds BENCH_PROMPT_TOKENS prompt-padding to bench_decode_ab so the Metal e2e path can be measured at arbitrary context depth, plus a lattice-vs- ollama-vs-MLX driver for the 1000-token-context / 100-token-response agentic workload. Surfaces the prefill gap (#185): lattice ingests the prompt one token at a time (99 tok/s prefill, 10.2s TTFT at 1000 ctx), making end-to-end ~7x slower than ollama and ~15x slower than MLX at this workload. Existing benches top out at 256-token context and miss it (#186). Refs #185, #186 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Reproducible scaffolding for #185 (prefill unbatched) and #186 (agentic bench tracking).
What
bench_decode_ab: newBENCH_PROMPT_TOKENSenv pads the prompt to a target token count, so the real Metal e2e path can be measured at arbitrary context depth (it was fixed at ~20 tokens).scripts/bench_compare_1k.py: lattice (viabench_decode_ab) vs ollama (/api/generate) vs MLX (mlx_lm) at 1000-ctx / 100-resp. Reports TTFT, decode, total, prefill & decode tok/s.docs/bench_results/agentic_1k_compare.json: this session's raw numbers.Why
Our benches top out at 256-token context and measure decode-only — they miss the workload that actually matters for agents (long context, short response). This harness surfaces the gap:
Prefill at 99 tok/s (one token at a time) = 10.2s TTFT = 87% of latency = ~7x slower than ollama end-to-end. Full analysis in #185.
Test
cargo build --release -p lattice-inference --bin bench_decode_ab --features "f16,metal-gpu" uv run python scripts/bench_compare_1k.pyclippy clean on the bench change; pre-commit (check + doc-lint) passed.
Refs #185, #186
🤖 Generated with Claude Code