改动 / #3247
#3247 [Benchmark] NCM feasibility study: stop/document, no engine change
open · @toel1234 · 0 评论 · 去 GitHub 看
BenchmarksSetup & installServer & APIAMD / HIPNVIDIA / CUDAModels & quantsDocumentationWindowsLinux
说明
## Problem and result NCM (HazyResearch) generates many tokens per pass. The question was whether it could be a faster draft source for Strata's speculative decoding. Result: not now. No released NCM checkpoint drafts in the target's token IDs, so no NCM acceptance could be measured. This PR records the study, its numbers and its limits. Strata's behaviour does not change. Measured on RTX 5070 (12 GB), Ryzen 9 7900X, Linux, existing engine 0.1.45 binary, checkout e88ee39d: - NCM TinyStories checkpoint, standalone: 40.504 ms median for 128 TinyStories BPE tokens (FP32, batch 1, 20 runs). - Swift 1.5 IQ2_XS, 64 greedy tokens, single runs: MTP only 19.58 / 19.01 tok/s, default lookup 20.15 / 18.79 (prose / code). Perfect 8-token oracle drafts: 38.18 / 30.59. All outputs matched their greedy reference. - Routed expert union per layer, 4 / 8-token windows: 25.4 / 40.8 (prose), 27.7 / 45.0 (code). - Calculated, not measured: an NCM drafter would need conditional acceptance of about 0.83 to 0.96 to beat the baseline. ## Related discussion none. Research and benchmark report only; no feature, refactor or default change. ## Approach - `docs/NCM.md`: plain summary, source review, measurements, break-even model, validation, decision. - `docs/benchmarks/ncm-2026-10-19-rtx5070/`: raw files (probe JSON, results.json, every engine argument list, stdout/stderr, prompt and oracle IDs, Terminal test log). Local paths rewritten to `$STRATA`, `$DATA`, `$OUT`. Routing traces (1.1 MB) not included; SHA-256 recorded. - `tools/ncm_probe.py`: standalone NCM probe and a break-even calculator (no PyTorch needed for the calculator). - `tools/ncm_target_bench.py`: the target pilot driver, with paths as arguments. ## Validation **Passed:** - Ten engine runs (two prompts × MTP, default, greedy reference, oracle 4, oracle 8) exited 0; all 64-token outputs equal to the greedy reference. Data in `docs/benchmarks/ncm-2026-10-19-rtx5070/target/results.json`. - Standalone probe, 3 warm-up + 20 measured generations, checkpoint SHA-256 values in the doc. - `tools/ncm_target_bench.py` rebuilds the same ten argument lists as the recorded `*.command.json` and recomputes the same routing unions from the original traces (checked without running the engine again). - `python3 -I tools/ncm_probe.py --break-even --window 4 --baseline-tps 80 --verify-ms 30 --draft-ms 5` gives the threshold in the doc. JSON files parse; all relative links in the new docs resolve. - `git diff --exit-code -- src include serve strata_cli strata_control apps requirements.txt requirements-monitor.txt` returned 0. **Failed:** - `python -m pytest tests/terminal -q` on e88ee39d (before this change, no Terminal code touched): 834 passed, 18 failed, 17 skipped. Log: `docs/benchmarks/ncm-2026-10-19-rtx5070/terminal-tests.log`. Not diagnosed here. **Not run:** - CUDA/HIP/SYCL/Metal builds: no engine code changed. - NCM acceptance against the target, retokenization, shared-VRAM residency, 16-token windows (`kVerifyMaxT = 8`), repeated or interleaved runs, the full benchmark protocol. ## Limits Single short runs on one machine, diagnostic settings (context 4096, KV residency 0, mapped experts), not the saved production configuration. No speedup is claimed. The oracle rows are an upper bound for an 8-token drafter in this setup, not a result for NCM. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
本站相关内容
相关页面的快捷入口。