tests: efficiency suite — tiny-model regression gates + full-model optimization dossier (#359)#360
Open
woolcoxm wants to merge 2 commits into
Open
tests: efficiency suite — tiny-model regression gates + full-model optimization dossier (#359)#360woolcoxm wants to merge 2 commits into
woolcoxm wants to merge 2 commits into
Conversation
…timization dossier Two layers of efficiency coverage for the engine, both parsing the telemetry glm.c already emits (REPLAY/PROFILE/[PROF]/CUDA-tier) but nothing previously asserted on: 1. test_inefficiency.py — tiny-model asserted regression tests (8 tests, run in make test via test-python). Gate on: throughput floor, PROFILE phase accounting sanity, disk-wait not dominant on a resident model, CPU greedy determinism, and (when a CUDA build is present) CUDA init, dense VRAM upload, and CPU-vs-CUDA argmax agreement >= 70%. CUDA tests auto-skip with a clear build hint on CPU-only binaries. 2. test_efficiency_report.py — opt-in optimization dossier for a real model. Turns on every instrumentation flag (PROF, COLI_CUDA_PROFILE, CACHE_ROUTE, DISK_SPLIT, LOOKA) and prints 9 sections (provenance, throughput + tail latency, where-time-goes, attention breakdown, expert cache, disk I/O + phase split, routing quality + predictability, speculation, GPU tiers), each flagging inefficiency with the concrete knob to move tok/s. Never fails CI. tools/efficiency.py is the shared harness: parse_run() captures every signal, run_engine() wraps the subprocess. Reuses PROFILE_RE/SPEED_RE from tools/benchmark_cuda_fixture.py and extends the tok/s regex to also catch the run_text (parenthesized) format the full-model PROMPT path uses. Makefile adds: efficiency / efficiency-cuda / efficiency-report targets. Verified end-to-end on the full glm52_i4_g64 model (CPU + CUDA).
…ustVugg#360) CI runs 'make check' = dependency-free tests, no model downloads (by design, JustVugg#140). glm_tiny/ is a gitignored generated fixture, so test_inefficiency.py hard-failed on the Windows/macOS/Linux runners with 'config.json: No such file or directory' instead of skipping. _engine_present() now requires BOTH glm.exe AND glm_tiny/config.json, and _skip_reason() names exactly which prerequisite is missing so the skip is actionable. Verified: 8 skipped (0 failed) with the fixture absent; 5 pass + 3 CUDA-skip with it present.
5 tasks
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.
Closes #359.
What this adds
Two layers of efficiency coverage, both parsing telemetry
glm.calready emits but nothing previously asserted on or surfaced:tests/test_inefficiency.py— 8 tiny-model asserted tests (run viamake test/test-pythondiscovery, ~0.15s/run onglm_tiny):tests/test_efficiency_report.py— opt-in optimization dossier for a real model. Turns on every instrumentation flag (PROF,COLI_CUDA_PROFILE,CACHE_ROUTE,DISK_SPLIT,LOOKA) and prints 9 sections — provenance, throughput + tail latency, where-time-goes, attention breakdown, expert cache, disk I/O + phase split, routing quality + predictability, speculation, GPU tiers — each flagging inefficiency with the concrete knob to move tok/s. Never fails CI.tools/efficiency.py— shared harness.parse_run()captures every telemetry signal;run_engine()wraps the subprocess. ReusesPROFILE_RE/SPEED_REfromtools/benchmark_cuda_fixture.pyand extends the tok/s regex to also match therun_text(parenthesized) format the full-model PROMPT path emits.Makefile —
efficiency/efficiency-cuda/efficiency-reporttargets.How to run
Verification
glm52_i4_g64(390 GB), CPU and CUDA: clean exit, no crash.Notes
make glm.exe CUDA_DLL=1+make cuda-dll). They auto-skip otherwise —make testis green on any CPU-only build.tools/efficiency.py, top oftest_efficiency_report.py), overridable via env. Documented intests/README_efficiency.md.