[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-108020":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":15,"stars7d":17,"stars30d":18,"stars90d":16,"forks30d":16,"starsTrendScore":19,"compositeScore":20,"rankGlobal":10,"rankLanguage":10,"license":21,"archived":22,"fork":22,"defaultBranch":23,"hasWiki":24,"hasPages":22,"topics":25,"createdAt":10,"pushedAt":26,"updatedAt":27,"readmeContent":28,"aiSummary":29,"trendingCount":16,"starSnapshotCount":16,"syncStatus":15,"lastSyncTime":30,"discoverSource":31},108020,"SpecPilot","StargazerX0\u002FSpecPilot","StargazerX0","SpecPilot: Autonomous Algorithm Discovery and Systems Optimization for Speculative Decoding","",null,"Python",216,12,1,2,0,17,127,7,65.84,"Apache License 2.0",false,"main",true,[],"2026-11-16 22:04:47","2026-11-23 03:11:19","\u003Cp align=\"center\">\n  \u003Cpicture>\n    \u003Csource media=\"(prefers-color-scheme: dark)\" srcset=\"assets\u002Fwordmark_dark.png\">\n    \u003Csource media=\"(prefers-color-scheme: light)\" srcset=\"assets\u002Fwordmark_light.png\">\n    \u003Cimg src=\"assets\u002Fwordmark.png\" width=\"360\" alt=\"SpecPilot\">\n  \u003C\u002Fpicture>\n\u003C\u002Fp>\n\n\u003Ch3 align=\"center\">Autonomous Algorithm Discovery and Systems Optimization for Speculative Decoding\u003C\u002Fh3>\n\n\u003Cp align=\"center\">\n  \u003Ca href=\"https:\u002F\u002Farxiv.org\u002Fabs\u002F2611.02501\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FarXiv-2611.02501-b31b1b.svg\" alt=\"arXiv\">\u003C\u002Fa>\n  \u003Ca href=\"https:\u002F\u002Fstargazerx0.github.io\u002Fspecpilot-project-page\u002F\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FProject-Page-4285F4.svg\" alt=\"Project page\">\u003C\u002Fa>\n  \u003Ca href=\"#citation\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FCite-BibTeX-555555.svg\" alt=\"BibTeX\">\u003C\u002Fa>\n  \u003Ca href=\"LICENSE\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FLicense-Apache_2.0-green.svg\" alt=\"License\">\u003C\u002Fa>\n\u003C\u002Fp>\n\n\u003Cp align=\"center\">\n  \u003Cimg src=\"assets\u002Ffig1_speedup_wide.png\" width=\"100%\" alt=\"Speedup over AR decoding with one request for stock and SpecPilot in four settings\">\n  \u003Cbr>\n  \u003Cem>SpecPilot more than doubles stock's speedup in every setting, without training or quality loss.\u003C\u002Fem>\n\u003C\u002Fp>\n\nReleased speculative decoding systems leave much of their speed unused, and the best fix differs for every deployment.\nSpecPilot is an agentic loop that finds lossless optimizations for each one. This repository ships the engine SpecPilot\nfound for each of six deployments, with the scripts to serve, benchmark and verify them.\n\n## Overview\n\n\u003Cp align=\"center\">\n  \u003Cimg src=\"assets\u002Ffig_agent.png\" width=\"100%\" alt=\"One round of the SpecPilot loop\">\n\u003C\u002Fp>\n\nIn each round of the loop, a cost model locates the largest gaps between the current system and its ceiling. Parallel\nagents explore directions and integrate the successful ones, and a kernel sub-agent tunes the kernels furthest from their memory-bandwidth limit. Token\nforcing checks every output token against stock to catch outputs that drift from the target model. A structured memory\ncarries validated mechanisms to new rounds and deployments.\n\nHere *stock* is the released drafter system (DFlash2 or DSpark) without SpecPilot, served on the same engine. Every\nSpecPilot engine (*final*) is lossless: decoding is greedy and the target model decides every token. The\n[project page](https:\u002F\u002Fstargazerx0.github.io\u002Fspecpilot-project-page\u002F) has a 40-second overview video.\n\n## Results\n\nSpeedup over autoregressive decoding (AR) on the dev split first turns of gsm8k, humaneval, math500, mbpp and mt-bench\n(2048 new tokens, geometric mean of per-request speedups). τ is the number of tokens committed per verify step.\n\n| Deployment | GPU | Requests | Stock \u002F AR | SpecPilot \u002F AR | SpecPilot \u002F stock | τ: stock → SpecPilot |\n|---|---|---|:---:|:---:|:---:|:---:|\n| [Qwen3.8-27B + DFlash2](settings\u002Fh100_c1_qwen38-27b_dflash2) | H100 | 1 | 3.95× | **8.86×** | 2.24× | 4.65 → 13.08* |\n| [Qwen3.8-27B + DSpark](settings\u002Fh100_c1_qwen38-27b_dspark) | H100 | 1 | 3.74× | **9.41×** | 2.52× | 4.42 → 12.85* |\n| [Qwen3.8-27B + DFlash2](settings\u002Fpro6000_c1_qwen38-27b_dflash2) | RTX PRO 6000 | 1 | 4.46× | **10.87×** | 2.44× | 5.23 → 12.80* |\n| [Muse-Glimmer-30B + DFlash2](settings\u002Fpro6000_c1_muse-30b_dflash2) | RTX PRO 6000 | 1 | 4.69× | **10.63×** | 2.27× | 5.16 → 12.64* |\n| [Qwen3.8-27B FP8 + DFlash2](settings\u002Fh100_batch_qwen38-27b-fp8_dflash2) | H100 | 16, 20, 24 | 2.02× | **3.90×** | 1.93× | 4.56 → 5.39 |\n| [Qwen3.8-27B FP8 + DSpark](settings\u002Fh100_batch_qwen38-27b-fp8_dspark) | H100 | 16, 20, 24 | 1.94× | **3.93×** | 2.03× | 4.37 → 5.42 |\n\n\\* The single-request finals use two-level verification (TLV), and τ counts the tokens committed per exact pass, so it\ncan exceed the 16-token draft block.\n\nH100 is the H100 80GB SXM5 (sm_90). RTX PRO 6000 is the RTX PRO 6000 Blackwell Server Edition 96 GB (sm_120). Stock\nruns at the drafter's serving configuration. On the RTX PRO 6000 we re-tuned stock for the card (Qwen: block 12 with\ntriton attention; Muse: block 16 with flashinfer).\n\n### Reproduced from a fresh clone\n\nWe reproduced the four H100 settings from a fresh clone and a fresh environment with `scripts\u002Fserve.sh` and\n`scripts\u002Fbench.sh`, starting a fresh server for every run (stock and SpecPilot 2 runs each, AR 1 run). Brackets give\n95% bootstrap CIs.\n\n| Setting | Stock \u002F AR | SpecPilot \u002F AR | SpecPilot \u002F stock | τ: stock → SpecPilot |\n|---|:---:|:---:|:---:|:---:|\n| `h100_c1_qwen38-27b_dflash2` | 3.96× | 8.91× | 2.25× [2.18, 2.32] | 4.65 → 13.08 |\n| `h100_c1_qwen38-27b_dspark` | 3.77× | 9.48× | 2.52× [2.46, 2.58] | 4.42 → 12.85 |\n| `h100_batch_qwen38-27b-fp8_dflash2` | 2.05× | 3.96× | 1.94× [1.90, 1.98] | 4.57 → 5.34 |\n| `h100_batch_qwen38-27b-fp8_dspark` | 1.92× | 3.91× | 2.04× [2.00, 2.09] | 4.39 → 5.40 |\n\n\u003Cdetails>\n\u003Csummary>Benchmark scores of the same runs\u003C\u002Fsummary>\n\n\u003Cbr>\n\n`scripts\u002Fscore.py` grades gsm8k, humaneval, math500 and mbpp. On the single-request settings, AR, stock and SpecPilot\nall score 18\u002F24 (SpecPilot with DSpark 19\u002F24), identically on every repeat. On the batching settings SpecPilot scores\n167–172\u002F240 and stock 170–173\u002F240 (stock varies by 2 between its own runs). AR scores 177–178\u002F240 there, 2–3 points\nabove stock and SpecPilot alike. The 240 rows are 80 items run at three concurrency levels, and many answers are cut\nat 2048 tokens, so these scores are a sanity check and not an accuracy evaluation.\n\n\u003C\u002Fdetails>\n\n## Quick start\n\n```bash\n# 1. Python environment (Python 3.11, torch 2.13 + CUDA 13.0, locked packages; once per machine)\nbash scripts\u002Fsetup_env.sh\n\n# 2. Checkpoints of one setting (or: all)\nbash scripts\u002Fdownload_models.sh h100_c1_qwen38-27b_dflash2\n\n# 3. Start a server on GPU 0 (port 30000): final (SpecPilot), stock or ar\nbash scripts\u002Fserve.sh h100_c1_qwen38-27b_dflash2 final 0\n\n# 4. Speed benchmark, then stop the server\nbash scripts\u002Fbench.sh h100_c1_qwen38-27b_dflash2 final-1 0\nbash scripts\u002Fstop.sh 30000\n\n# 5. Repeat steps 3-4 for stock and ar, then compare and score\ncd ~\u002Fspecpilot_data\u002Fwork\u002Fbench\npython3 ~\u002FSpecPilot\u002Fscripts\u002Fcompare.py speed --ar ar-1.json --stock stock-1.json --final final-1.json\npython3 ~\u002FSpecPilot\u002Fscripts\u002Fscore.py final-1.json stock-1.json\n```\n\nThe setting names are the folder names in [`settings\u002F`](settings). Data goes under `SPECPILOT_DATA` (default\n`~\u002Fspecpilot_data`): `shared\u002F` holds the venv, checkpoints and build caches, and `work\u002F` holds the assembled engines,\nserver logs and benchmark results. The servers speak the SGLang HTTP and OpenAI-compatible APIs on\n`127.0.0.1:\u003Cport>`.\n\n> [!IMPORTANT]\n> **Warm up once.** The first boot of each engine compiles its CUDA, Triton and DeepGEMM kernels into a shared cache,\n> and some kernels compile on first use. On a fresh install the first measured pass is slower (the batching finals ran\n> 10–15% slow at 16 requests on our first run), so run each benchmark once before measuring.\n\n## Models\n\nAll checkpoints are public on Hugging Face. Every measurement used the pinned revision below, and\n`scripts\u002Fdownload_models.sh` downloads exactly these.\n\n| Model | Used by | Revision |\n|---|---|---|\n| [Qwen\u002FQwen3.8-27B](https:\u002F\u002Fhuggingface.co\u002FQwen\u002FQwen3.8-27B) | single-request Qwen settings | `1d4bf0f2ff6012fd82039f2fa52739d0dd7c60c0` |\n| [Qwen\u002FQwen3.8-27B-FP8](https:\u002F\u002Fhuggingface.co\u002FQwen\u002FQwen3.8-27B-FP8) | batching settings | `017b9c7af6b5689d5dd426a76e0bc077eb5ca20a` |\n| [z-lab\u002FQwen3.8-27B-DFlash2](https:\u002F\u002Fhuggingface.co\u002Fz-lab\u002FQwen3.8-27B-DFlash2) | Qwen + DFlash2 settings | `50307d4c4cde6860d4eee73e2547cd786fe8e8a4` |\n| [RadixArk\u002FQwen3.8-27B-DSpark](https:\u002F\u002Fhuggingface.co\u002FRadixArk\u002FQwen3.8-27B-DSpark) | Qwen + DSpark settings | `b9a5dbdf03bc999c6c73c426b19c2d9041cea393` |\n| [meta-models\u002FMuse-Glimmer-30B](https:\u002F\u002Fhuggingface.co\u002Fmeta-models\u002FMuse-Glimmer-30B) | Muse setting | `a4e59da52a7bc87ae7251dd5545c0dd437c44b68` |\n| [incoai\u002FMuse-Glimmer-30B-DFlash2](https:\u002F\u002Fhuggingface.co\u002Fincoai\u002FMuse-Glimmer-30B-DFlash2) | Muse setting | `8336acb8dc9b8bf9c25f12d7785ee6df26703119` |\n\n## What the finals contain\n\nEach setting's README lists its final's mechanisms in full. The main ones:\n\n| Setting | Main mechanisms |\n|---|---|\n| `h100_c1_qwen38-27b_dflash2` | W12 weights, TLV on the nested 8-bit view of W12, 32-node tree verify, certified exact-argmax LM head |\n| `h100_c1_qwen38-27b_dspark` | DSpark adapter, Markov-conditioned draft tree over a union candidate lattice, TLV with an INT6 copy, the target-side stack of the DFlash2 final |\n| `pro6000_c1_qwen38-27b_dflash2` | W12 on `mma.sync` for sm_120, tree verify on triton attention, TLV with a scaled INT6\u002FINT8 copy, L2 weight prefetch |\n| `pro6000_c1_muse-30b_dflash2` | W12 on sm_120, TLV with a scaled INT6\u002FINT8 copy, top-32 tree verify, L2 weight prefetch |\n| `h100_batch_qwen38-27b-fp8_dflash2` | ragged draft trees with a tiered verify budget, FP8 GEMM routing, segment admission of prompts, per-request drafter block length |\n| `h100_batch_qwen38-27b-fp8_dspark` | the DFlash2 batching final's target-side mechanisms, batched union-candidate lattice builder |\n\n### W12: a lossless 12-bit weight format\n\n\u003Cp align=\"center\">\n  \u003Cimg src=\"assets\u002Ffig3_w12.png\" width=\"100%\" alt=\"W12 format: a BF16 weight split into three 4-bit planes, decoded in registers inside the GEMM\">\n\u003C\u002Fp>\n\nThe four single-request finals stream the target's BF16 weights in W12, at 12.01–12.02 bits per weight on dense\nmodels. Every weight decodes bit-exactly, in registers inside the GEMM. On its own, W12 makes plain BF16 decoding\n1.15–1.26× faster on dense 8–30B models at batch 1–32. It beats cuBLAS BF16 up to 64 rows per GEMM (H100: on the\nlarge projections; RTX PRO 6000: on every projection).\n\n## Evaluation\n\n- **`scripts\u002Fbench.sh`** runs the paper's workload: first turns of the dev split (20 items per dataset, the prompt\n  formats of the DFlash evaluation), greedy, 2048 new tokens. Single-request settings run at concurrency 1 on the\n  first 6 items per dataset (`ITEMS=20` for all). Batching settings run closed loop at 16, 20 and 24 concurrent\n  requests over all 100 items. It records per-request tokens, latency, verify steps, output ids and text.\n- **`scripts\u002Fcompare.py speed`** reports speedups (geometric mean of per-request rate ratios, 95% bootstrap CI), τ and\n  output identity, overall and per dataset as in the paper's tables.\n- **`scripts\u002Fscore.py`** grades a bench run. gsm8k and math500 use the last `\\boxed{}`. humaneval and mbpp run the last\n  code block against the dataset tests in a sandboxed subprocess. mt-bench is not graded.\n\nOutputs are not bitwise identical to AR for any speculative decoder here, stock included. Verify-time batched GEMMs\nand attention reduce in a different order than single-token decoding, so near-ties can flip. We accepted each final\nonly after a token-level check that every committed token is the target's own choice at that position.\n\n## How the engines are built\n\nOne stock engine ships in this repository: an SGLang tree pruned to the paths these settings use (`python\u002F`) and the\nexperiment plugin (`research\u002Fdflash_lab\u002F`). The DSpark settings add the DSpark modules in `overlays\u002Fdspark_stock\u002F`.\n\nA final is the stock tree with its setting's `files\u002F` copied on top (no final deletes a file), plus the configuration\nin `settings\u002F\u003Csetting>\u002Fconfig.json`: the `SPECPILOT_*` environment switches (`final.env`), the verify width\n(`final.block_size`) and extra server arguments (`final.launch_args`).\n\n`scripts\u002Fbuild_engine.py \u003Csetting> {stock,final} \u003Cdir>` assembles a tree and prints its content hash.\n`scripts\u002Fserve.sh` does this on first use and starts every server with a `PYTHONPATH` that holds only that tree.\n\n## Repository layout\n\n```\nsettings\u002F\u003Csetting>\u002F       README.md, config.json (models, stock and final configuration, paper numbers), files\u002F\npython\u002F                   stock engine (pruned SGLang)\noverlays\u002Fdspark_stock\u002F    DSpark modules added to the stock engine for the DSpark settings\nresearch\u002Fenv.sh           environment (paths, CUDA compat, caches); requirements.lock.txt: exact packages\nresearch\u002Fscripts\u002F         server launchers: launch.sh, serve.sh, stop.sh, wait_ready.sh, protocol_env.py\nresearch\u002Fbench\u002F           bench.py (closed-loop client), grade.py, splits\u002Fdev (manifest.json: dataset revisions)\nscripts\u002F                  setup_env.sh, download_models.sh, build_engine.py, serve.sh, bench.sh, stop.sh,\n                          compare.py, score.py\nassets\u002F                   figures for this README\n```\n\n## Notes\n\n- **Hardware.** Every setting runs on one GPU of the listed type. The CUDA kernels of the RTX PRO 6000 finals are built\n  for sm_120a only, and the H100 finals were measured on H100 only.\n- **Driver.** torch 2.13 + CUDA 13.0 needs an R580 driver. On older drivers `setup_env.sh` installs NVIDIA's\n  forward-compat libcuda and `research\u002Fenv.sh` puts it on `LD_LIBRARY_PATH` (our H100s ran R550 this way).\n- **Muse.** The Muse chat template writes the current date into the system prompt, so run all arms of a comparison\n  within one UTC day.\n\n## Citation\n\n```bibtex\n@misc{li2026specpilot,\n  title         = {SpecPilot: Autonomous Algorithm Discovery and Systems\n                   Optimization for Speculative Decoding},\n  author        = {Li, Kunjun and Chai, Wenhao and Liang, Yihao and Hu, Yuezhou\n                   and Xu, Shuyao and Pan, Yi and Zheng, William X.\n                   and Ramchandran, Kannan and Keutzer, Kurt and Jiao, Jiantao},\n  year          = {2026},\n  eprint        = {2611.02501},\n  archivePrefix = {arXiv},\n  primaryClass  = {cs.LG},\n  url           = {https:\u002F\u002Farxiv.org\u002Fabs\u002F2611.02501}\n}\n```\n\n## License\n\nApache License 2.0; see [`LICENSE`](LICENSE). `python\u002F` is derived from [SGLang](https:\u002F\u002Fgithub.com\u002Fsgl-project\u002Fsglang).\n","SpecPilot 是一个面向推测解码（Speculative Decoding）的自动化算法发现与系统优化框架。它通过基于成本建模、并行智能体探索和内核级调优的闭环机制，为不同部署环境（如不同模型+草案器组合）自动发现零损失、高性能的优化策略，在不牺牲生成质量的前提下显著提升推理吞吐量。项目已验证在 Qwen3.8-27B 等大模型搭配 DFlash2\u002FDSpark 草案器的场景下，相较基线提速超 2 倍。适用于需要低延迟、高吞吐且严格保证输出一致性的 LLM 推理服务部署场景。","2026-11-24 04:33:18","CREATED_QUERY"]