[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-115353":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":14,"stars7d":17,"stars30d":17,"stars90d":16,"forks30d":16,"starsTrendScore":18,"compositeScore":19,"rankGlobal":10,"rankLanguage":10,"license":20,"archived":21,"fork":21,"defaultBranch":22,"hasWiki":21,"hasPages":21,"topics":23,"createdAt":10,"pushedAt":36,"updatedAt":37,"readmeContent":38,"aiSummary":39,"trendingCount":16,"starSnapshotCount":16,"syncStatus":17,"lastSyncTime":40,"discoverSource":41},115353,"ASpec","inclusionAI\u002FASpec","inclusionAI","A high-throughput training framework for Speculative decoding models.","https:\u002F\u002Fgithub.com\u002FinclusionAI\u002FASpec",null,"Python",59,8,1,18,0,2,3,46.06,"Apache License 2.0",false,"main",[24,25,26,27,28,29,30,31,32,33,34,35],"dflash","dflash2","dspark","eagle3","eagle4","ling-3","ling-3-flash","llm","mooncake","pytorch","sglang","speculative-decoding","2026-11-23 11:00:35","2026-11-23 03:50:39","# ASpec\n\n[中文概览](README_zh-CN.md) · [Documentation](docs\u002FREADME.md) · [Roadmap](ROADMAP.md) · [Quickstart](docs\u002Fuser-guide\u002Fquickstart.md)\n\n**Faster draft training. More room to experiment.**\n\nASpec is a high-throughput training framework for speculative decoding draft models. It optimizes\nDraft forward, backward and optimizer execution, overlaps training with Target feature generation,\nand shares compatible Target features across independent experiments.\n\nASpec is developed from the [TorchSpec](https:\u002F\u002Fgithub.com\u002Flightseekorg\u002FTorchSpec) codebase,\nbuilding on its training infrastructure with further execution and workflow optimizations.\n\nUse one workflow to explore algorithms and model structures, train at long context, compare\nindependent experiments, and take a checkpoint through evaluation and export.\n\n![ASpec architecture: asynchronous Target feature generation, GPU tensor transport, and independent Draft experiments sharing compatible features.](docs\u002Fassets\u002Farchitecture.svg)\n\n## Why ASpec?\n\n- **Speed up Draft training itself.** Optimized attention, fused kernels and selective head\u002Floss\n  computation reduce the work and memory traffic in each forward and backward pass.\n- **Keep the training pipeline moving.** Overlap Target feature generation with Draft training,\n  move features through a GPU tensor data path, and schedule training by useful work.\n- **One Target, multiple concurrent Draft experiments.** Compare algorithms, structures or\n  hyperparameters while generating compatible Target features once. Each Draft keeps its own\n  weights, optimizer, progress and checkpoints, without a shared optimizer-step barrier.\n  See [shared Target training](docs\u002Fuser-guide\u002Fsharing.md) and the\n  [comparison and recovery walkthrough](examples\u002Fqwen3-8b-shared-target\u002FREADME.md).\n- **Make long-context training practical.** Combine sequence packing, context parallelism and\n  optimized attention execution to reduce padding waste and distribute long sequences across GPUs.\n- **Explore without rebuilding the workflow.** Switch between algorithm and model recipes with\n  consistent configuration, reporting, recovery, evaluation and export.\n\n## Choose your Draft\n\nChoose the algorithm and model structure for your workload. Draft and Target models can have\ndifferent architectures:\n\n| Dimension | Implemented choices |\n| --- | --- |\n| Draft algorithm | DSpark, DFlash, EAGLE3, EAGLE4, native MTP; experimental DFlash2 |\n| FFN and routing | Dense, Qwen MoE, Ling MoE |\n| Attention structure | MHA\u002FGQA, materialized MLA, sliding-window attention (SWA), CSA, QSA, DSA |\n| Execution | Sequence packing, context parallelism, shared Target features, static multi-node training |\n\nSee [algorithm details](docs\u002Fuser-guide\u002Falgorithms.md) and [structure stages](docs\u002Fuser-guide\u002Fstructures.md)\nfor the supported combinations, training phases and export formats.\nDSpark\u002FDFlash with Qwen and Ling are the main optimization and recipe priorities; other implemented\npaths have explicit support boundaries, and DFlash2 remains experimental.\n\nScale from a first multi-GPU run to static multi-node training, with NVLink, TCP and RDMA data paths.\nCheck [supported paths and limitations](docs\u002Fsupport.md), then browse the [recipes](docs\u002Fuser-guide\u002Frecipes.md) for starting points.\n\n## Installation\n\nIn an activated Linux virtual environment:\n\n```bash\npip install ling-aspec\n```\n\nThis installs the Draft training environment. In a **separate Target virtual environment**, install\nthe SGLang integration and apply its patch:\n\n```bash\npip install ling-aspec-target\naspec patch-sglang\nCUDA_VISIBLE_DEVICES=0 aspec target\n```\n\nKeep the Target service running, then start training in the Draft environment below.\nThe default connection is `http:\u002F\u002F127.0.0.1:30000`; set `inference.target_service.address`\nfor a remote Target. Each command uses its own environment.\nSelect the allocated GPUs separately for each role; this example uses GPU 0 for Target and GPU 1 for Draft.\n\nSee the [installation guide](docs\u002Fuser-guide\u002Finstallation.md) for prerequisites, source installation\nand release wheels, or use the [container setup](docs\u002Fuser-guide\u002Fcontainers.md).\nOptionally run `aspec doctor` to check the environment.\n\n## Quickstart\n\nWith two NVLink-connected GPUs:\n\n```bash\nCUDA_VISIBLE_DEVICES=1 aspec quickstart ling-tiny --output outputs\u002Fling-tiny-001\n# Or choose Qwen3-8B:\nCUDA_VISIBLE_DEVICES=1 aspec quickstart qwen3-8b --output outputs\u002Fqwen3-8b-001\n```\n\nBoth profiles use bundled raw conversations, their own tokenizer\u002Ftemplate and an eight-step\ntrain\u002Fresume\u002Fnative-export check. Add `--target \u002Fabsolute\u002Fpath\u002Fto\u002Fmodel` to use a local checkpoint.\nSee [Quickstart](docs\u002Fuser-guide\u002Fquickstart.md) for the full workflow, then choose a\n[training recipe](docs\u002Fuser-guide\u002Frecipes.md) and [prepare your data](docs\u002Fuser-guide\u002Fdata.md).\nFor training with Target-generated data and held-out evaluation, continue with the\n[Qwen3-8B DSpark recipe](docs\u002Fuser-guide\u002Frecipes.md#qwen3-8b-dspark-quality-recipe).\n\nAdditional workflows cover [offline feature generation and replay](examples\u002Fqwen3-8b-offline\u002FREADME.md)\nand [DSA dense → indexer → sparse training](examples\u002Fqwen3-8b-dsa\u002FREADME.md).\n\n## Performance\n\nASpec improves both Draft execution and the complete online training pipeline. The\n[DSpark comparison](docs\u002Fbenchmarks\u002Fresults.md) measures Qwen3-8B, Qwen3.5-9B and Qwen3.8-27B\non Hopper GPUs at short and long context. A representative Qwen3-8B \u002F 4K result:\n\n| Measurement | ASpec input tokens\u002Fs | \u002F TorchSpec | \u002F SpecForge | \u002F AngelSpec |\n| --- | ---: | ---: | ---: | ---: |\n| Draft-only, 1 GPU | 15,256.44 | 1.96× | 2.07× | 2.48× |\n| Online steady window, 8 GPUs | 77,721.37 | 2.28× | 2.50× | 2.68× |\n\nThe comparison uses one original document per Draft rank and microstep (MBS1), aligned per-document\nanchor budgets and logical batch sizes, normal interconnects and sufficient buffers. Draft-only\nexcludes Target execution, transport and feature loading; the online steady window includes them\nafter warmup update eight. These are training input rates, not inference speedups or time to a given\nmodel quality. The full matrix reports software stacks, GPU splits and complete-loop rates separately.\n\nA separate [fixed-sequence Qwen3-8B \u002F CP1 study](docs\u002Fbenchmarks\u002Fdspark-alignment.md) compares\ntraining quality: BSHD validation CE stays close to TorchSpec; measured mean accepted length\n(tokens per verification round, including the Target bonus token) is\n3.665717 for TorchSpec, 3.691665 for ASpec BSHD and 3.746300 for ASpec THD. With deterministic\ninference enabled, all three match Target-only greedy output token IDs on 256 questions across\nthree repeats. These findings cover that training sequence and evaluation configuration.\n\nFor your own training run, see [DSpark performance settings](docs\u002Fuser-guide\u002Frecipes.md#dspark-performance-settings)\nfor cuDNN attention and direct-prefill options. Resource splits depend on the workload.\n\nSee [benchmark results and methodology](docs\u002Fuser-guide\u002Fbenchmarks.md) for measured workloads and\nreproducible comparisons. To assess the drafts you train, use the\n[evaluation and export guide](docs\u002Fuser-guide\u002Fevaluation.md) for held-out metrics, acceptance and\ndownstream validation.\n\n## Learn more\n\n- [Configuration](docs\u002Fuser-guide\u002Fconfiguration.md) · [Training and recovery](docs\u002Fuser-guide\u002Ftraining.md)\n- [Evaluation and export](docs\u002Fuser-guide\u002Fevaluation.md) · [Troubleshooting](docs\u002Fuser-guide\u002Ftroubleshooting.md)\n- [Contributing](CONTRIBUTING.md) · [Security](SECURITY.md)\n- [Architecture](docs\u002Fframework\u002FARCHITECTURE.md) · [Project roadmap and status](ROADMAP.md)\n- [Supported paths](docs\u002Fsupport.md) · [Contributor validation](docs\u002Fcontributing\u002Fvalidation.md)\n\n## Citation\n\nIf you find ASpec useful, please consider citing it:\n\n```bibtex\n@misc{aspec2026,\n  author = {Zhou, Aihui and Long, Lingkun and Yu, Chaofan and\n            Yang, Zhe and Peng, Cunyin and Zhang, Zhiqiang and Zhou, Jun},\n  title = {{ASpec}: A High-Throughput Training Framework for Speculative Decoding},\n  year = {2026},\n  url = {https:\u002F\u002Fgithub.com\u002FinclusionAI\u002FASpec}\n}\n```\n\nCitation metadata is available in [CITATION.cff](CITATION.cff).\n\n## License\n\nASpec is licensed under [Apache 2.0](LICENSE). Third-party material retains its own licenses\nand notices; see the source headers and [license texts](licenses\u002F). Model and dataset licenses\nare separate.\n\n## Acknowledgements\n\nWe thank [TorchSpec](https:\u002F\u002Fgithub.com\u002Flightseekorg\u002FTorchSpec),\n[AngelSpec](https:\u002F\u002Fgithub.com\u002FTencent\u002FAngelSpec), and\n[SpecForge](https:\u002F\u002Fgithub.com\u002Fsgl-project\u002FSpecForge) for their contributions to the speculative\ndecoding training ecosystem.\n","ASpec 是一个面向推测解码（Speculative Decoding）草案模型的高吞吐量训练框架。它通过优化草案模型的前向\u002F反向传播与优化器执行、重叠目标模型特征生成与草案训练、以及在多个独立实验间共享兼容的目标特征，显著提升训练效率。技术上支持序列打包、上下文并行、融合算子、选择性头计算与损失裁剪，并原生适配多种草案算法（如DSpark、DFlash、EAGLE3\u002F4）及混合架构（Qwen\u002FLing MoE、MLA、SWA等）。适用于需要快速迭代草案模型结构、算法或超参的大语言模型推理加速研发场景，尤其适合长上下文下的高效训练与多方案对比实验。","2026-11-24 04:50:45","CREATED_QUERY"]