Inkling-2-Mini DGX Spark recipe + t5a DFlash2 drafter (package 1741ea3c)
Browse filesThis view is limited to 50 files because it contains too many changes. See raw diff
Files changed (50)
- LICENSEAdded+201
- NOTICEAdded+20
- README.mdAdded+179
- SHA256SUMSAdded
- THIRD_PARTY_NOTICES.mdAdded+38
- drafter-mix/BUILT_FROMAdded+1
- drafter-mix/Inkling-2-Mini-DFlash2-mix.safetensorsAdded+3
- drafter-mix/LICENSEAdded+201
- drafter-mix/NOTICEAdded+22
- drafter-mix/SHA256SUMSAdded+1
- drafter/LICENSEAdded+201
- drafter/NOTICEAdded+29
- drafter/README.mdAdded+7
- drafter/SHA256SUMSAdded+2
- drafter/config.jsonAdded+68
- drafter/model.safetensorsAdded+3
- licenses/CUTLASS-LICENSE.txtAdded+34
- licenses/FLASH-ATTENTION-LICENSE.txtAdded+29
- recipe/README.mdAdded+52
- recipe/RELEASE_NOTES.mdAdded+40
- recipe/base-1fb4134b.sha256Added+12
- recipe/profiles/agentic.rowAdded+1
- recipe/profiles/long.rowAdded+1
- recipe/serve.shAdded+71
- recipe/stack/SHA256SUMSAdded+775
- recipe/stack/cands/n292-v2-v297-pk3c/recipe/CREDITS.mdAdded+94
- recipe/stack/cands/n292-v2-v297-pk3c/recipe/LICENSEAdded+21
- recipe/stack/cands/n292-v2-v297-pk3c/recipe/NOTICEAdded+54
- recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_attn/CREDITS.knapcio-v2.9.3.mdAdded+94
- recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_attn/LICENSE.knapcio-v2.9.3Added+21
- recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_attn/NOTICE.knapcio-v2.9.3Added+54
- recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_attn/README.mdAdded+164
- recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_attn/__init__.pyAdded+170
- recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_attn/_hook.pyAdded+83
- recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_attn/build.pyAdded+102
- recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_attn/csrc/attn_kernel.cuhAdded+555
- recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_attn/csrc/inkling_attn_ext.cuAdded+326
- recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_attn/ops.pyAdded+76
- recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_attn/patch.pyAdded+562
- recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_attn/tests/test_install.pyAdded+54
- recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_attn/tests/test_w8split_cpu.pyAdded+118
- recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_cert/README.mdAdded+197
- recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_cert/__init__.pyAdded+172
- recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_cert/_hook.pyAdded+78
- recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_cert/build.pyAdded+102
- recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_cert/cert_math.pyAdded+163
- recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_cert/certwide.pyAdded+140
- recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_cert/certwide_math.pyAdded+74
- recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_cert/certwide_reduce.pyAdded+68
- recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_cert/csrc/cert_ext.cuAdded+549
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201 Apache License Version 2.0, January 2004 http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.
"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:
(a) You must give any other recipients of the Work or Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License.
You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.1234567891011121314151617181920Inkling-2-Mini on one NVIDIA DGX Spark: SGLang serving recipe and the t5a DFlash2 draft modelCopyright 2026 Diffbot
Licensed under the Apache License, Version 2.0 (the "License"); you may not use the files of this repository except incompliance with the License and with the licenses of the third-party components listed in THIRD_PARTY_NOTICES.md.You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 (also in the file LICENSE).
This repository contains:- drafter/ and drafter-mix/: a draft model for speculative decoding of thinkingmachines/Inkling-2-Mini, fine-tuned by us from Inkling-2-Mini-DFlash2-Global (L13) (Copyright 2026 Cameron Basham, Apache License 2.0), which is derived from Inco AI's Inkling-2-Mini-DFlash2 (incoai/Inkling-2-Mini-DFlash2, Apache License 2.0) and designed for Thinking Machines Lab's Inkling-2-Mini (thinkingmachines/Inkling-2-Mini, Apache License 2.0). The NOTICE files in drafter/ and drafter-mix/ state the changes we made.- recipe/: launch scripts, profiles and tests written by us (Apache License 2.0), and recipe/stack/, the frozen serving stack: code that runs inside the SGLang container (sgl-project/sglang, Apache License 2.0). Parts of recipe/stack/ are third-party code under the MIT, BSD-3-Clause and Apache-2.0 licenses, kept with their own license and notice files; THIRD_PARTY_NOTICES.md lists them.
The base model weights (thinkingmachines/Inkling-2-Mini) and the SGLang container image are not part of this repository;recipe/serve.sh uses them as published.123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179---license: apache-2.0base_model: thinkingmachines/Inkling-2-Minipipeline_tag: text-generationtags:- inkling-2-mini- dflash2- speculative-decoding- draft-model- sglang- dgx-spark- gb10- agentic-coding- long-context---
# Inkling-2-Mini on one DGX Spark: SGLang recipe and the t5a drafter
A serving recipe for [thinkingmachines/Inkling-2-Mini](https://huggingface.co/thinkingmachines/Inkling-2-Mini) on a singleNVIDIA DGX Spark (GB10, 128 GB unified memory), tuned for agentic coding and long code prompts. It runs the stock SGLang image(pinned by digest) with our kernel patches mounted at launch, the base weights unmodified, and t5a: our DFlash2 draft model,fine-tuned for agentic coding and long code, included here.
On a 96-request multi-turn agentic coding replay (eval1), against stock SGLang and stock vLLM on the same Spark:
- **1 user: 1.80x faster than stock SGLang** and 2.20x faster than stock vLLM (529.3 s for the replay vs 952.5 s / 1161.8 s).- **4 users: 1.78x / 2.13x** (451.3 s vs 804.7 s / 963.3 s).- **Long context:** 5827 tokens/s fresh prefill at 35K tokens (1.82x stock SGLang), 70.9 tokens/s single-stream decode at 32K (1.33x).- **Quality:** KL divergence 0.00639 nats to the reference implementation, against 0.00626 for stock SGLang and 0.00600 for stock vLLM.
## Quality
| | Stock vLLM | Stock SGLang | **This recipe** ||---|---:|---:|---:|| KL divergence to the reference, nats (lower bound; lower is better) | 0.00600 | 0.00626 | **0.00639** || Top-1 agreement with the reference | 97.37% | 97.54% | **97.43%** |
The reference is the released checkpoint (thinkingmachines/Inkling-2-Mini @1fb4134b) run in the Hugging Face transformersreference implementation, which dequantizes the NVFP4 / MXFP8 experts and computes in BF16 activations; there is no BF16 releaseof this model. Each server is teacher-forced on the same token windows of three public corpora (neutral text, code, agentic) andscored on the second half of each window from its top-20 log probabilities (a lower bound on the full KL). All three engines sitnear 0.006 nats because all three run the experts with quantized activations, as the checkpoint is meant to be served. Thisrecipe reads slightly higher than both stock engines (table above). The target model verifies every drafted token, but theoutputs are not bit-identical to stock SGLang's: the recipe's kernels and verification batches differ in floating-point detail,so greedy text can diverge between the engines, as it does between stock SGLang and stock vLLM.
## Agentic coding speed
| eval1, 96 requests | Stock vLLM | Stock SGLang | **This recipe** | vs stock vLLM | vs stock SGLang ||---|---:|---:|---:|---:|---:|| Wall time, 1 user (s) | 1161.8 | 952.5 | **529.3** | **2.20x** | **1.80x** || Wall time, 4 users (s) | 963.3 | 804.7 | **451.3** | **2.13x** | **1.78x** || Decode per stream, median, 1 user (tokens/s) | 54.7 | 59.1 | 81.2 | 1.49x | 1.37x || Decode per stream, median, 4 users (tokens/s) | 14.3 | 21.3 | 30.1 | 2.10x | 1.41x || Time to first token, median, 1 user (s) | 2.36 | 1.95 | 1.30 | 1.82x | 1.51x || Time to first token, median, 4 users (s) | 4.13 | 2.91 | 2.69 | 1.53x | 1.08x || Output tokens of the replay, 1 user / 4 users | 17,536 / 17,144 | 16,537 / 16,656 | 16,816 / 17,794 | | |
eval1 is a 96-request multi-turn agentic coding replay: sessions are replayed turn by turn with their tool definitions, 1 or 4sessions at a time, so each session's later turns reuse the prefix cache as they would in an agent loop. Requests are greedy(temperature 0) with the output budget of the original turn. Wall time is the time to finish all 96 requests; speedups are rawwall-time ratios. The engines do not emit the same number of tokens (last row), so the ratios are not normalized for outputlength. Time to first token is measured to the first content, reasoning or tool-call delta. A tool call that arrives in onepiece reports its whole generation time there, so the two median rows mix generation with first-token time; read them asindicative.
## Long context
| Prompt-processing and decode speed (tokens/s) | Stock vLLM | Stock SGLang | **This recipe** | vs stock vLLM | vs stock SGLang ||---|---:|---:|---:|---:|---:|| Fresh prefill, 2K-token prompt | 862 | 2128 | **3391** | 3.93x | 1.59x || Fresh prefill, 35K-token prompt | 2381 | 3205 | **5827** | 2.45x | 1.82x || Decode, 1 stream, 2K context | 57.3 | 54.4 | **101.0** | 1.76x | 1.86x || Decode, 1 stream, 32K context (median) | 53.8 | 53.4 | **70.9** | 1.32x | 1.33x || Decode, 4 streams at 16K each, aggregate | 113.7 | 109.4 | **164.3** | 1.45x | 1.50x |
Prompts are fixed slices of an open-source code corpus followed by "Explain what this code does, step by step."; greedy, themodel's default reasoning effort, a fixed number of output tokens (the end-of-sequence token is ignored), so every engine decodes the same token count. Freshprefill = the first request on a prompt; decode = (400 - 16) tokens over the time difference of a 400-token and a 16-tokenrequest on the cached prompt. The 35K row is the mean of a 35,056-token and a 34,173-token prompt.
## How it was measured
One DGX Spark, 2026-12-02 13:36-17:51 PST: 18 fresh server boots, two per engine for each of the three loads (1-user replay, 4-user replay,and the long-context and quality checks), in an interleaved order. Every value is the mean ofan engine's two boots; speedups are the ratio of those means. Each engine ran at its published settings, with the changes named below that a Sparkneeds; memory was not equalized:
- **Stock vLLM:** the `vllm/vllm-openai` Inkling-2-Mini image (pinned digest `c2dc759f`), its published DGX Spark recipe with the bundled DSpark drafter (7 draft tokens), 262,144-token context, `--gpu-memory-utilization 0.55` (our setting: the published recipe sets none, and vLLM's default of 0.9 cannot run beside the host on a Spark).- **Stock SGLang:** the `lmsysorg/sglang` Inkling-2-Mini image (pinned digest `efac853b`), the SGLang cookbook's DGX Spark DSpark settings (TP1, FA4 attention, page 128, 8 draft tokens) plus two changes of ours: 262,144-token context (the cookbook sets none)and `--mem-fraction-static 0.55` (the cookbook's 0.45 left too small a KV pool for 4 sessions).- **This recipe:** the same SGLang image, `PROFILE=agentic` of `recipe/serve.sh` (262,144-token context, `--mem-fraction-static 0.82`, t5a with 8-token blocks).
## Quick start
You need a DGX Spark with Docker and the NVIDIA container toolkit, about 25 GB of disk for the weights plus the SGLang image,and no other large GPU program running (the agentic profile claims 82% of the unified memory for SGLang).
```bashhf download diffbot/Inkling-2-Mini-DFlash2-t5a-DGX-Spark --local-dir ~/models/Inkling-2-Mini-DFlash2-t5a-DGX-Sparkhf download thinkingmachines/Inkling-2-Mini --revision 1fb4134b9a74f9681054f4ef82e4bf1f458a2337 --local-dir ~/models/Inkling-2-MiniMODEL_DIR=~/models/Inkling-2-Mini bash ~/models/Inkling-2-Mini-DFlash2-t5a-DGX-Spark/recipe/serve.sh```
The server listens on `http://127.0.0.1:8000/v1` (OpenAI-compatible; model `inkling-2-mini`; reasoning and tool calls are parsed).The first boot compiles kernels and captures CUDA graphs and takes several minutes longer than later boots, which reuse thecache in `~/.cache/inkling2-mini-t5a`. `bash recipe/serve.sh stop` stops it. Settings (port, API key, memory fraction, thelong-context profile) are documented at the top of `recipe/serve.sh`; `recipe/README.md` explains the stack.
```bashcurl -s http://127.0.0.1:8000/v1/chat/completions -H 'Content-Type: application/json' \ -d '{"model": "inkling-2-mini", "messages": [{"role": "user", "content": "Write a binary search in Rust."}]}'```
## Long-context profile: 1M tokens and image input
`PROFILE=long bash recipe/serve.sh` serves a 1,048,576-token context with image input (`--enable-multimodal`), at the same`--mem-fraction-static 0.82` and otherwise the same settings as the agentic profile. Run it on a Spark with nothing else largerunning. The speed tables above were measured with the agentic profile, not this one. What its boot test on one DGX Sparkshowed (2026-12-02 13:16-13:35 PST; a functional check, not a benchmark):
- KV pool of 1,144,960 tokens.- Needle retrieval at 599K and 900K prompt tokens: both found, with 276 s and 562 s to the first token (fresh prefill).- Image input: 5 of 6 probes answered correctly; the sixth (reading a three-digit number) used up its 8,192-token budget while reasoning and gave no answer.- Lowest free host memory during the test: 10.5 GiB.
Both profiles also passed the release test (`recipe/test/clean-checkout.sh`) from a fresh checkout of this repository on a DGX Spark,2026-12-02 18:27-18:58 PST: every file matched `SHA256SUMS`, the base weights matched `recipe/base-1fb4134b.sha256`, and the firstboot from an empty kernel cache took 909 s (agentic) and 887 s (long). The smoke test passed (chat, a tool call, a 32K-token prompt,and on the long profile an image), with no errors in the server log.
`bash recipe/test/clean-checkout.sh <this repo> <base model dir>` boots a separate copy on port 8115 with a fresh cache, runs`recipe/test/smoke.py` (chat, a tool call, a 32K-token prompt) and removes it again.
## The t5a drafter
t5a is a DFlash2 block-diffusion draft model (5 layers, 8-token blocks, two global-attention layers) that proposes tokens forInkling-2-Mini to verify. We fine-tuned it from Inkling-2-Mini-DFlash2-Global (L13), itself derived from Inco AI'sInkling-2-Mini-DFlash2, on text generated by Inkling-2-Mini itself: agentic coding sessions and long code-explanation data,with a smaller share of short coding prompts. The long code-explanation data are slices of permissively licensed open-sourcerepositories and code from tool outputs, asked with the same instruction as the long-context table. The eval1 sessions and thecode corpus behind the long-context table were excluded from the training data (by session, by file path and by overlapping6-line code shingles).
| Files | Contents ||---|---|| `drafter/` | t5a in BF16 (`model.safetensors`, 990 MB, and `config.json`, the original architecture). || `drafter-mix/` | The same weights pre-quantized for the recipe's drafter kernels (int8 attention, 4-bit feed-forward; 552 MB). The recipe refuses a mix that was not built from the drafter beside it. || `recipe/` | `serve.sh`, the launch profiles, tests, and `stack/`: the frozen serving stack, byte for byte as benchmarked. |
The drafter loads in this recipe's SGLang stack. Other engines need DFlash2 support with global-attention draft layers.
## Limitations
- Built and measured on one DGX Spark only; other GB10 systems should work but are untested, and other GPUs are not supported.- The stack is pinned to one SGLang image; the patches will not apply to other SGLang versions.- Both profiles claim 82% of the memory for SGLang (the long profile adds image input and a 1M-token context): in the benchmark runs the host's available memory fell to 7-10 GB at its lowest (stock engines at 0.55: 44-49 GB). Lower `MEM` if you run other GPU programs beside it (the KV pool shrinks accordingly).- The quality evidence is the KL table and functional checks (chat, tool calls, long prompts), not a full benchmark suite.- The speed tables compare the engines at different memory fractions (0.82 for the recipe, 0.55 for both stock engines), which favours the recipe's larger KV pool on the 4-user replay.
## Credits and license
Built on Thinking Machines Lab's Inkling-2-Mini, Inco AI's Inkling-2-Mini-DFlash2 (and z-lab's DFlash), Cameron Basham'sInkling-2-Mini-DFlash2-Global (L13), the SGLang project, and knapcio's MIT-licensed Inkling-2-Mini DGX Spark SGLang recipe([github.com/knapcio/Inkling-2-Mini-1x-DGX-Spark](https://github.com/knapcio/Inkling-2-Mini-1x-DGX-Spark)), the base of`recipe/stack/` (its license and credits are kept there unchanged).
This repository is Apache-2.0 (`LICENSE`, `NOTICE`); the third-party code in `recipe/stack/` keeps its own MIT, BSD-3-Clauseand Apache-2.0 licenses, listed in `THIRD_PARTY_NOTICES.md`. Changes and history: `recipe/RELEASE_NOTES.md`.
1234567891011121314151617181920212223242526272829303132333435363738# Third-party components
This repository is Apache-2.0 (`LICENSE`, `NOTICE`) except for the third-party code listed here, which keeps its own license.Every license and notice file named below is shipped unchanged next to the code it covers. `recipe/stack/` is a frozen copy ofthe serving stack exactly as it was benchmarked; files in it were not edited for this release, so their comments and file namesare the build's own.
## Model weights
| Component | License | Where | Notes ||---|---|---|---|| Inkling-2-Mini, Thinking Machines Lab (`thinkingmachines/Inkling-2-Mini` @1fb4134b) | Apache-2.0 | not in this repo | Downloaded by the user; `recipe/serve.sh` checks it against `recipe/base-1fb4134b.sha256` and mounts it read-only, unmodified. || Inkling-2-Mini-DFlash2-Global (L13), Cameron Basham | Apache-2.0 | `drafter/`, `drafter-mix/` (modified) | The starting point of our fine-tune. Its NOTICE is reproduced in `drafter/NOTICE`. || Inkling-2-Mini-DFlash2, Inco AI (`incoai/Inkling-2-Mini-DFlash2` @4f9088ea), method by z-lab ([DFlash](https://github.com/z-lab/dflash)) | Apache-2.0 | via the above | The DFlash2 drafter that Inkling-2-Mini-DFlash2-Global was derived from. |
## Code in `recipe/stack/`
| Component | License | Where in `recipe/stack/` | License / notice file ||---|---|---|---|| An open-source Inkling-2-Mini DGX Spark SGLang recipe (v2.9.3 / v2.9.7 line): the `overlay/` packages and launcher that our stack is built on | MIT | `cands/n292-v2-v297-pk3c/recipe/`, `cands/n361-s3b-p/recipe/`, `cands/n419j3-2416d17a/recipe/`, `cands/n343a-s2-verify-scodes/`, the copies in `inkling_n389/`, and the adapted walk-step code in `patch/n105_rnnhoist.py` (notice in its header) | `LICENSE`, `NOTICE` and `CREDITS.md` in each of those `recipe/` directories, and the `LICENSE.*`, `NOTICE.*` and `CREDITS.*` files beside the packages copied from it. `CREDITS.md` and `NOTICE` there are that recipe's own files, kept verbatim: where they say "this repository", "ours" or "scripts/...", they mean that recipe, not this one. || pico 12-bit BF16 GEMV kernels (`bf16x` format and reader) | MIT | `.../overlay/inkling_pico12/third_party/pico/`, `.../overlay/inkling_wide/csrc/bf16x_format.cuh` | `third_party/pico/LICENSE` || CUTLASS SM120 block-scaled grouped-GEMM mainloop (modified) | BSD-3-Clause | `cands/n343a-s2-verify-scodes/overlay/inkling_scodes/csrc/scodes_sm120_mma_array.hpp` | license text in the file header || FlashInfer 0.7.4 NVFP4 grouped GEMM (reduced) | Apache-2.0 | `cands/n343a-s2-verify-scodes/overlay/inkling_scodes/csrc/scodes_group_gemm.cuh` | see the recipe `NOTICE` || SGLang kernels and functions (copied, modified): split-KV decode / verify attention, reject sampling, DFLASH selector walk, the DSpark sampler fixes of sgl-project/sglang PRs #51681 and #51692, the Inkling2 K-clip and RMSNorm kernel bodies | Apache-2.0 | `.../overlay/inkling_kv12/`, `.../overlay/inkling_vattn/`, `.../overlay/inkling_rsfix/`, `cands/*/overlay_*/inkling_n395/` | recipe `NOTICE`; `inkling_n395/LICENSE.sglang`, `NOTICE.n395` || SGLang Inkling-2-Mini DFlash2 integration script, Inco AI (`sglang_inkling_dflash2.py` from `incoai/Inkling-2-Mini-DFlash2` @4f9088ea, unmodified, SHA-256 14223ae2) | Apache-2.0 | `dflash2/sglang_inkling_dflash2.py` | this file; `LICENSE` |
| CUTLASS kernels embedded with edits (SM90/SM100 grouped-GEMM kernel and collective builders) | BSD-3-Clause | `cands/*/recipe/patch/n52_band.cuh`, `cands/*/overlay_*/n381c_band.cuh` | `licenses/CUTLASS-LICENSE.txt` (repo root) || SGLang source files from the image, copied and modified: the Inkling-2 attention, loop-controller and draft-head modules, the routed-quant kernel, and the SM120 FA4 forward kernel (itself derived from FlashAttention) | Apache-2.0; the FA4 kernel BSD-3-Clause | `cands/*/recipe/patch/inkling2_*.py`, `cands/*/recipe/serve/inkling2_mtp.py`, `cands/*/recipe/patch/n13_fwd.py`, `n32_fwd.py`, `n64a_fwd.py`, `n64b_fwd.py`, `cands/*/overlay_*/n355_quant.cuh` | the file headers and the stack launcher's header name the image file each starts from; `licenses/FLASH-ATTENTION-LICENSE.txt` |
The remaining files of `recipe/stack/` are our own code, and our changes in the modified copies above are ours too, Apache-2.0;the original parts of those copies keep their licenses. Everything outside `recipe/stack/` is ours, Apache-2.0, except`licenses/`, which holds upstream license texts.
## Software used at run time, not included
- SGLang (`sgl-project/sglang`), the `lmsysorg/sglang` image pinned by digest in `recipe/profiles/*.row`: Apache-2.0. The stack's files are mounted into that image at launch; the image itself is unchanged.- NVIDIA CUDA, CUTLASS / CuTe DSL and FlashInfer as shipped in that image.1a22381fd44acb5b2e0a583a20537641099dc16c59b6b7c7cab7e61faa0e9e43a123version https://git-lfs.github.com/spec/v1oid sha256:c6c42710f9d890776d73706f81527f175b748a85d772606c2b248a6066f5cc2dsize 551600700123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201 Apache License Version 2.0, January 2004 http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.
"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:
(a) You must give any other recipients of the Work or Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License.
You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.12345678910111213141516171819202122t5a (mix): the t5a draft model in a pre-quantized layout (file: Inkling-2-Mini-DFlash2-mix.safetensors)Copyright 2026 Diffbot
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 (also in the file LICENSE next to this one).
This file is a modified version (Apache License 2.0, section 4(b)) of ../drafter/model.safetensors (SHA-256 a22381fd44acb5b2...,see ../drafter/NOTICE for that model's origin and attribution: Cameron Basham's Inkling-2-Mini-DFlash2-Global (L13), derived fromInco AI's Inkling-2-Mini-DFlash2, for Thinking Machines Lab's Inkling-2-Mini; all Apache License 2.0).
Changes made (2026-12-02), with a published Apache-2.0 converter run unmodified (make_mix_from_original.py, numpy only,SHA-256 1500e565ddaf07f84f134b11650238f571cd4c05506cd849719878b5b08040c4): 1. Format: a safetensors file whose header metadata says {"format": "strata-dflash2-q1", "variant": "mix"}; the recipe's drafter kernels read it next to the original weights. 2. Quantization of the five transformer layers' matrices: attention q_proj / o_proj to int8 with one float32 scale per row; feed-forward gate_proj / up_proj / down_proj to 4-bit E2M1 with a UE4M3 scale per 16 values and one float32 scale per matrix. 3. Norm weights and convolution base kernels stored as float32 (same values); all other tensors unchanged bfloat16; the codebook rows beyond the 200,058-entry vocabulary are left out. Result: 551,600,700 bytes, SHA-256 c6c42710f9d890776d73706f81527f175b748a85d772606c2b248a6066f5cc2d. BUILT_FROM names the drafter it was made from; recipe/serve.sh refuses a mix whose pins do not match the drafter beside it.
The quantized drafter only proposes tokens; Inkling-2-Mini verifies every one of them.1c6c42710f9d890776d73706f81527f175b748a85d772606c2b248a6066f5cc2d Inkling-2-Mini-DFlash2-mix.safetensors123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201 Apache License Version 2.0, January 2004 http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.
"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:
(a) You must give any other recipients of the Work or Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License.
You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.1234567891011121314151617181920212223242526272829t5a: a DFlash2-family draft model for thinkingmachines/Inkling-2-Mini (files: config.json, model.safetensors)Copyright 2026 Diffbot
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 (also in the file LICENSE next to this one).
This draft model checkpoint is a modified version (Apache License 2.0, section 4(b)) of:
Inkling-2-Mini-DFlash2-Global (L13), Hugging Face revision 19d7b703, model.safetensors SHA-256 4d4d83d0a9a1cf7348a9..., whose NOTICE reads:
Inkling-2-Mini-DFlash2-Global (L13) Copyright 2026 Cameron Basham
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
This draft model checkpoint is derived from and designed for use with: - Thinking Machines Lab, Inkling-2-Mini (https://huggingface.co/thinkingmachines/Inkling-2-Mini), Apache License 2.0 - Inco AI, Inkling-2-Mini-DFlash2 (https://huggingface.co/incoai/Inkling-2-Mini-DFlash2), Apache License 2.0
Changes made by Diffbot (2026-11-28 to 2026-12-02): - The weights were fine-tuned in several stages on text generated by Inkling-2-Mini itself (greedy and sampled continuations of agentic coding sessions and long code-explanation data, with a smaller share of short coding prompts). The architecture, tensor names, shapes and dtypes are unchanged; config.json is the original's. - Result: model.safetensors, 989,975,648 bytes, SHA-256 a22381fd44acb5b2e0a583a20537641099dc16c59b6b7c7cab7e61faa0e9e43a.
No endorsement by Cameron Basham, Inco AI, z-lab or Thinking Machines Lab is implied.1234567# t5a drafter (BF16)
A DFlash2 draft model for thinkingmachines/Inkling-2-Mini, fine-tuned from Inkling-2-Mini-DFlash2-Global (L13) on text generated byInkling-2-Mini (agentic coding sessions and long code-explanation data, with a smaller share of short coding prompts). Samearchitecture as the original (config.json unchanged): 5 layers (sliding / global / sliding / global / sliding), 8-token blocks,conditioned on target layers 5, 23, 41 and 48. `SHA256SUMS` lists the two files the recipe loads. License and attribution: `LICENSE`,`NOTICE`. How to serve it: the repository's `README.md` and `recipe/serve.sh`.12df8b1f466b0a35d6badc3e292ae94009727fe397c4335c296e99c5b86df4b4a9 config.jsona22381fd44acb5b2e0a583a20537641099dc16c59b6b7c7cab7e61faa0e9e43a model.safetensors1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768{ "architectures": [ "DFlash2DraftModel" ], "attention_bias": false, "attention_dropout": 0.0, "bos_token_id": null, "dflash_config": { "block_size": 8, "conv_group_size": 16, "conv_kernel_size": 2, "final_logit_softcapping": 30.0, "mask_token_id": 200056, "selector_rank": 256, "selector_softcap_mode": "after_correction", "selector_top_k": 16, "target_layer_ids": [ 5, 23, 41, 48 ] }, "dtype": "bfloat16", "eos_token_id": null, "head_dim": 128, "hidden_act": "silu", "hidden_size": 2304, "initializer_range": 0.02, "intermediate_size": 6912, "is_causal": false, "layer_types": [ "sliding_attention", "full_attention", "sliding_attention", "full_attention", "sliding_attention" ], "max_position_embeddings": 1048576, "max_window_layers": 5, "model_type": "qwen3", "num_attention_heads": 32, "num_hidden_layers": 5, "num_key_value_heads": 8, "num_target_layers": 48, "pad_token_id": null, "rms_norm_eps": 1e-06, "rope_parameters": { "rope_theta": 10000.0, "rope_type": "default" }, "sliding_window": 2048, "tie_word_embeddings": false, "transformers_version": "5.12.1", "use_cache": false, "use_sliding_window": true, "vocab_size": 201024, "global_rope_theta": 1000000.0, "dflash_global_config": { "global_layers": [ 1, 3 ], "global_rope_theta": 1000000.0, "global_yarn_scale": null, "global_yarn_orig_max_pos": 2048 }}123version https://git-lfs.github.com/spec/v1oid sha256:a22381fd44acb5b2e0a583a20537641099dc16c59b6b7c7cab7e61faa0e9e43asize 98997564812345678910111213141516171819202122232425262728293031323334Copyright (c) 2017 - 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.SPDX-License-Identifier: BSD-3-Clause
Redistribution and use in source and binary forms, with or withoutmodification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, thislist of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,this list of conditions and the following disclaimer in the documentationand/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of itscontributors may be used to endorse or promote products derived fromthis software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THEIMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE AREDISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLEFOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIALDAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS ORSERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVERCAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USEOF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Certain files within this repository are subject to separate licensing terms:
- The files located in the `python/CuTeDSL` directory are licensed under the NVIDIA End User License Agreement (EULA). Please refer to https://docs.nvidia.com/cutlass/latest/media/docs/pythonDSL/license.html for the full terms.1234567891011121314151617181920212223242526272829BSD 3-Clause License
Copyright (c) 2022, the respective contributors, as shown by the AUTHORS file.All rights reserved.
Redistribution and use in source and binary forms, with or withoutmodification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
* Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THEIMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE AREDISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLEFOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIALDAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS ORSERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVERCAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USEOF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152# The recipe
`serve.sh` is the only entry point. It runs the stock SGLang image `lmsysorg/sglang@sha256:efac853b…` (the Inkling-2-Miniday-0 build) and mounts the files of `stack/` into it; nothing is built into the image and the base weights are mountedread-only, unchanged.
## Files
| Path | What it is ||---|---|| `serve.sh` | The launcher you run. Checks this checkout (`../SHA256SUMS`) and the base weights (`base-1fb4134b.sha256`), pulls the pinned image if missing, fills a profile row with this checkout's paths and calls the frozen stack launcher with it. || `profiles/agentic.row` | The benchmarked configuration, as one `KEY=value ... bash <launcher>` line: 262,144-token context, `--mem-fraction-static 0.82`, the t5a drafter and its mix, and every feature switch of the stack. Placeholders `@STACK@`, `@DRAFTER@`, `@MIX@`, `@CACHE@` are filled by `serve.sh`. || `profiles/long.row` | The same configuration with a 1,048,576-token context and image input (`CTX=1048576`, `--enable-multimodal`). || `stack/cands/<build>/` | The frozen serving stack: seven build directories exactly as benchmarked (`stack/SHA256SUMS`). Their names are build identifiers; the row says which file of which build is mounted where. || `stack/cands/n419j3-2416d17a/recipe/serve/serve.sh` | The stack launcher the row calls. It checks the drafter (`SHA256SUMS`), the mix pins (`serve/mixpin.sh`) and the DFlash2 integration script (sha256 14223ae2), then starts one container. || `stack/dflash2/sglang_inkling_dflash2.py` | Inco AI's SGLang integration script for DFlash2 drafters, unmodified; run inside the container before the server starts. || `base-1fb4134b.sha256` | SHA-256 of every file of thinkingmachines/Inkling-2-Mini at revision 1fb4134b that the server reads. || `test/clean-checkout.sh`, `test/smoke.py` | The release test: boot a separate copy with a fresh cache, smoke-test it, remove it. `DRY_RUN=1` checks a checkout on any machine without a GPU. |
## What the stack changes
All changes are inside the SGLang process; the served API is SGLang's OpenAI-compatible server with the `inkling` reasoningparser and the `inkling2` tool-call parser.
- **Speculative decoding with t5a.** SGLang's DFLASH worker with block verification and 8-token draft blocks. The draft model's matrices run from the pre-quantized mix (int8 attention, 4-bit feed-forward), its vocabulary projection from a hot list of 98,304 token ids (`overlay/inkling_draftbytes/hotvocab/`, token-frequency ranks only), and a per-batch-size cap (`cands/n419ab-6d18f8eb/df-r1b2.json`) limits how many draft tokens are verified when acceptance is unlikely. Prompt copy proposes continuations found in long prompts (8K tokens and up). The target model verifies every draft token.- **Kernels for the target model.** Prefill: fused relative-bias FA4 attention on the sliding and global layers, a chunked NVFP4 MoE path, and fused norm / projection kernels. Decode and verify: exactly coded 12-bit BF16 weights for the dense projections and the LM head with a certified greedy head, CUTLASS NVFP4 grouped GEMMs with coded scale factors, and small-batch GEMV tiles.- **Scheduling.** 12,288-token prefill chunks, up to 48 running requests, prefix caching for multi-turn sessions.
Each switch is an environment variable in the row (`INKLING_*`, `N*`, `SGLANG_*`); the package READMEs under`stack/cands/*/recipe/overlay/` document them. Setting a switch differently from the row gives an unmeasured configuration.
## Memory
SGLang sizes its KV pool from the memory free at boot: pool = free memory - (1 - MEM) x total. At the profile's MEM 0.82 thehost keeps about 20 GB. If another GPU program (for example an embedding server) runs beside it, start that first and lower`MEM`; never start a large GPU program after the server, since the pool already holds that memory.
## Verifying a checkout without a GPU
```bashDRY_RUN=1 bash recipe/test/clean-checkout.sh . ~/models/Inkling-2-Mini```
This checks every file's SHA-256, the base weights and the drafter / mix pins, and records the `docker run` command line thelauncher would execute (`docker-argv.log`) without running it.12345678910111213141516171819202122232425262728293031323334353637383940# Release notes
## 1.0 (2026-12-02, Pacific time)
First public release.
**Contents**
- `drafter/`: t5a, a DFlash2 draft model for Inkling-2-Mini fine-tuned from Inkling-2-Mini-DFlash2-Global (L13). `model.safetensors` SHA-256 `a22381fd44acb5b2e0a583a20537641099dc16c59b6b7c7cab7e61faa0e9e43a`, `config.json` `df8b1f466b0a35d6badc3e292ae94009727fe397c4335c296e99c5b86df4b4a9`.- `drafter-mix/`: the same weights pre-quantized for the recipe's draft kernels. `Inkling-2-Mini-DFlash2-mix.safetensors` SHA-256 `c6c42710f9d890776d73706f81527f175b748a85d772606c2b248a6066f5cc2d`, built from the drafter above (`BUILT_FROM`); rebuilt independently from the drafter and found byte-identical before release.- `recipe/`: the launcher, the `agentic` and `long` profiles and the frozen serving stack (`recipe/stack/SHA256SUMS`).
**Pinned**
- Base model: thinkingmachines/Inkling-2-Mini, revision `1fb4134b9a74f9681054f4ef82e4bf1f458a2337` (`recipe/base-1fb4134b.sha256`).- Image: `lmsysorg/sglang@sha256:efac853b46811ccb760545b7b29e7119bdf907537ccf6e863fac3011fe8b98de`.- DFlash2 integration script: Inco AI's `sglang_inkling_dflash2.py` from incoai/Inkling-2-Mini-DFlash2 @4f9088ea, SHA-256 `14223ae2…`.
**Profiles**
- `agentic` (default): the benchmarked configuration, 262,144-token context, `--mem-fraction-static 0.82`. Every table on the model card was measured with it.- `long`: 1,048,576-token context with image input (`--enable-multimodal`), `--mem-fraction-static 0.82`, otherwise identical to `agentic`; for a Spark with nothing else large running. Boot test of the same configuration (2026-12-02 13:16-13:35 PST): KV pool 1,144,960 tokens; needles at 599K and 900K prompt tokens found (276 s / 562 s to first token); 5 of 6 image probes correct (the sixth ran out of its 8,192-token budget while reasoning); lowest free memory 10.5 GiB; no faults.
**How the release was checked**
- For both profiles, the `docker run` command line produced by `recipe/serve.sh` from a fresh checkout is identical, argument for argument, to the one the frozen serving configuration produces (only the container name, port and paths differ).- `recipe/test/clean-checkout.sh` on a DGX Spark, 2026-12-02 18:27-18:58 PST, from a fresh copy of this repository: PASS for both profiles (checksums, base weights, first boot from an empty kernel cache 909 s agentic / 887 s long, smoke test incl. a 32K-token prompt and, on the long profile, an image; no errors in the server log).
**Known limitations**: see the model card.12345678910111265e60f51aa1284d4fb022584908c315270334d991828bb774af60584523539d1 model-00001-of-00001.safetensors53a9035f3255945704b5857657cfb00c1165090c0641c4f782a0cbf268cc16dc chat_template.jinja8216dd43157f5474cfff88f486a1e433fef703c674f694e485a86a761c412b1e config.jsona08737c07a65a8fdf69f7cf086576210e5aad4b241437090b26d7b0c4f7905f7 generation_config.json7c656207d3ce37879c7be209a036b0dde43bf01f78159bff06880b868ed57143 hf_quant_config.jsonc1631065b7b00787993522dddc66a68b3abee869192977fb3dcb796e63bc5838 model.safetensors.index.json7c3b651317f01f73bcf4e1dceba66ef8b7e1a1eac6bc171e882e690a4b10a1d2 mtp.safetensorsd7350adce18c8be4b607f261c8f0f7eabbf720bb7aaf648a43d4f8372bbacc2d processor_config.jsonc16f44b3594563d82743ddb0417a2be1bfe3e2000dfad2da4b8f32554593e1a0 special_tokens_map.jsonbf09342d285139fd37ce10c70878af1d52cb390e9901e10248654293a80ee636 tokenizer_config.json7f332727f9a3f093dd452a39cc978e6757627e5dad1b0673aa4e75174f236dd6 tokenizer.jsonf170372dd655728909228220d77cf6b8104a59f38a91262a7d2c4027906ec0d8 tiktoken/tokenizer.model1IMAGE=lmsysorg/sglang@sha256:efac853b46811ccb760545b7b29e7119bdf907537ccf6e863fac3011fe8b98de CACHE_DIR=@CACHE@ DFLASH2_SCRIPT=@STACK@/dflash2/sglang_inkling_dflash2.py DRAFT_DIR=@DRAFTER@ EXTRA_ARGS='--mamba-max-states-per-path -1 --chunked-prefill-size 12288 --cuda-graph-max-bs-prefill 12288' EXTRA_DOCKER='-v @STACK@/cands/n292-v2-v297-pk3c/recipe/patch/n66fb.py:/sgl-workspace/sglang/python/sglang/kernels/ops/elementwise/n66fb.py:ro -v @STACK@/cands/n292-v2-v297-pk3c/recipe/patch/inkling2_loop_model.py:/sgl-workspace/sglang/python/sglang/srt/models/inkling_common/inkling2_loop.py:ro -v @STACK@/cands/n292-v2-v297-pk3c/recipe/patch/n50b_fused.py:/sgl-workspace/sglang/python/sglang/kernels/ops/elementwise/n50b_fused.py:ro -e SGLANG_INKLING_N66=0 -e SGLANG_INKLING_N66_FORM=H -e SGLANG_INKLING_N66_RB=2 -e SGLANG_INKLING_N66_BLOCK_K=64 -e SGLANG_INKLING_N66_BLOCK_N=64 -e SGLANG_INKLING_N66_STAGES=2 -e N75_STACK_FUSED=1 -v @STACK@/cands/n292-v2-v297-pk3c/recipe/patch/n140_kern.py:/sgl-workspace/sglang/python/sglang/srt/models/inkling_common/n140_kern.py:ro -v @STACK@/cands/n292-v2-v297-pk3c/recipe/patch/n80_cuda.py:/sgl-workspace/sglang/python/sglang/srt/models/inkling_common/n80_cuda.py:ro -v @STACK@/cands/n292-v2-v297-pk3c/recipe/patch/n80_draft.py:/sgl-workspace/sglang/python/sglang/srt/models/inkling_common/n80_draft.py:ro -e N140_I6=1 -e N140_EXACT=E1 -e N80_NW=16 -e N80_MK_NW=8 -v @STACK@/cands/n361-s3b-p/recipe/overlay:/opt/inkling-overlay:ro -v @STACK@/cands/n343a-s2-verify-scodes/overlay:/opt/inkling-scodes:ro -v @STACK@/cands/n419c-8f01ac06/overlay_n419c:/opt/n320:ro -v @STACK@/cands/n362j-e35d7419/overlay_n362j/n351_quant.cuh:/sgl-workspace/sglang/python/sglang/kernels/jit/csrc/inkling2/n351_quant.cuh:ro -v @STACK@/cands/n362j-e35d7419/overlay_n362j/n355_quant.cuh:/sgl-workspace/sglang/python/sglang/kernels/jit/csrc/inkling2/n355_quant.cuh:ro -v @STACK@/cands/n362j-e35d7419/overlay_n362j/n381c_band.cuh:/sgl-workspace/sglang/python/sglang/kernels/jit/csrc/inkling2/n381c_band.cuh:ro -v @STACK@/cands/n419j3-2416d17a/overlay_dfglobal:/opt/inkling-dfglobal:ro -v @STACK@/cands/n419j3-2416d17a/overlay_pcopyro:/opt/inkling-pcopyro:ro -e PYTHONPATH=/opt/inkling-pcopyro:/opt/inkling-dfglobal:/opt/inkling-scodes:/opt/n320:/opt/inkling-overlay -e INKLING_DFLASH_GLOBAL=1 -e INKLING_SCODES=1 -e INKLING_SCODES_CHECK=1 -e INKLING_N329=1 -e INKLING_N351=5 -e INKLING_N355=9 -e INKLING_N381=pv=1 -e INKLING_N389=1 -e INKLING_PROLOGUE=1 -e INKLING_ATTN=prefill_swa -e INKLING_ATTN_GATE=1 -e INKLING_PFUSE=all -e INKLING_PFUSE_HOIST=1 -e N80_DRAFT= -v @STACK@/cands/n419ab-6d18f8eb/df-r1b2.json:/opt/n419ab/df-r1b2.json:ro -e INKLING_VERIFY_CAP=dfpolicy:/opt/n419ab/df-r1b2.json,bsmax=8 -e INKLING_VERIFY_CAP_LOG_EVERY=0 -e INKLING_VERIFY_CAP_STEPLOG= -e INKLING_VERIFY_CAP_REMAP=1 -e INKLING_DRAFT_BYTES= -e INKLING_DRAFT_HOTVOCAB_FILE=/opt/inkling-overlay/inkling_draftbytes/hotvocab/inkling2-mini-hot-r2.json -e INKLING_VATTN=1 -e INKLING_VERIFY_CAP_FASTPROBS=0 -e INKLING_VERIFY_CAP_FUSED_ACCEPT=0 -e INKLING_NOEXP=1 -e INKLING_PADX=1 -e INKLING_DFLASH_BYTES=mx8,mx8w,hot8 -e INKLING_DFLASH_HOT_N=98304 -e INKLING_DFLASH_PREFIX_TAIL=0 -e INKLING_DFLASH_PREFIX_TAIL_MAX_INPUT=4096 -e INKLING_DFLASH_TAIL_SNAPSHOTS=0 -e INKLING_DFLASH_TAIL_DEFER=1 -e INKLING_DFLASH_PCOPY=12 -e INKLING_DFLASH_PCOPY_RINGOFF=1 -e INKLING_DFLASH_PCOPY_MIN_CTX=8192 -e INKLING_DFLASH_CTX8=0 -e INKLING_DFLASH_CTX8_MAX_M= -e INKLING_PROMPT_TOUCH=1 -e INKLING_DFLASH_FUSED_ACCEPT=1 -e INKLING_RSFIX=1 -e INKLING_KV12=0 -e INKLING_KV12_MAX_PAGES=2048 -e INKLING_KV12S=0 -e INKLING_KV12S_OVERFLOW_HEADS=2048 -e INKLING_KV12S_FALLBACK_PAGES=64 -e SGLANG_RAGGED_VERIFY_MODE=static -e INKLING_KV12S_POOL=static -e INKLING_KV12S_DFLASH_SETTLE=shared -e INKLING_PICO12=dense,lmhead,stack1 -e INKLING_CERT_HEAD=1 -e INKLING_WIDE=dense,lmhead -e INKLING_WIDE_SCOPE=verify -e INKLING_CERT_WIDE=1 -e INKLING_CERT_WIDE_MAX_ROWS= -e INKLING_CERT_WIDE_STATS=0 -e INKLING_KERNELS=qkvr_gemv -e INKLING_SPLIT_PROJ_WRAPPED=1 -e INKLING_N437=1 -e INKLING_N395=1 -e INKLING_N438=1' MEM=0.82 MIX_BASE_SHA256=a22381fd44acb5b2e0a583a20537641099dc16c59b6b7c7cab7e61faa0e9e43a MIX_DIR=@MIX@ MIX_SHA256=c6c42710f9d890776d73706f81527f175b748a85d772606c2b248a6066f5cc2d N105_MODE=bf16_splitg_split_coop8 N105_PRE_NW=8 N105_RNNHOIST=1 N35_W8='' N37_TILE_K=256 N38_DRAFT_W8=0 N41_CTX_SL=0 N50=0 N52_BAND=2 N52_FORM=f2 N52_LEAN=1 N52_RASTER=0 N52_TB=16 N64=1 N64_MIN_K=0 N64_PREALLOC=24 N75_C12='' N75_C12_CUDA_NW=qkvr=16,wo_ud=16 N75_C12_KERNEL=cuda N78_CERT='' N80_DRAFT='' N86_G1=0 N86_G2=0 N86_N75_CLASSES=qkvr,wo_ud N86_N75_MS=8,16 SPEC=dflash2 bash @STACK@/cands/n419j3-2416d17a/recipe/serve/serve.sh1IMAGE=lmsysorg/sglang@sha256:efac853b46811ccb760545b7b29e7119bdf907537ccf6e863fac3011fe8b98de CACHE_DIR=@CACHE@ DFLASH2_SCRIPT=@STACK@/dflash2/sglang_inkling_dflash2.py DRAFT_DIR=@DRAFTER@ EXTRA_ARGS='--mamba-max-states-per-path -1 --chunked-prefill-size 12288 --cuda-graph-max-bs-prefill 12288 --enable-multimodal' EXTRA_DOCKER='-v @STACK@/cands/n292-v2-v297-pk3c/recipe/patch/n66fb.py:/sgl-workspace/sglang/python/sglang/kernels/ops/elementwise/n66fb.py:ro -v @STACK@/cands/n292-v2-v297-pk3c/recipe/patch/inkling2_loop_model.py:/sgl-workspace/sglang/python/sglang/srt/models/inkling_common/inkling2_loop.py:ro -v @STACK@/cands/n292-v2-v297-pk3c/recipe/patch/n50b_fused.py:/sgl-workspace/sglang/python/sglang/kernels/ops/elementwise/n50b_fused.py:ro -e SGLANG_INKLING_N66=0 -e SGLANG_INKLING_N66_FORM=H -e SGLANG_INKLING_N66_RB=2 -e SGLANG_INKLING_N66_BLOCK_K=64 -e SGLANG_INKLING_N66_BLOCK_N=64 -e SGLANG_INKLING_N66_STAGES=2 -e N75_STACK_FUSED=1 -v @STACK@/cands/n292-v2-v297-pk3c/recipe/patch/n140_kern.py:/sgl-workspace/sglang/python/sglang/srt/models/inkling_common/n140_kern.py:ro -v @STACK@/cands/n292-v2-v297-pk3c/recipe/patch/n80_cuda.py:/sgl-workspace/sglang/python/sglang/srt/models/inkling_common/n80_cuda.py:ro -v @STACK@/cands/n292-v2-v297-pk3c/recipe/patch/n80_draft.py:/sgl-workspace/sglang/python/sglang/srt/models/inkling_common/n80_draft.py:ro -e N140_I6=1 -e N140_EXACT=E1 -e N80_NW=16 -e N80_MK_NW=8 -v @STACK@/cands/n361-s3b-p/recipe/overlay:/opt/inkling-overlay:ro -v @STACK@/cands/n343a-s2-verify-scodes/overlay:/opt/inkling-scodes:ro -v @STACK@/cands/n419c-8f01ac06/overlay_n419c:/opt/n320:ro -v @STACK@/cands/n362j-e35d7419/overlay_n362j/n351_quant.cuh:/sgl-workspace/sglang/python/sglang/kernels/jit/csrc/inkling2/n351_quant.cuh:ro -v @STACK@/cands/n362j-e35d7419/overlay_n362j/n355_quant.cuh:/sgl-workspace/sglang/python/sglang/kernels/jit/csrc/inkling2/n355_quant.cuh:ro -v @STACK@/cands/n362j-e35d7419/overlay_n362j/n381c_band.cuh:/sgl-workspace/sglang/python/sglang/kernels/jit/csrc/inkling2/n381c_band.cuh:ro -v @STACK@/cands/n419j3-2416d17a/overlay_dfglobal:/opt/inkling-dfglobal:ro -v @STACK@/cands/n419j3-2416d17a/overlay_pcopyro:/opt/inkling-pcopyro:ro -e PYTHONPATH=/opt/inkling-pcopyro:/opt/inkling-dfglobal:/opt/inkling-scodes:/opt/n320:/opt/inkling-overlay -e INKLING_DFLASH_GLOBAL=1 -e INKLING_SCODES=1 -e INKLING_SCODES_CHECK=1 -e INKLING_N329=1 -e INKLING_N351=5 -e INKLING_N355=9 -e INKLING_N381=pv=1 -e INKLING_N389=1 -e INKLING_PROLOGUE=1 -e INKLING_ATTN=prefill_swa -e INKLING_ATTN_GATE=1 -e INKLING_PFUSE=all -e INKLING_PFUSE_HOIST=1 -e N80_DRAFT= -v @STACK@/cands/n419ab-6d18f8eb/df-r1b2.json:/opt/n419ab/df-r1b2.json:ro -e INKLING_VERIFY_CAP=dfpolicy:/opt/n419ab/df-r1b2.json,bsmax=8 -e INKLING_VERIFY_CAP_LOG_EVERY=0 -e INKLING_VERIFY_CAP_STEPLOG= -e INKLING_VERIFY_CAP_REMAP=1 -e INKLING_DRAFT_BYTES= -e INKLING_DRAFT_HOTVOCAB_FILE=/opt/inkling-overlay/inkling_draftbytes/hotvocab/inkling2-mini-hot-r2.json -e INKLING_VATTN=1 -e INKLING_VERIFY_CAP_FASTPROBS=0 -e INKLING_VERIFY_CAP_FUSED_ACCEPT=0 -e INKLING_NOEXP=1 -e INKLING_PADX=1 -e INKLING_DFLASH_BYTES=mx8,mx8w,hot8 -e INKLING_DFLASH_HOT_N=98304 -e INKLING_DFLASH_PREFIX_TAIL=0 -e INKLING_DFLASH_PREFIX_TAIL_MAX_INPUT=4096 -e INKLING_DFLASH_TAIL_SNAPSHOTS=0 -e INKLING_DFLASH_TAIL_DEFER=1 -e INKLING_DFLASH_PCOPY=12 -e INKLING_DFLASH_PCOPY_RINGOFF=1 -e INKLING_DFLASH_PCOPY_MIN_CTX=8192 -e INKLING_DFLASH_CTX8=0 -e INKLING_DFLASH_CTX8_MAX_M= -e INKLING_PROMPT_TOUCH=1 -e INKLING_DFLASH_FUSED_ACCEPT=1 -e INKLING_RSFIX=1 -e INKLING_KV12=0 -e INKLING_KV12_MAX_PAGES=2048 -e INKLING_KV12S=0 -e INKLING_KV12S_OVERFLOW_HEADS=2048 -e INKLING_KV12S_FALLBACK_PAGES=64 -e SGLANG_RAGGED_VERIFY_MODE=static -e INKLING_KV12S_POOL=static -e INKLING_KV12S_DFLASH_SETTLE=shared -e INKLING_PICO12=dense,lmhead,stack1 -e INKLING_CERT_HEAD=1 -e INKLING_WIDE=dense,lmhead -e INKLING_WIDE_SCOPE=verify -e INKLING_CERT_WIDE=1 -e INKLING_CERT_WIDE_MAX_ROWS= -e INKLING_CERT_WIDE_STATS=0 -e INKLING_KERNELS=qkvr_gemv -e INKLING_SPLIT_PROJ_WRAPPED=1 -e INKLING_N437=1 -e INKLING_N395=1 -e INKLING_N438=1' MEM=0.82 MIX_BASE_SHA256=a22381fd44acb5b2e0a583a20537641099dc16c59b6b7c7cab7e61faa0e9e43a MIX_DIR=@MIX@ MIX_SHA256=c6c42710f9d890776d73706f81527f175b748a85d772606c2b248a6066f5cc2d N105_MODE=bf16_splitg_split_coop8 N105_PRE_NW=8 N105_RNNHOIST=1 N35_W8='' N37_TILE_K=256 N38_DRAFT_W8=0 N41_CTX_SL=0 N50=0 N52_BAND=2 N52_FORM=f2 N52_LEAN=1 N52_RASTER=0 N52_TB=16 N64=1 N64_MIN_K=0 N64_PREALLOC=24 N75_C12='' N75_C12_CUDA_NW=qkvr=16,wo_ud=16 N75_C12_KERNEL=cuda N78_CERT='' N80_DRAFT='' N86_G1=0 N86_G2=0 N86_N75_CLASSES=qkvr,wo_ud N86_N75_MS=8,16 SPEC=dflash2 CTX=1048576 bash @STACK@/cands/n419j3-2416d17a/recipe/serve/serve.sh1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071#!/usr/bin/env bash# Inkling-2-Mini + the t5a DFlash2 drafter on one NVIDIA DGX Spark (GB10), served by SGLang.## MODEL_DIR=~/models/Inkling-2-Mini bash recipe/serve.sh # start (detached container), then wait until ready# bash recipe/serve.sh stop## What it does: checks the repo's checksums, pulls the pinned SGLang image if it is missing, fills the launch row of the chosen# profile (recipe/profiles/<PROFILE>.row) with this checkout's paths, and runs the frozen launcher# recipe/stack/cands/n419j3-2416d17a/recipe/serve/serve.sh with it, unchanged. The row is the exact configuration that was# benchmarked; only the paths, the container name, the port and the optional API key come from here.## Settings (environment):# MODEL_DIR thinkingmachines/Inkling-2-Mini at revision 1fb4134b (required; mounted read-only)# PROFILE agentic (default: 262,144-token context, the measured configuration) | long (1M context + image input)# PORT host port of the OpenAI-compatible API (default 8000)# BIND host address the port is published on (default 127.0.0.1; reach it over an SSH tunnel, or set 0.0.0.0# only together with API_KEY)# API_KEY optional bearer key the server requires# NAME container name (default inkling2-mini)# MEM SGLang --mem-fraction-static (default: the profile's, 0.82; lower it if other GPU programs run beside it)# CACHE_DIR JIT / kernel cache (default ~/.cache/inkling2-mini-t5a; the first boot compiles, later boots reuse it)# CHECK_BASE 1 (default) = sha256-check the base weights once per MODEL_DIR (marker in CACHE_DIR); 0 = skip# WAIT 1 (default) = wait for /health and /v1/models before returning; 0 = return after docker runset -euo pipefailR=$(cd "$(dirname "$0")" && pwd); REPO=$(cd "$R/.." && pwd)NAME=${NAME:-inkling2-mini}; PORT=${PORT:-8000}; BIND=${BIND:-127.0.0.1}; PROFILE=${PROFILE:-agentic}CACHE_DIR=${CACHE_DIR:-$HOME/.cache/inkling2-mini-t5a}; CHECK_BASE=${CHECK_BASE:-1}; WAIT=${WAIT:-1}if [ "${1:-}" = stop ]; then docker rm -f "$NAME" > /dev/null 2>&1 && echo "stopped $NAME" || echo "$NAME not running"; exit 0; fisay() { echo "[serve] $*"; }die() { echo "[serve] ERROR: $*" >&2; exit 1; }
ROWF=$R/profiles/$PROFILE.row[ -f "$ROWF" ] || die "no profile '$PROFILE' (recipe/profiles/*.row)"
: "${MODEL_DIR:?set MODEL_DIR to the thinkingmachines/Inkling-2-Mini checkout (revision 1fb4134b)}"MODEL_DIR=$(cd "$MODEL_DIR" && pwd)[ "$BIND" = 127.0.0.1 ] || [ -n "${API_KEY:-}" ] || die "BIND=$BIND publishes the API beyond this machine: set API_KEY too"[ "$(uname -m)" = aarch64 ] || say "warning: built and measured on a DGX Spark (aarch64, GB10); this host is $(uname -m)"command -v docker > /dev/null && command -v python3 > /dev/null && command -v sha256sum > /dev/null || die "needs docker, python3 and sha256sum"
# 1. this checkout: the frozen trees, the launcher, the drafter and its mix are exactly the released bytes( cd "$REPO" && grep -E ' (recipe/(stack|profiles)/|drafter/|drafter-mix/)' SHA256SUMS | sha256sum -c --quiet - ) || die "checkout differs from SHA256SUMS"# 2. the base weights (once per MODEL_DIR; 20 GB, about a minute)mkdir -p "$CACHE_DIR"MARK=$CACHE_DIR/base-ok-$(printf '%s' "$MODEL_DIR" | sha256sum | cut -c1-12)if [ "$CHECK_BASE" = 1 ] && [ ! -f "$MARK" ]; then say "checking base weights in $MODEL_DIR against recipe/base-1fb4134b.sha256" ( cd "$MODEL_DIR" && sha256sum --quiet -c "$R/base-1fb4134b.sha256" ) || die "MODEL_DIR is not thinkingmachines/Inkling-2-Mini @1fb4134b" touch "$MARK"fi# 3. the image, pinned by digest (the frozen launcher runs with --pull=never)IMAGE=$(grep -o 'IMAGE=[^ ]*' "$ROWF" | head -1 | cut -d= -f2-)docker image inspect "$IMAGE" > /dev/null 2>&1 || { say "pulling $IMAGE"; docker pull "$IMAGE"; }# 4. the row, with this checkout's paths; MEM override; then the frozen launcherROW=$(sed -e "s#@STACK@#$R/stack#g" -e "s#@DRAFTER@#$REPO/drafter#g" -e "s#@MIX@#$REPO/drafter-mix#g" -e "s#@CACHE@#$CACHE_DIR#g" "$ROWF")if [ -n "${MEM:-}" ]; then ROW=$(sed -E "s/ MEM=[0-9.]+ / MEM=$MEM /" <<< "$ROW"); grep -q " MEM=$MEM " <<< "$ROW" || die "could not set MEM=$MEM"; ficase "$ROW" in *@*@*) die "unfilled placeholder in $ROWF";; esacexport VLLM_NO_USAGE_STATS=1 DO_NOT_TRACK=1say "profile $PROFILE, container $NAME, http://$BIND:$PORT/v1 (model inkling-2-mini), cache $CACHE_DIR"if [ -n "${API_KEY:-}" ]; then export API_KEY; else unset API_KEY; fi # the frozen launcher adds --api-key only when seteval "env NAME=\"\$NAME\" PORT=\"\$PORT\" BIND=\"\$BIND\" MODEL_DIR=\"\$MODEL_DIR\" $ROW"[ "$WAIT" = 1 ] || exit 0# 5. ready = /health and /v1/models answer (first boot: ~15-25 min of kernel compilation and CUDA-graph capture)H=(); [ -n "${API_KEY:-}" ] && H=(-H "Authorization: Bearer $API_KEY"); HOST=$BIND; [ "$HOST" = 0.0.0.0 ] && HOST=127.0.0.1for i in $(seq 1 270); do if curl -sf -m 5 "${H[@]}" "http://$HOST:$PORT/health" > /dev/null && curl -sf -m 5 "${H[@]}" "http://$HOST:$PORT/v1/models" | grep -q inkling; then say "ready after $((i * 10)) s"; exit 0; fi docker ps --format '{{.Names}}' | grep -qx "$NAME" || { docker logs --tail 60 "$NAME" 2>&1 || true; die "container $NAME exited during boot"; } sleep 10donedie "not ready after 45 min; docker logs $NAME"12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477561a59cd6f4d9b31abd76da83f67b5797f4a1f5e5ec9ce866e78fdcd8692896eb cands/n292-v2-v297-pk3c/recipe/CREDITS.md1a87a7afb937c54991860f623a0365882a854cf08bf058e6efd60e87488fcddd cands/n292-v2-v297-pk3c/recipe/LICENSE398c1c6b775c7865ad1c50f1cc73ed01116a4d8e213ed3bcf7eff0bc2d268642 cands/n292-v2-v297-pk3c/recipe/NOTICE61a59cd6f4d9b31abd76da83f67b5797f4a1f5e5ec9ce866e78fdcd8692896eb cands/n292-v2-v297-pk3c/recipe/overlay/inkling_attn/CREDITS.knapcio-v2.9.3.md1a87a7afb937c54991860f623a0365882a854cf08bf058e6efd60e87488fcddd cands/n292-v2-v297-pk3c/recipe/overlay/inkling_attn/LICENSE.knapcio-v2.9.3398c1c6b775c7865ad1c50f1cc73ed01116a4d8e213ed3bcf7eff0bc2d268642 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_attn/NOTICE.knapcio-v2.9.34d3f0b284bde7c3a066f1134ec52d1896512804aa92d311b0fb48659cc617bd6 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_attn/README.mdf7c0b49cfd8e4047947118882ae79b001dfc1486e4dd9ee92e544e89c83c70ca cands/n292-v2-v297-pk3c/recipe/overlay/inkling_attn/__init__.pyab12eae066bc1cc54662498a1d7d53aa468619997fc204e6a14ba26715977a0c cands/n292-v2-v297-pk3c/recipe/overlay/inkling_attn/_hook.py3cf30a00b0670b0babb2024b85ec88508e66562fe1901e9b2bc51b86275b3a8a cands/n292-v2-v297-pk3c/recipe/overlay/inkling_attn/build.pyecd499f8ab53c0d2e03942fd1ef9ba4165ea16b276fbb26b9a5bfbfa078da34a cands/n292-v2-v297-pk3c/recipe/overlay/inkling_attn/csrc/attn_kernel.cuhe10f9d601a09d438749189902a4da13411a4318610de2c87d90c0335cec80995 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_attn/csrc/inkling_attn_ext.cu8b097c56fbe2b6facb41e80e97e0fd6198fcb0a85460f127a716731b3ae8a921 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_attn/ops.pyfa70374aba0e5f826993c98cbf4303a0b515f9457b60461dc3f8da30c64f9892 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_attn/patch.py0424895a98d8a22a9cdce8c3ac32dd00ce0000c6292e0b6a732848ffc4b426ea cands/n292-v2-v297-pk3c/recipe/overlay/inkling_attn/tests/test_install.py9884d1befc3894d1f5f4b4c8b34df827a4bd752232f046673af05db33494009a cands/n292-v2-v297-pk3c/recipe/overlay/inkling_attn/tests/test_w8split_cpu.pyeb0c172281bf706ade1554a37192d0bf59db643bc1b0cefb7b863b4e93231a4b cands/n292-v2-v297-pk3c/recipe/overlay/inkling_cert/README.md5882400af5a589496e782828387924f5e833ebace1356cf72ea720799975d31e cands/n292-v2-v297-pk3c/recipe/overlay/inkling_cert/__init__.pyee0ef2ccad715b6614ee88fedd6f5a5a67291e6c76e3fed8c9bf4bf663209858 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_cert/_hook.py54869935ed0fc96e98a78e8422b62282693f3231db2883e780a1e0d816f44efd cands/n292-v2-v297-pk3c/recipe/overlay/inkling_cert/build.pya254d8f11b5fa27c01c3d5df3584dc703a5140d202955cc963064b2aca5e8677 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_cert/cert_math.py0e6a597b3ff6dc12b01e9247906604262006cf2094b7358dab49bc6dd2fa9177 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_cert/certwide.py957d0dd2a18d5ac7de6fc88e937052852549750e669af9ebc40abb753c81328d cands/n292-v2-v297-pk3c/recipe/overlay/inkling_cert/certwide_math.pydc2b48f09ba8ab465daf9ad63fbc728dbcd01b725798f0a634f8af411022f07b cands/n292-v2-v297-pk3c/recipe/overlay/inkling_cert/certwide_reduce.pye2f40277fe04993deed769348905e2e911dcbe218f6f6298c677977e91951669 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_cert/csrc/cert_ext.cu88a27a25adb3e0a2553e82cbc30a0c8a02dcf84635048baba921a746fb4cf175 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_cert/csrc/certwide_screen.cuhe062ec37ea4eef60f7dd7be2f42b6e2541b06dcdcadc3e255cc1e1fec56ee2ca cands/n292-v2-v297-pk3c/recipe/overlay/inkling_cert/csrc/screen6.cuh8398ac6708c32f5fe2224a15e3495708e0760d79564208c822c7bdf9a93ccf92 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_cert/dflash.py9d4fd4e0867b28d19bde7c1a47a6dbc462691dee38ab2f34073f454838b374b1 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_cert/ops.py2b6ba45d552282da40e2d1d380707dc26ad679eb114fb0bd1c533fe6944a4b2e cands/n292-v2-v297-pk3c/recipe/overlay/inkling_cert/patches.py56274922d9aaa203ef2b5bd3dff7d7f3973d562b1f47541dc833669a10b7eeb8 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_cert/quant.py689f292b6e85042db4d7f700ef39573dcc1f441683abcae71e5074109c6e8168 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_cert/tests/test_cert.py7eec9ed58f35f5ae644b15ead34fc384fe5f1d8eee47f6fe1dd580a9d896e825 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_cert/tests/test_certwide.py131940bc65d9c1efca8ccf4816e9f5ae615394510f7bdd70d550cb0200a7e12a cands/n292-v2-v297-pk3c/recipe/overlay/inkling_cert/tests/test_dflash.py9c582d423bee68dd253422ad91c42ad6e9d494c67030b0e09e2e660549b2ad83 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_cert/tests/test_patches.py089b23ba89259410f7f4c5a73d6a261ac928a44add4f5debeabc84a5b7a9c364 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_cert/tools/gpu_check_cert.py1b41188139e5e59c0d1138efbc218aa5469c2b3570fdce2a7f2b790589f991ea cands/n292-v2-v297-pk3c/recipe/overlay/inkling_cert/tools/smoke_hooks.py269984f2e0628a6387af93a27350f6ccd53691d6ebc6ff63b4efd83a536fd1c7 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_dfaccept/README.md24eb31b321286bef5e99130e3b083ddfe8faafcb342c052305c5a98a5d7d9f59 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_dfaccept/__init__.pyab12eae066bc1cc54662498a1d7d53aa468619997fc204e6a14ba26715977a0c cands/n292-v2-v297-pk3c/recipe/overlay/inkling_dfaccept/_hook.py7ba089479db0974c09b76f1042f9131bb944e309343d72867c089e9faa3760fe cands/n292-v2-v297-pk3c/recipe/overlay/inkling_dfaccept/core.py251128ff0efd9eb43e6a8225570e89d08b6e6b7c7b0cd3d1d8392050a3d9f563 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_dfaccept/patches.py5eb381c6c5137f7a670130ad22fe406706dedb095d0a9817f15d57ecddb809e8 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_dfbytes/README.md7cf77494d835269f88a704f0eaca2518ff2fda31c60d32d371b757f0db88ec66 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_dfbytes/__init__.pyab12eae066bc1cc54662498a1d7d53aa468619997fc204e6a14ba26715977a0c cands/n292-v2-v297-pk3c/recipe/overlay/inkling_dfbytes/_hook.pyaca345f7e98de7509e7b507e4d401c8692db76687f3ab9116538261f7b143dcb cands/n292-v2-v297-pk3c/recipe/overlay/inkling_dfbytes/ctx8.pycebe39ac06717ae5735ff4f839c1e5992a2b2f4ab50d4f98a062baa9c2f4a415 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_dfbytes/patches.pyf126616fd8682f570af7bdf7ec26e807d40c61051a8049d3e3efa16f94369798 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_dftail/__init__.pyab12eae066bc1cc54662498a1d7d53aa468619997fc204e6a14ba26715977a0c cands/n292-v2-v297-pk3c/recipe/overlay/inkling_dftail/_hook.pyae77c2c3723aa2cdb32d9f26eea67ee82a44a6c55282483416ed2c801af40296 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_dftail/_sources.py6cd072ae1ca44714816b874c733805ea8c3be511a23715829e63298ed8dfd566 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_dftail/bpatch.pyb23bdb11c23c0cc06297899ca7e71a3f1be781052726427c1b5000e27afb8b0b cands/n292-v2-v297-pk3c/recipe/overlay/inkling_dftail/snapshot.pye3b1e2f5194051bba30e455756c6b1943f5aacd03599ce1fa4b1b542844c0663 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_draftbytes/README.md8dd8abba6fa60514f4a68c64f54dd8cffedffbaa0982f4d4847be7627e3389c2 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_draftbytes/__init__.py812d99b5844ca99e56fa11394663733404441d35c3b42e804d8884a604eab6df cands/n292-v2-v297-pk3c/recipe/overlay/inkling_draftbytes/_hooks.pyae8f4cb9cccea61a658bf3de2e0a4ef2cb0d01213915c5ce1732087100976ceb cands/n292-v2-v297-pk3c/recipe/overlay/inkling_draftbytes/_opts.py06a22262122f4cc0b9bbf1497b98ab2f331175c2b407fc572284935d228788a5 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_draftbytes/_triton.pyc3d8459315b854912142d8b6deb7a2d903cee5913bcf2ee6ddb059faeebf9c13 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_draftbytes/csrc/w8gemv.cu2430b0bbe643063b7b842df20b5058ca07db302e37e0f199770ffa3fc49a1c3e cands/n292-v2-v297-pk3c/recipe/overlay/inkling_draftbytes/dwin.py32bbb9a854451827e7633b19d0bb534e697fbd6c8ee6e76dae412d2dda464a4d cands/n292-v2-v297-pk3c/recipe/overlay/inkling_draftbytes/hotvocab/inkling2-mini-hot-r2.jsonbab4e585eaff5c71e86eaa79bf5a0b9a11fa4bcbbca1495286b29d037d443ef4 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_draftbytes/ops.pyda084e9753f9d9a80876ac94595a375ec625302e23fac51a72fdc33e681e9cec cands/n292-v2-v297-pk3c/recipe/overlay/inkling_draftbytes/patches.pycd3a06f12f2c22cbd73d62b24836eb8fb43b2d57e423ed3b4a18bb0b5df4a6e2 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_draftbytes/quant.pyf0fbc7e4b44e513c724d7381f6d12b04838cc3826c547be51b36fe1b47c48860 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_draftbytes/rnnhoist.py65acc6c881f54a868270eec9e2acdd552fe0158da010dfb001ad112929360682 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_draftbytes/tau.py40db95bd0174f5a3d9f732a1e742ff022384884046b1da095e3b76d528f38c28 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_draftbytes/timing.pycb76bf7c8ae6b78337483d6e3145b4aadb076db528a7777e95fdc95e804f4346 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_draftbytes/w8gemv.py84c62ef2bad39eb126b3f03e356aa8e7149ce00cdef07b441bb8a3066544daef cands/n292-v2-v297-pk3c/recipe/overlay/inkling_kernels/README.mdcf121c574ddc27aa1ff24138814b25990cf9e6426fe5ac91f08166c9b944073e cands/n292-v2-v297-pk3c/recipe/overlay/inkling_kernels/__init__.pyee0ef2ccad715b6614ee88fedd6f5a5a67291e6c76e3fed8c9bf4bf663209858 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_kernels/_hook.py75dafe2d6bfbeb65193bbab71f1c915ebca4e3919edb540898f93cf9f7594b7e cands/n292-v2-v297-pk3c/recipe/overlay/inkling_kernels/moe_tiles.py97d9379d33afc634a1a91e41e2fef1bda8d1609d19fe58ff95d2adafb5808d6b cands/n292-v2-v297-pk3c/recipe/overlay/inkling_kernels/qkvr_gemv.py9886b5e338556024c03dd58a31b14e9e5f03e094609b547915e324f44605857f cands/n292-v2-v297-pk3c/recipe/overlay/inkling_kv12/README.md41daa1fc09a60a324539affd7ec9667a0350020fc6633f8c068fec9dc5f78ee0 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_kv12/__init__.pyab12eae066bc1cc54662498a1d7d53aa468619997fc204e6a14ba26715977a0c cands/n292-v2-v297-pk3c/recipe/overlay/inkling_kv12/_hook.pybc8941909122c51bcc80cb1b37fda233061c0c50c180e031aba3a8c7789e7691 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_kv12/ops.pyd4514e3786f2dd98370a6126733239344f94280c4b89d7126536b99b66352283 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_kv12/patch.py4c035d2a7cfc45f17cf9fb39341a6fa85bc4634b3926725f7d23cd9501808012 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_kv12s/__init__.pydd08112a15db424731b25bb3dd8e5d27a688033896fb11269e3c021e6e0f2bdf cands/n292-v2-v297-pk3c/recipe/overlay/inkling_kv12s/attention.py6f96ca7ed4d69503bb2e83f95ddf08b201b510acf9cc1b034f724125a726a214 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_kv12s/check_data.py10932369507cd317ee7f1ad1966433bfbcb34da2106b795b6b580a60a85e159f cands/n292-v2-v297-pk3c/recipe/overlay/inkling_kv12s/device.py616a0ab680b3b259128a39dfeb77d7b8b77ed7cb6bef74d890e0487f38ee507a cands/n292-v2-v297-pk3c/recipe/overlay/inkling_kv12s/patch.py3554c61d7da8134766ed41206239065ba1e7b5df3b38a390a66a931876cf4533 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_kv12s/pressure.pyd0ad1f533a820b97d19ffbc420c8f490497c38641bb48f7328206299aa48f145 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_kv12s/segsum.py7d8d61c362c645a610e65d4ccba7e0dce8d46dcd150a27df5d2546fb37093661 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_kv12s/static.py37b1fd7d544955e98c4d8ee1d16f4e49e2f945dc18b137b894b1fd5cbe7ce102 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_kv12s/storage.pya7a4ce407859b7f31120608314ae7d9f8df8244ef309dcd9cd3aae689f731f0c cands/n292-v2-v297-pk3c/recipe/overlay/inkling_kv12s/swa_layout.pybb72def3d71f7cf145079bc5edc4f8ee1a208f15780928b806337826d81bda8d cands/n292-v2-v297-pk3c/recipe/overlay/inkling_noexp/__init__.pyab12eae066bc1cc54662498a1d7d53aa468619997fc204e6a14ba26715977a0c cands/n292-v2-v297-pk3c/recipe/overlay/inkling_noexp/_hook.pyd6207856ed7b8146c9842cbebac87b652a05f9e0c83dd84ef644d7edb4d55c42 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_noexp/_mask.py81752701087d7a56045ab97627e3e2ceaf039099d5b561c061321a22acf6b689 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_padx/__init__.pyab12eae066bc1cc54662498a1d7d53aa468619997fc204e6a14ba26715977a0c cands/n292-v2-v297-pk3c/recipe/overlay/inkling_padx/_hook.py51823f619e768163dbfa547165e7af04ddf93af35ff13e6b8ff0ef02abaaf686 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_padx/patches.py2710527dfb9c184e3cc77780c6d69ab64b22bba032daa2087736302d54c5b0d7 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_pcopy/__init__.pyab12eae066bc1cc54662498a1d7d53aa468619997fc204e6a14ba26715977a0c cands/n292-v2-v297-pk3c/recipe/overlay/inkling_pcopy/_hook.pyc210ac609cd5ff936aed7b0d582b5a89dc059cfaab93dc91ad7cd6a445866062 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_pcopy/_sources.py2b9b808117ef4b23884652c9a199258bebaacfb485199d434304969ae1f33353 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_pcopy/fixtures.py26a153b5ffa4ee27159401581b109872b91216cbd36db8d6f1e04bf43c3ca2f7 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_pcopy/fused.py26e1cdbb37a8d7f58d7b92c42270e151d08822d3e9797130dbbb19d483b1352e cands/n292-v2-v297-pk3c/recipe/overlay/inkling_pcopy/history.py079f558fe7ddc02f8bd320d71fa329e569bf3e1ecc2c9a419fe32f62b7139192 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_pcopy/matcher.py14b3d2fda0fbc5a7a640187872ec77c072f2ba723de74983ab5a63b10fa85545 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_pcopy/patch.py89a122d26a44d635e94586af6dfdb50c53f48a462d7ea02395b293fb1ef9c6d3 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_pcopy/rule.py61a59cd6f4d9b31abd76da83f67b5797f4a1f5e5ec9ce866e78fdcd8692896eb cands/n292-v2-v297-pk3c/recipe/overlay/inkling_pfuse/CREDITS.md.knapcio-v2.9.31a87a7afb937c54991860f623a0365882a854cf08bf058e6efd60e87488fcddd cands/n292-v2-v297-pk3c/recipe/overlay/inkling_pfuse/LICENSE.knapcio-v2.9.3398c1c6b775c7865ad1c50f1cc73ed01116a4d8e213ed3bcf7eff0bc2d268642 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_pfuse/NOTICE.knapcio-v2.9.3aa5869a0f6a177c6cda7280c4a2564097a06f02b3e260c4a25cd24a8c6193018 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_pfuse/README.md9820ebf80c8ffff40d14244fdab623d1511ea8fc751a1fa8c17f759fade25f9d cands/n292-v2-v297-pk3c/recipe/overlay/inkling_pfuse/__init__.pyab12eae066bc1cc54662498a1d7d53aa468619997fc204e6a14ba26715977a0c cands/n292-v2-v297-pk3c/recipe/overlay/inkling_pfuse/_hook.py7e47cfd76d45851d371aa23e089deba31c99823e2296ca145522b4d801583b7e cands/n292-v2-v297-pk3c/recipe/overlay/inkling_pfuse/_triton_mix.py1930979f4bdc1b97bac83cc95dc4c15ab726b0ce69f11baeda9cf753011c7e41 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_pfuse/_triton_sconv.pyd3b81190b2622e5a437c823af4ae16e0ebf1e8b631c7a9432bc1e71503bd01ce cands/n292-v2-v297-pk3c/recipe/overlay/inkling_pfuse/layer.py508f34216dec13dcc30d77c08cd09d10f7d20bbbb28bb031e90414c7b25d3f8b cands/n292-v2-v297-pk3c/recipe/overlay/inkling_pfuse/mix.py32fe8bcacf8d6fc64ee401b014c421c4cdc0d5c6d342a50a489bf65891cbfd5a cands/n292-v2-v297-pk3c/recipe/overlay/inkling_pfuse/tools/attrib_prefill.py1ff7a611ad3a7e6ee9955f5ece2fc8778b5e37186bec785bf304e68f997300a3 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_pfuse/tools/bench_loop.py467bc7d06db2756307d7da7fc7289c7ff2a2f08d4ec1550cad57b6dcf1bbd73f cands/n292-v2-v297-pk3c/recipe/overlay/inkling_pfuse/tools/gpu_check_pfuse.py63f3bbbdc63686529c2ed70ef5a94cbe66ab761a985799f58e27d9aaedacfad8 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_pfuse/tools/sweep_mix.py61a59cd6f4d9b31abd76da83f67b5797f4a1f5e5ec9ce866e78fdcd8692896eb cands/n292-v2-v297-pk3c/recipe/overlay/inkling_phoist/CREDITS.md.knapcio-v2.9.31a87a7afb937c54991860f623a0365882a854cf08bf058e6efd60e87488fcddd cands/n292-v2-v297-pk3c/recipe/overlay/inkling_phoist/LICENSE.knapcio-v2.9.3398c1c6b775c7865ad1c50f1cc73ed01116a4d8e213ed3bcf7eff0bc2d268642 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_phoist/NOTICE.knapcio-v2.9.326eb3a17f9a426fb11dfec4e294dd2ed187b7104bf36e7588a9d6df8ee63134b cands/n292-v2-v297-pk3c/recipe/overlay/inkling_phoist/__init__.pyab12eae066bc1cc54662498a1d7d53aa468619997fc204e6a14ba26715977a0c cands/n292-v2-v297-pk3c/recipe/overlay/inkling_phoist/_hook.pyca8c58f123ea47200ca9306f1e043fae10672f381cf96e7685f5f6adff3e953a cands/n292-v2-v297-pk3c/recipe/overlay/inkling_phoist/phoist.pyf55d49b173b3f6ef080ce2dcc563333f193dfcbf75a7e8f7f6f5b353e4be7576 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_phoist/phoist_triton.pya12fbe61a792b2c2c7597b259ab99a0b9656922865a9a24836d92f17e121f876 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_pico12/README.md8aeb4211fa86cc155ac12af76eedea7963e96c1f43c766e3c749bcfba35ac370 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_pico12/__init__.pyee0ef2ccad715b6614ee88fedd6f5a5a67291e6c76e3fed8c9bf4bf663209858 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_pico12/_hook.py0b9cd153d788be7ffed98a8bd0d7b4fbab6222f1e3c06961865a01a6cd991c44 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_pico12/build.pyaab4b5396310f0f0cbe21c1fcd5906e25b8c62f18689685c48ff5f530622c7c8 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_pico12/csrc/pico12_ext.cu8babed542f329a5040a02167d6d30e880d35a4f334b457adff8489dfa198800a cands/n292-v2-v297-pk3c/recipe/overlay/inkling_pico12/csrc/pico12_range.cu97329931d0e392fc5ac1292657bb9852bae973fd4336ec47dcea626bd78a09cd cands/n292-v2-v297-pk3c/recipe/overlay/inkling_pico12/ops.py1d91c866aaa329e6045d2161a776ba6e2064f3f81b8a6a6903f0bb6c6cc3608e cands/n292-v2-v297-pk3c/recipe/overlay/inkling_pico12/patches.pyfb9c7ecee826335f6014f5f2040b5abe132a86aa6e43f1545bb1e5db19cea16b cands/n292-v2-v297-pk3c/recipe/overlay/inkling_pico12/third_party/pico/LICENSE60b3ad14b8d2291101c82f3cc8c0653a6e778b1db9abfe463992dd3737550b4f cands/n292-v2-v297-pk3c/recipe/overlay/inkling_pico12/third_party/pico/common/check.h5d96f43891a930cffa23c8649a79d28d019f7597bf5b2ac51e46eb6de5ff6e87 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_pico12/third_party/pico/kernels/common.cuhbaa1d8d7ff69d0f132acbfba354eb35dc4e5011b5f3e1ae3d177d6d1dcfb5256 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_pico12/third_party/pico/kernels/dsk.h91230a0b0783d2af5da87d6476e60c2dc2d94d60879998e54db547dc6f01982d cands/n292-v2-v297-pk3c/recipe/overlay/inkling_pico12/third_party/pico/kernels/gemv16.cu61a59cd6f4d9b31abd76da83f67b5797f4a1f5e5ec9ce866e78fdcd8692896eb cands/n292-v2-v297-pk3c/recipe/overlay/inkling_prologue/CREDITS.knapcio-v2.9.3.md1a87a7afb937c54991860f623a0365882a854cf08bf058e6efd60e87488fcddd cands/n292-v2-v297-pk3c/recipe/overlay/inkling_prologue/LICENSE.knapcio-v2.9.3398c1c6b775c7865ad1c50f1cc73ed01116a4d8e213ed3bcf7eff0bc2d268642 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_prologue/NOTICE.knapcio-v2.9.3d807c304d543312f6c3c3e2f1d40a3dcedc982c8bef30a34ca891fe6c7956fbe cands/n292-v2-v297-pk3c/recipe/overlay/inkling_prologue/__init__.pyab12eae066bc1cc54662498a1d7d53aa468619997fc204e6a14ba26715977a0c cands/n292-v2-v297-pk3c/recipe/overlay/inkling_prologue/_hook.pyd83c5b71d817b66804bfaa2c7108a96b4374033102b709639555456feed6478d cands/n292-v2-v297-pk3c/recipe/overlay/inkling_prologue/_triton.pyfed63858ca1872cf9fc4122cff02af670e297b972df4d075c929c77613b7f6c4 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_ptouch/__init__.pyab12eae066bc1cc54662498a1d7d53aa468619997fc204e6a14ba26715977a0c cands/n292-v2-v297-pk3c/recipe/overlay/inkling_ptouch/_hook.pyb8dfe59c5b140d6a9804be846b06cb4ec07746bb0176ff8b2637177c9487806f cands/n292-v2-v297-pk3c/recipe/overlay/inkling_rsfix/README.mdedf339d321b72e9207204143906526677b6beacb179e1399ac9dc183ba29bd72 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_rsfix/__init__.py2a1eabd10f7e964a53fe76b66254873fcfd461b0d32f7277db42457d7d65990a cands/n292-v2-v297-pk3c/recipe/overlay/inkling_rsfix/_hook.pyc4e84d4ef8e7343e1563617814c65d0d71fbe19915461d73245818f83e9d1e6c cands/n292-v2-v297-pk3c/recipe/overlay/inkling_rsfix/_sources.pye4dfce68cae58f71a0658410fe88e6520f94d6c389f8d57e482dacea363509d8 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_rsfix/blockwise.py9530622cde80e49864d60a50342ff1850e6c6389eb1baa0207d68ba6a388005c cands/n292-v2-v297-pk3c/recipe/overlay/inkling_rsfix/markov.py93da51652aa8ec27396610a10724b6571e5de8d4ee08e236677c9e98604db951 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_rsfix/reference.py61e81094be26a6f8a46f07f1b062b07eab246a52553ed094ba147813d92dd513 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_rsfix/reject.pyd5607344cacbcf77fb4cdcc6ce9de49a4290bbf85281f78c9c397a2984dc06eb cands/n292-v2-v297-pk3c/recipe/overlay/inkling_rsfix/selector.py63c5e7852205045be8bca6e84160df8f2f4dd4f44a8093a6a5a04d9fffbca47e cands/n292-v2-v297-pk3c/recipe/overlay/inkling_vattn/README.mda08d05ffbd94bdb1c94194432d927b1f30035fa6f23fcc2adc7de36b2930c78c cands/n292-v2-v297-pk3c/recipe/overlay/inkling_vattn/__init__.pyab12eae066bc1cc54662498a1d7d53aa468619997fc204e6a14ba26715977a0c cands/n292-v2-v297-pk3c/recipe/overlay/inkling_vattn/_hook.py63aad1d099fec3f2b66a0ffd8d3709a564644edac2d4f25c1c33018be3dd6f25 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_vattn/ops.py4f18599a0ad748f7f6a507f165ac72327e733eb082fd6276995b9e4474869652 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_vattn/patch.py66f94a7e6143ee5bde5e8f83aefe4333ad9d701282b411f0c30091eff637b3b7 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_vcap/README.md6a39653aa552d2035e4700918cf7e6dd488881c46cd4d52a3edf8424fe7f3cbd cands/n292-v2-v297-pk3c/recipe/overlay/inkling_vcap/__init__.py01b543f9ea35fd83b4ef34d681b86f6aedd3fc9cbc26b270fb98d3159025c4c2 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_vcap/config.pybbe0288dd145ba12f1d7312b7def82a7dc0f76c31b5dfa3e2236730eba177b79 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_vcap/dfcap.py9caf5d3ca057b622e4cca6e35456f7435f9e1d1e5df692f491e12271014d8aed cands/n292-v2-v297-pk3c/recipe/overlay/inkling_vcap/dfcheck.pyf7d2389c58143c3ea661616d82f42e1c7b55b8f95c78dcb424c45d205c4d2203 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_vcap/dflash.py41cd33472898d7ad98bcbaae2eaf5c27238069b6cdd7815528c932795673e5da cands/n292-v2-v297-pk3c/recipe/overlay/inkling_vcap/dfsteplog.pybda7d9e386db34eb3f3a8c8aeda249b91ff8ec27d176c23fb5574e80ec81c431 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_vcap/fastprobs.pyd364b1bc5a27dd747b08095030670ac085205454b548ba54b453f96872cd90bb cands/n292-v2-v297-pk3c/recipe/overlay/inkling_vcap/fused.py897b421d153acd9c0494e084e0d8227804a00f5d24c245646dec74079c422b84 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_vcap/fused_accept.py0a928a2c9b2677ce1a359da34d444b40ff38cc6a01c8f44c5723dbaabb6751e5 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_vcap/importhook.py2738304eeff01b7d21c700c7408b24e1c429ad912fdc6e58952cf5a1d2a80963 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_vcap/logic.py9ba4bf5aeafcc3d1e58adecbad230cbfa128079c6577843a6e28e40866258a20 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_vcap/patches.py21082944e6df1a1eb5d288c226562278d8b493ea37cb6ccbf6a8a98bcaa93cce cands/n292-v2-v297-pk3c/recipe/overlay/inkling_vcap/policies/df-SLDF1-sm.jsonb9505b8e00284277b8354cf72a406d8bc2b465d8619f51f44e8609964093b5ee cands/n292-v2-v297-pk3c/recipe/overlay/inkling_vcap/policies/df-SLDF2x.jsonab43150b4ff972b9975192761515e843088f8838b765090c888f1c3e79334e9f cands/n292-v2-v297-pk3c/recipe/overlay/inkling_vcap/policies/r2-theta004.json359b404bd41371397ec8948ece4700d10e1e2b6271301e47439dc4cd83198310 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_vcap/policyfile.py982f86bb234ebfd5ca7f37304ae9bf78b5fa90969e75357a5a44905f8a708f49 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_vcap/state.pyc7f51ebddeba0c2cb5a11bf8075fec231f081ef58ffd0e2c93097a70ebbca04a cands/n292-v2-v297-pk3c/recipe/overlay/inkling_vcap/v3_kernels.py4cd0f8e5854e5ed4f1745e6a56aaeba679c4ec4bc17352960f1f01fe3b8f8cf0 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_wide/README.mde473be74143084bca38efb0fce7b281b63239471bc43e99692863dd53b85dd16 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_wide/__init__.pyee0ef2ccad715b6614ee88fedd6f5a5a67291e6c76e3fed8c9bf4bf663209858 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_wide/_hook.py409563a58078e003f0f61c39162dca23563d08cf6fe3e6ecd53211b30538bd12 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_wide/build.py640625aed9282589c3c32b06f0b57be48efd230c88425a4264748fed3f23eb15 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_wide/csrc/bf16x_format.cuha281cb85d1867e5acd8dfe7c8d3b2f1b68b5cb1d3091ad6445eba09d66341e94 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_wide/csrc/wide_ext.cu3b12f4ef0077ccc61f4867a1369a66fc2a3b10e791c19f4323956756086418cd cands/n292-v2-v297-pk3c/recipe/overlay/inkling_wide/ops.py0deb113320ff36523d0e5a25851c3d27aa9412ed5b74d3fd74288504e0404e09 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_wide/patches.py5b3f3070eab76b167d3ac2a7f03cfea9e59901e45dbe3a01059cbe5d423bcdbc cands/n292-v2-v297-pk3c/recipe/overlay/inkling_wide/tests/fake_wide_ext.pyb436a3347e2e274fc146d5ed6969f489415fa60f0fc0f58593fd0875d1ddfd87 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_wide/tests/test_wide.pyfb9c7ecee826335f6014f5f2040b5abe132a86aa6e43f1545bb1e5db19cea16b cands/n292-v2-v297-pk3c/recipe/overlay/inkling_wide/third_party/pico/LICENSEb37e3528ad0ca2dcbd2ab38ee4be67ec88980e769c4a5dbddfa5b45624f28fa7 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_wide/tools/gpu_check_wide.pyff089d1ab9f66eb5ee40a3f77a6193120abc064d9eb97a60e495a5ec3fa743eb cands/n292-v2-v297-pk3c/recipe/overlay/inkling_wide/tools/gpu_integration_wide.py7c4ee1a5c11e621b374a4cabe855842cb0b8d6efdf0b766e842bd1b3de3cd2f3 cands/n292-v2-v297-pk3c/recipe/overlay/sitecustomize.py94dff41c4a23af9e57243750d82d08be918de563b63b4d42a41c859051a34426 cands/n292-v2-v297-pk3c/recipe/patch/inkling2_attn.py64914ef9213420b37bdb361dfb3bdadb5ff07994deda96c548762e006927bd44 cands/n292-v2-v297-pk3c/recipe/patch/inkling2_loop.py70d8797b523b0fcdaad6e709e14bfc4bbdcc735a4b49824b430997ff1018dd78 cands/n292-v2-v297-pk3c/recipe/patch/inkling2_loop_model.py29d1f5cb5101a7a0aac48c4b1f15252acaba01a404c6e2475c6c798f0797d997 cands/n292-v2-v297-pk3c/recipe/patch/n105_rnnhoist.py9d0231ebab913cb3b3956c421ae5f4f69d2661728f1f8d3b3d64755f9e455f63 cands/n292-v2-v297-pk3c/recipe/patch/n13_attn_global.py7d6f1ab93c1252e891446df090e414c6aa975ca480a360b5ac65fb6d16c8be9a cands/n292-v2-v297-pk3c/recipe/patch/n13_fwd.py1801287d6696437fa6417c335decf0f4b9deb7391b4d4e4fd8e5c893cf272333 cands/n292-v2-v297-pk3c/recipe/patch/n140_kern.py6b69991a90d2ca2a6196d4d1d28014983614a6030d8a38d43aa08c7a29f49f65 cands/n292-v2-v297-pk3c/recipe/patch/n14_moe.py8e2d7b61a2ffee1e5bbdaf3f2406a202f13e3a9d96df0f849d35af4d781cac62 cands/n292-v2-v297-pk3c/recipe/patch/n14_quant.cuha67d3cacb45d4a981add4407552b030c8bdf08dabb7e136f555b21475aa3126a cands/n292-v2-v297-pk3c/recipe/patch/n15_fused.pye8373342b54dfccbe4c04fd21e137172286b902b07ed6f5037deeb95eb70c9ef cands/n292-v2-v297-pk3c/recipe/patch/n32_attn_local.py571c3e4a819b27e175091b7af099e972bc4c38b6eac3f1af1ff4e88b6b662746 cands/n292-v2-v297-pk3c/recipe/patch/n32_fwd.py65f51937ca44728959542ca4ed7456973b45e7f32bd54934e44a49ee256630c4 cands/n292-v2-v297-pk3c/recipe/patch/n35_w8.pyaa79c3095959d385dc1c6f9fdcf7558a73547fcc31c4f6460c6e77cbc9327605 cands/n292-v2-v297-pk3c/recipe/patch/n35_w8gemv.pyb4cc2402f4c0eee56dc4ce9721043b6d16ed04e932f94848b395f3873f58cb59 cands/n292-v2-v297-pk3c/recipe/patch/n37_tiles.py5b1a90477bb2ed2dddf31b3adbc8cb200538335854ddb99ce59ecdf3dbfadfac cands/n292-v2-v297-pk3c/recipe/patch/n50b_fused.py1dc6b870ef8c25dd40615930cbf62dfec0e29c5d6b785eb8d42d532ea4a9cd04 cands/n292-v2-v297-pk3c/recipe/patch/n52_band.cuhe4118504ce8a210f8d4ef86d1be579dd4d73e4161bb0c9e4264811ad51999140 cands/n292-v2-v297-pk3c/recipe/patch/n52_moe.py3523d5fe6549aec71d853c0713403fbdc15984e08c3e5820c2a790a6ede84855 cands/n292-v2-v297-pk3c/recipe/patch/n64_attn_global.pyeefba4b83410c246441d74d5311deacc6da6e4405d28e3c5b5fa344d4d29eb81 cands/n292-v2-v297-pk3c/recipe/patch/n64a_fwd.pycca0cd0d7b860ed4cc78a98651264ecb8fd20793055e58323c2623b8531b6d0d cands/n292-v2-v297-pk3c/recipe/patch/n64b_fwd.pyd1b88fb14a0d18ccff2ed53b79dcfcb1a2565e50e6cf625053bf39cdc9f1ecd9 cands/n292-v2-v297-pk3c/recipe/patch/n66fb.pyb7abf0229b9d40558dc6dd576fb300bec9e0a6b9c173b458881111ff0bc89206 cands/n292-v2-v297-pk3c/recipe/patch/n71_resnorm.py91f1bb6066a4e5abf77253e23816783880ea38cff649aebd844157b60268c5e7 cands/n292-v2-v297-pk3c/recipe/patch/n71_sconvres.pyd4411fd151e6212a0feb14ed41457be3c976b92a8f5c981cbc2d1a890075eb7b cands/n292-v2-v297-pk3c/recipe/patch/n75_c12.py71fd33a2a119db28c4ca8a24d75e9678131c87b327d095a329fdad18bc03e29a cands/n292-v2-v297-pk3c/recipe/patch/n75_cuda.py00bece24b9b910eb33d1f85fe1e60b2685a2ac4dfb5f5136d891b9db668968f7 cands/n292-v2-v297-pk3c/recipe/patch/n75_install.py17349b269f1eb7f2551fac79b9e8020b10708410156a08e1b959c8e53f491f79 cands/n292-v2-v297-pk3c/recipe/patch/n78_head.py9447c05ffbf888a1aea1a7da467399f572f1d684f142f24c4cccfacefcd353f8 cands/n292-v2-v297-pk3c/recipe/patch/n78_kern.pyefe43e40ebccb20b31398ef7b7a4e70e0dd1a6192a95904ebb70fb6a8f3d3b73 cands/n292-v2-v297-pk3c/recipe/patch/n80_cuda.pycd2d6ef590744ee69cd3b2dfdff9c42cf957eef291f858c3054f1b651b84943f cands/n292-v2-v297-pk3c/recipe/patch/n80_draft.py9ba4c20f9fa95c8d9a337f4eeea6abae50e142f747d4dde618712f04e127f56f cands/n292-v2-v297-pk3c/recipe/patch/n86_riders.py25030bef80b49e72d46355799e7febea0867ea57aed711f7c9ae28159a81f390 cands/n292-v2-v297-pk3c/recipe/serve/inkling2_mtp.pyc71f08ef804dc439f08eca133bd2591868c60e535d06819cda55033785bf195f cands/n292-v2-v297-pk3c/recipe/serve/serve.sh1bccd9dadf233cd9af15aa63a8d2cc22e0706983355a00e380731d09a5bdb682 cands/n292-v2-v297-pk3c/recipe/serve/sl.json61a59cd6f4d9b31abd76da83f67b5797f4a1f5e5ec9ce866e78fdcd8692896eb cands/n343a-s2-verify-scodes/CREDITS.md1a87a7afb937c54991860f623a0365882a854cf08bf058e6efd60e87488fcddd cands/n343a-s2-verify-scodes/LICENSE398c1c6b775c7865ad1c50f1cc73ed01116a4d8e213ed3bcf7eff0bc2d268642 cands/n343a-s2-verify-scodes/NOTICEe07ff88a0574411792e46cebe6bdd276ca1745c440c5c36bff221c72e2d9e190 cands/n343a-s2-verify-scodes/overlay/inkling_scodes/README.md34a6e1f889e463443f62aac75b5ba075f8893a2656ba6db992426251cb94dcf0 cands/n343a-s2-verify-scodes/overlay/inkling_scodes/__init__.pyee0ef2ccad715b6614ee88fedd6f5a5a67291e6c76e3fed8c9bf4bf663209858 cands/n343a-s2-verify-scodes/overlay/inkling_scodes/_hook.pyea07c7f27e5fa867156d316e434ba0a8126a663b54f1a569f675172f18361421 cands/n343a-s2-verify-scodes/overlay/inkling_scodes/csrc/scodes_args.h8cb82134421f71f05c629ffd95383748e0ac19fb071b31699a1c432771a781b5 cands/n343a-s2-verify-scodes/overlay/inkling_scodes/csrc/scodes_binding.cu060f5b9d3250ca4d2261ded10839ea0010748ecf715cda6fe6ed7af959ce5cca cands/n343a-s2-verify-scodes/overlay/inkling_scodes/csrc/scodes_group_gemm.cuh428d428016a533597539acf1d908d5fccc3eba049b71a25ec7049b95b6893d8c cands/n343a-s2-verify-scodes/overlay/inkling_scodes/csrc/scodes_inst_128_128.cuc808f4b1e8992dd76a67a00ca6d0fd8f0f762ea05e644f5295c9709f5d565349 cands/n343a-s2-verify-scodes/overlay/inkling_scodes/csrc/scodes_inst_32_128.cu39eccddb7294c16dea572ed64e3bdff8d3ee468dd4e98c45bc05c8a387565918 cands/n343a-s2-verify-scodes/overlay/inkling_scodes/csrc/scodes_inst_32_256.cu9c6c0ff50971a322ad90de53d27a28e5519b3c0d99134e0c9cdad8f7eff4869c cands/n343a-s2-verify-scodes/overlay/inkling_scodes/csrc/scodes_inst_64_128.cuad5769b8154581a1c7f72abee12fc95486dae9a0332d632887896ba0cd3179a3 cands/n343a-s2-verify-scodes/overlay/inkling_scodes/csrc/scodes_inst_64_256.cu4b56d68d7a7fc99932447f14cc4c83542b74ed50bb49bc41bf200c49b2da4ebf cands/n343a-s2-verify-scodes/overlay/inkling_scodes/csrc/scodes_sm120_mma_array.hpp9374f3758c08772d6cb7b73885234108bdda93e6184184e784a9589e5cc9cf6c cands/n343a-s2-verify-scodes/overlay/inkling_scodes/encode.pye863a5a1d92f938cac6b23cb52d66a4bde210c495940e117f5c8839e5a74fb22 cands/n343a-s2-verify-scodes/overlay/inkling_scodes/kernel.pye446d09f6e4d582a4daaccc06f556e184f6919398f62933b6eb30a4f48c6d1d8 cands/n361-s3b-p/overlay_n320/inkling_n320s/__init__.pyc7095f22f861b691071abb1c4303ac97e7431d7744f7c1c441eed16df5da552f cands/n361-s3b-p/overlay_n320/inkling_n329/__init__.py7f57e8170a49f4bf179c9ccf50b59a4570e0fd5f6e54d890faf8bded7e847396 cands/n361-s3b-p/overlay_n320/inkling_n329/n329_rows.pyb93d559f1b964104903f96dcb4508020dcdcc65b012c885bf9e2505c92c89701 cands/n361-s3b-p/overlay_n320/inkling_n329/n329_rows_ctl.py53a039ef443368a80a306757a3009181a7e9c15c41770efccf5f58895f836ebc cands/n361-s3b-p/overlay_n320/inkling_n351/__init__.pyfbae72358a1bdc41225f5d00e37c7e8013a5660c4c4e2cdd39a05525f2ee2aeb cands/n361-s3b-p/overlay_n320/n351_quant.cuh172e5b9281facac196160b287aa56a9a3eb79a0fcbf87f0e94c776c0e0520863 cands/n361-s3b-p/overlay_n320/sitecustomize.py61a59cd6f4d9b31abd76da83f67b5797f4a1f5e5ec9ce866e78fdcd8692896eb cands/n361-s3b-p/recipe/CREDITS.md1a87a7afb937c54991860f623a0365882a854cf08bf058e6efd60e87488fcddd cands/n361-s3b-p/recipe/LICENSE398c1c6b775c7865ad1c50f1cc73ed01116a4d8e213ed3bcf7eff0bc2d268642 cands/n361-s3b-p/recipe/NOTICEcfc7749b96f63bd31c3c42b5c471bf756814053e847c10f3eb003417bc523d30 cands/n361-s3b-p/recipe/draft-mix/LICENSE298b4ff803f06cbb4024bd5cdcc53dfa1ba06825936d31a776ef70fe6d30c2a0 cands/n361-s3b-p/recipe/draft-mix/NOTICE61a59cd6f4d9b31abd76da83f67b5797f4a1f5e5ec9ce866e78fdcd8692896eb cands/n361-s3b-p/recipe/overlay/inkling_attn/CREDITS.knapcio-v2.9.3.md1a87a7afb937c54991860f623a0365882a854cf08bf058e6efd60e87488fcddd cands/n361-s3b-p/recipe/overlay/inkling_attn/LICENSE.knapcio-v2.9.3398c1c6b775c7865ad1c50f1cc73ed01116a4d8e213ed3bcf7eff0bc2d268642 cands/n361-s3b-p/recipe/overlay/inkling_attn/NOTICE.knapcio-v2.9.34d3f0b284bde7c3a066f1134ec52d1896512804aa92d311b0fb48659cc617bd6 cands/n361-s3b-p/recipe/overlay/inkling_attn/README.mdf7c0b49cfd8e4047947118882ae79b001dfc1486e4dd9ee92e544e89c83c70ca cands/n361-s3b-p/recipe/overlay/inkling_attn/__init__.pyab12eae066bc1cc54662498a1d7d53aa468619997fc204e6a14ba26715977a0c cands/n361-s3b-p/recipe/overlay/inkling_attn/_hook.py3cf30a00b0670b0babb2024b85ec88508e66562fe1901e9b2bc51b86275b3a8a cands/n361-s3b-p/recipe/overlay/inkling_attn/build.pyecd499f8ab53c0d2e03942fd1ef9ba4165ea16b276fbb26b9a5bfbfa078da34a cands/n361-s3b-p/recipe/overlay/inkling_attn/csrc/attn_kernel.cuhe10f9d601a09d438749189902a4da13411a4318610de2c87d90c0335cec80995 cands/n361-s3b-p/recipe/overlay/inkling_attn/csrc/inkling_attn_ext.cu8b097c56fbe2b6facb41e80e97e0fd6198fcb0a85460f127a716731b3ae8a921 cands/n361-s3b-p/recipe/overlay/inkling_attn/ops.pyfa70374aba0e5f826993c98cbf4303a0b515f9457b60461dc3f8da30c64f9892 cands/n361-s3b-p/recipe/overlay/inkling_attn/patch.py0424895a98d8a22a9cdce8c3ac32dd00ce0000c6292e0b6a732848ffc4b426ea cands/n361-s3b-p/recipe/overlay/inkling_attn/tests/test_install.py9884d1befc3894d1f5f4b4c8b34df827a4bd752232f046673af05db33494009a cands/n361-s3b-p/recipe/overlay/inkling_attn/tests/test_w8split_cpu.pyeb0c172281bf706ade1554a37192d0bf59db643bc1b0cefb7b863b4e93231a4b cands/n361-s3b-p/recipe/overlay/inkling_cert/README.md5882400af5a589496e782828387924f5e833ebace1356cf72ea720799975d31e cands/n361-s3b-p/recipe/overlay/inkling_cert/__init__.pyee0ef2ccad715b6614ee88fedd6f5a5a67291e6c76e3fed8c9bf4bf663209858 cands/n361-s3b-p/recipe/overlay/inkling_cert/_hook.py54869935ed0fc96e98a78e8422b62282693f3231db2883e780a1e0d816f44efd cands/n361-s3b-p/recipe/overlay/inkling_cert/build.pya254d8f11b5fa27c01c3d5df3584dc703a5140d202955cc963064b2aca5e8677 cands/n361-s3b-p/recipe/overlay/inkling_cert/cert_math.py0e6a597b3ff6dc12b01e9247906604262006cf2094b7358dab49bc6dd2fa9177 cands/n361-s3b-p/recipe/overlay/inkling_cert/certwide.py957d0dd2a18d5ac7de6fc88e937052852549750e669af9ebc40abb753c81328d cands/n361-s3b-p/recipe/overlay/inkling_cert/certwide_math.pydc2b48f09ba8ab465daf9ad63fbc728dbcd01b725798f0a634f8af411022f07b cands/n361-s3b-p/recipe/overlay/inkling_cert/certwide_reduce.pye2f40277fe04993deed769348905e2e911dcbe218f6f6298c677977e91951669 cands/n361-s3b-p/recipe/overlay/inkling_cert/csrc/cert_ext.cu88a27a25adb3e0a2553e82cbc30a0c8a02dcf84635048baba921a746fb4cf175 cands/n361-s3b-p/recipe/overlay/inkling_cert/csrc/certwide_screen.cuhe062ec37ea4eef60f7dd7be2f42b6e2541b06dcdcadc3e255cc1e1fec56ee2ca cands/n361-s3b-p/recipe/overlay/inkling_cert/csrc/screen6.cuh8398ac6708c32f5fe2224a15e3495708e0760d79564208c822c7bdf9a93ccf92 cands/n361-s3b-p/recipe/overlay/inkling_cert/dflash.py9d4fd4e0867b28d19bde7c1a47a6dbc462691dee38ab2f34073f454838b374b1 cands/n361-s3b-p/recipe/overlay/inkling_cert/ops.py2b6ba45d552282da40e2d1d380707dc26ad679eb114fb0bd1c533fe6944a4b2e cands/n361-s3b-p/recipe/overlay/inkling_cert/patches.py56274922d9aaa203ef2b5bd3dff7d7f3973d562b1f47541dc833669a10b7eeb8 cands/n361-s3b-p/recipe/overlay/inkling_cert/quant.py689f292b6e85042db4d7f700ef39573dcc1f441683abcae71e5074109c6e8168 cands/n361-s3b-p/recipe/overlay/inkling_cert/tests/test_cert.py7eec9ed58f35f5ae644b15ead34fc384fe5f1d8eee47f6fe1dd580a9d896e825 cands/n361-s3b-p/recipe/overlay/inkling_cert/tests/test_certwide.py131940bc65d9c1efca8ccf4816e9f5ae615394510f7bdd70d550cb0200a7e12a cands/n361-s3b-p/recipe/overlay/inkling_cert/tests/test_dflash.py9c582d423bee68dd253422ad91c42ad6e9d494c67030b0e09e2e660549b2ad83 cands/n361-s3b-p/recipe/overlay/inkling_cert/tests/test_patches.py089b23ba89259410f7f4c5a73d6a261ac928a44add4f5debeabc84a5b7a9c364 cands/n361-s3b-p/recipe/overlay/inkling_cert/tools/gpu_check_cert.py1b41188139e5e59c0d1138efbc218aa5469c2b3570fdce2a7f2b790589f991ea cands/n361-s3b-p/recipe/overlay/inkling_cert/tools/smoke_hooks.py269984f2e0628a6387af93a27350f6ccd53691d6ebc6ff63b4efd83a536fd1c7 cands/n361-s3b-p/recipe/overlay/inkling_dfaccept/README.md24eb31b321286bef5e99130e3b083ddfe8faafcb342c052305c5a98a5d7d9f59 cands/n361-s3b-p/recipe/overlay/inkling_dfaccept/__init__.pyab12eae066bc1cc54662498a1d7d53aa468619997fc204e6a14ba26715977a0c cands/n361-s3b-p/recipe/overlay/inkling_dfaccept/_hook.py7ba089479db0974c09b76f1042f9131bb944e309343d72867c089e9faa3760fe cands/n361-s3b-p/recipe/overlay/inkling_dfaccept/core.py251128ff0efd9eb43e6a8225570e89d08b6e6b7c7b0cd3d1d8392050a3d9f563 cands/n361-s3b-p/recipe/overlay/inkling_dfaccept/patches.py5eb381c6c5137f7a670130ad22fe406706dedb095d0a9817f15d57ecddb809e8 cands/n361-s3b-p/recipe/overlay/inkling_dfbytes/README.md7cf77494d835269f88a704f0eaca2518ff2fda31c60d32d371b757f0db88ec66 cands/n361-s3b-p/recipe/overlay/inkling_dfbytes/__init__.pyab12eae066bc1cc54662498a1d7d53aa468619997fc204e6a14ba26715977a0c cands/n361-s3b-p/recipe/overlay/inkling_dfbytes/_hook.pyaca345f7e98de7509e7b507e4d401c8692db76687f3ab9116538261f7b143dcb cands/n361-s3b-p/recipe/overlay/inkling_dfbytes/ctx8.pycebe39ac06717ae5735ff4f839c1e5992a2b2f4ab50d4f98a062baa9c2f4a415 cands/n361-s3b-p/recipe/overlay/inkling_dfbytes/patches.pyf126616fd8682f570af7bdf7ec26e807d40c61051a8049d3e3efa16f94369798 cands/n361-s3b-p/recipe/overlay/inkling_dftail/__init__.pyab12eae066bc1cc54662498a1d7d53aa468619997fc204e6a14ba26715977a0c cands/n361-s3b-p/recipe/overlay/inkling_dftail/_hook.pyae77c2c3723aa2cdb32d9f26eea67ee82a44a6c55282483416ed2c801af40296 cands/n361-s3b-p/recipe/overlay/inkling_dftail/_sources.py6cd072ae1ca44714816b874c733805ea8c3be511a23715829e63298ed8dfd566 cands/n361-s3b-p/recipe/overlay/inkling_dftail/bpatch.pyb23bdb11c23c0cc06297899ca7e71a3f1be781052726427c1b5000e27afb8b0b cands/n361-s3b-p/recipe/overlay/inkling_dftail/snapshot.pye3b1e2f5194051bba30e455756c6b1943f5aacd03599ce1fa4b1b542844c0663 cands/n361-s3b-p/recipe/overlay/inkling_draftbytes/README.md8dd8abba6fa60514f4a68c64f54dd8cffedffbaa0982f4d4847be7627e3389c2 cands/n361-s3b-p/recipe/overlay/inkling_draftbytes/__init__.py812d99b5844ca99e56fa11394663733404441d35c3b42e804d8884a604eab6df cands/n361-s3b-p/recipe/overlay/inkling_draftbytes/_hooks.pyae8f4cb9cccea61a658bf3de2e0a4ef2cb0d01213915c5ce1732087100976ceb cands/n361-s3b-p/recipe/overlay/inkling_draftbytes/_opts.py06a22262122f4cc0b9bbf1497b98ab2f331175c2b407fc572284935d228788a5 cands/n361-s3b-p/recipe/overlay/inkling_draftbytes/_triton.pyc3d8459315b854912142d8b6deb7a2d903cee5913bcf2ee6ddb059faeebf9c13 cands/n361-s3b-p/recipe/overlay/inkling_draftbytes/csrc/w8gemv.cu2430b0bbe643063b7b842df20b5058ca07db302e37e0f199770ffa3fc49a1c3e cands/n361-s3b-p/recipe/overlay/inkling_draftbytes/dwin.py32bbb9a854451827e7633b19d0bb534e697fbd6c8ee6e76dae412d2dda464a4d cands/n361-s3b-p/recipe/overlay/inkling_draftbytes/hotvocab/inkling2-mini-hot-r2.jsonbab4e585eaff5c71e86eaa79bf5a0b9a11fa4bcbbca1495286b29d037d443ef4 cands/n361-s3b-p/recipe/overlay/inkling_draftbytes/ops.pyda084e9753f9d9a80876ac94595a375ec625302e23fac51a72fdc33e681e9cec cands/n361-s3b-p/recipe/overlay/inkling_draftbytes/patches.pycd3a06f12f2c22cbd73d62b24836eb8fb43b2d57e423ed3b4a18bb0b5df4a6e2 cands/n361-s3b-p/recipe/overlay/inkling_draftbytes/quant.pyf0fbc7e4b44e513c724d7381f6d12b04838cc3826c547be51b36fe1b47c48860 cands/n361-s3b-p/recipe/overlay/inkling_draftbytes/rnnhoist.py65acc6c881f54a868270eec9e2acdd552fe0158da010dfb001ad112929360682 cands/n361-s3b-p/recipe/overlay/inkling_draftbytes/tau.py40db95bd0174f5a3d9f732a1e742ff022384884046b1da095e3b76d528f38c28 cands/n361-s3b-p/recipe/overlay/inkling_draftbytes/timing.pycb76bf7c8ae6b78337483d6e3145b4aadb076db528a7777e95fdc95e804f4346 cands/n361-s3b-p/recipe/overlay/inkling_draftbytes/w8gemv.py84c62ef2bad39eb126b3f03e356aa8e7149ce00cdef07b441bb8a3066544daef cands/n361-s3b-p/recipe/overlay/inkling_kernels/README.mdcf121c574ddc27aa1ff24138814b25990cf9e6426fe5ac91f08166c9b944073e cands/n361-s3b-p/recipe/overlay/inkling_kernels/__init__.pyee0ef2ccad715b6614ee88fedd6f5a5a67291e6c76e3fed8c9bf4bf663209858 cands/n361-s3b-p/recipe/overlay/inkling_kernels/_hook.py75dafe2d6bfbeb65193bbab71f1c915ebca4e3919edb540898f93cf9f7594b7e cands/n361-s3b-p/recipe/overlay/inkling_kernels/moe_tiles.py97d9379d33afc634a1a91e41e2fef1bda8d1609d19fe58ff95d2adafb5808d6b cands/n361-s3b-p/recipe/overlay/inkling_kernels/qkvr_gemv.py9886b5e338556024c03dd58a31b14e9e5f03e094609b547915e324f44605857f cands/n361-s3b-p/recipe/overlay/inkling_kv12/README.md41daa1fc09a60a324539affd7ec9667a0350020fc6633f8c068fec9dc5f78ee0 cands/n361-s3b-p/recipe/overlay/inkling_kv12/__init__.pyab12eae066bc1cc54662498a1d7d53aa468619997fc204e6a14ba26715977a0c cands/n361-s3b-p/recipe/overlay/inkling_kv12/_hook.pybc8941909122c51bcc80cb1b37fda233061c0c50c180e031aba3a8c7789e7691 cands/n361-s3b-p/recipe/overlay/inkling_kv12/ops.pyd4514e3786f2dd98370a6126733239344f94280c4b89d7126536b99b66352283 cands/n361-s3b-p/recipe/overlay/inkling_kv12/patch.py4c035d2a7cfc45f17cf9fb39341a6fa85bc4634b3926725f7d23cd9501808012 cands/n361-s3b-p/recipe/overlay/inkling_kv12s/__init__.pydd08112a15db424731b25bb3dd8e5d27a688033896fb11269e3c021e6e0f2bdf cands/n361-s3b-p/recipe/overlay/inkling_kv12s/attention.py6f96ca7ed4d69503bb2e83f95ddf08b201b510acf9cc1b034f724125a726a214 cands/n361-s3b-p/recipe/overlay/inkling_kv12s/check_data.py10932369507cd317ee7f1ad1966433bfbcb34da2106b795b6b580a60a85e159f cands/n361-s3b-p/recipe/overlay/inkling_kv12s/device.py616a0ab680b3b259128a39dfeb77d7b8b77ed7cb6bef74d890e0487f38ee507a cands/n361-s3b-p/recipe/overlay/inkling_kv12s/patch.py3554c61d7da8134766ed41206239065ba1e7b5df3b38a390a66a931876cf4533 cands/n361-s3b-p/recipe/overlay/inkling_kv12s/pressure.pyd0ad1f533a820b97d19ffbc420c8f490497c38641bb48f7328206299aa48f145 cands/n361-s3b-p/recipe/overlay/inkling_kv12s/segsum.py7d8d61c362c645a610e65d4ccba7e0dce8d46dcd150a27df5d2546fb37093661 cands/n361-s3b-p/recipe/overlay/inkling_kv12s/static.py37b1fd7d544955e98c4d8ee1d16f4e49e2f945dc18b137b894b1fd5cbe7ce102 cands/n361-s3b-p/recipe/overlay/inkling_kv12s/storage.pya7a4ce407859b7f31120608314ae7d9f8df8244ef309dcd9cd3aae689f731f0c cands/n361-s3b-p/recipe/overlay/inkling_kv12s/swa_layout.py5b2d5c191cffda9cb772e493514b06b8e87e94e46fdbf36b1ad4b5a9ac4487da cands/n361-s3b-p/recipe/overlay/inkling_mixdraft/__init__.py83a952e187fb34e111798adf45ebf18a2e3546b6647657f4ea0effe3370192da cands/n361-s3b-p/recipe/overlay/inkling_mixdraft/kernel.pydf3f862c7d93b8be6e82498afeb62e3144d15b7a0c876a96ba464f4c9f71cd4d cands/n361-s3b-p/recipe/overlay/inkling_mixdraft/linear.pybb72def3d71f7cf145079bc5edc4f8ee1a208f15780928b806337826d81bda8d cands/n361-s3b-p/recipe/overlay/inkling_noexp/__init__.pyab12eae066bc1cc54662498a1d7d53aa468619997fc204e6a14ba26715977a0c cands/n361-s3b-p/recipe/overlay/inkling_noexp/_hook.pyd6207856ed7b8146c9842cbebac87b652a05f9e0c83dd84ef644d7edb4d55c42 cands/n361-s3b-p/recipe/overlay/inkling_noexp/_mask.py81752701087d7a56045ab97627e3e2ceaf039099d5b561c061321a22acf6b689 cands/n361-s3b-p/recipe/overlay/inkling_padx/__init__.pyab12eae066bc1cc54662498a1d7d53aa468619997fc204e6a14ba26715977a0c cands/n361-s3b-p/recipe/overlay/inkling_padx/_hook.py51823f619e768163dbfa547165e7af04ddf93af35ff13e6b8ff0ef02abaaf686 cands/n361-s3b-p/recipe/overlay/inkling_padx/patches.py2710527dfb9c184e3cc77780c6d69ab64b22bba032daa2087736302d54c5b0d7 cands/n361-s3b-p/recipe/overlay/inkling_pcopy/__init__.pyab12eae066bc1cc54662498a1d7d53aa468619997fc204e6a14ba26715977a0c cands/n361-s3b-p/recipe/overlay/inkling_pcopy/_hook.pyc210ac609cd5ff936aed7b0d582b5a89dc059cfaab93dc91ad7cd6a445866062 cands/n361-s3b-p/recipe/overlay/inkling_pcopy/_sources.py2b9b808117ef4b23884652c9a199258bebaacfb485199d434304969ae1f33353 cands/n361-s3b-p/recipe/overlay/inkling_pcopy/fixtures.py26a153b5ffa4ee27159401581b109872b91216cbd36db8d6f1e04bf43c3ca2f7 cands/n361-s3b-p/recipe/overlay/inkling_pcopy/fused.py26e1cdbb37a8d7f58d7b92c42270e151d08822d3e9797130dbbb19d483b1352e cands/n361-s3b-p/recipe/overlay/inkling_pcopy/history.py079f558fe7ddc02f8bd320d71fa329e569bf3e1ecc2c9a419fe32f62b7139192 cands/n361-s3b-p/recipe/overlay/inkling_pcopy/matcher.py14b3d2fda0fbc5a7a640187872ec77c072f2ba723de74983ab5a63b10fa85545 cands/n361-s3b-p/recipe/overlay/inkling_pcopy/patch.py89a122d26a44d635e94586af6dfdb50c53f48a462d7ea02395b293fb1ef9c6d3 cands/n361-s3b-p/recipe/overlay/inkling_pcopy/rule.py61a59cd6f4d9b31abd76da83f67b5797f4a1f5e5ec9ce866e78fdcd8692896eb cands/n361-s3b-p/recipe/overlay/inkling_pfuse/CREDITS.md.knapcio-v2.9.31a87a7afb937c54991860f623a0365882a854cf08bf058e6efd60e87488fcddd cands/n361-s3b-p/recipe/overlay/inkling_pfuse/LICENSE.knapcio-v2.9.3398c1c6b775c7865ad1c50f1cc73ed01116a4d8e213ed3bcf7eff0bc2d268642 cands/n361-s3b-p/recipe/overlay/inkling_pfuse/NOTICE.knapcio-v2.9.3aa5869a0f6a177c6cda7280c4a2564097a06f02b3e260c4a25cd24a8c6193018 cands/n361-s3b-p/recipe/overlay/inkling_pfuse/README.md9820ebf80c8ffff40d14244fdab623d1511ea8fc751a1fa8c17f759fade25f9d cands/n361-s3b-p/recipe/overlay/inkling_pfuse/__init__.pyab12eae066bc1cc54662498a1d7d53aa468619997fc204e6a14ba26715977a0c cands/n361-s3b-p/recipe/overlay/inkling_pfuse/_hook.py7e47cfd76d45851d371aa23e089deba31c99823e2296ca145522b4d801583b7e cands/n361-s3b-p/recipe/overlay/inkling_pfuse/_triton_mix.py1930979f4bdc1b97bac83cc95dc4c15ab726b0ce69f11baeda9cf753011c7e41 cands/n361-s3b-p/recipe/overlay/inkling_pfuse/_triton_sconv.pyd3b81190b2622e5a437c823af4ae16e0ebf1e8b631c7a9432bc1e71503bd01ce cands/n361-s3b-p/recipe/overlay/inkling_pfuse/layer.py508f34216dec13dcc30d77c08cd09d10f7d20bbbb28bb031e90414c7b25d3f8b cands/n361-s3b-p/recipe/overlay/inkling_pfuse/mix.py32fe8bcacf8d6fc64ee401b014c421c4cdc0d5c6d342a50a489bf65891cbfd5a cands/n361-s3b-p/recipe/overlay/inkling_pfuse/tools/attrib_prefill.py1ff7a611ad3a7e6ee9955f5ece2fc8778b5e37186bec785bf304e68f997300a3 cands/n361-s3b-p/recipe/overlay/inkling_pfuse/tools/bench_loop.py467bc7d06db2756307d7da7fc7289c7ff2a2f08d4ec1550cad57b6dcf1bbd73f cands/n361-s3b-p/recipe/overlay/inkling_pfuse/tools/gpu_check_pfuse.py63f3bbbdc63686529c2ed70ef5a94cbe66ab761a985799f58e27d9aaedacfad8 cands/n361-s3b-p/recipe/overlay/inkling_pfuse/tools/sweep_mix.py61a59cd6f4d9b31abd76da83f67b5797f4a1f5e5ec9ce866e78fdcd8692896eb cands/n361-s3b-p/recipe/overlay/inkling_phoist/CREDITS.md.knapcio-v2.9.31a87a7afb937c54991860f623a0365882a854cf08bf058e6efd60e87488fcddd cands/n361-s3b-p/recipe/overlay/inkling_phoist/LICENSE.knapcio-v2.9.3398c1c6b775c7865ad1c50f1cc73ed01116a4d8e213ed3bcf7eff0bc2d268642 cands/n361-s3b-p/recipe/overlay/inkling_phoist/NOTICE.knapcio-v2.9.326eb3a17f9a426fb11dfec4e294dd2ed187b7104bf36e7588a9d6df8ee63134b cands/n361-s3b-p/recipe/overlay/inkling_phoist/__init__.pyab12eae066bc1cc54662498a1d7d53aa468619997fc204e6a14ba26715977a0c cands/n361-s3b-p/recipe/overlay/inkling_phoist/_hook.pyca8c58f123ea47200ca9306f1e043fae10672f381cf96e7685f5f6adff3e953a cands/n361-s3b-p/recipe/overlay/inkling_phoist/phoist.pyf55d49b173b3f6ef080ce2dcc563333f193dfcbf75a7e8f7f6f5b353e4be7576 cands/n361-s3b-p/recipe/overlay/inkling_phoist/phoist_triton.pya12fbe61a792b2c2c7597b259ab99a0b9656922865a9a24836d92f17e121f876 cands/n361-s3b-p/recipe/overlay/inkling_pico12/README.md8aeb4211fa86cc155ac12af76eedea7963e96c1f43c766e3c749bcfba35ac370 cands/n361-s3b-p/recipe/overlay/inkling_pico12/__init__.pyee0ef2ccad715b6614ee88fedd6f5a5a67291e6c76e3fed8c9bf4bf663209858 cands/n361-s3b-p/recipe/overlay/inkling_pico12/_hook.py0b9cd153d788be7ffed98a8bd0d7b4fbab6222f1e3c06961865a01a6cd991c44 cands/n361-s3b-p/recipe/overlay/inkling_pico12/build.pyaab4b5396310f0f0cbe21c1fcd5906e25b8c62f18689685c48ff5f530622c7c8 cands/n361-s3b-p/recipe/overlay/inkling_pico12/csrc/pico12_ext.cu8babed542f329a5040a02167d6d30e880d35a4f334b457adff8489dfa198800a cands/n361-s3b-p/recipe/overlay/inkling_pico12/csrc/pico12_range.cu97329931d0e392fc5ac1292657bb9852bae973fd4336ec47dcea626bd78a09cd cands/n361-s3b-p/recipe/overlay/inkling_pico12/ops.py1d91c866aaa329e6045d2161a776ba6e2064f3f81b8a6a6903f0bb6c6cc3608e cands/n361-s3b-p/recipe/overlay/inkling_pico12/patches.pyfb9c7ecee826335f6014f5f2040b5abe132a86aa6e43f1545bb1e5db19cea16b cands/n361-s3b-p/recipe/overlay/inkling_pico12/third_party/pico/LICENSE60b3ad14b8d2291101c82f3cc8c0653a6e778b1db9abfe463992dd3737550b4f cands/n361-s3b-p/recipe/overlay/inkling_pico12/third_party/pico/common/check.h5d96f43891a930cffa23c8649a79d28d019f7597bf5b2ac51e46eb6de5ff6e87 cands/n361-s3b-p/recipe/overlay/inkling_pico12/third_party/pico/kernels/common.cuhbaa1d8d7ff69d0f132acbfba354eb35dc4e5011b5f3e1ae3d177d6d1dcfb5256 cands/n361-s3b-p/recipe/overlay/inkling_pico12/third_party/pico/kernels/dsk.h91230a0b0783d2af5da87d6476e60c2dc2d94d60879998e54db547dc6f01982d cands/n361-s3b-p/recipe/overlay/inkling_pico12/third_party/pico/kernels/gemv16.cu61a59cd6f4d9b31abd76da83f67b5797f4a1f5e5ec9ce866e78fdcd8692896eb cands/n361-s3b-p/recipe/overlay/inkling_prologue/CREDITS.knapcio-v2.9.3.md1a87a7afb937c54991860f623a0365882a854cf08bf058e6efd60e87488fcddd cands/n361-s3b-p/recipe/overlay/inkling_prologue/LICENSE.knapcio-v2.9.3398c1c6b775c7865ad1c50f1cc73ed01116a4d8e213ed3bcf7eff0bc2d268642 cands/n361-s3b-p/recipe/overlay/inkling_prologue/NOTICE.knapcio-v2.9.3d807c304d543312f6c3c3e2f1d40a3dcedc982c8bef30a34ca891fe6c7956fbe cands/n361-s3b-p/recipe/overlay/inkling_prologue/__init__.pyab12eae066bc1cc54662498a1d7d53aa468619997fc204e6a14ba26715977a0c cands/n361-s3b-p/recipe/overlay/inkling_prologue/_hook.pyd83c5b71d817b66804bfaa2c7108a96b4374033102b709639555456feed6478d cands/n361-s3b-p/recipe/overlay/inkling_prologue/_triton.pyfed63858ca1872cf9fc4122cff02af670e297b972df4d075c929c77613b7f6c4 cands/n361-s3b-p/recipe/overlay/inkling_ptouch/__init__.pyab12eae066bc1cc54662498a1d7d53aa468619997fc204e6a14ba26715977a0c cands/n361-s3b-p/recipe/overlay/inkling_ptouch/_hook.pyb8dfe59c5b140d6a9804be846b06cb4ec07746bb0176ff8b2637177c9487806f cands/n361-s3b-p/recipe/overlay/inkling_rsfix/README.mdedf339d321b72e9207204143906526677b6beacb179e1399ac9dc183ba29bd72 cands/n361-s3b-p/recipe/overlay/inkling_rsfix/__init__.py2a1eabd10f7e964a53fe76b66254873fcfd461b0d32f7277db42457d7d65990a cands/n361-s3b-p/recipe/overlay/inkling_rsfix/_hook.pyc4e84d4ef8e7343e1563617814c65d0d71fbe19915461d73245818f83e9d1e6c cands/n361-s3b-p/recipe/overlay/inkling_rsfix/_sources.pye4dfce68cae58f71a0658410fe88e6520f94d6c389f8d57e482dacea363509d8 cands/n361-s3b-p/recipe/overlay/inkling_rsfix/blockwise.py9530622cde80e49864d60a50342ff1850e6c6389eb1baa0207d68ba6a388005c cands/n361-s3b-p/recipe/overlay/inkling_rsfix/markov.py93da51652aa8ec27396610a10724b6571e5de8d4ee08e236677c9e98604db951 cands/n361-s3b-p/recipe/overlay/inkling_rsfix/reference.py61e81094be26a6f8a46f07f1b062b07eab246a52553ed094ba147813d92dd513 cands/n361-s3b-p/recipe/overlay/inkling_rsfix/reject.pyd5607344cacbcf77fb4cdcc6ce9de49a4290bbf85281f78c9c397a2984dc06eb cands/n361-s3b-p/recipe/overlay/inkling_rsfix/selector.py63c5e7852205045be8bca6e84160df8f2f4dd4f44a8093a6a5a04d9fffbca47e cands/n361-s3b-p/recipe/overlay/inkling_vattn/README.mda08d05ffbd94bdb1c94194432d927b1f30035fa6f23fcc2adc7de36b2930c78c cands/n361-s3b-p/recipe/overlay/inkling_vattn/__init__.pyab12eae066bc1cc54662498a1d7d53aa468619997fc204e6a14ba26715977a0c cands/n361-s3b-p/recipe/overlay/inkling_vattn/_hook.py63aad1d099fec3f2b66a0ffd8d3709a564644edac2d4f25c1c33018be3dd6f25 cands/n361-s3b-p/recipe/overlay/inkling_vattn/ops.py4f18599a0ad748f7f6a507f165ac72327e733eb082fd6276995b9e4474869652 cands/n361-s3b-p/recipe/overlay/inkling_vattn/patch.py66f94a7e6143ee5bde5e8f83aefe4333ad9d701282b411f0c30091eff637b3b7 cands/n361-s3b-p/recipe/overlay/inkling_vcap/README.md6a39653aa552d2035e4700918cf7e6dd488881c46cd4d52a3edf8424fe7f3cbd cands/n361-s3b-p/recipe/overlay/inkling_vcap/__init__.py01b543f9ea35fd83b4ef34d681b86f6aedd3fc9cbc26b270fb98d3159025c4c2 cands/n361-s3b-p/recipe/overlay/inkling_vcap/config.pybbe0288dd145ba12f1d7312b7def82a7dc0f76c31b5dfa3e2236730eba177b79 cands/n361-s3b-p/recipe/overlay/inkling_vcap/dfcap.py9caf5d3ca057b622e4cca6e35456f7435f9e1d1e5df692f491e12271014d8aed cands/n361-s3b-p/recipe/overlay/inkling_vcap/dfcheck.pyf7d2389c58143c3ea661616d82f42e1c7b55b8f95c78dcb424c45d205c4d2203 cands/n361-s3b-p/recipe/overlay/inkling_vcap/dflash.py41cd33472898d7ad98bcbaae2eaf5c27238069b6cdd7815528c932795673e5da cands/n361-s3b-p/recipe/overlay/inkling_vcap/dfsteplog.pybda7d9e386db34eb3f3a8c8aeda249b91ff8ec27d176c23fb5574e80ec81c431 cands/n361-s3b-p/recipe/overlay/inkling_vcap/fastprobs.pyd364b1bc5a27dd747b08095030670ac085205454b548ba54b453f96872cd90bb cands/n361-s3b-p/recipe/overlay/inkling_vcap/fused.py897b421d153acd9c0494e084e0d8227804a00f5d24c245646dec74079c422b84 cands/n361-s3b-p/recipe/overlay/inkling_vcap/fused_accept.py0a928a2c9b2677ce1a359da34d444b40ff38cc6a01c8f44c5723dbaabb6751e5 cands/n361-s3b-p/recipe/overlay/inkling_vcap/importhook.py2738304eeff01b7d21c700c7408b24e1c429ad912fdc6e58952cf5a1d2a80963 cands/n361-s3b-p/recipe/overlay/inkling_vcap/logic.py9ba4bf5aeafcc3d1e58adecbad230cbfa128079c6577843a6e28e40866258a20 cands/n361-s3b-p/recipe/overlay/inkling_vcap/patches.py21082944e6df1a1eb5d288c226562278d8b493ea37cb6ccbf6a8a98bcaa93cce cands/n361-s3b-p/recipe/overlay/inkling_vcap/policies/df-SLDF1-sm.jsonb9505b8e00284277b8354cf72a406d8bc2b465d8619f51f44e8609964093b5ee cands/n361-s3b-p/recipe/overlay/inkling_vcap/policies/df-SLDF2x.jsonab43150b4ff972b9975192761515e843088f8838b765090c888f1c3e79334e9f cands/n361-s3b-p/recipe/overlay/inkling_vcap/policies/r2-theta004.json359b404bd41371397ec8948ece4700d10e1e2b6271301e47439dc4cd83198310 cands/n361-s3b-p/recipe/overlay/inkling_vcap/policyfile.py982f86bb234ebfd5ca7f37304ae9bf78b5fa90969e75357a5a44905f8a708f49 cands/n361-s3b-p/recipe/overlay/inkling_vcap/state.pyc7f51ebddeba0c2cb5a11bf8075fec231f081ef58ffd0e2c93097a70ebbca04a cands/n361-s3b-p/recipe/overlay/inkling_vcap/v3_kernels.py4cd0f8e5854e5ed4f1745e6a56aaeba679c4ec4bc17352960f1f01fe3b8f8cf0 cands/n361-s3b-p/recipe/overlay/inkling_wide/README.mde473be74143084bca38efb0fce7b281b63239471bc43e99692863dd53b85dd16 cands/n361-s3b-p/recipe/overlay/inkling_wide/__init__.pyee0ef2ccad715b6614ee88fedd6f5a5a67291e6c76e3fed8c9bf4bf663209858 cands/n361-s3b-p/recipe/overlay/inkling_wide/_hook.py409563a58078e003f0f61c39162dca23563d08cf6fe3e6ecd53211b30538bd12 cands/n361-s3b-p/recipe/overlay/inkling_wide/build.py640625aed9282589c3c32b06f0b57be48efd230c88425a4264748fed3f23eb15 cands/n361-s3b-p/recipe/overlay/inkling_wide/csrc/bf16x_format.cuha281cb85d1867e5acd8dfe7c8d3b2f1b68b5cb1d3091ad6445eba09d66341e94 cands/n361-s3b-p/recipe/overlay/inkling_wide/csrc/wide_ext.cu3b12f4ef0077ccc61f4867a1369a66fc2a3b10e791c19f4323956756086418cd cands/n361-s3b-p/recipe/overlay/inkling_wide/ops.py0deb113320ff36523d0e5a25851c3d27aa9412ed5b74d3fd74288504e0404e09 cands/n361-s3b-p/recipe/overlay/inkling_wide/patches.py5b3f3070eab76b167d3ac2a7f03cfea9e59901e45dbe3a01059cbe5d423bcdbc cands/n361-s3b-p/recipe/overlay/inkling_wide/tests/fake_wide_ext.pyb436a3347e2e274fc146d5ed6969f489415fa60f0fc0f58593fd0875d1ddfd87 cands/n361-s3b-p/recipe/overlay/inkling_wide/tests/test_wide.pyfb9c7ecee826335f6014f5f2040b5abe132a86aa6e43f1545bb1e5db19cea16b cands/n361-s3b-p/recipe/overlay/inkling_wide/third_party/pico/LICENSEb37e3528ad0ca2dcbd2ab38ee4be67ec88980e769c4a5dbddfa5b45624f28fa7 cands/n361-s3b-p/recipe/overlay/inkling_wide/tools/gpu_check_wide.pyff089d1ab9f66eb5ee40a3f77a6193120abc064d9eb97a60e495a5ec3fa743eb cands/n361-s3b-p/recipe/overlay/inkling_wide/tools/gpu_integration_wide.py65acb522ac26d4bdacff65abacf544479da47d7bc6d43ed97b319972a36b560a cands/n361-s3b-p/recipe/overlay/sitecustomize.py1f64526e4dcec5cd6d3cd3d842ebbf74035e4f34b64aeb7d761693b8198bd924 cands/n361-s3b-p/recipe/patch/inkling2_attn.py64914ef9213420b37bdb361dfb3bdadb5ff07994deda96c548762e006927bd44 cands/n361-s3b-p/recipe/patch/inkling2_loop.py70d8797b523b0fcdaad6e709e14bfc4bbdcc735a4b49824b430997ff1018dd78 cands/n361-s3b-p/recipe/patch/inkling2_loop_model.py29d1f5cb5101a7a0aac48c4b1f15252acaba01a404c6e2475c6c798f0797d997 cands/n361-s3b-p/recipe/patch/n105_rnnhoist.py9d0231ebab913cb3b3956c421ae5f4f69d2661728f1f8d3b3d64755f9e455f63 cands/n361-s3b-p/recipe/patch/n13_attn_global.py7d6f1ab93c1252e891446df090e414c6aa975ca480a360b5ac65fb6d16c8be9a cands/n361-s3b-p/recipe/patch/n13_fwd.py1801287d6696437fa6417c335decf0f4b9deb7391b4d4e4fd8e5c893cf272333 cands/n361-s3b-p/recipe/patch/n140_kern.py6b69991a90d2ca2a6196d4d1d28014983614a6030d8a38d43aa08c7a29f49f65 cands/n361-s3b-p/recipe/patch/n14_moe.py8e2d7b61a2ffee1e5bbdaf3f2406a202f13e3a9d96df0f849d35af4d781cac62 cands/n361-s3b-p/recipe/patch/n14_quant.cuha67d3cacb45d4a981add4407552b030c8bdf08dabb7e136f555b21475aa3126a cands/n361-s3b-p/recipe/patch/n15_fused.pye8373342b54dfccbe4c04fd21e137172286b902b07ed6f5037deeb95eb70c9ef cands/n361-s3b-p/recipe/patch/n32_attn_local.py571c3e4a819b27e175091b7af099e972bc4c38b6eac3f1af1ff4e88b6b662746 cands/n361-s3b-p/recipe/patch/n32_fwd.py65f51937ca44728959542ca4ed7456973b45e7f32bd54934e44a49ee256630c4 cands/n361-s3b-p/recipe/patch/n35_w8.pyaa79c3095959d385dc1c6f9fdcf7558a73547fcc31c4f6460c6e77cbc9327605 cands/n361-s3b-p/recipe/patch/n35_w8gemv.pyb4cc2402f4c0eee56dc4ce9721043b6d16ed04e932f94848b395f3873f58cb59 cands/n361-s3b-p/recipe/patch/n37_tiles.py5b1a90477bb2ed2dddf31b3adbc8cb200538335854ddb99ce59ecdf3dbfadfac cands/n361-s3b-p/recipe/patch/n50b_fused.py1dc6b870ef8c25dd40615930cbf62dfec0e29c5d6b785eb8d42d532ea4a9cd04 cands/n361-s3b-p/recipe/patch/n52_band.cuhe4118504ce8a210f8d4ef86d1be579dd4d73e4161bb0c9e4264811ad51999140 cands/n361-s3b-p/recipe/patch/n52_moe.py3523d5fe6549aec71d853c0713403fbdc15984e08c3e5820c2a790a6ede84855 cands/n361-s3b-p/recipe/patch/n64_attn_global.pyeefba4b83410c246441d74d5311deacc6da6e4405d28e3c5b5fa344d4d29eb81 cands/n361-s3b-p/recipe/patch/n64a_fwd.pycca0cd0d7b860ed4cc78a98651264ecb8fd20793055e58323c2623b8531b6d0d cands/n361-s3b-p/recipe/patch/n64b_fwd.pyd1b88fb14a0d18ccff2ed53b79dcfcb1a2565e50e6cf625053bf39cdc9f1ecd9 cands/n361-s3b-p/recipe/patch/n66fb.pyb7abf0229b9d40558dc6dd576fb300bec9e0a6b9c173b458881111ff0bc89206 cands/n361-s3b-p/recipe/patch/n71_resnorm.py91f1bb6066a4e5abf77253e23816783880ea38cff649aebd844157b60268c5e7 cands/n361-s3b-p/recipe/patch/n71_sconvres.pyd4411fd151e6212a0feb14ed41457be3c976b92a8f5c981cbc2d1a890075eb7b cands/n361-s3b-p/recipe/patch/n75_c12.py71fd33a2a119db28c4ca8a24d75e9678131c87b327d095a329fdad18bc03e29a cands/n361-s3b-p/recipe/patch/n75_cuda.py00bece24b9b910eb33d1f85fe1e60b2685a2ac4dfb5f5136d891b9db668968f7 cands/n361-s3b-p/recipe/patch/n75_install.py17349b269f1eb7f2551fac79b9e8020b10708410156a08e1b959c8e53f491f79 cands/n361-s3b-p/recipe/patch/n78_head.py9447c05ffbf888a1aea1a7da467399f572f1d684f142f24c4cccfacefcd353f8 cands/n361-s3b-p/recipe/patch/n78_kern.pyefe43e40ebccb20b31398ef7b7a4e70e0dd1a6192a95904ebb70fb6a8f3d3b73 cands/n361-s3b-p/recipe/patch/n80_cuda.pycd2d6ef590744ee69cd3b2dfdff9c42cf957eef291f858c3054f1b651b84943f cands/n361-s3b-p/recipe/patch/n80_draft.py9ba4c20f9fa95c8d9a337f4eeea6abae50e142f747d4dde618712f04e127f56f cands/n361-s3b-p/recipe/patch/n86_riders.py25030bef80b49e72d46355799e7febea0867ea57aed711f7c9ae28159a81f390 cands/n361-s3b-p/recipe/serve/inkling2_mtp.pyc71f08ef804dc439f08eca133bd2591868c60e535d06819cda55033785bf195f cands/n361-s3b-p/recipe/serve/serve.sh1bccd9dadf233cd9af15aa63a8d2cc22e0706983355a00e380731d09a5bdb682 cands/n361-s3b-p/recipe/serve/sl.jsone446d09f6e4d582a4daaccc06f556e184f6919398f62933b6eb30a4f48c6d1d8 cands/n362j-e35d7419/overlay_n362j/inkling_n320s/__init__.pyc7095f22f861b691071abb1c4303ac97e7431d7744f7c1c441eed16df5da552f cands/n362j-e35d7419/overlay_n362j/inkling_n329/__init__.py7f57e8170a49f4bf179c9ccf50b59a4570e0fd5f6e54d890faf8bded7e847396 cands/n362j-e35d7419/overlay_n362j/inkling_n329/n329_rows.pyb93d559f1b964104903f96dcb4508020dcdcc65b012c885bf9e2505c92c89701 cands/n362j-e35d7419/overlay_n362j/inkling_n329/n329_rows_ctl.py53a039ef443368a80a306757a3009181a7e9c15c41770efccf5f58895f836ebc cands/n362j-e35d7419/overlay_n362j/inkling_n351/__init__.py21c6bb2fb7a4f89883d7e3a7a961fa3dc70214add3946eea0453ce9ca5eb1bc8 cands/n362j-e35d7419/overlay_n362j/inkling_n355/__init__.py008b6b876291608b74d67cd8cf8a1388fd3ff834e3f09eccf5aaa4aadc39d605 cands/n362j-e35d7419/overlay_n362j/inkling_n381/__init__.py61a59cd6f4d9b31abd76da83f67b5797f4a1f5e5ec9ce866e78fdcd8692896eb cands/n362j-e35d7419/overlay_n362j/inkling_n389/CREDITS.knapcio-v2.9.3.md1a87a7afb937c54991860f623a0365882a854cf08bf058e6efd60e87488fcddd cands/n362j-e35d7419/overlay_n362j/inkling_n389/LICENSE.knapcio-v2.9.3398c1c6b775c7865ad1c50f1cc73ed01116a4d8e213ed3bcf7eff0bc2d268642 cands/n362j-e35d7419/overlay_n362j/inkling_n389/NOTICE.knapcio-v2.9.3d2244f97dadfcac0397db826a15785ab3c2c8223936542793bd899b95ded96b4 cands/n362j-e35d7419/overlay_n362j/inkling_n389/NOTICE.n389218f78d74077c1ccfbe6f57c97198dd27febe31b8eda0104f7150dbbcf189dc0 cands/n362j-e35d7419/overlay_n362j/inkling_n389/__init__.py60bfcb1846f6ff35cb49914112b968b7ed064749bbfabe1e53f5d0b8fa99b3dc cands/n362j-e35d7419/overlay_n362j/inkling_n389/n389_fold.pyfbae72358a1bdc41225f5d00e37c7e8013a5660c4c4e2cdd39a05525f2ee2aeb cands/n362j-e35d7419/overlay_n362j/n351_quant.cuhf52c80f1a1809cbc9023eec0bc80ed8b75ae7f8c38d2821ee9ee944f3776cb12 cands/n362j-e35d7419/overlay_n362j/n355_quant.cuh906b487474bbb2823e8b022ed6e6309d486c2dede36ba6cd626987d5d01682ce cands/n362j-e35d7419/overlay_n362j/n381c_band.cuhd0e71fae12062a48d86e8c32c74057dad55030eba16595637a667d47f7faed91 cands/n362j-e35d7419/overlay_n362j/sitecustomize.pye01c50cbc6fd57a4a80fdb31c7953fda1a31189caa7406578af95282f68160fb cands/n419ab-6d18f8eb/df-r1b2.jsone446d09f6e4d582a4daaccc06f556e184f6919398f62933b6eb30a4f48c6d1d8 cands/n419c-8f01ac06/overlay_n419c/inkling_n320s/__init__.pyc7095f22f861b691071abb1c4303ac97e7431d7744f7c1c441eed16df5da552f cands/n419c-8f01ac06/overlay_n419c/inkling_n329/__init__.py7f57e8170a49f4bf179c9ccf50b59a4570e0fd5f6e54d890faf8bded7e847396 cands/n419c-8f01ac06/overlay_n419c/inkling_n329/n329_rows.pyb93d559f1b964104903f96dcb4508020dcdcc65b012c885bf9e2505c92c89701 cands/n419c-8f01ac06/overlay_n419c/inkling_n329/n329_rows_ctl.py53a039ef443368a80a306757a3009181a7e9c15c41770efccf5f58895f836ebc cands/n419c-8f01ac06/overlay_n419c/inkling_n351/__init__.py21c6bb2fb7a4f89883d7e3a7a961fa3dc70214add3946eea0453ce9ca5eb1bc8 cands/n419c-8f01ac06/overlay_n419c/inkling_n355/__init__.py008b6b876291608b74d67cd8cf8a1388fd3ff834e3f09eccf5aaa4aadc39d605 cands/n419c-8f01ac06/overlay_n419c/inkling_n381/__init__.py61a59cd6f4d9b31abd76da83f67b5797f4a1f5e5ec9ce866e78fdcd8692896eb cands/n419c-8f01ac06/overlay_n419c/inkling_n389/CREDITS.knapcio-v2.9.3.md1a87a7afb937c54991860f623a0365882a854cf08bf058e6efd60e87488fcddd cands/n419c-8f01ac06/overlay_n419c/inkling_n389/LICENSE.knapcio-v2.9.3398c1c6b775c7865ad1c50f1cc73ed01116a4d8e213ed3bcf7eff0bc2d268642 cands/n419c-8f01ac06/overlay_n419c/inkling_n389/NOTICE.knapcio-v2.9.3d2244f97dadfcac0397db826a15785ab3c2c8223936542793bd899b95ded96b4 cands/n419c-8f01ac06/overlay_n419c/inkling_n389/NOTICE.n389218f78d74077c1ccfbe6f57c97198dd27febe31b8eda0104f7150dbbcf189dc0 cands/n419c-8f01ac06/overlay_n419c/inkling_n389/__init__.py60bfcb1846f6ff35cb49914112b968b7ed064749bbfabe1e53f5d0b8fa99b3dc cands/n419c-8f01ac06/overlay_n419c/inkling_n389/n389_fold.pyfb1dbfad967ba0dde9ef5388065522c25f7b941767d8a9c7b38772c82ed504f2 cands/n419c-8f01ac06/overlay_n419c/inkling_n395/CREDITS.n395.md1495e1e757ef4d0925a2350563cf5754bb23c51701a8ec4fb3c5cdcbedae6747 cands/n419c-8f01ac06/overlay_n419c/inkling_n395/LICENSE.sglang5231b461b3afdf993dcf18e8bf9ba0d2224862bf2d18bc1595786305a37a0b08 cands/n419c-8f01ac06/overlay_n419c/inkling_n395/NOTICE.n395159aa3fb6a260f9d31f59f6f0cee8d788fb6df89ef878b67704362964511ef3d cands/n419c-8f01ac06/overlay_n419c/inkling_n395/__init__.pyf91db648419151f0ea309ff118a42671fb6f57c2f407fb3c29ae5fab8c3013e6 cands/n419c-8f01ac06/overlay_n419c/inkling_n395/n395_fold.pye3c66465c3b4073378524540f526db49f63d0b48431c02f9f7deebe8df23cea0 cands/n419c-8f01ac06/overlay_n419c/inkling_n395/n438_fold.py0e6c97c168fbe1a87166ac0f87c013a4f2a056d0171de7992e44b99ee97a212a cands/n419c-8f01ac06/overlay_n419c/inkling_n437/__init__.pyfbae72358a1bdc41225f5d00e37c7e8013a5660c4c4e2cdd39a05525f2ee2aeb cands/n419c-8f01ac06/overlay_n419c/n351_quant.cuhf52c80f1a1809cbc9023eec0bc80ed8b75ae7f8c38d2821ee9ee944f3776cb12 cands/n419c-8f01ac06/overlay_n419c/n355_quant.cuh906b487474bbb2823e8b022ed6e6309d486c2dede36ba6cd626987d5d01682ce cands/n419c-8f01ac06/overlay_n419c/n381c_band.cuhbf46f120897ec6fed90ab204d23a9be5ae4d507d832b6a0ff99c56e0463ad2d7 cands/n419c-8f01ac06/overlay_n419c/sitecustomize.py8e3b8e0156229c28f335bc7f8a171567839652343c0750e3c1053cdc64ab2e38 cands/n419j3-2416d17a/overlay_dfglobal/inkling_dfglobal/__init__.pyab12eae066bc1cc54662498a1d7d53aa468619997fc204e6a14ba26715977a0c cands/n419j3-2416d17a/overlay_dfglobal/inkling_dfglobal/_hook.pye446d09f6e4d582a4daaccc06f556e184f6919398f62933b6eb30a4f48c6d1d8 cands/n419j3-2416d17a/overlay_n419j/inkling_n320s/__init__.pyc7095f22f861b691071abb1c4303ac97e7431d7744f7c1c441eed16df5da552f cands/n419j3-2416d17a/overlay_n419j/inkling_n329/__init__.py7f57e8170a49f4bf179c9ccf50b59a4570e0fd5f6e54d890faf8bded7e847396 cands/n419j3-2416d17a/overlay_n419j/inkling_n329/n329_rows.pyb93d559f1b964104903f96dcb4508020dcdcc65b012c885bf9e2505c92c89701 cands/n419j3-2416d17a/overlay_n419j/inkling_n329/n329_rows_ctl.py53a039ef443368a80a306757a3009181a7e9c15c41770efccf5f58895f836ebc cands/n419j3-2416d17a/overlay_n419j/inkling_n351/__init__.py21c6bb2fb7a4f89883d7e3a7a961fa3dc70214add3946eea0453ce9ca5eb1bc8 cands/n419j3-2416d17a/overlay_n419j/inkling_n355/__init__.py008b6b876291608b74d67cd8cf8a1388fd3ff834e3f09eccf5aaa4aadc39d605 cands/n419j3-2416d17a/overlay_n419j/inkling_n381/__init__.py61a59cd6f4d9b31abd76da83f67b5797f4a1f5e5ec9ce866e78fdcd8692896eb cands/n419j3-2416d17a/overlay_n419j/inkling_n389/CREDITS.knapcio-v2.9.3.md1a87a7afb937c54991860f623a0365882a854cf08bf058e6efd60e87488fcddd cands/n419j3-2416d17a/overlay_n419j/inkling_n389/LICENSE.knapcio-v2.9.3398c1c6b775c7865ad1c50f1cc73ed01116a4d8e213ed3bcf7eff0bc2d268642 cands/n419j3-2416d17a/overlay_n419j/inkling_n389/NOTICE.knapcio-v2.9.3d2244f97dadfcac0397db826a15785ab3c2c8223936542793bd899b95ded96b4 cands/n419j3-2416d17a/overlay_n419j/inkling_n389/NOTICE.n389218f78d74077c1ccfbe6f57c97198dd27febe31b8eda0104f7150dbbcf189dc0 cands/n419j3-2416d17a/overlay_n419j/inkling_n389/__init__.py60bfcb1846f6ff35cb49914112b968b7ed064749bbfabe1e53f5d0b8fa99b3dc cands/n419j3-2416d17a/overlay_n419j/inkling_n389/n389_fold.pyfbae72358a1bdc41225f5d00e37c7e8013a5660c4c4e2cdd39a05525f2ee2aeb cands/n419j3-2416d17a/overlay_n419j/n351_quant.cuhf52c80f1a1809cbc9023eec0bc80ed8b75ae7f8c38d2821ee9ee944f3776cb12 cands/n419j3-2416d17a/overlay_n419j/n355_quant.cuh906b487474bbb2823e8b022ed6e6309d486c2dede36ba6cd626987d5d01682ce cands/n419j3-2416d17a/overlay_n419j/n381c_band.cuhd551992419fd5498de5acfe99fb28c9e5695d869e7cdac00c47b0728b12ebd94 cands/n419j3-2416d17a/overlay_n419j/sitecustomize.pyac94bb9163aa7ee6b467f8dcc5e3d51ab8aab3d2ab509ab11e3c63895561f3c1 cands/n419j3-2416d17a/overlay_pcopyro/inkling_pcopyro/__init__.py61a59cd6f4d9b31abd76da83f67b5797f4a1f5e5ec9ce866e78fdcd8692896eb cands/n419j3-2416d17a/recipe/CREDITS.md1a87a7afb937c54991860f623a0365882a854cf08bf058e6efd60e87488fcddd cands/n419j3-2416d17a/recipe/LICENSE398c1c6b775c7865ad1c50f1cc73ed01116a4d8e213ed3bcf7eff0bc2d268642 cands/n419j3-2416d17a/recipe/NOTICE61a59cd6f4d9b31abd76da83f67b5797f4a1f5e5ec9ce866e78fdcd8692896eb cands/n419j3-2416d17a/recipe/overlay/inkling_attn/CREDITS.knapcio-v2.9.3.md1a87a7afb937c54991860f623a0365882a854cf08bf058e6efd60e87488fcddd cands/n419j3-2416d17a/recipe/overlay/inkling_attn/LICENSE.knapcio-v2.9.3398c1c6b775c7865ad1c50f1cc73ed01116a4d8e213ed3bcf7eff0bc2d268642 cands/n419j3-2416d17a/recipe/overlay/inkling_attn/NOTICE.knapcio-v2.9.34d3f0b284bde7c3a066f1134ec52d1896512804aa92d311b0fb48659cc617bd6 cands/n419j3-2416d17a/recipe/overlay/inkling_attn/README.mdf7c0b49cfd8e4047947118882ae79b001dfc1486e4dd9ee92e544e89c83c70ca cands/n419j3-2416d17a/recipe/overlay/inkling_attn/__init__.pyab12eae066bc1cc54662498a1d7d53aa468619997fc204e6a14ba26715977a0c cands/n419j3-2416d17a/recipe/overlay/inkling_attn/_hook.py3cf30a00b0670b0babb2024b85ec88508e66562fe1901e9b2bc51b86275b3a8a cands/n419j3-2416d17a/recipe/overlay/inkling_attn/build.pyecd499f8ab53c0d2e03942fd1ef9ba4165ea16b276fbb26b9a5bfbfa078da34a cands/n419j3-2416d17a/recipe/overlay/inkling_attn/csrc/attn_kernel.cuhe10f9d601a09d438749189902a4da13411a4318610de2c87d90c0335cec80995 cands/n419j3-2416d17a/recipe/overlay/inkling_attn/csrc/inkling_attn_ext.cu8b097c56fbe2b6facb41e80e97e0fd6198fcb0a85460f127a716731b3ae8a921 cands/n419j3-2416d17a/recipe/overlay/inkling_attn/ops.pyfa70374aba0e5f826993c98cbf4303a0b515f9457b60461dc3f8da30c64f9892 cands/n419j3-2416d17a/recipe/overlay/inkling_attn/patch.py0424895a98d8a22a9cdce8c3ac32dd00ce0000c6292e0b6a732848ffc4b426ea cands/n419j3-2416d17a/recipe/overlay/inkling_attn/tests/test_install.py9884d1befc3894d1f5f4b4c8b34df827a4bd752232f046673af05db33494009a cands/n419j3-2416d17a/recipe/overlay/inkling_attn/tests/test_w8split_cpu.pyeb0c172281bf706ade1554a37192d0bf59db643bc1b0cefb7b863b4e93231a4b cands/n419j3-2416d17a/recipe/overlay/inkling_cert/README.md5882400af5a589496e782828387924f5e833ebace1356cf72ea720799975d31e cands/n419j3-2416d17a/recipe/overlay/inkling_cert/__init__.pyee0ef2ccad715b6614ee88fedd6f5a5a67291e6c76e3fed8c9bf4bf663209858 cands/n419j3-2416d17a/recipe/overlay/inkling_cert/_hook.py54869935ed0fc96e98a78e8422b62282693f3231db2883e780a1e0d816f44efd cands/n419j3-2416d17a/recipe/overlay/inkling_cert/build.pya254d8f11b5fa27c01c3d5df3584dc703a5140d202955cc963064b2aca5e8677 cands/n419j3-2416d17a/recipe/overlay/inkling_cert/cert_math.py0e6a597b3ff6dc12b01e9247906604262006cf2094b7358dab49bc6dd2fa9177 cands/n419j3-2416d17a/recipe/overlay/inkling_cert/certwide.py957d0dd2a18d5ac7de6fc88e937052852549750e669af9ebc40abb753c81328d cands/n419j3-2416d17a/recipe/overlay/inkling_cert/certwide_math.pydc2b48f09ba8ab465daf9ad63fbc728dbcd01b725798f0a634f8af411022f07b cands/n419j3-2416d17a/recipe/overlay/inkling_cert/certwide_reduce.pye2f40277fe04993deed769348905e2e911dcbe218f6f6298c677977e91951669 cands/n419j3-2416d17a/recipe/overlay/inkling_cert/csrc/cert_ext.cu88a27a25adb3e0a2553e82cbc30a0c8a02dcf84635048baba921a746fb4cf175 cands/n419j3-2416d17a/recipe/overlay/inkling_cert/csrc/certwide_screen.cuhe062ec37ea4eef60f7dd7be2f42b6e2541b06dcdcadc3e255cc1e1fec56ee2ca cands/n419j3-2416d17a/recipe/overlay/inkling_cert/csrc/screen6.cuh8398ac6708c32f5fe2224a15e3495708e0760d79564208c822c7bdf9a93ccf92 cands/n419j3-2416d17a/recipe/overlay/inkling_cert/dflash.py9d4fd4e0867b28d19bde7c1a47a6dbc462691dee38ab2f34073f454838b374b1 cands/n419j3-2416d17a/recipe/overlay/inkling_cert/ops.py2b6ba45d552282da40e2d1d380707dc26ad679eb114fb0bd1c533fe6944a4b2e cands/n419j3-2416d17a/recipe/overlay/inkling_cert/patches.py56274922d9aaa203ef2b5bd3dff7d7f3973d562b1f47541dc833669a10b7eeb8 cands/n419j3-2416d17a/recipe/overlay/inkling_cert/quant.py689f292b6e85042db4d7f700ef39573dcc1f441683abcae71e5074109c6e8168 cands/n419j3-2416d17a/recipe/overlay/inkling_cert/tests/test_cert.py7eec9ed58f35f5ae644b15ead34fc384fe5f1d8eee47f6fe1dd580a9d896e825 cands/n419j3-2416d17a/recipe/overlay/inkling_cert/tests/test_certwide.py131940bc65d9c1efca8ccf4816e9f5ae615394510f7bdd70d550cb0200a7e12a cands/n419j3-2416d17a/recipe/overlay/inkling_cert/tests/test_dflash.py9c582d423bee68dd253422ad91c42ad6e9d494c67030b0e09e2e660549b2ad83 cands/n419j3-2416d17a/recipe/overlay/inkling_cert/tests/test_patches.py089b23ba89259410f7f4c5a73d6a261ac928a44add4f5debeabc84a5b7a9c364 cands/n419j3-2416d17a/recipe/overlay/inkling_cert/tools/gpu_check_cert.py1b41188139e5e59c0d1138efbc218aa5469c2b3570fdce2a7f2b790589f991ea cands/n419j3-2416d17a/recipe/overlay/inkling_cert/tools/smoke_hooks.py269984f2e0628a6387af93a27350f6ccd53691d6ebc6ff63b4efd83a536fd1c7 cands/n419j3-2416d17a/recipe/overlay/inkling_dfaccept/README.md24eb31b321286bef5e99130e3b083ddfe8faafcb342c052305c5a98a5d7d9f59 cands/n419j3-2416d17a/recipe/overlay/inkling_dfaccept/__init__.pyab12eae066bc1cc54662498a1d7d53aa468619997fc204e6a14ba26715977a0c cands/n419j3-2416d17a/recipe/overlay/inkling_dfaccept/_hook.py7ba089479db0974c09b76f1042f9131bb944e309343d72867c089e9faa3760fe cands/n419j3-2416d17a/recipe/overlay/inkling_dfaccept/core.py251128ff0efd9eb43e6a8225570e89d08b6e6b7c7b0cd3d1d8392050a3d9f563 cands/n419j3-2416d17a/recipe/overlay/inkling_dfaccept/patches.py5eb381c6c5137f7a670130ad22fe406706dedb095d0a9817f15d57ecddb809e8 cands/n419j3-2416d17a/recipe/overlay/inkling_dfbytes/README.md7cf77494d835269f88a704f0eaca2518ff2fda31c60d32d371b757f0db88ec66 cands/n419j3-2416d17a/recipe/overlay/inkling_dfbytes/__init__.pyab12eae066bc1cc54662498a1d7d53aa468619997fc204e6a14ba26715977a0c cands/n419j3-2416d17a/recipe/overlay/inkling_dfbytes/_hook.pyaca345f7e98de7509e7b507e4d401c8692db76687f3ab9116538261f7b143dcb cands/n419j3-2416d17a/recipe/overlay/inkling_dfbytes/ctx8.pycebe39ac06717ae5735ff4f839c1e5992a2b2f4ab50d4f98a062baa9c2f4a415 cands/n419j3-2416d17a/recipe/overlay/inkling_dfbytes/patches.pyf126616fd8682f570af7bdf7ec26e807d40c61051a8049d3e3efa16f94369798 cands/n419j3-2416d17a/recipe/overlay/inkling_dftail/__init__.pyab12eae066bc1cc54662498a1d7d53aa468619997fc204e6a14ba26715977a0c cands/n419j3-2416d17a/recipe/overlay/inkling_dftail/_hook.pyae77c2c3723aa2cdb32d9f26eea67ee82a44a6c55282483416ed2c801af40296 cands/n419j3-2416d17a/recipe/overlay/inkling_dftail/_sources.py6cd072ae1ca44714816b874c733805ea8c3be511a23715829e63298ed8dfd566 cands/n419j3-2416d17a/recipe/overlay/inkling_dftail/bpatch.pyb23bdb11c23c0cc06297899ca7e71a3f1be781052726427c1b5000e27afb8b0b cands/n419j3-2416d17a/recipe/overlay/inkling_dftail/snapshot.pye3b1e2f5194051bba30e455756c6b1943f5aacd03599ce1fa4b1b542844c0663 cands/n419j3-2416d17a/recipe/overlay/inkling_draftbytes/README.md8dd8abba6fa60514f4a68c64f54dd8cffedffbaa0982f4d4847be7627e3389c2 cands/n419j3-2416d17a/recipe/overlay/inkling_draftbytes/__init__.py812d99b5844ca99e56fa11394663733404441d35c3b42e804d8884a604eab6df cands/n419j3-2416d17a/recipe/overlay/inkling_draftbytes/_hooks.pyae8f4cb9cccea61a658bf3de2e0a4ef2cb0d01213915c5ce1732087100976ceb cands/n419j3-2416d17a/recipe/overlay/inkling_draftbytes/_opts.py06a22262122f4cc0b9bbf1497b98ab2f331175c2b407fc572284935d228788a5 cands/n419j3-2416d17a/recipe/overlay/inkling_draftbytes/_triton.pyc3d8459315b854912142d8b6deb7a2d903cee5913bcf2ee6ddb059faeebf9c13 cands/n419j3-2416d17a/recipe/overlay/inkling_draftbytes/csrc/w8gemv.cu2430b0bbe643063b7b842df20b5058ca07db302e37e0f199770ffa3fc49a1c3e cands/n419j3-2416d17a/recipe/overlay/inkling_draftbytes/dwin.py32bbb9a854451827e7633b19d0bb534e697fbd6c8ee6e76dae412d2dda464a4d cands/n419j3-2416d17a/recipe/overlay/inkling_draftbytes/hotvocab/inkling2-mini-hot-r2.jsonbab4e585eaff5c71e86eaa79bf5a0b9a11fa4bcbbca1495286b29d037d443ef4 cands/n419j3-2416d17a/recipe/overlay/inkling_draftbytes/ops.pyda084e9753f9d9a80876ac94595a375ec625302e23fac51a72fdc33e681e9cec cands/n419j3-2416d17a/recipe/overlay/inkling_draftbytes/patches.pycd3a06f12f2c22cbd73d62b24836eb8fb43b2d57e423ed3b4a18bb0b5df4a6e2 cands/n419j3-2416d17a/recipe/overlay/inkling_draftbytes/quant.pyf0fbc7e4b44e513c724d7381f6d12b04838cc3826c547be51b36fe1b47c48860 cands/n419j3-2416d17a/recipe/overlay/inkling_draftbytes/rnnhoist.py65acc6c881f54a868270eec9e2acdd552fe0158da010dfb001ad112929360682 cands/n419j3-2416d17a/recipe/overlay/inkling_draftbytes/tau.py40db95bd0174f5a3d9f732a1e742ff022384884046b1da095e3b76d528f38c28 cands/n419j3-2416d17a/recipe/overlay/inkling_draftbytes/timing.pycb76bf7c8ae6b78337483d6e3145b4aadb076db528a7777e95fdc95e804f4346 cands/n419j3-2416d17a/recipe/overlay/inkling_draftbytes/w8gemv.py84c62ef2bad39eb126b3f03e356aa8e7149ce00cdef07b441bb8a3066544daef cands/n419j3-2416d17a/recipe/overlay/inkling_kernels/README.mdcf121c574ddc27aa1ff24138814b25990cf9e6426fe5ac91f08166c9b944073e cands/n419j3-2416d17a/recipe/overlay/inkling_kernels/__init__.pyee0ef2ccad715b6614ee88fedd6f5a5a67291e6c76e3fed8c9bf4bf663209858 cands/n419j3-2416d17a/recipe/overlay/inkling_kernels/_hook.py75dafe2d6bfbeb65193bbab71f1c915ebca4e3919edb540898f93cf9f7594b7e cands/n419j3-2416d17a/recipe/overlay/inkling_kernels/moe_tiles.py97d9379d33afc634a1a91e41e2fef1bda8d1609d19fe58ff95d2adafb5808d6b cands/n419j3-2416d17a/recipe/overlay/inkling_kernels/qkvr_gemv.py9886b5e338556024c03dd58a31b14e9e5f03e094609b547915e324f44605857f cands/n419j3-2416d17a/recipe/overlay/inkling_kv12/README.md41daa1fc09a60a324539affd7ec9667a0350020fc6633f8c068fec9dc5f78ee0 cands/n419j3-2416d17a/recipe/overlay/inkling_kv12/__init__.pyab12eae066bc1cc54662498a1d7d53aa468619997fc204e6a14ba26715977a0c cands/n419j3-2416d17a/recipe/overlay/inkling_kv12/_hook.pybc8941909122c51bcc80cb1b37fda233061c0c50c180e031aba3a8c7789e7691 cands/n419j3-2416d17a/recipe/overlay/inkling_kv12/ops.pyd4514e3786f2dd98370a6126733239344f94280c4b89d7126536b99b66352283 cands/n419j3-2416d17a/recipe/overlay/inkling_kv12/patch.py4c035d2a7cfc45f17cf9fb39341a6fa85bc4634b3926725f7d23cd9501808012 cands/n419j3-2416d17a/recipe/overlay/inkling_kv12s/__init__.pydd08112a15db424731b25bb3dd8e5d27a688033896fb11269e3c021e6e0f2bdf cands/n419j3-2416d17a/recipe/overlay/inkling_kv12s/attention.py6f96ca7ed4d69503bb2e83f95ddf08b201b510acf9cc1b034f724125a726a214 cands/n419j3-2416d17a/recipe/overlay/inkling_kv12s/check_data.py10932369507cd317ee7f1ad1966433bfbcb34da2106b795b6b580a60a85e159f cands/n419j3-2416d17a/recipe/overlay/inkling_kv12s/device.py616a0ab680b3b259128a39dfeb77d7b8b77ed7cb6bef74d890e0487f38ee507a cands/n419j3-2416d17a/recipe/overlay/inkling_kv12s/patch.py3554c61d7da8134766ed41206239065ba1e7b5df3b38a390a66a931876cf4533 cands/n419j3-2416d17a/recipe/overlay/inkling_kv12s/pressure.pyd0ad1f533a820b97d19ffbc420c8f490497c38641bb48f7328206299aa48f145 cands/n419j3-2416d17a/recipe/overlay/inkling_kv12s/segsum.py7d8d61c362c645a610e65d4ccba7e0dce8d46dcd150a27df5d2546fb37093661 cands/n419j3-2416d17a/recipe/overlay/inkling_kv12s/static.py37b1fd7d544955e98c4d8ee1d16f4e49e2f945dc18b137b894b1fd5cbe7ce102 cands/n419j3-2416d17a/recipe/overlay/inkling_kv12s/storage.pya7a4ce407859b7f31120608314ae7d9f8df8244ef309dcd9cd3aae689f731f0c cands/n419j3-2416d17a/recipe/overlay/inkling_kv12s/swa_layout.py5b2d5c191cffda9cb772e493514b06b8e87e94e46fdbf36b1ad4b5a9ac4487da cands/n419j3-2416d17a/recipe/overlay/inkling_mixdraft/__init__.py83a952e187fb34e111798adf45ebf18a2e3546b6647657f4ea0effe3370192da cands/n419j3-2416d17a/recipe/overlay/inkling_mixdraft/kernel.pydf3f862c7d93b8be6e82498afeb62e3144d15b7a0c876a96ba464f4c9f71cd4d cands/n419j3-2416d17a/recipe/overlay/inkling_mixdraft/linear.pybb72def3d71f7cf145079bc5edc4f8ee1a208f15780928b806337826d81bda8d cands/n419j3-2416d17a/recipe/overlay/inkling_noexp/__init__.pyab12eae066bc1cc54662498a1d7d53aa468619997fc204e6a14ba26715977a0c cands/n419j3-2416d17a/recipe/overlay/inkling_noexp/_hook.pyd6207856ed7b8146c9842cbebac87b652a05f9e0c83dd84ef644d7edb4d55c42 cands/n419j3-2416d17a/recipe/overlay/inkling_noexp/_mask.py81752701087d7a56045ab97627e3e2ceaf039099d5b561c061321a22acf6b689 cands/n419j3-2416d17a/recipe/overlay/inkling_padx/__init__.pyab12eae066bc1cc54662498a1d7d53aa468619997fc204e6a14ba26715977a0c cands/n419j3-2416d17a/recipe/overlay/inkling_padx/_hook.py51823f619e768163dbfa547165e7af04ddf93af35ff13e6b8ff0ef02abaaf686 cands/n419j3-2416d17a/recipe/overlay/inkling_padx/patches.py2710527dfb9c184e3cc77780c6d69ab64b22bba032daa2087736302d54c5b0d7 cands/n419j3-2416d17a/recipe/overlay/inkling_pcopy/__init__.pyab12eae066bc1cc54662498a1d7d53aa468619997fc204e6a14ba26715977a0c cands/n419j3-2416d17a/recipe/overlay/inkling_pcopy/_hook.pyc210ac609cd5ff936aed7b0d582b5a89dc059cfaab93dc91ad7cd6a445866062 cands/n419j3-2416d17a/recipe/overlay/inkling_pcopy/_sources.py2b9b808117ef4b23884652c9a199258bebaacfb485199d434304969ae1f33353 cands/n419j3-2416d17a/recipe/overlay/inkling_pcopy/fixtures.py26a153b5ffa4ee27159401581b109872b91216cbd36db8d6f1e04bf43c3ca2f7 cands/n419j3-2416d17a/recipe/overlay/inkling_pcopy/fused.py26e1cdbb37a8d7f58d7b92c42270e151d08822d3e9797130dbbb19d483b1352e cands/n419j3-2416d17a/recipe/overlay/inkling_pcopy/history.py079f558fe7ddc02f8bd320d71fa329e569bf3e1ecc2c9a419fe32f62b7139192 cands/n419j3-2416d17a/recipe/overlay/inkling_pcopy/matcher.py14b3d2fda0fbc5a7a640187872ec77c072f2ba723de74983ab5a63b10fa85545 cands/n419j3-2416d17a/recipe/overlay/inkling_pcopy/patch.py89a122d26a44d635e94586af6dfdb50c53f48a462d7ea02395b293fb1ef9c6d3 cands/n419j3-2416d17a/recipe/overlay/inkling_pcopy/rule.py61a59cd6f4d9b31abd76da83f67b5797f4a1f5e5ec9ce866e78fdcd8692896eb cands/n419j3-2416d17a/recipe/overlay/inkling_pfuse/CREDITS.md.knapcio-v2.9.31a87a7afb937c54991860f623a0365882a854cf08bf058e6efd60e87488fcddd cands/n419j3-2416d17a/recipe/overlay/inkling_pfuse/LICENSE.knapcio-v2.9.3398c1c6b775c7865ad1c50f1cc73ed01116a4d8e213ed3bcf7eff0bc2d268642 cands/n419j3-2416d17a/recipe/overlay/inkling_pfuse/NOTICE.knapcio-v2.9.3aa5869a0f6a177c6cda7280c4a2564097a06f02b3e260c4a25cd24a8c6193018 cands/n419j3-2416d17a/recipe/overlay/inkling_pfuse/README.md9820ebf80c8ffff40d14244fdab623d1511ea8fc751a1fa8c17f759fade25f9d cands/n419j3-2416d17a/recipe/overlay/inkling_pfuse/__init__.pyab12eae066bc1cc54662498a1d7d53aa468619997fc204e6a14ba26715977a0c cands/n419j3-2416d17a/recipe/overlay/inkling_pfuse/_hook.py7e47cfd76d45851d371aa23e089deba31c99823e2296ca145522b4d801583b7e cands/n419j3-2416d17a/recipe/overlay/inkling_pfuse/_triton_mix.py1930979f4bdc1b97bac83cc95dc4c15ab726b0ce69f11baeda9cf753011c7e41 cands/n419j3-2416d17a/recipe/overlay/inkling_pfuse/_triton_sconv.pyd3b81190b2622e5a437c823af4ae16e0ebf1e8b631c7a9432bc1e71503bd01ce cands/n419j3-2416d17a/recipe/overlay/inkling_pfuse/layer.py508f34216dec13dcc30d77c08cd09d10f7d20bbbb28bb031e90414c7b25d3f8b cands/n419j3-2416d17a/recipe/overlay/inkling_pfuse/mix.py32fe8bcacf8d6fc64ee401b014c421c4cdc0d5c6d342a50a489bf65891cbfd5a cands/n419j3-2416d17a/recipe/overlay/inkling_pfuse/tools/attrib_prefill.py1ff7a611ad3a7e6ee9955f5ece2fc8778b5e37186bec785bf304e68f997300a3 cands/n419j3-2416d17a/recipe/overlay/inkling_pfuse/tools/bench_loop.py467bc7d06db2756307d7da7fc7289c7ff2a2f08d4ec1550cad57b6dcf1bbd73f cands/n419j3-2416d17a/recipe/overlay/inkling_pfuse/tools/gpu_check_pfuse.py63f3bbbdc63686529c2ed70ef5a94cbe66ab761a985799f58e27d9aaedacfad8 cands/n419j3-2416d17a/recipe/overlay/inkling_pfuse/tools/sweep_mix.py61a59cd6f4d9b31abd76da83f67b5797f4a1f5e5ec9ce866e78fdcd8692896eb cands/n419j3-2416d17a/recipe/overlay/inkling_phoist/CREDITS.md.knapcio-v2.9.31a87a7afb937c54991860f623a0365882a854cf08bf058e6efd60e87488fcddd cands/n419j3-2416d17a/recipe/overlay/inkling_phoist/LICENSE.knapcio-v2.9.3398c1c6b775c7865ad1c50f1cc73ed01116a4d8e213ed3bcf7eff0bc2d268642 cands/n419j3-2416d17a/recipe/overlay/inkling_phoist/NOTICE.knapcio-v2.9.326eb3a17f9a426fb11dfec4e294dd2ed187b7104bf36e7588a9d6df8ee63134b cands/n419j3-2416d17a/recipe/overlay/inkling_phoist/__init__.pyab12eae066bc1cc54662498a1d7d53aa468619997fc204e6a14ba26715977a0c cands/n419j3-2416d17a/recipe/overlay/inkling_phoist/_hook.pyca8c58f123ea47200ca9306f1e043fae10672f381cf96e7685f5f6adff3e953a cands/n419j3-2416d17a/recipe/overlay/inkling_phoist/phoist.pyf55d49b173b3f6ef080ce2dcc563333f193dfcbf75a7e8f7f6f5b353e4be7576 cands/n419j3-2416d17a/recipe/overlay/inkling_phoist/phoist_triton.pya12fbe61a792b2c2c7597b259ab99a0b9656922865a9a24836d92f17e121f876 cands/n419j3-2416d17a/recipe/overlay/inkling_pico12/README.md8aeb4211fa86cc155ac12af76eedea7963e96c1f43c766e3c749bcfba35ac370 cands/n419j3-2416d17a/recipe/overlay/inkling_pico12/__init__.pyee0ef2ccad715b6614ee88fedd6f5a5a67291e6c76e3fed8c9bf4bf663209858 cands/n419j3-2416d17a/recipe/overlay/inkling_pico12/_hook.py0b9cd153d788be7ffed98a8bd0d7b4fbab6222f1e3c06961865a01a6cd991c44 cands/n419j3-2416d17a/recipe/overlay/inkling_pico12/build.pyaab4b5396310f0f0cbe21c1fcd5906e25b8c62f18689685c48ff5f530622c7c8 cands/n419j3-2416d17a/recipe/overlay/inkling_pico12/csrc/pico12_ext.cu8babed542f329a5040a02167d6d30e880d35a4f334b457adff8489dfa198800a cands/n419j3-2416d17a/recipe/overlay/inkling_pico12/csrc/pico12_range.cu97329931d0e392fc5ac1292657bb9852bae973fd4336ec47dcea626bd78a09cd cands/n419j3-2416d17a/recipe/overlay/inkling_pico12/ops.py1d91c866aaa329e6045d2161a776ba6e2064f3f81b8a6a6903f0bb6c6cc3608e cands/n419j3-2416d17a/recipe/overlay/inkling_pico12/patches.pyfb9c7ecee826335f6014f5f2040b5abe132a86aa6e43f1545bb1e5db19cea16b cands/n419j3-2416d17a/recipe/overlay/inkling_pico12/third_party/pico/LICENSE60b3ad14b8d2291101c82f3cc8c0653a6e778b1db9abfe463992dd3737550b4f cands/n419j3-2416d17a/recipe/overlay/inkling_pico12/third_party/pico/common/check.h5d96f43891a930cffa23c8649a79d28d019f7597bf5b2ac51e46eb6de5ff6e87 cands/n419j3-2416d17a/recipe/overlay/inkling_pico12/third_party/pico/kernels/common.cuhbaa1d8d7ff69d0f132acbfba354eb35dc4e5011b5f3e1ae3d177d6d1dcfb5256 cands/n419j3-2416d17a/recipe/overlay/inkling_pico12/third_party/pico/kernels/dsk.h91230a0b0783d2af5da87d6476e60c2dc2d94d60879998e54db547dc6f01982d cands/n419j3-2416d17a/recipe/overlay/inkling_pico12/third_party/pico/kernels/gemv16.cu61a59cd6f4d9b31abd76da83f67b5797f4a1f5e5ec9ce866e78fdcd8692896eb cands/n419j3-2416d17a/recipe/overlay/inkling_prologue/CREDITS.knapcio-v2.9.3.md1a87a7afb937c54991860f623a0365882a854cf08bf058e6efd60e87488fcddd cands/n419j3-2416d17a/recipe/overlay/inkling_prologue/LICENSE.knapcio-v2.9.3398c1c6b775c7865ad1c50f1cc73ed01116a4d8e213ed3bcf7eff0bc2d268642 cands/n419j3-2416d17a/recipe/overlay/inkling_prologue/NOTICE.knapcio-v2.9.3d807c304d543312f6c3c3e2f1d40a3dcedc982c8bef30a34ca891fe6c7956fbe cands/n419j3-2416d17a/recipe/overlay/inkling_prologue/__init__.pyab12eae066bc1cc54662498a1d7d53aa468619997fc204e6a14ba26715977a0c cands/n419j3-2416d17a/recipe/overlay/inkling_prologue/_hook.pyd83c5b71d817b66804bfaa2c7108a96b4374033102b709639555456feed6478d cands/n419j3-2416d17a/recipe/overlay/inkling_prologue/_triton.pyfed63858ca1872cf9fc4122cff02af670e297b972df4d075c929c77613b7f6c4 cands/n419j3-2416d17a/recipe/overlay/inkling_ptouch/__init__.pyab12eae066bc1cc54662498a1d7d53aa468619997fc204e6a14ba26715977a0c cands/n419j3-2416d17a/recipe/overlay/inkling_ptouch/_hook.pyb8dfe59c5b140d6a9804be846b06cb4ec07746bb0176ff8b2637177c9487806f cands/n419j3-2416d17a/recipe/overlay/inkling_rsfix/README.mdedf339d321b72e9207204143906526677b6beacb179e1399ac9dc183ba29bd72 cands/n419j3-2416d17a/recipe/overlay/inkling_rsfix/__init__.py2a1eabd10f7e964a53fe76b66254873fcfd461b0d32f7277db42457d7d65990a cands/n419j3-2416d17a/recipe/overlay/inkling_rsfix/_hook.pyc4e84d4ef8e7343e1563617814c65d0d71fbe19915461d73245818f83e9d1e6c cands/n419j3-2416d17a/recipe/overlay/inkling_rsfix/_sources.pye4dfce68cae58f71a0658410fe88e6520f94d6c389f8d57e482dacea363509d8 cands/n419j3-2416d17a/recipe/overlay/inkling_rsfix/blockwise.py9530622cde80e49864d60a50342ff1850e6c6389eb1baa0207d68ba6a388005c cands/n419j3-2416d17a/recipe/overlay/inkling_rsfix/markov.py93da51652aa8ec27396610a10724b6571e5de8d4ee08e236677c9e98604db951 cands/n419j3-2416d17a/recipe/overlay/inkling_rsfix/reference.py61e81094be26a6f8a46f07f1b062b07eab246a52553ed094ba147813d92dd513 cands/n419j3-2416d17a/recipe/overlay/inkling_rsfix/reject.pyd5607344cacbcf77fb4cdcc6ce9de49a4290bbf85281f78c9c397a2984dc06eb cands/n419j3-2416d17a/recipe/overlay/inkling_rsfix/selector.py63c5e7852205045be8bca6e84160df8f2f4dd4f44a8093a6a5a04d9fffbca47e cands/n419j3-2416d17a/recipe/overlay/inkling_vattn/README.mda08d05ffbd94bdb1c94194432d927b1f30035fa6f23fcc2adc7de36b2930c78c cands/n419j3-2416d17a/recipe/overlay/inkling_vattn/__init__.pyab12eae066bc1cc54662498a1d7d53aa468619997fc204e6a14ba26715977a0c cands/n419j3-2416d17a/recipe/overlay/inkling_vattn/_hook.py63aad1d099fec3f2b66a0ffd8d3709a564644edac2d4f25c1c33018be3dd6f25 cands/n419j3-2416d17a/recipe/overlay/inkling_vattn/ops.py4f18599a0ad748f7f6a507f165ac72327e733eb082fd6276995b9e4474869652 cands/n419j3-2416d17a/recipe/overlay/inkling_vattn/patch.py66f94a7e6143ee5bde5e8f83aefe4333ad9d701282b411f0c30091eff637b3b7 cands/n419j3-2416d17a/recipe/overlay/inkling_vcap/README.md6a39653aa552d2035e4700918cf7e6dd488881c46cd4d52a3edf8424fe7f3cbd cands/n419j3-2416d17a/recipe/overlay/inkling_vcap/__init__.py01b543f9ea35fd83b4ef34d681b86f6aedd3fc9cbc26b270fb98d3159025c4c2 cands/n419j3-2416d17a/recipe/overlay/inkling_vcap/config.pybbe0288dd145ba12f1d7312b7def82a7dc0f76c31b5dfa3e2236730eba177b79 cands/n419j3-2416d17a/recipe/overlay/inkling_vcap/dfcap.py9caf5d3ca057b622e4cca6e35456f7435f9e1d1e5df692f491e12271014d8aed cands/n419j3-2416d17a/recipe/overlay/inkling_vcap/dfcheck.pyf7d2389c58143c3ea661616d82f42e1c7b55b8f95c78dcb424c45d205c4d2203 cands/n419j3-2416d17a/recipe/overlay/inkling_vcap/dflash.py41cd33472898d7ad98bcbaae2eaf5c27238069b6cdd7815528c932795673e5da cands/n419j3-2416d17a/recipe/overlay/inkling_vcap/dfsteplog.pybda7d9e386db34eb3f3a8c8aeda249b91ff8ec27d176c23fb5574e80ec81c431 cands/n419j3-2416d17a/recipe/overlay/inkling_vcap/fastprobs.pyd364b1bc5a27dd747b08095030670ac085205454b548ba54b453f96872cd90bb cands/n419j3-2416d17a/recipe/overlay/inkling_vcap/fused.py897b421d153acd9c0494e084e0d8227804a00f5d24c245646dec74079c422b84 cands/n419j3-2416d17a/recipe/overlay/inkling_vcap/fused_accept.py0a928a2c9b2677ce1a359da34d444b40ff38cc6a01c8f44c5723dbaabb6751e5 cands/n419j3-2416d17a/recipe/overlay/inkling_vcap/importhook.py2738304eeff01b7d21c700c7408b24e1c429ad912fdc6e58952cf5a1d2a80963 cands/n419j3-2416d17a/recipe/overlay/inkling_vcap/logic.py9ba4bf5aeafcc3d1e58adecbad230cbfa128079c6577843a6e28e40866258a20 cands/n419j3-2416d17a/recipe/overlay/inkling_vcap/patches.py21082944e6df1a1eb5d288c226562278d8b493ea37cb6ccbf6a8a98bcaa93cce cands/n419j3-2416d17a/recipe/overlay/inkling_vcap/policies/df-SLDF1-sm.jsonb9505b8e00284277b8354cf72a406d8bc2b465d8619f51f44e8609964093b5ee cands/n419j3-2416d17a/recipe/overlay/inkling_vcap/policies/df-SLDF2x.jsonab43150b4ff972b9975192761515e843088f8838b765090c888f1c3e79334e9f cands/n419j3-2416d17a/recipe/overlay/inkling_vcap/policies/r2-theta004.json359b404bd41371397ec8948ece4700d10e1e2b6271301e47439dc4cd83198310 cands/n419j3-2416d17a/recipe/overlay/inkling_vcap/policyfile.py982f86bb234ebfd5ca7f37304ae9bf78b5fa90969e75357a5a44905f8a708f49 cands/n419j3-2416d17a/recipe/overlay/inkling_vcap/state.pyc7f51ebddeba0c2cb5a11bf8075fec231f081ef58ffd0e2c93097a70ebbca04a cands/n419j3-2416d17a/recipe/overlay/inkling_vcap/v3_kernels.py4cd0f8e5854e5ed4f1745e6a56aaeba679c4ec4bc17352960f1f01fe3b8f8cf0 cands/n419j3-2416d17a/recipe/overlay/inkling_wide/README.mde473be74143084bca38efb0fce7b281b63239471bc43e99692863dd53b85dd16 cands/n419j3-2416d17a/recipe/overlay/inkling_wide/__init__.pyee0ef2ccad715b6614ee88fedd6f5a5a67291e6c76e3fed8c9bf4bf663209858 cands/n419j3-2416d17a/recipe/overlay/inkling_wide/_hook.py409563a58078e003f0f61c39162dca23563d08cf6fe3e6ecd53211b30538bd12 cands/n419j3-2416d17a/recipe/overlay/inkling_wide/build.py640625aed9282589c3c32b06f0b57be48efd230c88425a4264748fed3f23eb15 cands/n419j3-2416d17a/recipe/overlay/inkling_wide/csrc/bf16x_format.cuha281cb85d1867e5acd8dfe7c8d3b2f1b68b5cb1d3091ad6445eba09d66341e94 cands/n419j3-2416d17a/recipe/overlay/inkling_wide/csrc/wide_ext.cu3b12f4ef0077ccc61f4867a1369a66fc2a3b10e791c19f4323956756086418cd cands/n419j3-2416d17a/recipe/overlay/inkling_wide/ops.py0deb113320ff36523d0e5a25851c3d27aa9412ed5b74d3fd74288504e0404e09 cands/n419j3-2416d17a/recipe/overlay/inkling_wide/patches.py5b3f3070eab76b167d3ac2a7f03cfea9e59901e45dbe3a01059cbe5d423bcdbc cands/n419j3-2416d17a/recipe/overlay/inkling_wide/tests/fake_wide_ext.pyb436a3347e2e274fc146d5ed6969f489415fa60f0fc0f58593fd0875d1ddfd87 cands/n419j3-2416d17a/recipe/overlay/inkling_wide/tests/test_wide.pyfb9c7ecee826335f6014f5f2040b5abe132a86aa6e43f1545bb1e5db19cea16b cands/n419j3-2416d17a/recipe/overlay/inkling_wide/third_party/pico/LICENSEb37e3528ad0ca2dcbd2ab38ee4be67ec88980e769c4a5dbddfa5b45624f28fa7 cands/n419j3-2416d17a/recipe/overlay/inkling_wide/tools/gpu_check_wide.pyff089d1ab9f66eb5ee40a3f77a6193120abc064d9eb97a60e495a5ec3fa743eb cands/n419j3-2416d17a/recipe/overlay/inkling_wide/tools/gpu_integration_wide.py65acb522ac26d4bdacff65abacf544479da47d7bc6d43ed97b319972a36b560a cands/n419j3-2416d17a/recipe/overlay/sitecustomize.py1f64526e4dcec5cd6d3cd3d842ebbf74035e4f34b64aeb7d761693b8198bd924 cands/n419j3-2416d17a/recipe/patch/inkling2_attn.py64914ef9213420b37bdb361dfb3bdadb5ff07994deda96c548762e006927bd44 cands/n419j3-2416d17a/recipe/patch/inkling2_loop.py70d8797b523b0fcdaad6e709e14bfc4bbdcc735a4b49824b430997ff1018dd78 cands/n419j3-2416d17a/recipe/patch/inkling2_loop_model.py29d1f5cb5101a7a0aac48c4b1f15252acaba01a404c6e2475c6c798f0797d997 cands/n419j3-2416d17a/recipe/patch/n105_rnnhoist.py9d0231ebab913cb3b3956c421ae5f4f69d2661728f1f8d3b3d64755f9e455f63 cands/n419j3-2416d17a/recipe/patch/n13_attn_global.py7d6f1ab93c1252e891446df090e414c6aa975ca480a360b5ac65fb6d16c8be9a cands/n419j3-2416d17a/recipe/patch/n13_fwd.py1801287d6696437fa6417c335decf0f4b9deb7391b4d4e4fd8e5c893cf272333 cands/n419j3-2416d17a/recipe/patch/n140_kern.py6b69991a90d2ca2a6196d4d1d28014983614a6030d8a38d43aa08c7a29f49f65 cands/n419j3-2416d17a/recipe/patch/n14_moe.py8e2d7b61a2ffee1e5bbdaf3f2406a202f13e3a9d96df0f849d35af4d781cac62 cands/n419j3-2416d17a/recipe/patch/n14_quant.cuha67d3cacb45d4a981add4407552b030c8bdf08dabb7e136f555b21475aa3126a cands/n419j3-2416d17a/recipe/patch/n15_fused.pye8373342b54dfccbe4c04fd21e137172286b902b07ed6f5037deeb95eb70c9ef cands/n419j3-2416d17a/recipe/patch/n32_attn_local.py571c3e4a819b27e175091b7af099e972bc4c38b6eac3f1af1ff4e88b6b662746 cands/n419j3-2416d17a/recipe/patch/n32_fwd.py65f51937ca44728959542ca4ed7456973b45e7f32bd54934e44a49ee256630c4 cands/n419j3-2416d17a/recipe/patch/n35_w8.pyaa79c3095959d385dc1c6f9fdcf7558a73547fcc31c4f6460c6e77cbc9327605 cands/n419j3-2416d17a/recipe/patch/n35_w8gemv.pyb4cc2402f4c0eee56dc4ce9721043b6d16ed04e932f94848b395f3873f58cb59 cands/n419j3-2416d17a/recipe/patch/n37_tiles.py5b1a90477bb2ed2dddf31b3adbc8cb200538335854ddb99ce59ecdf3dbfadfac cands/n419j3-2416d17a/recipe/patch/n50b_fused.py1dc6b870ef8c25dd40615930cbf62dfec0e29c5d6b785eb8d42d532ea4a9cd04 cands/n419j3-2416d17a/recipe/patch/n52_band.cuhe4118504ce8a210f8d4ef86d1be579dd4d73e4161bb0c9e4264811ad51999140 cands/n419j3-2416d17a/recipe/patch/n52_moe.py3523d5fe6549aec71d853c0713403fbdc15984e08c3e5820c2a790a6ede84855 cands/n419j3-2416d17a/recipe/patch/n64_attn_global.pyeefba4b83410c246441d74d5311deacc6da6e4405d28e3c5b5fa344d4d29eb81 cands/n419j3-2416d17a/recipe/patch/n64a_fwd.pycca0cd0d7b860ed4cc78a98651264ecb8fd20793055e58323c2623b8531b6d0d cands/n419j3-2416d17a/recipe/patch/n64b_fwd.pyd1b88fb14a0d18ccff2ed53b79dcfcb1a2565e50e6cf625053bf39cdc9f1ecd9 cands/n419j3-2416d17a/recipe/patch/n66fb.pyb7abf0229b9d40558dc6dd576fb300bec9e0a6b9c173b458881111ff0bc89206 cands/n419j3-2416d17a/recipe/patch/n71_resnorm.py91f1bb6066a4e5abf77253e23816783880ea38cff649aebd844157b60268c5e7 cands/n419j3-2416d17a/recipe/patch/n71_sconvres.pyd4411fd151e6212a0feb14ed41457be3c976b92a8f5c981cbc2d1a890075eb7b cands/n419j3-2416d17a/recipe/patch/n75_c12.py71fd33a2a119db28c4ca8a24d75e9678131c87b327d095a329fdad18bc03e29a cands/n419j3-2416d17a/recipe/patch/n75_cuda.py00bece24b9b910eb33d1f85fe1e60b2685a2ac4dfb5f5136d891b9db668968f7 cands/n419j3-2416d17a/recipe/patch/n75_install.py17349b269f1eb7f2551fac79b9e8020b10708410156a08e1b959c8e53f491f79 cands/n419j3-2416d17a/recipe/patch/n78_head.py9447c05ffbf888a1aea1a7da467399f572f1d684f142f24c4cccfacefcd353f8 cands/n419j3-2416d17a/recipe/patch/n78_kern.pyefe43e40ebccb20b31398ef7b7a4e70e0dd1a6192a95904ebb70fb6a8f3d3b73 cands/n419j3-2416d17a/recipe/patch/n80_cuda.pycd2d6ef590744ee69cd3b2dfdff9c42cf957eef291f858c3054f1b651b84943f cands/n419j3-2416d17a/recipe/patch/n80_draft.py9ba4c20f9fa95c8d9a337f4eeea6abae50e142f747d4dde618712f04e127f56f cands/n419j3-2416d17a/recipe/patch/n86_riders.py25030bef80b49e72d46355799e7febea0867ea57aed711f7c9ae28159a81f390 cands/n419j3-2416d17a/recipe/serve/inkling2_mtp.py2b27a2b7797d41922869d0c3b95ba281ea812a70557d194782908ad247a74fe6 cands/n419j3-2416d17a/recipe/serve/mixpin.sh9c80d55f4f87c0f9b29222cf27c85c5a899be961f7c44b98c5d59e8f172215ce cands/n419j3-2416d17a/recipe/serve/serve.sh6e3fa6a41f6ceb0e80812e387488538ac8dc436851193a4dcdaecaeb93ab5e6b cands/n419j3-2416d17a/recipe/serve/serve.sh.orig1bccd9dadf233cd9af15aa63a8d2cc22e0706983355a00e380731d09a5bdb682 cands/n419j3-2416d17a/recipe/serve/sl.json14223ae2f3aa1d661da67cf0143ec33070d952a6e28a119e6cec64fcc0bebe50 dflash2/sglang_inkling_dflash2.py12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394# Credits
- **Thinking Machines Lab** for Inkling-2-Mini, its NVFP4 / MXFP8 checkpoint and the bundled DSpark draft model (`mtp.safetensors`) ([model card](https://huggingface.co/thinkingmachines/Inkling-2-Mini), [announcement](https://thinkingmachines.ai/news/inkling-2-mini/), Apache-2.0).- **incoai**, [Inkling-2-Mini-DFlash2](https://huggingface.co/incoai/Inkling-2-Mini-DFlash2) (Apache-2.0): the DFlash2 draft model that is this recipe's default drafter, and its SGLang compatibility patch (`sglang_inkling_dflash2.py`), both used as published at revision `4f9088ea`, fetched by `scripts/download.sh` and not distributed here. The drafter byte cuts, the DFLASH verify-width cap, the certified head on DFLASH steps and the selector fix are ours, on top of it.- **The DFlash authors** ([z-lab/dflash](https://github.com/z-lab/dflash)): block-diffusion drafting for speculative decoding, the method behind the DFlash2 drafter, and SGLang's DFLASH worker that serves it.- **SGLang** project for the Inkling-2-Mini support, the `lmsysorg/sglang:inkling-2-mini` image and the [Inkling-2-Mini cookbook](https://docs.sglang.io/cookbook/autoregressive/ThinkingMachines/Inkling-2-Mini), whose DGX Spark DSpark cell (TP1/EP1, FA4, page 128, 8 draft tokens, the four `SGLANG_OPT_*` switches, `MAX_JOBS=4`, the `inkling` / `inkling2` parsers) is the base of the default profile.- **vLLM** project for the Inkling-2-Mini support (vllm-project/vllm #69027, #69028, #69039 by Woosuk Kwon and contributors), the `vllm/vllm-openai:inkling-2-mini` image and the [vLLM recipe](https://recipes.vllm.ai/thinkingmachines/Inkling-2-Mini) behind the alternative profile.- **Tech2Wild (tonyd2wild)**, [Inkling-2-Mini-NVFP4-DGX-Spark](https://github.com/tonyd2wild/Inkling-2-Mini-NVFP4-DGX-Spark): the first single-Spark vLLM recipe for this model. Reused here: the vLLM tier settings (`--gpu-memory-utilization 0.80` at 262K context with tool calling on), the hybrid KV-pool block model and the FP8-KV long-context tier with its memory budget (74 GiB of FP8 KV at 1M), the GB10 page-cache trap, and the advice to keep MemAvailable above ~6 GiB.- **thefullctx**, [inkling-2-mini-sglang-dgx-spark](https://github.com/thefullctx/inkling-2-mini-sglang-dgx-spark) and [inkling-2-mini-vllm-dgx-spark](https://github.com/thefullctx/inkling-2-mini-vllm-dgx-spark): the first published SGLang vs vLLM head-to-head on one Spark (vLLM slightly ahead on short c1 decode, SGLang ~2x on long prefill, faster long-context decode and much lower memory use), which set the arms of our comparison.- **Thien Tran (gau-nernst)**, vLLM PR #69168 (small-M GEMMs for Inkling's looped core): the split-K router / conv-projection and controller re-tiling we screened (not adopted, flat in serving).- **sxuff**, [inkling-2-mini-spark](https://github.com/sxuff/inkling-2-mini-spark) (Apache-2.0): the vLLM + DSpark + INT8 draft recipe and benchmark used for the same-harness comparison, and the `--safetensors-load-strategy eager` result (127 -> 45 s) that prompted our one-pass checkpoint load with SGLang's own flag.- **0xSero**, [inference-optimisation skill](https://github.com/sybil-solutions/inference-optimisation-skill) (MIT): the method behind sxuff's eager-load finding.- **tie-pilot-qxw**, [dspark-markov-walk](https://github.com/tie-pilot-qxw/dspark-markov-walk) (MIT), and [vLLM PR #62958](https://github.com/vllm-project/vllm/pull/62958): the one-kernel DSpark Markov walk that inspired `rnnhoist`. Our projection split is an independent implementation.- **nick398** on the [NVIDIA developer forum thread](https://forums.developer.nvidia.com/t/inkling-2-mini/389745): the first FP8-KV serving notes for this model (vLLM `--kv-cache-dtype fp8` on an RTX 5090: about half the KV memory per token, described there as a quality trade-off).- **Andy Shu (@blaesus)**, [dsgb10](https://github.com/blaesus/dsgb10) (formerly dsgx10, MIT), as carried in [Picom-code/pico-dgx-ds4](https://github.com/Picom-code/pico-dgx-ds4) ("pico"): the exactly coded 12-bit BF16 GEMV (`bf16x` format and kernel) that `overlay/inkling_pico12/` builds and calls for the dense projections and the LM head; the sources are vendored unmodified in `overlay/inkling_pico12/third_party/pico/` with their licence.- **Andy Shu's `bf16x` reader** is also copied (MIT, with its notice) into `overlay/inkling_wide/csrc/bf16x_format.cuh`, which reads pico12's coded weights in the 17-256-row GEMM, and `overlay/inkling_cert/` compiles pico's head GEMV body from the vendored copy for the exact pass of the certified LM head.- **Tri Dao et al., FlashAttention-2** (algorithm): the online-softmax tiling of the fused relative-bias prefill attention in `overlay/inkling_attn/`.- **SGLang Inkling2 kernels**: the split-KV relative-bias verify kernel that `overlay/inkling_vattn/` routes every batch size to (and copies, with the bias computed per key tile, above 32 rows), the split-KV decode kernel that `overlay/inkling_kv12/` follows with its K / V tile loads replaced, the split softmax kernels that `VCAP_FASTPROBS` calls, the block-verification accept kernel behind `--speculative-use-block-verification`, and the fused loop-controller kernels of sgl-project/sglang PR #51926, already in the image.- **SGLang PR #51681** (DSpark Markov sampler: Philox words that rounded to u == 1) and **SGLang PR #51692** (blockwise rejection precision): their fixes are carried verbatim in `overlay/inkling_rsfix/` (`RSFIX`) until the image has them. The reject-sampler CDF fix and the DFLASH selector no-match fix in the same package are ours.- **Sun et al.**, "Block Verification Accelerates Speculative Decoding" (ICLR 2025): the block-verification algorithm that sampled requests use (`VCAP_BV`, `DFLASH_BV`). Running it under the verify cap (dead drafts as a stopped draft) and its logits-only form in the fused accept are ours.- **Xiao et al.**, StreamingLLM (2023): the attention sink kept by the optional drafter global-attention window (`dwin`, 128 sink tokens by default).- **Lossless float compression by exponent coding** (ZipNN, Hershcovitch et al., 2024; SplitZip) and **Andy Shu's exactly coded 12-bit `bf16x` format**: the inspiration for the packed 12-bit global-layer KV in `overlay/inkling_kv12/` (sign + mantissa byte, 4-bit exponent code, escapes). The KV format, packer and attention kernel are our own code; nothing is copied from these projects.- **Alexey Fateev / Project Maya**, [maya-inkling-mini](https://github.com/alesha-pro/maya-inkling-mini) (MIT): launch and "bytes in flight" notes on Inkling's small per-visit kernels that framed our L2-warming screen (not adopted, see docs/experiments.md).- **FR-Spec** (Zhao et al., ACL 2025, frequency-ranked draft vocabulary) and SGLang's EAGLE `--speculative-token-map`: the idea behind the hot-vocabulary draft. The prompt corpus that ranks the shipped list comes from allenai/WildChat-1M (ODC-BY), OpenAssistant/oasst2 (Apache-2.0), NousResearch/hermes-function-calling-v1 (Apache-2.0), bigcode/self-oss-instruct-sc2-exec-filter-50k (ODC-BY), HuggingFaceH4/ultrachat_200k (MIT), ise-uiuc/Magicoder-OSS-Instruct-75K (MIT), openai/gsm8k (MIT), databricks/databricks-dolly-15k (CC-BY-SA-3.0), EleutherAI/hendrycks_math (MIT), abisee/cnn_dailymail (Apache-2.0), CohereLabs/aya_dataset (Apache-2.0), wikimedia/wikipedia (CC-BY-SA-4.0), juletxara/mgsm (CC-BY-SA-4.0) and llm-jp/oasst2-33k-ja (Apache-2.0); only token frequencies of the model's own outputs are shipped, no prompt text.- **thefullctx**: the KV page-size 16 measurement we screened (not adopted here).- **Christopher Owen** and B12X (MXFP4-CSF): the scale-code format idea behind `overlay/inkling_scodes/` (our implementation, in a modified FlashInfer / CUTLASS mainloop).- **Christopher Owen, spark-ds41f** (Apache-2.0): the packed-BF16 vocabulary projection (b12x patch 0012) whose format we ported to Triton in a screen (not adopted, see docs/experiments.md).- **FlashInfer** (CUTLASS / CuTe DSL grouped GEMMs, the GEMVs) and **CUTLASS**: the kernels the MoE tile choice and the GPU checks run on; since v2.8.4 also the b12x MXFP8 GEMM and quantiser (`mm_mxfp8`, `mxfp8_quantize`) that run the drafter's eligible linears (mx8w), used as shipped.- **NVIDIA** for the DGX Spark platform.- **speedbench** ([knapcio/speedbench](https://github.com/knapcio/speedbench)), our own benchmark, for the headline numbers and the long-context table; its frozen prompt set also feeds the decode table.
Our own earlier recipes contributed ideas reused here: the verify cap with dead-row expert remap (DeepSeek-V4.1recipe), the batch-aware pay-for-rows rule and the certified greedy LM head (GLM-5.3-Flash recipe), FP8 / low-bitdraft heads (DeepSeek-V4.1), and our spark-tools and speedbench for measurement.
Every lever adopted from someone else's work gets a line here and an entry in the Credit column of the README.123456789101112131415161718192021MIT License
Copyright (c) 2026 Zbigniew Majewski
Permission is hereby granted, free of charge, to any person obtaining a copyof this software and associated documentation files (the "Software"), to dealin the Software without restriction, including without limitation the rightsto use, copy, modify, merge, publish, distribute, sublicense, and/or sellcopies of the Software, and to permit persons to whom the Software isfurnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in allcopies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ORIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THEAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHERLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THESOFTWARE.123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354Inkling-2-Mini on one NVIDIA DGX Spark
Repository-authored launch scripts, benchmark scripts and documentation: MIT, see LICENSE.
Third-party code vendored in this repository:- overlay/inkling_pico12/third_party/pico/: kernels/gemv16.cu, kernels/common.cuh, kernels/dsk.h, common/check.h by Andy Shu (github.com/blaesus/dsgb10, formerly dsgx10, `ds41f-4xgx10-switchless/engine/` at commit f2117916, as carried in github.com/Picom-code/pico-dgx-ds4), MIT licence, Copyright (c) 2026 Andy Shu; full text in overlay/inkling_pico12/third_party/pico/LICENSE. Unmodified except a two-line header naming the origin.- overlay/inkling_wide/csrc/bf16x_format.cuh: the `bf16x` reader (layout description, bf16x_raw_off, mad_imm, bf16x_dec, ldg_bf16x) copied from the same pico gemv16.cu (commit f2117916), MIT licence, Copyright (c) 2026 Andy Shu; full text in overlay/inkling_wide/third_party/pico/LICENSE.- overlay/inkling_cert/csrc/cert_ext.cu compiles kernels/gemv16.cu from overlay/inkling_pico12/third_party/pico/ (above) into its own extension; no further copy.
- overlay/inkling_scodes/csrc/scodes_sm120_mma_array.hpp: derived from CUTLASS's SM120 block-scaled grouped-GEMM collective mainloop (NVIDIA CORPORATION & AFFILIATES, BSD-3-Clause, licence text kept in the file header), modified to expand coded scale factors; scodes_group_gemm.cuh reduces FlashInfer 0.7.4's include/flashinfer/gemm/group_gemm_nvfp4_groupwise_sm120.cuh (Apache-2.0, Copyright (c) 2026 FlashInfer team) to the configuration SGLang uses and swaps in that mainloop.- overlay/inkling_kv12/ops.py: the decode / verify attention kernels (`_kv12_partials_np`, `_kv12_partials`) follow SGLang's Inkling2 split-KV decode kernel (`_decode_partials` in sglang.kernels.ops.attention.inkling2_decode_attention_sm90, sgl-project/sglang, Apache-2.0) with the same grid, tile order and online softmax, modified to read packed 12-bit K / V tiles from a side pool.- overlay/inkling_vattn/ops.py: `_inkernel_bias_partials` is the same SGLang `_decode_partials` kernel body (sgl-project/sglang, Apache-2.0), modified to compute the relative-position bias per key tile in-kernel.- overlay/inkling_rsfix/markov.py and overlay/inkling_rsfix/blockwise.py: the changes of sgl-project/sglang pull requests #51681 (dspark markov_sample) and #51692 (dspark blockwise_rejection), applied verbatim to copies of the image's functions (sgl-project/sglang, Apache-2.0). overlay/inkling_rsfix/reject.py and selector.py are copies of SGLang's reject_sampling kernels and DFLASH selector walk (Apache-2.0), modified as described in overlay/inkling_rsfix/README.md.
Third-party model files fetched at run time, not distributed in this repository:- Inkling-2-Mini-DFlash2 (huggingface.co/incoai/Inkling-2-Mini-DFlash2) by incoai, revision 4f9088ea66c21f2b99ed657d1941c306b03e84d2: the draft model (config.json, model.safetensors) and its SGLang compatibility patch (sglang_inkling_dflash2.py). Licensed under the Apache License, Version 2.0; you may not use these files except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0. Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. scripts/download.sh fetches them unmodified at that revision; scripts/launch.sh checks their sha256 and runs the patch, unmodified, inside the serving container only. The draft method builds on DFlash (github.com/z-lab/dflash).
The serving engines run from their published container images, pinned by digest in scripts/launch.sh:- SGLang (sgl-project/sglang), lmsysorg/sglang:inkling-2-mini, Apache-2.0.- vLLM (vllm-project/vllm), vllm/vllm-openai:inkling-2-mini, Apache-2.0.bench/decode_table.py reads the prompt file of speedbench (knapcio/speedbench, MIT) from a separate checkout; theprompts themselves are not copied here.
No model weights or container images are distributed. The Inkling-2-Mini weights (thinkingmachines/Inkling-2-Mini)are Apache-2.0 from Thinking Machines Lab; read the model card for the terms that apply to anything you serve.12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394# Credits
- **Thinking Machines Lab** for Inkling-2-Mini, its NVFP4 / MXFP8 checkpoint and the bundled DSpark draft model (`mtp.safetensors`) ([model card](https://huggingface.co/thinkingmachines/Inkling-2-Mini), [announcement](https://thinkingmachines.ai/news/inkling-2-mini/), Apache-2.0).- **incoai**, [Inkling-2-Mini-DFlash2](https://huggingface.co/incoai/Inkling-2-Mini-DFlash2) (Apache-2.0): the DFlash2 draft model that is this recipe's default drafter, and its SGLang compatibility patch (`sglang_inkling_dflash2.py`), both used as published at revision `4f9088ea`, fetched by `scripts/download.sh` and not distributed here. The drafter byte cuts, the DFLASH verify-width cap, the certified head on DFLASH steps and the selector fix are ours, on top of it.- **The DFlash authors** ([z-lab/dflash](https://github.com/z-lab/dflash)): block-diffusion drafting for speculative decoding, the method behind the DFlash2 drafter, and SGLang's DFLASH worker that serves it.- **SGLang** project for the Inkling-2-Mini support, the `lmsysorg/sglang:inkling-2-mini` image and the [Inkling-2-Mini cookbook](https://docs.sglang.io/cookbook/autoregressive/ThinkingMachines/Inkling-2-Mini), whose DGX Spark DSpark cell (TP1/EP1, FA4, page 128, 8 draft tokens, the four `SGLANG_OPT_*` switches, `MAX_JOBS=4`, the `inkling` / `inkling2` parsers) is the base of the default profile.- **vLLM** project for the Inkling-2-Mini support (vllm-project/vllm #69027, #69028, #69039 by Woosuk Kwon and contributors), the `vllm/vllm-openai:inkling-2-mini` image and the [vLLM recipe](https://recipes.vllm.ai/thinkingmachines/Inkling-2-Mini) behind the alternative profile.- **Tech2Wild (tonyd2wild)**, [Inkling-2-Mini-NVFP4-DGX-Spark](https://github.com/tonyd2wild/Inkling-2-Mini-NVFP4-DGX-Spark): the first single-Spark vLLM recipe for this model. Reused here: the vLLM tier settings (`--gpu-memory-utilization 0.80` at 262K context with tool calling on), the hybrid KV-pool block model and the FP8-KV long-context tier with its memory budget (74 GiB of FP8 KV at 1M), the GB10 page-cache trap, and the advice to keep MemAvailable above ~6 GiB.- **thefullctx**, [inkling-2-mini-sglang-dgx-spark](https://github.com/thefullctx/inkling-2-mini-sglang-dgx-spark) and [inkling-2-mini-vllm-dgx-spark](https://github.com/thefullctx/inkling-2-mini-vllm-dgx-spark): the first published SGLang vs vLLM head-to-head on one Spark (vLLM slightly ahead on short c1 decode, SGLang ~2x on long prefill, faster long-context decode and much lower memory use), which set the arms of our comparison.- **Thien Tran (gau-nernst)**, vLLM PR #69168 (small-M GEMMs for Inkling's looped core): the split-K router / conv-projection and controller re-tiling we screened (not adopted, flat in serving).- **sxuff**, [inkling-2-mini-spark](https://github.com/sxuff/inkling-2-mini-spark) (Apache-2.0): the vLLM + DSpark + INT8 draft recipe and benchmark used for the same-harness comparison, and the `--safetensors-load-strategy eager` result (127 -> 45 s) that prompted our one-pass checkpoint load with SGLang's own flag.- **0xSero**, [inference-optimisation skill](https://github.com/sybil-solutions/inference-optimisation-skill) (MIT): the method behind sxuff's eager-load finding.- **tie-pilot-qxw**, [dspark-markov-walk](https://github.com/tie-pilot-qxw/dspark-markov-walk) (MIT), and [vLLM PR #62958](https://github.com/vllm-project/vllm/pull/62958): the one-kernel DSpark Markov walk that inspired `rnnhoist`. Our projection split is an independent implementation.- **nick398** on the [NVIDIA developer forum thread](https://forums.developer.nvidia.com/t/inkling-2-mini/389745): the first FP8-KV serving notes for this model (vLLM `--kv-cache-dtype fp8` on an RTX 5090: about half the KV memory per token, described there as a quality trade-off).- **Andy Shu (@blaesus)**, [dsgb10](https://github.com/blaesus/dsgb10) (formerly dsgx10, MIT), as carried in [Picom-code/pico-dgx-ds4](https://github.com/Picom-code/pico-dgx-ds4) ("pico"): the exactly coded 12-bit BF16 GEMV (`bf16x` format and kernel) that `overlay/inkling_pico12/` builds and calls for the dense projections and the LM head; the sources are vendored unmodified in `overlay/inkling_pico12/third_party/pico/` with their licence.- **Andy Shu's `bf16x` reader** is also copied (MIT, with its notice) into `overlay/inkling_wide/csrc/bf16x_format.cuh`, which reads pico12's coded weights in the 17-256-row GEMM, and `overlay/inkling_cert/` compiles pico's head GEMV body from the vendored copy for the exact pass of the certified LM head.- **Tri Dao et al., FlashAttention-2** (algorithm): the online-softmax tiling of the fused relative-bias prefill attention in `overlay/inkling_attn/`.- **SGLang Inkling2 kernels**: the split-KV relative-bias verify kernel that `overlay/inkling_vattn/` routes every batch size to (and copies, with the bias computed per key tile, above 32 rows), the split-KV decode kernel that `overlay/inkling_kv12/` follows with its K / V tile loads replaced, the split softmax kernels that `VCAP_FASTPROBS` calls, the block-verification accept kernel behind `--speculative-use-block-verification`, and the fused loop-controller kernels of sgl-project/sglang PR #51926, already in the image.- **SGLang PR #51681** (DSpark Markov sampler: Philox words that rounded to u == 1) and **SGLang PR #51692** (blockwise rejection precision): their fixes are carried verbatim in `overlay/inkling_rsfix/` (`RSFIX`) until the image has them. The reject-sampler CDF fix and the DFLASH selector no-match fix in the same package are ours.- **Sun et al.**, "Block Verification Accelerates Speculative Decoding" (ICLR 2025): the block-verification algorithm that sampled requests use (`VCAP_BV`, `DFLASH_BV`). Running it under the verify cap (dead drafts as a stopped draft) and its logits-only form in the fused accept are ours.- **Xiao et al.**, StreamingLLM (2023): the attention sink kept by the optional drafter global-attention window (`dwin`, 128 sink tokens by default).- **Lossless float compression by exponent coding** (ZipNN, Hershcovitch et al., 2024; SplitZip) and **Andy Shu's exactly coded 12-bit `bf16x` format**: the inspiration for the packed 12-bit global-layer KV in `overlay/inkling_kv12/` (sign + mantissa byte, 4-bit exponent code, escapes). The KV format, packer and attention kernel are our own code; nothing is copied from these projects.- **Alexey Fateev / Project Maya**, [maya-inkling-mini](https://github.com/alesha-pro/maya-inkling-mini) (MIT): launch and "bytes in flight" notes on Inkling's small per-visit kernels that framed our L2-warming screen (not adopted, see docs/experiments.md).- **FR-Spec** (Zhao et al., ACL 2025, frequency-ranked draft vocabulary) and SGLang's EAGLE `--speculative-token-map`: the idea behind the hot-vocabulary draft. The prompt corpus that ranks the shipped list comes from allenai/WildChat-1M (ODC-BY), OpenAssistant/oasst2 (Apache-2.0), NousResearch/hermes-function-calling-v1 (Apache-2.0), bigcode/self-oss-instruct-sc2-exec-filter-50k (ODC-BY), HuggingFaceH4/ultrachat_200k (MIT), ise-uiuc/Magicoder-OSS-Instruct-75K (MIT), openai/gsm8k (MIT), databricks/databricks-dolly-15k (CC-BY-SA-3.0), EleutherAI/hendrycks_math (MIT), abisee/cnn_dailymail (Apache-2.0), CohereLabs/aya_dataset (Apache-2.0), wikimedia/wikipedia (CC-BY-SA-4.0), juletxara/mgsm (CC-BY-SA-4.0) and llm-jp/oasst2-33k-ja (Apache-2.0); only token frequencies of the model's own outputs are shipped, no prompt text.- **thefullctx**: the KV page-size 16 measurement we screened (not adopted here).- **Christopher Owen** and B12X (MXFP4-CSF): the scale-code format idea behind `overlay/inkling_scodes/` (our implementation, in a modified FlashInfer / CUTLASS mainloop).- **Christopher Owen, spark-ds41f** (Apache-2.0): the packed-BF16 vocabulary projection (b12x patch 0012) whose format we ported to Triton in a screen (not adopted, see docs/experiments.md).- **FlashInfer** (CUTLASS / CuTe DSL grouped GEMMs, the GEMVs) and **CUTLASS**: the kernels the MoE tile choice and the GPU checks run on; since v2.8.4 also the b12x MXFP8 GEMM and quantiser (`mm_mxfp8`, `mxfp8_quantize`) that run the drafter's eligible linears (mx8w), used as shipped.- **NVIDIA** for the DGX Spark platform.- **speedbench** ([knapcio/speedbench](https://github.com/knapcio/speedbench)), our own benchmark, for the headline numbers and the long-context table; its frozen prompt set also feeds the decode table.
Our own earlier recipes contributed ideas reused here: the verify cap with dead-row expert remap (DeepSeek-V4.1recipe), the batch-aware pay-for-rows rule and the certified greedy LM head (GLM-5.3-Flash recipe), FP8 / low-bitdraft heads (DeepSeek-V4.1), and our spark-tools and speedbench for measurement.
Every lever adopted from someone else's work gets a line here and an entry in the Credit column of the README.123456789101112131415161718192021MIT License
Copyright (c) 2026 Zbigniew Majewski
Permission is hereby granted, free of charge, to any person obtaining a copyof this software and associated documentation files (the "Software"), to dealin the Software without restriction, including without limitation the rightsto use, copy, modify, merge, publish, distribute, sublicense, and/or sellcopies of the Software, and to permit persons to whom the Software isfurnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in allcopies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ORIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THEAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHERLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THESOFTWARE.123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354Inkling-2-Mini on one NVIDIA DGX Spark
Repository-authored launch scripts, benchmark scripts and documentation: MIT, see LICENSE.
Third-party code vendored in this repository:- overlay/inkling_pico12/third_party/pico/: kernels/gemv16.cu, kernels/common.cuh, kernels/dsk.h, common/check.h by Andy Shu (github.com/blaesus/dsgb10, formerly dsgx10, `ds41f-4xgx10-switchless/engine/` at commit f2117916, as carried in github.com/Picom-code/pico-dgx-ds4), MIT licence, Copyright (c) 2026 Andy Shu; full text in overlay/inkling_pico12/third_party/pico/LICENSE. Unmodified except a two-line header naming the origin.- overlay/inkling_wide/csrc/bf16x_format.cuh: the `bf16x` reader (layout description, bf16x_raw_off, mad_imm, bf16x_dec, ldg_bf16x) copied from the same pico gemv16.cu (commit f2117916), MIT licence, Copyright (c) 2026 Andy Shu; full text in overlay/inkling_wide/third_party/pico/LICENSE.- overlay/inkling_cert/csrc/cert_ext.cu compiles kernels/gemv16.cu from overlay/inkling_pico12/third_party/pico/ (above) into its own extension; no further copy.
- overlay/inkling_scodes/csrc/scodes_sm120_mma_array.hpp: derived from CUTLASS's SM120 block-scaled grouped-GEMM collective mainloop (NVIDIA CORPORATION & AFFILIATES, BSD-3-Clause, licence text kept in the file header), modified to expand coded scale factors; scodes_group_gemm.cuh reduces FlashInfer 0.7.4's include/flashinfer/gemm/group_gemm_nvfp4_groupwise_sm120.cuh (Apache-2.0, Copyright (c) 2026 FlashInfer team) to the configuration SGLang uses and swaps in that mainloop.- overlay/inkling_kv12/ops.py: the decode / verify attention kernels (`_kv12_partials_np`, `_kv12_partials`) follow SGLang's Inkling2 split-KV decode kernel (`_decode_partials` in sglang.kernels.ops.attention.inkling2_decode_attention_sm90, sgl-project/sglang, Apache-2.0) with the same grid, tile order and online softmax, modified to read packed 12-bit K / V tiles from a side pool.- overlay/inkling_vattn/ops.py: `_inkernel_bias_partials` is the same SGLang `_decode_partials` kernel body (sgl-project/sglang, Apache-2.0), modified to compute the relative-position bias per key tile in-kernel.- overlay/inkling_rsfix/markov.py and overlay/inkling_rsfix/blockwise.py: the changes of sgl-project/sglang pull requests #51681 (dspark markov_sample) and #51692 (dspark blockwise_rejection), applied verbatim to copies of the image's functions (sgl-project/sglang, Apache-2.0). overlay/inkling_rsfix/reject.py and selector.py are copies of SGLang's reject_sampling kernels and DFLASH selector walk (Apache-2.0), modified as described in overlay/inkling_rsfix/README.md.
Third-party model files fetched at run time, not distributed in this repository:- Inkling-2-Mini-DFlash2 (huggingface.co/incoai/Inkling-2-Mini-DFlash2) by incoai, revision 4f9088ea66c21f2b99ed657d1941c306b03e84d2: the draft model (config.json, model.safetensors) and its SGLang compatibility patch (sglang_inkling_dflash2.py). Licensed under the Apache License, Version 2.0; you may not use these files except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0. Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. scripts/download.sh fetches them unmodified at that revision; scripts/launch.sh checks their sha256 and runs the patch, unmodified, inside the serving container only. The draft method builds on DFlash (github.com/z-lab/dflash).
The serving engines run from their published container images, pinned by digest in scripts/launch.sh:- SGLang (sgl-project/sglang), lmsysorg/sglang:inkling-2-mini, Apache-2.0.- vLLM (vllm-project/vllm), vllm/vllm-openai:inkling-2-mini, Apache-2.0.bench/decode_table.py reads the prompt file of speedbench (knapcio/speedbench, MIT) from a separate checkout; theprompts themselves are not copied here.
No model weights or container images are distributed. The Inkling-2-Mini weights (thinkingmachines/Inkling-2-Mini)are Apache-2.0 from Thinking Machines Lab; read the model card for the terms that apply to anything you serve.123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164# inkling_attn: prefill attention with the relative bias computed in-kernel
Switch: `INKLING_ATTN=prefill_swa[,prefill_global]` (or `all`); unset = nothing is imported.
## What it replaces
Stock prefill, per layer visit (`Inkling2Attention._forward`, non-compact branch):
1. `RelLogitsProj`: cuBLAS einsum `thd,de->the`, writes BF16 `[t, 24, 1024]` (403 MB for an 8K chunk);2. FA4 SM120 (`flash_attn_with_kvcache` -> `_flash_attn_varlen_func`): a shear kernel copies it into `[round_up(t, 64), 24, 1280]`, then the attention mainloop TMA-loads 2 bytes of bias per score.
(`inkling_prefill.bias_layout` fuses 1 and the shear copy; the mainloop still reads the sheared tensor.)
With this package, one CUDA kernel (`csrc/attn_kernel.cuh`) computes the bias inside the attention mainloop: eachwarp holds its 16 query rows' `r` (`[16, 16]`, the rel-clip output) as an MMA A fragment, multiplies it by the`proj` columns of the tile's 79 distances (10 extra m16n8k16 MMAs per 16 x 64 tile, about +8 % MMA work), stagesthe BF16-rounded `[16, 80]` result in shared memory and reads it back sheared. No `[t, 24, 1024]` tensor exists.FA2-style kernel: 4 warps x 16 rows (BM 64), 64-key tiles, Q in registers, cp.async K/V from the paged cache(page 128), ldmatrix on XOR-swizzled rows, FP32 online softmax, BF16 P, FP32 output + LSE in FA4's layout.232-236 registers, no spills, 43 KB smem, 2 CTAs per SM. `proj` is repacked per call by a tiny kernel so each lane loads itsB fragment with one 8-byte load.
| lever | layers | taken calls ||---|---|---|| `prefill_swa` | 40 sliding-window visits per token (window 1024) | prefill / extend, BF16 KV, no CP, no breakable graph || `prefill_global` | 8 global visits per token | same; bias work only on tiles within 1024 keys of the diagonal |
Decode, target verify and draft extend never enter a visit (stock paths untouched).
## Long prefixes: 8 warps from `INKLING_ATTN_W8_FROM` keys (default 131072)
The 4-warp kernel (BM 64, 2 CTAs / SM) keeps ~71 TF/s up to ~256-320K prefix keys in isolation (~150K in serving)and falls to the stock rate (~47 TF/s) at 512K-1M as its K/V traffic per FLOP stops being served from L2. The 8-warpinstantiation (BM 128, half the bytes per FLOP) holds ~69 TF/s at every prefix and computes every rowbit-identically. On global layers, for the BF16 loader and the packed-prefix loader alike, the binding launches twogrids per call (`launch_global`): requests whose prefix (seqused_k - new rows) is >= `INKLING_ATTN_W8_FROM` run on8 warps, the others on 4; each CTA reads its request's lengths on the device and returns before any shared-memoryaccess when the other grid owns the request (no host sync, CUDA-graph capturable). `INKLING_ATTN_W8_FROM=0`, SWAlayers and `INKLING_ATTN_WARPS=8` keep a single launch. Checks: `tests/test_w8split_cpu.py`,a development GPU check, not shipped (both loaders, 256K-1M, graph replay).
## Math and exactness
Same math as stock: bias = BF16(FP32 dot of r and proj) for distances 0..1023 (0 beyond on global layers),s = qk * scale + bias in FP32, causal (+ window 1023 on SWA layers), P rounded to BF16 before PV, FP32 output,natural-log LSE (-inf for a row with no key). Differences are FP32 accumulation order (QK, bias dot, PV andonline-softmax tile boundaries: 64 keys here, 128 in FA4). Measured against an FP32 reference (no TF32) on real`proj` weights: see Results; the kernel's error is at or below stock FA4's at every shape.
## Patch points (patch.py)
- `Inkling2Attention._forward`: marks an eligible visit (context variable); nothing else changes.- `RelLogitsProj.__call__`: inside the visit returns `r` itself (no einsum); SGLang then narrows it like any `rel_bias` (row prefix views keep the data pointer).- `flash_attention_v4_sm120._flash_attn_varlen_func`: a `rel_bias` that is (a row prefix of) the visit's `r` runs `ops.prefill_attention` with the layer's `proj` and returns FA4's `(out, lse)`; a call the kernel does not cover falls back to stock FA4 with the einsum bias; an `r` marker outside its visit raises.
Install-time checks: `check_sources` looks for the exact code the patches rely on in the installed sglang(`_forward`, `RelLogitsProj`, the SM120 wrapper, the backend's `rel_bias` / LSE handling, FA4's bias applicationand shear pads, the SM120 module selection, CP and breakable-graph helpers); a mismatch raises (exit 78 throughsitecustomize). `RelLogitsProj.forward`'s signature is checked at patch time.
## Arming (sitecustomize.py)
Add after the `INKLING_PREFILL` block (order does not matter for correctness; see coexistence):
```python if _on("INKLING_ATTN"): import inkling_attn inkling_attn.install()```
and forward `INKLING_ATTN` into the container in `scripts/launch.sh` like the other switches. The extension isbuilt when the model imports `inkling2_attn` (before any CUDA-graph capture), about 1 min on the first start, thenreused from `INKLING_ATTN_CACHE` (default `/root/.cache/inkling-attn`). Pre-build once with`python3 -m inkling_attn.build`. Start-up log: `[inkling_attn pid=...] enabled prefill_swa ...` and`extension built|reused ...`. `inkling_attn.patch.STATS` counts kernel / fallback / shadowed visits (eager mode).
## Coexistence with inkling_prefill
- `bias_layout` becomes unnecessary for the layers this package takes: in their visits `RelLogitsProj.__call__` returns `r` before `bias_layout`'s `forward` wrapper runs, and `bias_layout`'s varlen wrapper passes the width-16 marker through. Layers not taken (e.g. global layers with only `prefill_swa`) still get `bias_layout`. Keeping `bias_layout` armed is therefore harmless and useful for `prefill_swa`-only.- Works in either install order (dispatch is at `__call__`, one level before any `forward` wrapper).- `qkvr_split`, `quant_once`, `partial_bf16`: independent.
## CUDA graphs
SGLang captures prefill graphs for this model (Backend.FULL, buckets up to `chunked_prefill_size` 8192, chunkswith a prefix replay too; docs/prefill/PREFILL.md 2.3). The kernel is captured inside them: static grid`(cdiv(q rows, 64) + requests) x heads`, every request split read from `cu_seqlens_q` / `seqused_k` on the device,no host sync, no allocation except the LSE `torch.empty` (graph pool). Rows past `cu_seqlens_q[-1]` are notwritten, as FA4. Breakable prefill graphs (attention replayed outside the visit) are excluded.
## Results (GB10, clocks untouched, 2026-11-21)
`results/kbench/round2/attn/check_attn.py`, run5 (`runs/run5.log`, `runs/results_run5.json`). Inputs: real layer-0 / layer-5`proj`, q, k ~ N(0, 1.5^2), v ~ N(0, 1), r ~ N(0, 2^2), shuffled pages of 128.
**Correctness**: max abs error vs an FP32 reference (no TF32, the stock BF16-rounded bias), sampled rows incl.query-block edges, all 24 heads:
| case | kind | out err ours / stock | LSE err ours / stock ||---|---|---|---|| chunk 8192, prefix 0 | SWA / global | 5.149e-3 / 5.149e-3, 3.437e-3 / 3.437e-3 | 1.647e-3 / 1.646e-3, 5.7e-6 / 1.5e-5 || chunk 8192, prefix 8K | SWA / global | 3.678e-3 / 3.682e-3, 2.463e-3 / 2.452e-3 | 2.375e-4 / 2.384e-4, 7.06e-5 / 7.15e-5 || chunk 8192, prefix 32K | SWA / global | 2.609e-3 / 2.606e-3, 5.686e-3 / 5.735e-3 | 4.0e-5 / 4.0e-5, 1.698e-3 / 1.698e-3 || chunk 2048, prefix 0 | SWA / global | 3.633e-3 / 3.634e-3, 3.870e-3 / 3.869e-3 | 3.8e-6 / 3.8e-6, 9.3e-5 / 9.3e-5 || 5 requests + empty slots | SWA / global | 3.732e-3 / 3.732e-3, 3.548e-3 / 3.548e-3 | 2.77e-5 / 2.67e-5, 4.1e-5 / 4.1e-5 || tiny rows (1, 3, 65, 17) | SWA / global | 3.653e-3 / 3.653e-3, 3.141e-3 / 3.141e-3 | 1.9e-6 / 2.9e-6, 1.9e-6 / 2.9e-6 |
Ours and stock are equally far from the reference (both dominated by the BF16 rounding of P); the worst relativeexcess is +0.4 % on out and +3.6 % on one LSE at the 1e-5 absolute level. No NaN, every covered row written.CUDA-graph capture replayed with 4 different request splits: bit-equal to eager, rows past `cu_seqlens_q[-1]`untouched. Patch routing: wrapper == direct call, fallback == stock bit for bit, escaped marker raises,RelLogitsProj dispatch correct in both install orders with bias_layout. CPU emulation of the lane-level indexmath (`emulate_kernel.py`) matches a dense FP64 reference.
**Speed** (cold L2: 128 MiB read before each rep; median of 20; useful FLOPs = 4 * 24 * 128 * visible keys;stock = einsum + FA4 with shear; bias_layout = Triton sheared bias + FA4 presheared; ours = repack + kernel):
| kind | chunk | prefix | stock us (TF/s) | bias_layout us (TF/s) | ours us (TF/s) | vs stock | vs bias_layout ||---|---|---|---|---|---|---|---|| SWA | 2048 | 0 | 2336 (8.3) | 1561 (12.4) | 427 (45.2) | 5.47x | 3.65x || SWA | 2048 | 8K | 2453 (10.5) | 1680 (15.3) | 524 (49.2) | 4.68x | 3.20x || SWA | 2048 | 32K | 2465 (10.5) | 1672 (15.4) | 520 (49.5) | 4.74x | 3.21x || SWA | 8192 | 0 | 9659 (10.0) | 6245 (15.5) | 1846 (52.3) | 5.23x | 3.38x || SWA | 8192 | 8K | 9830 (10.5) | 6420 (16.1) | 1933 (53.3) | 5.08x | 3.32x || SWA | 8192 | 32K | 9816 (10.5) | 6419 (16.1) | 1966 (52.4) | 4.99x | 3.26x || global | 2048 | 0 | 2460 (10.5) | 1684 (15.3) | 520 (49.6) | 4.73x | 3.24x || global | 2048 | 8K | 6735 (34.4) | 5881 (39.4) | 3298 (70.3) | 2.04x | 1.78x || global | 2048 | 32K | 19753 (43.1) | 18934 (44.9) | 12063 (70.5) | 1.64x | 1.57x || global | 8192 | 0 | 16780 (24.6) | 13336 (30.9) | 6259 (65.9) | 2.68x | 2.13x || global | 8192 | 8K | 33887 (36.5) | 30264 (40.9) | 17916 (69.0) | 1.89x | 1.69x || global | 8192 | 32K | 86358 (43.0) | 82526 (45.0) | 53135 (69.8) | 1.63x | 1.55x || global | 8192 | 120K | 279140 (45.8) | 275093 (46.5) | 179440 (71.2) | 1.56x | 1.53x |
(The einsum alone is 2.0 ms per 8K chunk.) Global layers reach the bias-free FA4 rate (67-70 TF/s indocs/prefill/PREFILL.md); SWA reaches 52-53 TF/s against FA4's bias-free 55-56.
Variants measured (run4): `INKLING_ATTN_WARPS=8` (BM 128, 1 CTA / SM) is 4-15 % slower; the unpacked proj loads(4 x LDG.16 per fragment instead of one 8-byte load) are 10-12 % slower on SWA. Defaults: 4 warps, packed.
**End-to-end estimate** (`estimate_e2e.py`: per 8K chunk, 40 SWA + 8 global visits at the measured per-visittimes, global interpolated over the prefix):
| prompt | recipe today (all inkling_prefill levers) | + inkling_attn (SWA only) | + inkling_attn (SWA + global) ||---|---|---|---|| 8K | 1.93 s, 4,253 tok/s | 1.75 s | 1.69 s, ~4,840 tok/s (-12 %) || 32K | 8.28 s, 3,958 tok/s | 7.57 s | 7.08 s, ~4,630 tok/s (-15 %) || 128K | 47.7 s, 2,749 tok/s | 44.8 s | 38.3 s, ~3,420 tok/s (-20 %) |
Against the stock engine (no inkling_prefill): 2.40 -> 2.00 s, 10.1 -> 8.2 s, 54.0 -> 42.0 s. Microbench-based;to be confirmed by the serving benchmark.
## Files
- `csrc/attn_kernel.cuh` kernel, `csrc/inkling_attn_ext.cu` binding, `build.py`, `ops.py`, `patch.py`, `__init__.py`.- Tests: `tests/test_install.py` (CPU: env parsing, source checks). GPU tests and bench (scratch): `results/kbench/round2/attn/check_attn.py` (GPU: correctness vs FP32 reference and stock, graph replay, patch routing, microbench), `emulate_kernel.py` (CPU emulation of the kernel's lane-level index math), `estimate_e2e.py` (end-to-end estimate from the bench).123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170"""Inkling-2-Mini prefill attention overlay for SGLang on DGX Spark (GB10, sm_121).
INKLING_ATTN=prefill_swa[,prefill_global] (or "all") unset / empty: install() does nothing and nothing is imported.
prefill_swa sliding-window layers (40 of the 48 layer visits) at prefill / extend: one CUDA kernel computes the relative-position bias inside the attention mainloop (from r [t, 24, 16] and proj [16, 1024]) instead of the stock einsum -> [t, 24, 1024] BF16 tensor -> FA4 shear copy -> FA4 with bias.prefill_global the same for the 8 global (causal) visits; the bias is non-zero only within 1024 keys of the diagonal, so most key tiles of a long prefix run without bias work.
Decode, target verify and draft extend are untouched. Same math as stock (BF16-rounded bias, FP32 scores,BF16 P, FP32 output and LSE); differences are FP32 accumulation order only (see README.md for the measurederror against an FP32 reference, side by side with stock FA4's).
install() parses the env, checks the patch targets in the installed sglang sources (without importing sglang),registers post-import hooks and prints one line. Problems raise RuntimeError (the combined sitecustomize thenexits with code 78). The CUDA extension is built (or reused from INKLING_ATTN_CACHE, default~/.cache/inkling-attn) when the Inkling attention module is imported, before any CUDA graph capture.INKLING_ATTN_VERBOSE=1 logs each applied patch."""
import importlib.utilimport osimport sys
from . import _hook
LEVERS = ("prefill_swa", "prefill_global")
ATTN = "srt/models/inkling_common/inkling2_attn.py"
_SOURCE_CHECKS = ( (ATTN, ( "class Inkling2Attention(", "def _forward(self, hidden_states, positions, forward_batch, *, attn, attn_padded):", "rel_bias = self.rel_logits_proj(r)", "attention_kwargs = dict(rel_bias=rel_bias, **bias_kwargs)", "from sglang.srt.model_executor.forward_context import get_attn_backend", "from sglang.srt.runtime_context import get_model, get_parallel, get_platform", "self.rel_extent = config.sliding_window_size if is_local else config.rel_extent", "sliding_window_size=config.sliding_window_size - 1 if is_local else -1", "out_dtype=torch.float32", "pack_gqa=False", "return_lse=True,", "r = self.rel_l2_clip(", )), ("srt/models/inkling_common/attn.py", ( "class RelLogitsProj(", "log_scaling_tau: torch.Tensor | None = None", "self.proj = nn.Parameter(torch.empty(d_rel, rel_extent), requires_grad=False)", 'return torch.einsum("thd,de->the", r, self.proj)', )), ("kernels/ops/attention/flash_attention_v4_sm120.py", ( "_flash_attn_varlen_func,", "result = _flash_attn_varlen_func(", "seqused_k=cache_seqlens,", 'rel_bias_kwargs["rel_bias"] = rel_bias', "if window_size == (-1, -1):", )), ("srt/layers/attention/flashattention_backend.py", ( 'kwargs["rel_bias"] = rel_bias', "softmax_lse.T", "cache_seqlens=cache_seqlens,", )), ("kernels/ops/attention/fa4_sm120/flash_fwd.py", ( "acc_S[i] = acc_S[i] * base_softmax_scale", "sBias[row, col, consumer_state.index].to(", )), ("kernels/ops/attention/flash_attn/cute/shearing_bias.py", ( "-Float32.inf if const_expr(window_size_left is not None) else 0.0", )), ("kernels/ops/attention/flash_attn/cute/interface.py", ( "else (num_head, total_q)", )), ("srt/model_executor/runner_backend_utils/breakable_cuda_graph/context.py", ( "def is_in_breakable_cuda_graph(", )), ("srt/layers/cp/utils.py", ( "def is_cp_active(forward_batch) -> bool:", )), ("srt/layers/attention/flashattention_backend.py", ( "if device_capability[0] == 12:", "from sglang.kernels.ops.attention.flash_attention_v4_sm120 import (", )),)
STATE = {"installed": False, "levers": (), "applied": []}
def _log(msg): sys.stderr.write(f"[inkling_attn pid={os.getpid()}] {msg}\n") sys.stderr.flush()
def parse_levers(value): items = [v.strip() for v in value.split(",") if v.strip()] items = [v for v in items if v.lower() not in ("0", "off", "none", "false", "no")] if "all" in items: items = list(LEVERS) + [v for v in items if v != "all"] levers = tuple(dict.fromkeys(items)) unknown = [v for v in levers if v not in LEVERS] if unknown: raise RuntimeError(f"inkling_attn: unknown INKLING_ATTN entries {unknown}; known: {', '.join(LEVERS)}, all") return levers
def sglang_root(): spec = importlib.util.find_spec("sglang") # does not execute sglang if spec is None or not spec.submodule_search_locations: raise RuntimeError("inkling_attn: the sglang package is not importable") return list(spec.submodule_search_locations)[0]
def check_sources(root=None): root = root or sglang_root() for rel, needles in _SOURCE_CHECKS: path = os.path.join(root, rel) try: with open(path, encoding="utf-8") as f: text = f.read() except OSError as exc: raise RuntimeError(f"inkling_attn: patch target {path} is missing") from exc missing = [n for n in needles if n not in text] if missing: raise RuntimeError(f"inkling_attn: patch target {path} lacks {missing}")
def _attach(module_name, fn): def callback(module): fn(module) STATE["applied"].append(module_name) if os.environ.get("INKLING_ATTN_VERBOSE"): _log(f"patched {module_name}")
_hook.when_imported(module_name, callback)
def _register(levers): from . import patch
kinds = tuple(lv.split("_", 1)[1] for lv in levers) # "swa" / "global"
def attn_cb(module): patch.patch_attn(module, kinds) if not os.environ.get("INKLING_ATTN_LAZY_BUILD"): from . import build
build.load() info = build.INFO _log(f"extension {'reused' if info['cached'] else 'built'} in {info['seconds']:.1f} s ({info['tag']})")
_attach(patch.SM120_MODULE, patch.patch_sm120) _attach(patch.COMMON_ATTN_MODULE, patch.patch_common_attn) _attach(patch.ATTN_MODULE, attn_cb)
def install(levers=None, root=None): """Activate the levers named in INKLING_ATTN (or `levers`). Idempotent.""" if STATE["installed"]: return STATE["levers"] levers = parse_levers(os.environ.get("INKLING_ATTN", "") if levers is None else ",".join(levers)) if not levers: STATE["installed"] = True return () check_sources(root) _register(levers) STATE.update(installed=True, levers=levers) _log("enabled " + " ".join(levers)) return levers1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283"""Post-import hooks: run a callback right after a module finishes executing.
Patches attach lazily so that processes which never import the model pay nothingand never import sglang or torch. If the target module is already imported, thecallback runs at once. A callback that raises makes the import of its target fail.Several overlays may each install a finder of this kind; they nest (each wraps theloader the next one returned), so every package's callbacks run."""
import importlib.abcimport sysimport threading
_lock = threading.RLock()_callbacks: dict = {}_finder = None
class _Loader(importlib.abc.Loader): def __init__(self, inner, name): self._inner = inner self._name = name
def create_module(self, spec): create = getattr(self._inner, "create_module", None) return create(spec) if create is not None else None
def exec_module(self, module): self._inner.exec_module(module) _run(self._name, module)
def __getattr__(self, attr): return getattr(self._inner, attr)
class _Finder(importlib.abc.MetaPathFinder): def __init__(self): self._busy = set()
def find_spec(self, fullname, path, target=None): if fullname not in _callbacks or fullname in self._busy: return None self._busy.add(fullname) try: spec = None for finder in sys.meta_path: if finder is self or not hasattr(finder, "find_spec"): continue spec = finder.find_spec(fullname, path, target) if spec is not None: break finally: self._busy.discard(fullname) if spec is None or spec.loader is None: return None spec.loader = _Loader(spec.loader, fullname) return spec
def _run(name, module): with _lock: callbacks = _callbacks.pop(name, []) for callback in callbacks: callback(module)
def when_imported(name, callback): """Call callback(module) once module `name` has been imported.""" global _finder with _lock: module = sys.modules.get(name) if module is None: _callbacks.setdefault(name, []).append(callback) if _finder is None: _finder = _Finder() sys.meta_path.insert(0, _finder) return callback(module)
def pending(): with _lock: return sorted(_callbacks)123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102"""Build (or reuse) the inkling_attn CUDA extension with torch.utils.cpp_extension.
Sources: csrc/inkling_attn_ext.cu (binding) + csrc/attn_kernel.cuh (kernel), compiled for sm_121a into<cache>/<tag>/, where <cache> is INKLING_ATTN_CACHE (default ~/.cache/inkling-attn, i.e. /root/.cache/inkling-attnin the container) and <tag> hashes the sources, the flags and the torch / CUDA versions, so a changed input neverreuses a stale build. Needs nvcc and ninja (both in the SGLang image); no GPU is needed to build.
python3 -m inkling_attn.build # build now (once, before serving); prints the path"""
import hashlibimport osimport sysimport time
HERE = os.path.dirname(os.path.abspath(__file__))SOURCES = (os.path.join(HERE, "csrc", "inkling_attn_ext.cu"),)HEADERS = (os.path.join(HERE, "csrc", "attn_kernel.cuh"),)NAME = "inkling_attn_ext"
_UNDEF = ( "-U__CUDA_NO_HALF_OPERATORS__", "-U__CUDA_NO_HALF_CONVERSIONS__", "-U__CUDA_NO_BFLOAT16_CONVERSIONS__", "-U__CUDA_NO_HALF2_OPERATORS__",)
def default_cache_dir(): return os.environ.get("INKLING_ATTN_CACHE") or os.path.join(os.path.expanduser("~"), ".cache", "inkling-attn")
def cuda_flags(arch="121a"): return [ f"-gencode=arch=compute_{arch},code=sm_{arch}", "-O3", "-std=c++20", "-lineinfo", *_UNDEF, ]
def build_tag(flags, torch_version, cuda_version): h = hashlib.sha256() for path in SOURCES + HEADERS: with open(path, "rb") as f: h.update(os.path.basename(path).encode() + b"\0" + f.read() + b"\0") h.update("\0".join(flags).encode()) h.update(f"\0{torch_version}\0{cuda_version}".encode()) return h.hexdigest()[:16]
_EXT = NoneINFO = {}
def load(cache_dir=None, arch="121a", verbose=False): """Import the extension, building it first when <cache>/<tag> holds no build of these inputs.""" global _EXT if _EXT is not None: return _EXT import torch from torch.utils import cpp_extension
flags = cuda_flags(arch) tag = build_tag(flags, torch.__version__, torch.version.cuda) build_dir = os.path.join(cache_dir or default_cache_dir(), tag) os.makedirs(build_dir, exist_ok=True) cached = any(f.endswith(".so") and f.startswith(NAME) for f in os.listdir(build_dir)) t0 = time.monotonic() try: ext = cpp_extension.load( name=NAME, sources=list(SOURCES), extra_cuda_cflags=flags, extra_include_paths=[os.path.join(HERE, "csrc")], build_directory=build_dir, verbose=verbose, ) except Exception as exc: # noqa: BLE001 raise RuntimeError(f"inkling_attn: building the extension in {build_dir} failed: {exc}") from exc if not callable(getattr(ext, "fwd", None)): raise RuntimeError(f"inkling_attn: extension in {build_dir} lacks fwd()") INFO.update(build_dir=build_dir, cached=cached, seconds=time.monotonic() - t0, tag=tag) _EXT = ext return ext
def main(argv=None): import argparse
p = argparse.ArgumentParser(description=__doc__.splitlines()[0]) p.add_argument("--cache", default=default_cache_dir()) p.add_argument("--verbose", action="store_true") a = p.parse_args(argv) load(a.cache, verbose=a.verbose) print(f"inkling_attn extension {'reused' if INFO['cached'] else 'built'} in {INFO['seconds']:.1f} s: {INFO['build_dir']}") return 0
if __name__ == "__main__": sys.exit(main())123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555// inkling_attn: prefill/extend attention for Inkling-2-Mini on GB10 (sm_121) with the relative-position bias// computed inside the kernel.//// Math (the same as SGLang's FA4 path with rel_bias, flash_attn/cute/interface.py + fa4_sm120/flash_fwd.py):// for request b, query row i (0 <= i < sq), absolute position p = i + (sk - sq), key j (0 <= j < sk):// visible j <= p, and for sliding-window layers also j >= p - window_left// d = p - j (relative distance)// bias = bf16( sum_e r[t, h, e] * proj[e, d] ) if d < rel_extent, else 0 (FP32 dot, BF16 round:// the stock cuBLAS einsum thd,de->the writes a BF16 tensor)// s = qk * softmax_scale + bias (FP32)// out = softmax_j(s) @ V (P rounded to BF16 before the PV MMA, as FA4 does), FP32 [T, H, 128]// lse = ln(sum_j exp(s)) FP32 [H, T] (-inf when a row sees no key)//// Instead of reading a materialised [T, H, rel_extent] tensor (2 bytes per score from DRAM), each warp// computes the bias of its 16 query rows x 64 keys tile from r (a 16 x 16 A fragment held in registers) and// proj (10 B fragments, L1-cached loads) with 10 extra m16n8k16 MMAs, stages the 16 x 80 BF16 result in shared// memory and reads it back sheared (element (a, b) of the score tile is T[a][a + 63 - b]).//// FA2-style: 4 warps x 16 query rows (BM = 64), BN = 64 keys a tile, Q fragments in registers, K and V single// buffered with cp.async (the K load of the next tile overlaps PV, the V load overlaps QK + softmax), ldmatrix// on 128-byte XOR-swizzled rows, online softmax in FP32. Paged KV (page size a multiple of 64), GQA by head index.#pragma once
#include <cuda_bf16.h>#include <cstdint>
namespace inkling_attn {
constexpr int kD = 128; // head dimconstexpr int kBN = 64; // keys a tileconstexpr int kDRel = 16; // r / proj inner dimconstexpr int kTCols = 16 + kBN; // staged bias columns a warp tile (79 used, +1 for the odd-row shift)constexpr int kTStride = 88; // BF16 elements a staged row (bank-conflict check: <= 2-way)constexpr float kLog2e = 1.4426950408889634f;constexpr int tstage_bytes(int warps) { return warps * 16 * kTStride * 2; }
struct Params { const __nv_bfloat16* q; // [T, H, 128] long long q_st, q_sh; const __nv_bfloat16* k; // [pages, page_size, H_kv, 128] long long k_sp, k_ss, k_sh; const __nv_bfloat16* v; long long v_sp, v_ss, v_sh; // Packed planes share the byte stride of the allocator's page envelope. const uint8_t *sm, *ex; const int *esc, *off, *overflow_ref, *flags; const uint16_t *staging, *overflow; long long packed_stride; int kv_heads, stage_slots, overflow_slots; const int* page_table; // [B, max_pages] long long pt_s; const int* cu_q; // [n_req + 1] const int* seq_k; // [>= n_req] int n_req; const __nv_bfloat16* r; // [T, H, 16] long long r_st, r_sh; const __nv_bfloat16* proj; // [16, rel_extent] contiguous const __nv_bfloat16* projp; // optional packed copy [rel_extent + 1, 16] (pack_proj), row rel_extent = 0 int rel_extent; float* out; // [T, H, 128] long long o_st, o_sh; float* lse; // lse[h * lse_sh + t] long long lse_sh; int heads, group, page_size; int total_q; // rows of q (guards cu_seqlens_q) int pt_cols; // page_table columns (guards seqused_k) int num_pages; // pages of the KV cache (guards page ids) float scale; int window_left; // sliding-window layers only // request selection (global layers, two launches of different warp counts over one call, see ops.W8_FROM): // 0 = every request; 1 = requests whose prefix (seqused_k - new rows) is < sel_keys; 2 = prefix >= sel_keys. int sel_mode, sel_keys; // gated epilogue (kGate, sliding-window BF16 path): y[t, h*128 + d] = bf16(x * sigmoid(gate) * sigmoid(lse - sink)) // with x = O / l, exactly SGLang's gate_sink kernel (inkling2/gate_sink.cuh) on the FP32 out and LSE this kernel // would have written; out is then not written (lse still is). const __nv_bfloat16* gate; // [T, H * 128], row stride g_st (16-byte aligned rows: staged with 16-byte loads) long long g_st; const __nv_bfloat16* sink; // [T, H], row stride s_st long long s_st; __nv_bfloat16* y; // [T, H * 128], row stride y_st long long y_st;};
namespace dev {
__device__ __forceinline__ uint32_t smem_u32(const void* p) { return static_cast<uint32_t>(__cvta_generic_to_shared(p));}
__device__ __forceinline__ void cp_async16(uint32_t dst, const void* src, bool valid) { const int n = valid ? 16 : 0; // 0: zero-fill, nothing read asm volatile("cp.async.cg.shared.global [%0], [%1], 16, %2;\n" ::"r"(dst), "l"(src), "r"(n) : "memory");}__device__ __forceinline__ void cp_commit() { asm volatile("cp.async.commit_group;\n" ::: "memory"); }__device__ __forceinline__ void cp_wait_all() { asm volatile("cp.async.wait_group 0;\n" ::: "memory"); }
__device__ __forceinline__ void ldsm_x4(uint32_t& r0, uint32_t& r1, uint32_t& r2, uint32_t& r3, uint32_t addr) { asm volatile("ldmatrix.sync.aligned.m8n8.x4.shared.b16 {%0,%1,%2,%3}, [%4];\n" : "=r"(r0), "=r"(r1), "=r"(r2), "=r"(r3) : "r"(addr) : "memory");}__device__ __forceinline__ void ldsm_x4_t(uint32_t& r0, uint32_t& r1, uint32_t& r2, uint32_t& r3, uint32_t addr) { asm volatile("ldmatrix.sync.aligned.m8n8.x4.trans.shared.b16 {%0,%1,%2,%3}, [%4];\n" : "=r"(r0), "=r"(r1), "=r"(r2), "=r"(r3) : "r"(addr) : "memory");}
// D += A * B, m16n8k16, BF16 inputs, FP32 accumulate__device__ __forceinline__ void mma(float (&c)[4], const uint32_t (&a)[4], uint32_t b0, uint32_t b1) { asm volatile( "mma.sync.aligned.m16n8k16.row.col.f32.bf16.bf16.f32 {%0,%1,%2,%3}, {%4,%5,%6,%7}, {%8,%9}, " "{%0,%1,%2,%3};\n" : "+f"(c[0]), "+f"(c[1]), "+f"(c[2]), "+f"(c[3]) : "r"(a[0]), "r"(a[1]), "r"(a[2]), "r"(a[3]), "r"(b0), "r"(b1));}
__device__ __forceinline__ float ex2(float x) { float y; asm("ex2.approx.ftz.f32 %0, %1;\n" : "=f"(y) : "f"(x)); return y;}
__device__ __forceinline__ uint32_t pack_bf16(float lo, float hi) { const __nv_bfloat162 v = __floats2bfloat162_rn(lo, hi); return *reinterpret_cast<const uint32_t*>(&v);}
__device__ __forceinline__ uint32_t ld_u32(const __nv_bfloat16* p) { return __ldg(reinterpret_cast<const unsigned int*>(p));}
__device__ __forceinline__ uint32_t ld_u16(const __nv_bfloat16* p) { return static_cast<uint32_t>(__ldg(reinterpret_cast<const unsigned short*>(p)));}
} // namespace dev
// proj [16, E] -> projp [E + 1, 16]: row d = {P(0,d),P(1,d),P(8,d),P(9,d), P(2,d),P(3,d),P(10,d),P(11,d), ...},// i.e. lane qd's B-fragment words {P(2qd,d),P(2qd+1,d)} and {P(2qd+8,d),P(2qd+9,d)} are 8 contiguous bytes;// row E is zero (distances beyond the extent).__global__ void pack_proj(const __nv_bfloat16* __restrict__ proj, __nv_bfloat16* __restrict__ projp, int E) { const int i = blockIdx.x * blockDim.x + threadIdx.x; // one output element if (i >= (E + 1) * kDRel) return; const int d = i / kDRel, slot = i % kDRel; const int qd = slot / 4, w = slot % 4; const int e = 2 * qd + (w & 1) + 8 * (w >> 1); projp[i] = d < E ? proj[e * E + d] : __float2bfloat16_rn(0.f);}
// Eight BF16 words for one swizzled shared-memory vector. No FP conversion.__device__ __forceinline__ uint4 packed_vector(const Params& p, int page, int kind, int head, int row, int dim, bool valid) { const uint4 zero = make_uint4(0, 0, 0, 0); if (!valid || page <= 0 || page >= p.num_pages) return zero; const long long start = static_cast<long long>(page) * p.packed_stride; const int flag = p.flags[start / sizeof(int)]; if (flag <= 0) return zero; const int element = ((kind * 128 + row) * p.kv_heads + head) * kD + dim; if (flag >= 2) { // The low byte stores valid rows plus one. The high bits store the slot. const int slot = flag >> 8; const int count = (flag & 255) - 1; if (slot >= p.stage_slots || row >= count || count > 128) return zero; const auto* src = p.staging + static_cast<long long>(slot) * 2 * 128 * p.kv_heads * kD; return *reinterpret_cast<const uint4*>(src + element); } const int lane = head * 2 + kind; const int ref = p.overflow_ref[start / sizeof(int) + lane]; if (ref) { if (ref < 0 || ref > p.overflow_slots) return zero; const auto* src = p.overflow + static_cast<long long>(ref - 1) * 128 * kD; return *reinterpret_cast<const uint4*>(src + row * kD + dim); } const auto sm = *reinterpret_cast<const uint2*>(p.sm + start + element); const uint32_t ex = *reinterpret_cast<const uint32_t*>(p.ex + start + element / 2); uint32_t words[4] = {};#pragma unroll for (int i = 0; i < 8; ++i) { const uint32_t bits = ((i < 4 ? sm.x : sm.y) >> (8 * (i & 3))) & 255; const uint32_t code = (ex >> (4 * i)) & 15; const uint32_t exponent = code == 15 ? 0 : code + 116; const uint32_t word = ((bits & 128) << 8) | (exponent << 7) | (bits & 127); words[i / 2] |= word << (16 * (i & 1)); } if (((ex & (ex >> 1) & (ex >> 2) & (ex >> 3)) & 0x11111111u) != 0) { const int* offsets = p.off + start / sizeof(int) + lane * 5 + row / 32; const int* entries = p.esc + start / sizeof(int) + lane * 64; const int begin = offsets[0], end = offsets[1]; const int limit = begin >= 0 && end >= begin && end <= 64 ? end : begin; for (int i = begin; i < limit; ++i) { const unsigned entry = entries[i]; const int column = (entry >> 16) & 127; if (((entry >> 23) & 127) == row && column >= dim && column < dim + 8) { const int index = column - dim, shift = (index & 1) * 16; words[index / 2] = (words[index / 2] & ~(0xffffu << shift)) | ((entry & 0xffffu) << shift); } } } return make_uint4(words[0], words[1], words[2], words[3]);}
// kW warps x 16 query rows a CTA (BM = 16 kW): 4 warps -> 2 CTAs / SM, 8 warps -> 1 CTA / SM (half the K/V// shared-memory fills per FLOP). Dynamic shared memory: tstage_bytes(kW).// gate_sink.cuh's sigmoid: ex2.approx / rcp.approx with round-to-nearest multiply and add__device__ __forceinline__ float gs_sigmoid(float x) { float e, r; float const t = __fmul_rn(-x, 1.4426950408889634f); asm("ex2.approx.f32 %0, %1;" : "=f"(e) : "f"(t)); asm("rcp.approx.f32 %0, %1;" : "=f"(r) : "f"(__fadd_rn(e, 1.0f))); return r;}
template <bool kLocal, bool kPacked, int kW, bool kPackedKV = false, bool kGate = false>__global__ void __launch_bounds__(kW * 32, 8 / kW) prefill_fwd(const Params p) { constexpr int kThr = kW * 32; constexpr int kBMw = 16 * kW; using namespace dev; __shared__ __align__(128) __nv_bfloat16 sK[kBN * kD]; __shared__ __align__(128) __nv_bfloat16 sV[kBN * kD]; extern __shared__ __align__(16) __nv_bfloat16 sT[]; // kW * 16 * kTStride (dynamic)
const int tid = threadIdx.x; const int warp = tid >> 5, lane = tid & 31, g = lane >> 2, qd = lane & 3;
// ---- work item: heads fastest (the 24 heads of one query block share K/V in L2), the last query blocks // (the most keys on causal global layers) first. const int lin = static_cast<int>(gridDim.x - 1 - blockIdx.x); const int head = lin % p.heads; int tile = lin / p.heads; int b = -1, start = 0, sq = 0; int prev_end = 0; for (int i = 0; i < p.n_req; ++i) { // metadata guards (CTA-uniform): rows inside q and never shared by two requests, keys inside the page table const int s = max(p.cu_q[i], prev_end); const int e = min(p.cu_q[i + 1], p.total_q); const int len = e > s ? e - s : 0; prev_end = max(prev_end, e); const int nb = (len + kBMw - 1) / kBMw; if (tile < nb) { b = i; start = s; sq = len; break; } tile -= nb; } if (b < 0) return;
const int sk = min(max(p.seq_k[b], 0), p.pt_cols * p.page_size); const int off = sk - sq; // prefix length if (p.sel_mode != 0) { // the other launch takes request b (decided on the unclamped prefix) const long long pre = static_cast<long long>(p.seq_k[b]) - sq; if ((pre >= p.sel_keys) != (p.sel_mode == 2)) return; } const int m0 = tile * kBMw; const int kvh = head / p.group; const int wl = p.window_left; const int lo_key = kLocal ? max(0, m0 + off - wl) : 0; const int hi_key = static_cast<int>(min(static_cast<long long>(sk), static_cast<long long>(m0) + kBMw + off)); const int nb_lo = lo_key / kBN; const int nb_hi = hi_key > lo_key ? hi_key / kBN + (hi_key % kBN != 0) : nb_lo; // exclusive
const int wrow0 = m0 + warp * 16; // request-relative first row of this warp const bool warp_rows = wrow0 < sq; const int pw0 = wrow0 + off; // its absolute position
// ---- Q and r fragments (A operands), rows wrow0 + g and + 8 uint32_t qa[8][4]; uint32_t ra[4]; { const int r0 = wrow0 + g, r1 = r0 + 8; const bool v0 = r0 < sq, v1 = r1 < sq; const long long t0 = start + (v0 ? r0 : 0), t1 = start + (v1 ? r1 : 0); const __nv_bfloat16* q0 = p.q + t0 * p.q_st + static_cast<long long>(head) * p.q_sh; const __nv_bfloat16* q1 = p.q + t1 * p.q_st + static_cast<long long>(head) * p.q_sh;#pragma unroll for (int kk = 0; kk < 8; ++kk) { const int c = 16 * kk + 2 * qd; qa[kk][0] = v0 ? ld_u32(q0 + c) : 0u; qa[kk][1] = v1 ? ld_u32(q1 + c) : 0u; qa[kk][2] = v0 ? ld_u32(q0 + c + 8) : 0u; qa[kk][3] = v1 ? ld_u32(q1 + c + 8) : 0u; } const __nv_bfloat16* rr0 = p.r + t0 * p.r_st + static_cast<long long>(head) * p.r_sh; const __nv_bfloat16* rr1 = p.r + t1 * p.r_st + static_cast<long long>(head) * p.r_sh; ra[0] = v0 ? ld_u32(rr0 + 2 * qd) : 0u; ra[1] = v1 ? ld_u32(rr1 + 2 * qd) : 0u; ra[2] = v0 ? ld_u32(rr0 + 2 * qd + 8) : 0u; ra[3] = v1 ? ld_u32(rr1 + 2 * qd + 8) : 0u; }
float o[16][4];#pragma unroll for (int i = 0; i < 16; ++i) o[i][0] = o[i][1] = o[i][2] = o[i][3] = 0.f; float mrow[2] = {-INFINITY, -INFINITY}; float lrow[2] = {0.f, 0.f};
// ---- one K or V tile of 64 keys -> shared memory (row = key, 16 chunks of 16 B, chunk ^= row & 7); // keys outside [lo_key, sk) are zero-filled (never read from memory). const long long pt_row = static_cast<long long>(b) * p.pt_s; auto load_tile = [&](__nv_bfloat16* dst, const __nv_bfloat16* base, long long sp, long long ss, long long sh, int nb, int kind) { const int n0 = nb * kBN; const int col = n0 / p.page_size; const int page = col >= 0 && col < p.pt_cols ? p.page_table[pt_row + col] : -1; const bool page_ok = page >= 0 && page < p.num_pages; // a bad page id reads nothing (zero tile) const int slot0 = n0 % p.page_size; const int chunk = tid & 15;#pragma unroll for (int i = 0; i < kBN * 16 / kThr; ++i) { const int row = (tid >> 4) + i * (kThr / 16); const int j = n0 + row; const bool ok = page_ok && j >= lo_key && j < sk; auto* target = dst + row * kD + ((chunk ^ (row & 7)) * 8); if constexpr (kPackedKV) { *reinterpret_cast<uint4*>(target) = packed_vector(p, page, kind, kvh, slot0 + row, chunk * 8, ok); } else { const auto* src0 = base + static_cast<long long>(page_ok ? page : 0) * sp + static_cast<long long>(kvh) * sh; const auto* src = ok ? src0 + static_cast<long long>(slot0 + row) * ss + chunk * 8 : src0; cp_async16(smem_u32(target), src, ok); } } };
__nv_bfloat16* tw = sT + warp * 16 * kTStride; const int par = g & 1; // odd rows are staged one column to the right so sheared reads are 4-byte aligned const __nv_bfloat16* proj = p.proj; const int ext = p.rel_extent;
if (nb_hi > nb_lo) load_tile(sK, p.k, p.k_sp, p.k_ss, p.k_sh, nb_hi - 1, 0); cp_commit();
for (int nb = nb_hi - 1; nb >= nb_lo; --nb) { const int n0 = nb * kBN; cp_wait_all(); __syncthreads(); // K(nb) visible; every warp is done with V(nb + 1) load_tile(sV, p.v, p.v_sp, p.v_ss, p.v_sh, nb, 1); cp_commit();
// this warp's rows see keys [pw0 - wl, pw0 + 15] const bool active = warp_rows && n0 <= pw0 + 15 && (!kLocal || n0 + kBN - 1 >= pw0 - wl); float s[8][4]; if (active) {#pragma unroll for (int i = 0; i < 8; ++i) s[i][0] = s[i][1] = s[i][2] = s[i][3] = 0.f; // S = Q K^T#pragma unroll for (int kk = 0; kk < 8; ++kk) {#pragma unroll for (int np = 0; np < 4; ++np) { const int key = 8 * (2 * np + (lane >> 4)) + (lane & 7); const int chunk = 2 * kk + ((lane >> 3) & 1); uint32_t b0, b1, b2, b3; ldsm_x4(b0, b1, b2, b3, smem_u32(sK + key * kD + ((chunk ^ (key & 7)) * 8))); mma(s[2 * np], qa[kk], b0, b1); mma(s[2 * np + 1], qa[kk], b2, b3); } } // relative bias: d(a, b) = pw0 + a - (n0 + b) = dbase + c, c = a + 63 - b in [0, 78] const int dbase = pw0 - n0 - (kBN - 1); if (dbase < ext) { float t[10][4];#pragma unroll for (int ct = 0; ct < 10; ++ct) { t[ct][0] = t[ct][1] = t[ct][2] = t[ct][3] = 0.f; const int d = dbase + 8 * ct + g; const bool in = d >= 0 && d < ext; // d < 0: masked (causal); d >= ext: bias 0 if constexpr (kPacked) { const int row = in ? d : ext; // the zero row const uint2 w = __ldg(reinterpret_cast<const uint2*>(p.projp + static_cast<long long>(row) * kDRel) + qd); mma(t[ct], ra, w.x, w.y); } else { const __nv_bfloat16* pc = proj + (in ? d : 0); const uint32_t k0 = in ? ld_u16(pc + (2 * qd) * ext) : 0u; const uint32_t k1 = in ? ld_u16(pc + (2 * qd + 1) * ext) : 0u; const uint32_t k8 = in ? ld_u16(pc + (2 * qd + 8) * ext) : 0u; const uint32_t k9 = in ? ld_u16(pc + (2 * qd + 9) * ext) : 0u; mma(t[ct], ra, k0 | (k1 << 16), k8 | (k9 << 16)); } }#pragma unroll for (int ct = 0; ct < 10; ++ct) { const int col = 8 * ct + 2 * qd + par; tw[g * kTStride + col] = __float2bfloat16_rn(t[ct][0]); tw[g * kTStride + col + 1] = __float2bfloat16_rn(t[ct][1]); tw[(g + 8) * kTStride + col] = __float2bfloat16_rn(t[ct][2]); tw[(g + 8) * kTStride + col + 1] = __float2bfloat16_rn(t[ct][3]); } __syncwarp();#pragma unroll for (int nt = 0; nt < 8; ++nt) {#pragma unroll for (int h = 0; h < 2; ++h) { const int a = g + 8 * h; const int s1 = a + (kBN - 2) - 8 * nt - 2 * qd + par; // even const uint32_t w = *reinterpret_cast<const uint32_t*>(tw + a * kTStride + s1); const float b_e0 = __uint_as_float(w & 0xffff0000u); // column c -> key n0 + 8nt + 2qd const float b_e1 = __uint_as_float(w << 16); // column c-1 -> key n0 + 8nt + 2qd + 1 s[nt][2 * h] = fmaf(s[nt][2 * h], p.scale, b_e0); s[nt][2 * h + 1] = fmaf(s[nt][2 * h + 1], p.scale, b_e1); } } } else {#pragma unroll for (int i = 0; i < 8; ++i) { s[i][0] *= p.scale; s[i][1] *= p.scale; s[i][2] *= p.scale; s[i][3] *= p.scale; } } // mask: causal diagonal, window left edge (rows past sq see zero-filled keys and are never stored) const bool need_mask = (n0 + kBN - 1 > pw0) || (kLocal && n0 < pw0 + 15 - wl); if (need_mask) {#pragma unroll for (int nt = 0; nt < 8; ++nt) {#pragma unroll for (int e = 0; e < 4; ++e) { const int a = g + 8 * (e >> 1); const int j = n0 + 8 * nt + 2 * qd + (e & 1); const int pr = pw0 + a; if (j > pr || (kLocal && j < pr - wl)) s[nt][e] = -INFINITY; } } } // online softmax (natural-log units, exp2 with log2(e) like FA4)#pragma unroll for (int h = 0; h < 2; ++h) { float mx = -INFINITY;#pragma unroll for (int nt = 0; nt < 8; ++nt) mx = fmaxf(mx, fmaxf(s[nt][2 * h], s[nt][2 * h + 1])); mx = fmaxf(mx, __shfl_xor_sync(0xffffffffu, mx, 1)); mx = fmaxf(mx, __shfl_xor_sync(0xffffffffu, mx, 2)); const float mnew = fmaxf(mrow[h], mx); const float muse = mnew == -INFINITY ? 0.f : mnew; const float alpha = ex2((mrow[h] - muse) * kLog2e); mrow[h] = mnew; float sum = 0.f;#pragma unroll for (int nt = 0; nt < 8; ++nt) { const float p0 = ex2((s[nt][2 * h] - muse) * kLog2e); const float p1 = ex2((s[nt][2 * h + 1] - muse) * kLog2e); s[nt][2 * h] = p0; s[nt][2 * h + 1] = p1; sum += p0 + p1; } lrow[h] = lrow[h] * alpha + sum;#pragma unroll for (int dn = 0; dn < 16; ++dn) { o[dn][2 * h] *= alpha; o[dn][2 * h + 1] *= alpha; } } }
cp_wait_all(); __syncthreads(); // V(nb) visible; every warp is done with K(nb) if (nb - 1 >= nb_lo) load_tile(sK, p.k, p.k_sp, p.k_ss, p.k_sh, nb - 1, 0); cp_commit();
if (active) { // O += P V#pragma unroll for (int kk = 0; kk < 4; ++kk) { uint32_t pa[4]; pa[0] = pack_bf16(s[2 * kk][0], s[2 * kk][1]); pa[1] = pack_bf16(s[2 * kk][2], s[2 * kk][3]); pa[2] = pack_bf16(s[2 * kk + 1][0], s[2 * kk + 1][1]); pa[3] = pack_bf16(s[2 * kk + 1][2], s[2 * kk + 1][3]);#pragma unroll for (int dp = 0; dp < 8; ++dp) { const int i4 = lane >> 3; const int key = 16 * kk + 8 * (i4 & 1) + (lane & 7); const int chunk = 2 * dp + (i4 >> 1); uint32_t v0, v1, v2, v3; ldsm_x4_t(v0, v1, v2, v3, smem_u32(sV + key * kD + ((chunk ^ (key & 7)) * 8))); mma(o[2 * dp], pa, v0, v1); mma(o[2 * dp + 1], pa, v2, v3); } } } } cp_wait_all();
// ---- epilogue: O / l (FP32), LSE = m + ln(l) // Gated (kGate): the warp's 16 x 128 gate tile is staged in shared memory (sK / sV are free once every warp left the // mainloop) with coalesced 16-byte loads, y is computed in place in the MMA layout, then stored with coalesced // 16-byte stores. 16-byte chunks are XOR-swizzled by row so the MMA-layout accesses are bank-conflict free. __nv_bfloat16* wbuf = nullptr; if constexpr (kGate) { __syncthreads(); wbuf = (warp < 4 ? sK + warp * 16 * kD : sV + (warp - 4) * 16 * kD);#pragma unroll for (int i = 0; i < 8; ++i) { const int rr = 2 * i + (lane >> 4), cc = (lane & 15) * 8; if (wrow0 + rr < sq) { const long long t = start + wrow0 + rr; *reinterpret_cast<uint4*>(wbuf + rr * kD + (((cc >> 3) ^ (rr & 7)) * 8)) = *reinterpret_cast<const uint4*>(p.gate + t * p.g_st + static_cast<long long>(head) * kD + cc); } } __syncwarp(); }#pragma unroll for (int h = 0; h < 2; ++h) { float l = lrow[h]; l += __shfl_xor_sync(0xffffffffu, l, 1); l += __shfl_xor_sync(0xffffffffu, l, 2); const int row = wrow0 + g + 8 * h; if (row < sq) { const bool ok = l > 0.f && l == l; const float inv = ok ? 1.f / l : 0.f; const long long t = start + row; if constexpr (kGate) { const float lse_v = ok ? mrow[h] + logf(l) : -INFINITY; if (qd == 0) p.lse[static_cast<long long>(head) * p.lse_sh + t] = lse_v; const float sc = gs_sigmoid(__fsub_rn(lse_v, __bfloat162float(p.sink[t * p.s_st + head]))); const int rl = g + 8 * h; // row within the warp's staged tile#pragma unroll for (int dn = 0; dn < 16; ++dn) { __nv_bfloat162* cell = reinterpret_cast<__nv_bfloat162*>(wbuf + rl * kD + ((dn ^ (rl & 7)) * 8) + 2 * qd); const __nv_bfloat162 gg = *cell; const float x0 = o[dn][2 * h] * inv, x1 = o[dn][2 * h + 1] * inv; __nv_bfloat162 yy; yy.x = __float2bfloat16_rn(__fmul_rn(__fmul_rn(x0, gs_sigmoid(__low2float(gg))), sc)); yy.y = __float2bfloat16_rn(__fmul_rn(__fmul_rn(x1, gs_sigmoid(__high2float(gg))), sc)); *cell = yy; // in place: each element is read and written by this thread only } } else { float* orow = p.out + t * p.o_st + static_cast<long long>(head) * p.o_sh;#pragma unroll for (int dn = 0; dn < 16; ++dn) { *reinterpret_cast<float2*>(orow + 8 * dn + 2 * qd) = make_float2(o[dn][2 * h] * inv, o[dn][2 * h + 1] * inv); } if (qd == 0) p.lse[static_cast<long long>(head) * p.lse_sh + t] = ok ? mrow[h] + logf(l) : -INFINITY; } } } if constexpr (kGate) { __syncwarp();#pragma unroll for (int i = 0; i < 8; ++i) { const int rr = 2 * i + (lane >> 4), cc = (lane & 15) * 8; if (wrow0 + rr < sq) { const long long t = start + wrow0 + rr; *reinterpret_cast<uint4*>(p.y + t * p.y_st + static_cast<long long>(head) * kD + cc) = *reinterpret_cast<const uint4*>(wbuf + rr * kD + (((cc >> 3) ^ (rr & 7)) * 8)); } } }}
} // namespace inkling_attn123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326// inkling_attn: PyTorch binding of the prefill attention kernel (attn_kernel.cuh).//// fwd(q, k_cache, v_cache, page_table, cu_seqlens_q, seqused_k, r, proj, out, lse, softmax_scale, window_left)// q [T, H, 128] bf16 (last dim contiguous)// k_cache [pages, page_size, H_kv, 128] bf16, v_cache the same (any strides of the first three dims)// page_table [B, max_pages] int32, cu_seqlens_q [n_req + 1] int32, seqused_k [>= n_req] int32// r [T, H, 16] bf16, proj [16, rel_extent] bf16 contiguous// out [T, H, 128] fp32 (written for the rows cu_seqlens_q covers), lse [H, T] fp32 (same rows)// window_left < 0: global (causal) layer; >= 0: sliding window [p - window_left, p]// No allocation, no host sync: the launch goes to PyTorch's current stream and is CUDA-graph capturable.// Rows of q past cu_seqlens_q[-1] are left untouched, as FA4 leaves them.// w8_from_keys > 0 (global layers, warps 4, BF16 or packed KV): requests with a prefix of >= w8_from_keys keys run// on 8 warps (BM 128), the others on 4, in two launches whose CTAs pick their requests on the device (no host sync,// CUDA-graph capturable). Both variants compute every row bit-identically.#include <torch/extension.h>#include <pybind11/stl.h>
#include <ATen/cuda/CUDAContext.h>#include <c10/cuda/CUDAException.h>#include <c10/cuda/CUDAGuard.h>
#include "attn_kernel.cuh"
namespace {
using inkling_attn::Params;
bool aligned(const void* p, size_t n) { return reinterpret_cast<uintptr_t>(p) % n == 0; }
// Gated launches: the kernel writes y only for rows < cu_q[n_req]; the rows after it (bucket padding of a captured// prefill graph) are zeroed here on the device, so a smaller replay never leaves an earlier replay's rows in y.__global__ void zero_tail_rows(__nv_bfloat16* y, long long y_st, int cols, const int* cu_q, int n_req, int rows) { const int end = cu_q[n_req]; for (int r = blockIdx.x; r < rows; r += gridDim.x) { if (r < end) continue; for (int c = threadIdx.x * 8; c < cols; c += blockDim.x * 8) *reinterpret_cast<uint4*>(y + r * y_st + c) = make_uint4(0, 0, 0, 0); }}
template <bool kLocal, bool kPacked, int kW, bool kPackedKV, bool kGate = false>void launch_w(const Params& p, dim3 blocks, cudaStream_t stream) { constexpr int smem = inkling_attn::tstage_bytes(kW); static bool configured[256] = {}; // per instantiation and device (the attribute is per context) int dev = 0; C10_CUDA_CHECK(cudaGetDevice(&dev)); TORCH_CHECK(dev >= 0 && dev < 256, "inkling_attn: device index out of range"); if (!configured[dev]) { C10_CUDA_CHECK(cudaFuncSetAttribute(inkling_attn::prefill_fwd<kLocal, kPacked, kW, kPackedKV, kGate>, cudaFuncAttributeMaxDynamicSharedMemorySize, smem)); configured[dev] = true; } inkling_attn::prefill_fwd<kLocal, kPacked, kW, kPackedKV, kGate><<<blocks, kW * 32, smem, stream>>>(p);}
template <bool kLocal, bool kPacked, bool kPackedKV = false, bool kGate = false>void launch(const Params& p, dim3 blocks, int64_t warps, cudaStream_t stream) { if (warps == 8) launch_w<kLocal, kPacked, 8, kPackedKV, kGate>(p, blocks, stream); else launch_w<kLocal, kPacked, 4, kPackedKV, kGate>(p, blocks, stream);}
// global layers: one launch, or the 8-warp (long prefixes) + 4-warp (the rest) pairtemplate <bool kPacked, bool kPackedKV, bool kGate = false>void launch_global(const Params& p, dim3 blocks, int64_t warps, int64_t w8_from_keys, int64_t grid8, cudaStream_t stream) { if (warps != 4 || w8_from_keys <= 0) { launch<false, kPacked, kPackedKV, kGate>(p, blocks, warps, stream); return; } Params p8 = p; // long-prefix requests first on 8 warps (half the K/V traffic per FLOP) p8.sel_mode = 2; p8.sel_keys = static_cast<int>(w8_from_keys); launch<false, kPacked, kPackedKV, kGate>(p8, dim3(static_cast<unsigned>(grid8)), 8, stream); C10_CUDA_KERNEL_LAUNCH_CHECK(); Params p4 = p; p4.sel_mode = 1; p4.sel_keys = static_cast<int>(w8_from_keys); launch<false, kPacked, kPackedKV, kGate>(p4, blocks, 4, stream);}
void fwd(const torch::Tensor& q, const torch::Tensor& k, const torch::Tensor& v, const torch::Tensor& page_table, const torch::Tensor& cu_q, const torch::Tensor& seq_k, const torch::Tensor& r, const torch::Tensor& proj, const torch::Tensor& out, const torch::Tensor& lse, double scale, int64_t window_left, const c10::optional<torch::Tensor>& projp_buf, int64_t warps, const c10::optional<std::vector<torch::Tensor>>& packed_kv, int64_t w8_from_keys, const c10::optional<torch::Tensor>& gate, const c10::optional<torch::Tensor>& sinks, const c10::optional<torch::Tensor>& y, bool zero_tail) { TORCH_CHECK(warps == 4 || warps == 8, "inkling_attn: warps must be 4 or 8"); TORCH_CHECK(w8_from_keys >= 0 && w8_from_keys < (int64_t(1) << 31), "inkling_attn: w8_from_keys out of range"); TORCH_CHECK(q.is_cuda() && q.scalar_type() == at::kBFloat16 && q.dim() == 3 && q.size(2) == inkling_attn::kD && q.stride(2) == 1, "inkling_attn: q must be CUDA bf16 [T, H, 128] with a contiguous last dim"); const int64_t T = q.size(0), H = q.size(1); int64_t page_size, hkv, num_pages; if (packed_kv) { TORCH_CHECK(window_left < 0 && packed_kv->size() == 8, "inkling_attn: invalid packed KV cache"); const auto& sm = (*packed_kv)[0]; TORCH_CHECK(sm.dim() == 5 && sm.size(1) == 2 && sm.size(2) == 128 && sm.size(4) == 128, "inkling_attn: invalid packed SM plane"); num_pages = sm.size(0); page_size = 128; hkv = sm.size(3); } else { for (const auto* c : {&k, &v}) { TORCH_CHECK(c->is_cuda() && c->scalar_type() == at::kBFloat16 && c->dim() == 4 && c->size(3) == inkling_attn::kD && c->stride(3) == 1, "inkling_attn: k/v cache must be CUDA bf16 [pages, page_size, H_kv, 128] with a contiguous last dim"); TORCH_CHECK(c->stride(0) % 8 == 0 && c->stride(1) % 8 == 0 && c->stride(2) % 8 == 0 && aligned(c->data_ptr(), 16), "inkling_attn: k/v cache rows must be 16-byte aligned"); } TORCH_CHECK(k.sizes() == v.sizes(), "inkling_attn: k and v caches differ in shape"); page_size = k.size(1); hkv = k.size(2); num_pages = k.size(0); TORCH_CHECK(page_size > 0 && page_size % inkling_attn::kBN == 0, "inkling_attn: page size must be a positive multiple of 64"); } TORCH_CHECK(H > 0, "inkling_attn: no heads"); TORCH_CHECK(hkv > 0 && H % hkv == 0, "inkling_attn: q heads must be a multiple of kv heads"); TORCH_CHECK(q.stride(0) % 2 == 0 && q.stride(1) % 2 == 0 && aligned(q.data_ptr(), 4), "inkling_attn: q alignment"); TORCH_CHECK(page_table.is_cuda() && page_table.scalar_type() == at::kInt && page_table.dim() == 2 && page_table.stride(1) == 1, "inkling_attn: page_table must be CUDA int32 [B, max_pages] with a contiguous last dim"); TORCH_CHECK(cu_q.is_cuda() && cu_q.scalar_type() == at::kInt && cu_q.dim() == 1 && cu_q.is_contiguous() && cu_q.numel() >= 1, "inkling_attn: cu_seqlens_q must be a contiguous CUDA int32 vector"); const int64_t n_req = cu_q.numel() - 1; TORCH_CHECK(seq_k.is_cuda() && seq_k.scalar_type() == at::kInt && seq_k.dim() == 1 && seq_k.is_contiguous() && seq_k.numel() >= n_req, "inkling_attn: seqused_k must be a contiguous CUDA int32 vector with one entry a request"); TORCH_CHECK(page_table.size(0) >= n_req, "inkling_attn: page_table has fewer rows than requests"); TORCH_CHECK(num_pages > 0 && num_pages < (int64_t(1) << 31) && page_table.size(1) * page_size < (int64_t(1) << 31), "inkling_attn: invalid KV cache or page table size"); TORCH_CHECK(r.is_cuda() && r.scalar_type() == at::kBFloat16 && r.dim() == 3 && r.size(0) == T && r.size(1) == H && r.size(2) == inkling_attn::kDRel && r.stride(2) == 1, "inkling_attn: r must be CUDA bf16 [T, H, 16] with a contiguous last dim"); TORCH_CHECK(r.stride(0) % 2 == 0 && r.stride(1) % 2 == 0 && aligned(r.data_ptr(), 4), "inkling_attn: r alignment"); TORCH_CHECK(proj.is_cuda() && proj.scalar_type() == at::kBFloat16 && proj.dim() == 2 && proj.size(0) == inkling_attn::kDRel && proj.is_contiguous() && proj.size(1) > 0, "inkling_attn: proj must be a contiguous CUDA bf16 [16, rel_extent]"); TORCH_CHECK(out.is_cuda() && out.scalar_type() == at::kFloat && out.dim() == 3 && out.size(0) == T && out.size(1) == H && out.size(2) == inkling_attn::kD && out.stride(2) == 1, "inkling_attn: out must be CUDA fp32 [T, H, 128] with a contiguous last dim"); TORCH_CHECK(out.stride(0) % 2 == 0 && out.stride(1) % 2 == 0 && aligned(out.data_ptr(), 8), "inkling_attn: out alignment"); TORCH_CHECK(lse.is_cuda() && lse.scalar_type() == at::kFloat && lse.dim() == 2 && lse.size(0) == H && lse.size(1) == T && lse.stride(1) == 1, "inkling_attn: lse must be CUDA fp32 [H, T] with a contiguous last dim"); for (const auto* t : {&k, &v, &page_table, &cu_q, &seq_k, &r, &proj, &out, &lse}) TORCH_CHECK(t->device() == q.device(), "inkling_attn: all tensors must be on q's device"); TORCH_CHECK(T < (int64_t(1) << 30) && n_req < (int64_t(1) << 20), "inkling_attn: too many rows"); if (T == 0 || (n_req == 0 && !y.has_value())) return; // gated with no requests: y is cleared after validation
Params p{}; p.q = reinterpret_cast<const __nv_bfloat16*>(q.data_ptr()); p.q_st = q.stride(0); p.q_sh = q.stride(1); if (packed_kv) { const auto& planes = *packed_kv; const std::vector<int64_t> inner_shapes[] = { {2, 128, hkv, 128}, {2, 128, hkv, 64}, {hkv, 2, 64}, {hkv, 2, 5}, {hkv, 2}, {1}, {2, 128, hkv, 128}, {128, 128}, }; for (int i = 0; i < 8; ++i) { const auto& plane = planes[i]; const auto dtype = i < 2 ? at::kByte : i < 6 ? at::kInt : at::kShort; TORCH_CHECK(plane.device() == q.device() && plane.scalar_type() == dtype && plane.dim() > 0 && plane.sizes().slice(1) == at::IntArrayRef(inner_shapes[i]), "inkling_attn: invalid packed KV device, dtype or shape"); if (i < 6) { TORCH_CHECK(plane.size(0) == num_pages && plane.select(0, 0).is_contiguous() && plane.stride(0) * plane.element_size() == planes[0].stride(0), "inkling_attn: packed planes must share a page stride"); } else { TORCH_CHECK(plane.is_contiguous() && plane.size(0) < (int64_t(1) << 31), "inkling_attn: invalid packed side arena layout"); } } p.sm = planes[0].data_ptr<uint8_t>(); p.ex = planes[1].data_ptr<uint8_t>(); p.esc = planes[2].data_ptr<int>(); p.off = planes[3].data_ptr<int>(); p.overflow_ref = planes[4].data_ptr<int>(); p.flags = planes[5].data_ptr<int>(); p.staging = reinterpret_cast<const uint16_t*>(planes[6].data_ptr<int16_t>()); p.overflow = reinterpret_cast<const uint16_t*>(planes[7].data_ptr<int16_t>()); p.packed_stride = planes[0].stride(0); p.kv_heads = static_cast<int>(hkv); p.stage_slots = static_cast<int>(planes[6].size(0)); p.overflow_slots = static_cast<int>(planes[7].size(0)); } else { p.k = reinterpret_cast<const __nv_bfloat16*>(k.data_ptr()); p.k_sp = k.stride(0); p.k_ss = k.stride(1); p.k_sh = k.stride(2); p.v = reinterpret_cast<const __nv_bfloat16*>(v.data_ptr()); p.v_sp = v.stride(0); p.v_ss = v.stride(1); p.v_sh = v.stride(2); } p.page_table = page_table.data_ptr<int>(); p.pt_s = page_table.stride(0); p.cu_q = cu_q.data_ptr<int>(); p.seq_k = seq_k.data_ptr<int>(); p.n_req = static_cast<int>(n_req); p.r = reinterpret_cast<const __nv_bfloat16*>(r.data_ptr()); p.r_st = r.stride(0); p.r_sh = r.stride(1); p.proj = reinterpret_cast<const __nv_bfloat16*>(proj.data_ptr()); p.rel_extent = static_cast<int>(proj.size(1)); p.out = out.data_ptr<float>(); p.o_st = out.stride(0); p.o_sh = out.stride(1); p.lse = lse.data_ptr<float>(); p.lse_sh = lse.stride(0); p.heads = static_cast<int>(H); p.group = static_cast<int>(H / hkv); p.page_size = static_cast<int>(page_size); p.total_q = static_cast<int>(T); p.pt_cols = static_cast<int>(page_table.size(1)); p.num_pages = static_cast<int>(num_pages); p.scale = static_cast<float>(scale); p.window_left = static_cast<int>(window_left); p.sel_mode = 0; p.sel_keys = 0; const bool gated = gate.has_value(); TORCH_CHECK(gated == sinks.has_value() && gated == y.has_value(), "inkling_attn: gate, sinks and y go together"); if (gated) { const auto& g = *gate; const auto& sk = *sinks; const auto& yy = *y; TORCH_CHECK(g.is_cuda() && g.device() == q.device() && g.scalar_type() == at::kBFloat16 && g.dim() == 2 && g.size(0) >= T && g.size(1) == H * inkling_attn::kD && g.stride(1) == 1 && g.stride(0) % 8 == 0 && aligned(g.data_ptr(), 16), "inkling_attn: gate must be CUDA bf16 [>= T, H * 128], contiguous last dim, 16-byte aligned rows"); TORCH_CHECK(sk.is_cuda() && sk.device() == q.device() && sk.scalar_type() == at::kBFloat16 && sk.dim() == 2 && sk.size(0) >= T && sk.size(1) == H && sk.stride(1) == 1, "inkling_attn: sinks must be CUDA bf16 [>= T, H] with a contiguous last dim"); TORCH_CHECK(yy.is_cuda() && yy.device() == q.device() && yy.scalar_type() == at::kBFloat16 && yy.dim() == 2 && yy.size(0) == T && yy.size(1) == H * inkling_attn::kD && yy.is_contiguous() && aligned(yy.data_ptr(), 16), "inkling_attn: y must be a contiguous CUDA bf16 [T, H * 128]"); { // y is written by many CTAs: it must not overlap anything the kernel reads or writes const auto y0 = reinterpret_cast<uintptr_t>(yy.data_ptr()), y1 = y0 + yy.numel() * 2; for (const auto* t : {&q, &k, &v, &r, &proj, &out, &lse, &g, &sk}) { const auto t0 = reinterpret_cast<uintptr_t>(t->data_ptr()); const auto t1 = t0 + (t->numel() ? (t->storage().nbytes() - t->storage_offset() * t->element_size()) : 0); TORCH_CHECK(y1 <= t0 || t1 <= y0, "inkling_attn: y overlaps an input or output buffer"); } } if (n_req == 0) { // no request rows: all of y is tail if (zero_tail) yy.zero_(); return; } p.gate = reinterpret_cast<const __nv_bfloat16*>(g.data_ptr()); p.g_st = g.stride(0); p.sink = reinterpret_cast<const __nv_bfloat16*>(sk.data_ptr()); p.s_st = sk.stride(0); p.y = reinterpret_cast<__nv_bfloat16*>(yy.data_ptr()); p.y_st = yy.stride(0); }
const int64_t bm = 16 * warps; const int64_t tiles = (T + bm - 1) / bm + n_req; const int64_t grid = tiles * H; TORCH_CHECK(grid < (int64_t(1) << 31), "inkling_attn: grid too large"); const int64_t grid8 = ((T + 127) / 128 + n_req) * H; const c10::cuda::CUDAGuard guard(q.device()); const auto stream = at::cuda::getCurrentCUDAStream(); TORCH_CHECK(window_left < 0 || proj.size(1) == window_left + 1, "inkling_attn: sliding-window layers need rel_extent == window + 1"); const bool packed = projp_buf.has_value(); if (packed) { const auto& pb = *projp_buf; TORCH_CHECK(pb.is_cuda() && pb.device() == q.device() && pb.scalar_type() == at::kBFloat16 && pb.is_contiguous() && pb.numel() == (proj.size(1) + 1) * inkling_attn::kDRel && aligned(pb.data_ptr(), 16), "inkling_attn: projp buffer must be a contiguous 16-byte aligned bf16 [(rel_extent + 1) * 16]"); const auto pb0 = reinterpret_cast<uintptr_t>(pb.data_ptr()), pb1 = pb0 + pb.numel() * 2; const auto pr0 = reinterpret_cast<uintptr_t>(proj.data_ptr()), pr1 = pr0 + proj.numel() * 2; TORCH_CHECK(pb1 <= pr0 || pr1 <= pb0, "inkling_attn: projp buffer overlaps proj"); p.projp = reinterpret_cast<const __nv_bfloat16*>(pb.data_ptr()); const int n = static_cast<int>(pb.numel()); inkling_attn::pack_proj<<<(n + 255) / 256, 256, 0, stream>>>(p.proj, reinterpret_cast<__nv_bfloat16*>(pb.data_ptr()), p.rel_extent); C10_CUDA_KERNEL_LAUNCH_CHECK(); } const dim3 blocks(static_cast<unsigned>(grid)); if (gated && zero_tail) { // zero_tail=false: a second launch into the same y (it must not clear the first's rows) const int zb = static_cast<int>(std::min<int64_t>(T, 1024)); zero_tail_rows<<<zb, 128, 0, stream>>>(p.y, p.y_st, static_cast<int>(H * inkling_attn::kD), p.cu_q, static_cast<int>(n_req), static_cast<int>(T)); C10_CUDA_KERNEL_LAUNCH_CHECK(); } if (packed_kv) { if (gated) { if (packed) launch_global<true, true, true>(p, blocks, warps, w8_from_keys, grid8, stream); else launch_global<false, true, true>(p, blocks, warps, w8_from_keys, grid8, stream); } else if (packed) launch_global<true, true>(p, blocks, warps, w8_from_keys, grid8, stream); else launch_global<false, true>(p, blocks, warps, w8_from_keys, grid8, stream); } else if (window_left >= 0) { if (gated) { if (packed) launch<true, true, false, true>(p, blocks, warps, stream); else launch<true, false, false, true>(p, blocks, warps, stream); } else if (packed) launch<true, true>(p, blocks, warps, stream); else launch<true, false>(p, blocks, warps, stream); } else { if (gated) { if (packed) launch_global<true, false, true>(p, blocks, warps, w8_from_keys, grid8, stream); else launch_global<false, false, true>(p, blocks, warps, w8_from_keys, grid8, stream); } else if (packed) launch_global<true, false>(p, blocks, warps, w8_from_keys, grid8, stream); else launch_global<false, false>(p, blocks, warps, w8_from_keys, grid8, stream); } C10_CUDA_KERNEL_LAUNCH_CHECK();}
} // namespace
PYBIND11_MODULE(TORCH_EXTENSION_NAME, m) { m.def("fwd", &fwd, "Inkling-2-Mini prefill attention with the relative bias computed in-kernel", py::arg("q"), py::arg("k"), py::arg("v"), py::arg("page_table"), py::arg("cu_q"), py::arg("seq_k"), py::arg("r"), py::arg("proj"), py::arg("out"), py::arg("lse"), py::arg("scale"), py::arg("window_left"), py::arg("projp_buf") = py::none(), py::arg("warps") = 4, py::arg("packed_kv") = py::none(), py::arg("w8_from_keys") = 0, py::arg("gate") = py::none(), py::arg("sinks") = py::none(), py::arg("y") = py::none(), py::arg("zero_tail") = true);}12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576"""Python entry point of the inkling_attn kernel (imported on the GPU path only)."""
from . import build
D_REL = 16HEAD_DIM = 128
import os
WARPS = int(os.environ.get("INKLING_ATTN_WARPS", "4")) # 4: BM 64, 2 CTAs / SM; 8: BM 128, 1 CTA / SMPACKED_PROJ = True # repack proj per call (one tiny launch) so each lane loads its B fragment with one 8-byte load# Global layers with WARPS 4 (BF16 and packed KV): a request whose prefix holds >= W8_FROM keys runs on 8 warps# (BM 128), the others on 4 (two launches, requests picked on the device). BM 64 holds ~71 TF/s up to ~256K prefix# keys in isolation (~150K in serving) and falls to ~47 TF/s at 512K-1M; BM 128 holds ~69 TF/s at every prefix and# is ~3-5 % slower below 256K. Bit-identical rows either way. 0 = off.W8_FROM = int(os.environ.get("INKLING_ATTN_W8_FROM", "131072"))
def prefill_attention(q, k_cache, v_cache, page_table, cu_seqlens_q, seqused_k, r, proj, softmax_scale, window_left, out=None, packed=None, warps=None, w8_from=None, lse=None, gate=None, sinks=None, y=None, zero_tail=True): """FA4-compatible (out, lse) of the Inkling prefill attention with the relative bias computed in-kernel.
q [T, H, 128] bf16; k_cache / v_cache [pages, page_size, H_kv, 128] bf16; page_table [B, max_pages] int32; cu_seqlens_q [n_req + 1] int32; seqused_k [n_req] int32 (prefix + new tokens); r [T, H, 16] bf16 (after the rel L2 clip, the RelLogitsProj input); proj [16, rel_extent] bf16; window_left: the layer's left window (sliding-window layers, rel_extent == window_left + 1) or None / negative (global causal layers). Returns out [T, H, 128] fp32 and lse [H, T] fp32 (FA4's varlen layout). Rows past cu_seqlens_q[-1] are not written. With gate [T, H*128] / sinks [T, H] / y [T, H*128] (any layer): the kernel writes y = bf16(out * sigmoid(gate) * sigmoid(lse - sink)) (SGLang's gate_sink on these values) instead of out and returns (y, lse). It first zeroes y's rows past cu_seqlens_q[-1] on the device; zero_tail=False skips that for a second launch into the same y (whose first launch already did it). """ import torch
ext = build.load() t, heads, _ = q.shape if out is None: out = torch.empty((t, heads, HEAD_DIM), dtype=torch.float32, device=q.device) if lse is None: lse = torch.empty((heads, t), dtype=torch.float32, device=q.device) wl = -1 if window_left is None or window_left < 0 else int(window_left) if r.stride(-1) != 1: r = r.contiguous() packed = PACKED_PROJ if packed is None else packed projp = torch.empty(((proj.shape[1] + 1) * D_REL,), dtype=torch.bfloat16, device=q.device) if packed else None ext.fwd(q, k_cache, v_cache, page_table, cu_seqlens_q, seqused_k, r, proj, out, lse, float(softmax_scale), wl, projp, WARPS if warps is None else int(warps), w8_from_keys=W8_FROM if w8_from is None else int(w8_from), gate=gate, sinks=sinks, y=y, zero_tail=bool(zero_tail)) return (out, lse) if y is None else (y, lse)
def packed_prefill_attention(q, layer, page_table, cu_seqlens_q, seqused_k, softmax_scale, *, r, proj, out=None, warps=None, w8_from=None, gate=None, sinks=None, y=None, zero_tail=True): """Run fused projected-bias prefill with exact KV reconstructed in shared memory.""" import torch
from inkling_kv12s.storage import validate_paged
validate_paged(q, layer, page_table, seqused_k, cu_seqlens_q) t, heads, _ = q.shape if out is None: out = torch.empty((t, heads, HEAD_DIM), dtype=torch.float32, device=q.device) lse = torch.empty((heads, t), dtype=torch.float32, device=q.device) if r.stride(-1) != 1: r = r.contiguous() projp = torch.empty(((proj.shape[1] + 1) * D_REL,), dtype=torch.bfloat16, device=q.device) if PACKED_PROJ else None planes = [*layer.planes, layer.stage, layer.overflow] ext = build.load() ext.fwd(q, layer.raw, layer.raw, page_table, cu_seqlens_q, seqused_k, r, proj, out, lse, float(softmax_scale), -1, projp, WARPS if warps is None else int(warps), planes, W8_FROM if w8_from is None else int(w8_from), gate=gate, sinks=sinks, y=y, zero_tail=bool(zero_tail)) return (out, lse) if y is None else (y, lse)123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562"""Patch points of inkling_attn (prefill / extend attention with the relative bias computed in-kernel).
Stock prefill path per layer visit (inkling2_attn.py Inkling2Attention._forward, the non-compact branch): rel_bias = self.rel_logits_proj(r) # cuBLAS einsum -> BF16 [t, 24, rel_extent] attn(q, k, v, forward_batch, return_lse=True, rel_bias=rel_bias) -> FlashAttentionBackend.forward_extend -> flash_attn_with_kvcache (SM120) -> flash_attn_varlen_func -> _flash_attn_varlen_func (FA4: shear copy + attention with the sheared bias)
With this overlay, inside an eligible visit (prefill/extend only, see _visit_for): 1. Inkling2Attention._forward is wrapped to mark the visit (a context variable; nothing else changes); 2. RelLogitsProj.forward returns r itself (the [t, H, 16] rel-clip output, no einsum) and records it in the visit: r travels to the backend in the rel_bias slot, so every narrowing SGLang applies to rel_bias (graph_utils.attention_input_scope / _attention_on_real_rows slice rows) applies to r the same way; 3. flash_attention_v4_sm120._flash_attn_varlen_func (the module global the SM120 wrapper calls) is wrapped: a rel_bias that is (a row prefix of) the visit's r runs ops.prefill_attention with the layer's proj, returning FA4's (out, lse). Any call shape the kernel does not cover falls back to the stock call with the materialised einsum bias (same math as stock). An r-shaped rel_bias (width 16) that reaches FA4 outside its visit raises instead of being misread.
Breakable prefill graphs replay attention as a deferred eager call outside the visit, so they are excluded atthe visit check (as inkling_prefill.bias_layout does). Decode, target verify and draft extend never enter a visit.
Coexistence with inkling_prefill.bias_layout: both mark visits and wrap FA4's varlen entry, and bias_layoutwraps RelLogitsProj.forward. This package dispatches one level earlier, at RelLogitsProj.__call__ (beforenn.Module.__call__ reaches any forward wrapper), so in an eligible visit r is returned whatever order the twopackages were installed in; bias_layout's forward wrapper is not reached, its varlen wrapper sees a width-16rel_bias it did not make and passes it through, and layers this package does not take (e.g. global layers withonly prefill_swa armed) still get bias_layout's sheared bias. Should anything else consume an eligible visitfirst, the _forward wrapper notices (the visit's r stays unset) and logs it once.
Device route: the visit requires a CUDA device of compute capability 12.x, the condition under whichFlashAttentionBackend._load_fa4_kernels uses the patched SM120 module, and no context-parallel extend."""
import contextvarsimport osimport sysimport weakref
ATTN_MODULE = "sglang.srt.models.inkling_common.inkling2_attn"COMMON_ATTN_MODULE = "sglang.srt.models.inkling_common.attn"SM120_MODULE = "sglang.kernels.ops.attention.flash_attention_v4_sm120"BREAKABLE_MODULE = "sglang.srt.model_executor.runner_backend_utils.breakable_cuda_graph.context"CP_MODULE = "sglang.srt.layers.cp.utils"MARK = "inkling_attn_prefill"D_REL = 16HEAD_DIM = 128
_CTX = contextvars.ContextVar("inkling_attn_ctx", default=None)STATS = {"kernel": 0, "fallback": 0, "shadowed": 0, "gated": 0, "gate_fallback": 0}# INKLING_ATTN_GATE=1: sliding-window prefill visits run the gated epilogue (gate_sink inside the attention kernel,# bit-identical to SGLang's gate_sink on the FP32 out + LSE). The visit records the gate / sinks its# _project_sources returns (an instance-level hook for the duration of the visit); the FA4 call then launches the# gated kernel (BF16 y + LSE; the FP32 out stays unwritten) and the visit's gate_sink call returns y.# INKLING_ATTN_GATE=all (or 2): global prefill visits too (BF16 and KV12S packed readers, via gate_begin / gate_commit)._GATE_ENV = os.environ.get("INKLING_ATTN_GATE", "").strip().lower()GATE_ALL = _GATE_ENV in ("all", "2")GATE = GATE_ALL or _GATE_ENV in ("1", "on", "true", "yes", "swa")
def _kernel_api_logging(): """SGLang's kernel API logging (SGLANG_KERNEL_API_LOGLEVEL > 0, parsed like kernel_api_logging._get_env) logs and may dump the FA4 wrapper's returned FP32 out before gate_sink runs; a gated launch leaves that buffer unwritten, so the gated epilogue stays off while it is enabled.""" try: return int(os.environ.get("SGLANG_KERNEL_API_LOGLEVEL", "0") or 0) != 0 except ValueError: return False
GATE_OFF_FOR_LOGGING = GATE and _kernel_api_logging()if GATE_OFF_FOR_LOGGING: GATE = False GATE_ALL = False_LOGGED = set()
def _log_once(key, msg): if key in _LOGGED: return _LOGGED.add(key) sys.stderr.write(f"[inkling_attn pid={os.getpid()}] {msg}\n") sys.stderr.flush()
if GATE_OFF_FOR_LOGGING: _log_once("gate_off", "gated epilogue OFF: SGLANG_KERNEL_API_LOGLEVEL is set (it reads the FA4 output buffer)")
class _Visit: __slots__ = ("owner", "local", "window_left", "r", "proj", "gate", "sinks", "tokens", "gated")
def __init__(self, owner, local, window_left, proj): self.owner = owner self.local = local self.window_left = window_left self.proj = proj self.r = None self.gate = self.sinks = self.tokens = None # from the visit's _project_sources (INKLING_ATTN_GATE) self.gated = None # (FP32 out buffer left unwritten, BF16 y) of a gated launch, until gate_sink takes y
class use_visit: """Context manager for direct calls (tools / tests): inside it, the patched varlen wrapper treats `r` (or a row prefix of it) passed as rel_bias as this package's marker for a layer with `proj`."""
def __init__(self, r, proj, window_left=None): local = window_left is not None and window_left >= 0 self._visit = _Visit(None, local, window_left if local else None, proj) self._visit.r = r _PRODUCED.append(weakref.ref(r)) del _PRODUCED[:-256] self._token = None
def __enter__(self): self._token = _CTX.set(self._visit) return self._visit
def __exit__(self, *exc): _CTX.reset(self._token) return False
_SM12X = {}
def _is_sm12x(device): """FlashAttentionBackend._load_fa4_kernels takes the SM120 FA4 module (the one patched here) iff major == 12.""" import torch
idx = device.index if device.index is not None else torch.cuda.current_device() if idx not in _SM12X: # GB10 only: the extension is built for sm_121a, and capability 12.x is what makes the backend use the # patched SM120 FA4 module _SM12X[idx] = tuple(torch.cuda.get_device_capability(idx)) == (12, 1) return _SM12X[idx]
def _visit_for(self, forward_batch, attn, get_attn_backend, get_model, in_breakable, kinds, cp_active=None): import torch
local = bool(getattr(self, "is_local", False)) if ("swa" if local else "global") not in kinds: return None if in_breakable is not None and in_breakable(): return None if cp_active is not None and cp_active(forward_batch): return None mode = forward_batch.forward_mode if not mode.is_extend() or mode.is_decode() or mode.is_target_verify(): return None for name in ("is_draft_extend", "is_draft_extend_v2"): fn = getattr(mode, name, None) if fn is not None and fn(): return None if getattr(attn, "pack_gqa", None): return None try: if get_model().kv_cache_dtype == "mxfp8": return None except Exception: # noqa: BLE001 return None contains = getattr(forward_batch, "contains_mm_inputs", None) if contains is not None and contains(): return None backend = get_attn_backend() if getattr(backend, "fa_skip_kv_cache", False) or getattr(backend, "use_mla", False): return None meta = getattr(backend, "forward_metadata", None) if meta is None: return None for name in ("swa_spec_metadata", "image_token_ranges", "local_attn_metadata"): if getattr(meta, name, None) is not None: return None if getattr(self, "head_dim", None) != HEAD_DIM or getattr(self, "d_rel", None) != D_REL: return None heads, kv_heads = self.num_tp_heads, self.num_tp_kv_heads if kv_heads <= 0 or heads % kv_heads: return None proj = getattr(getattr(self, "rel_logits_proj", None), "proj", None) rel = self.rel_extent if not ( isinstance(proj, torch.Tensor) and proj.is_cuda and _is_sm12x(proj.device) and proj.dtype == torch.bfloat16 and proj.dim() == 2 and tuple(proj.shape) == (D_REL, rel) and proj.is_contiguous() ): return None window = getattr(attn, "sliding_window_size", None) if local: if window is None or window < 0 or window + 1 != rel: return None elif window not in (None, -1): return None return _Visit(self, local, window if local else None, proj)
def make_forward(prev, get_attn_backend, get_model, in_breakable, kinds, cp_active=None): def _forward(self, hidden_states, positions, forward_batch, *, attn, attn_padded): visit = _visit_for(self, forward_batch, attn, get_attn_backend, get_model, in_breakable, kinds, cp_active) if visit is None: if GATE and _CTX.get() is not None: # an ineligible nested visit must not see the outer one token = _CTX.set(None) try: return prev(self, hidden_states, positions, forward_batch, attn=attn, attn_padded=attn_padded) finally: _CTX.reset(token) return prev(self, hidden_states, positions, forward_batch, attn=attn, attn_padded=attn_padded) token = _CTX.set(visit) hooked = False if GATE and (visit.local or GATE_ALL) and "_project_sources" not in self.__dict__: project = self._project_sources # the full (class-level, wrapped) chain
def _project_sources(sources): res = project(sources) if isinstance(res, tuple) and len(res) == 6: visit.gate, visit.sinks = res[4], res[5] visit.tokens = res[0].shape[0] return res
self.__dict__["_project_sources"] = _project_sources # instance attribute shadows the method hooked = True try: result = prev(self, hidden_states, positions, forward_batch, attn=attn, attn_padded=attn_padded) finally: if hooked: self.__dict__.pop("_project_sources", None) _CTX.reset(token) if visit.gated is not None: raise RuntimeError("inkling_attn: a gated attention output never reached gate_sink") if visit.r is None: STATS["shadowed"] += 1 _log_once( "shadowed", "an eligible visit never reached RelLogitsProj.__call__ with an r this package takes " "(something else produced the bias); that visit ran without this package", ) return result
_forward.__wrapped__ = prev setattr(_forward, MARK, True) return _forward
_PRODUCED = [] # weak references to the last r markers handed out (bounded)
def make_rel_call(prev): """RelLogitsProj.__call__: inside an eligible visit return r itself (the marker) before nn.Module.__call__, i.e. before every RelLogitsProj.forward wrapper, whatever order the overlays were installed in.""" import torch
def __call__(self, *args, **kwargs): r_out = args[0] if args else kwargs.get("r_out") log_scaling_tau = args[1] if len(args) > 1 else kwargs.get("log_scaling_tau") visit = _CTX.get() if ( visit is not None and visit.r is None and log_scaling_tau is None and visit.owner is not None and visit.owner.rel_logits_proj is self and self.proj is visit.proj and isinstance(r_out, torch.Tensor) and r_out.dim() == 3 and r_out.is_cuda and r_out.dtype == torch.bfloat16 and r_out.shape[1] == visit.owner.num_tp_heads and r_out.shape[2] == D_REL and r_out.stride(2) == 1 and len(args) + len(kwargs) <= 2 ): visit.r = r_out _PRODUCED.append(weakref.ref(r_out)) del _PRODUCED[:-256] return r_out return prev(self, *args, **kwargs)
__call__.__wrapped__ = prev setattr(__call__, MARK, True) return __call__
def _is_produced(bias): for ref in _PRODUCED: r = ref() if r is not None and r.device == bias.device and _same_storage_rows(bias, r): return True return False
def _same_storage_rows(bias, r): return ( bias.dim() == 3 and bias.data_ptr() == r.data_ptr() and bias.shape[1:] == r.shape[1:] and bias.stride() == r.stride() and bias.shape[0] <= r.shape[0] )
def packed_rel_projection(bias): """Resolve a fused projection marker intercepted by a packed attention reader.""" visit = _CTX.get() if visit is not None and visit.r is not None and _same_storage_rows(bias, visit.r): return visit.proj if bias.shape[-1] == D_REL and _is_produced(bias): raise RuntimeError("inkling_attn: packed reader received a marker outside its visit") return None
def _kernel_call(visit, bias, kwargs): """Arguments for ops.prefill_attention, or None when this call is outside what the kernel covers.""" import torch
q = kwargs.get("q") k = kwargs.get("k") v = kwargs.get("v") page_table = kwargs.get("page_table") cu_q = kwargs.get("cu_seqlens_q") seq_k = kwargs.get("seqused_k") out = kwargs.get("out") for name in ( "qv", "cu_seqlens_k", "seqused_q", "learnable_sink", "score_mod", "mask_mod", "aux_tensors", "q_descale", "k_descale", "v_descale", "sfq", "sfk", "sfv", "gather_kv_indices", "block_sparse_tensors", "aux_scalars", ): if kwargs.get(name) is not None: return None if kwargs.get("softcap") not in (None, 0.0) or kwargs.get("rel_bias_presheared"): return None if not kwargs.get("causal", False) or kwargs.get("num_splits", 1) not in (0, 1) or kwargs.get("pack_gqa"): return None window = tuple(kwargs.get("window_size", (None, None))) if visit.local: if window != (visit.window_left, 0): return None elif window not in ((None, None), (-1, -1), (None, 0), (-1, 0)): return None scale = kwargs.get("softmax_scale") if scale is None: return None if not all(isinstance(t, torch.Tensor) for t in (q, k, v, page_table, cu_q, seq_k)): return None if k.dim() != 4 or k.shape[1] <= 0 or k.shape[2] <= 0 or cu_q.numel() < 2 or q.dim() != 3 or q.shape[1] <= 0: return None if not ( q.dtype == k.dtype == v.dtype == torch.bfloat16 and q.dim() == 3 and q.shape[2] == HEAD_DIM and q.shape[1] == bias.shape[1] and q.shape[0] == bias.shape[0] and k.dim() == 4 and k.shape == v.shape and k.shape[3] == HEAD_DIM and k.shape[1] % 64 == 0 and q.shape[1] % k.shape[2] == 0 and page_table.dtype == cu_q.dtype == seq_k.dtype == torch.int32 and page_table.dim() == 2 and page_table.stride(1) == 1 and cu_q.is_contiguous() and seq_k.is_contiguous() ): return None if out is not None and not ( out.dtype == torch.float32 and tuple(out.shape) == (q.shape[0], q.shape[1], HEAD_DIM) and out.stride(2) == 1 ): return None if out is None: return None # FA4 would return q.dtype; Inkling always passes an FP32 out dev = q.device if not all(t.device == dev for t in (k, v, page_table, cu_q, seq_k, bias, out, visit.proj)): return None if not ( q.stride(2) == 1 and q.stride(0) % 2 == 0 and q.stride(1) % 2 == 0 and q.data_ptr() % 4 == 0 and all(c.stride(3) == 1 and c.stride(0) % 8 == 0 and c.stride(1) % 8 == 0 and c.stride(2) % 8 == 0 and c.data_ptr() % 16 == 0 for c in (k, v)) and bias.stride(0) % 2 == 0 and bias.stride(1) % 2 == 0 and bias.data_ptr() % 4 == 0 and out.stride(0) % 2 == 0 and out.stride(1) % 2 == 0 and out.data_ptr() % 8 == 0 and cu_q.dim() == 1 and seq_k.dim() == 1 and seq_k.numel() >= cu_q.numel() - 1 and page_table.shape[0] >= cu_q.numel() - 1 ): return None return dict( q=q, k_cache=k, v_cache=v, page_table=page_table, cu_seqlens_q=cu_q, seqused_k=seq_k, r=bias, proj=visit.proj, softmax_scale=float(scale), window_left=visit.window_left if visit.local else None, out=out, )
def make_varlen(stock): import torch
def _flash_attn_varlen_func(*args, **kwargs): bias = kwargs.get("rel_bias") if bias is not None and not args: visit = _CTX.get() if visit is not None and visit.r is not None and _same_storage_rows(bias, visit.r): call = _kernel_call(visit, bias, kwargs) if call is not None: from . import ops
STATS["kernel"] += 1 if GATE and (visit.local or GATE_ALL) and visit.gated is None and _gate_ok(visit, call): gate, sinks = visit.gate, visit.sinks y = torch.empty(tuple(gate.shape), dtype=torch.bfloat16, device=gate.device) _, lse = ops.prefill_attention(**call, gate=gate, sinks=sinks, y=y) visit.gated = (call["out"], y) STATS["gated"] += 1 kind = "SWA" if visit.local else "global" _log_once(f"gated_first_{kind}", f"first gated {kind} prefill launch ({call['q'].shape[0]} rows)") return call["out"], lse # out stays unwritten: only gate_sink consumes it, and returns y return ops.prefill_attention(**call) STATS["fallback"] += 1 _log_once("fallback", "a marked call is outside the kernel's coverage; running stock FA4 for it") kwargs["rel_bias"] = torch.einsum("thd,de->the", bias, visit.proj) kwargs.pop("rel_bias_presheared", None) return stock(**kwargs) if bias is not None and bias.dim() == 3 and bias.shape[-1] == D_REL and _is_produced(bias): raise RuntimeError( "inkling_attn: an r-shaped rel_bias (width 16) reached FA4 outside the layer visit that made it" ) return stock(*args, **kwargs)
_flash_attn_varlen_func.__wrapped__ = stock setattr(_flash_attn_varlen_func, MARK, True) return _flash_attn_varlen_func
def _gate_ok(visit, call): """The gated launch is taken only for a whole-visit call (the q rows _project_sources returned, so no real-rows narrowing between the visit and the backend) with gate / sinks in the layouts the kernel reads.""" import torch
gate, sinks, q, out = visit.gate, visit.sinks, call["q"], call["out"] if gate is None or sinks is None or visit.tokens != q.shape[0]: return False t, heads = q.shape[0], q.shape[1] ok = ( gate.dtype == sinks.dtype == torch.bfloat16 and gate.dim() == 2 and tuple(gate.shape) == (t, heads * HEAD_DIM) and gate.stride(1) == 1 and gate.stride(0) % 8 == 0 and gate.data_ptr() % 16 == 0 and sinks.dim() == 2 and tuple(sinks.shape) == (t, heads) and sinks.stride(1) == 1 and gate.device == sinks.device == q.device and tuple(out.shape[:2]) == (t, heads) ) if not ok: STATS["gate_fallback"] += 1 _log_once("gate_fallback", "gated epilogue: unexpected gate / sinks layout; stock gate_sink used") return ok
def gate_begin(q, out): """For a packed (KV12S) global prefill reader: the gate / sinks / y kwargs of a gated launch when this visit's gate_sink can take the kernel's y (INKLING_ATTN_GATE=all, whole-visit rows, kernel layouts), else None. The caller launches with them and then calls gate_commit(g, out).""" import torch
if not GATE_ALL: return None visit = _CTX.get() if visit is None or visit.local or visit.gated is not None or out is None: return None if not _gate_ok(visit, {"q": q, "out": out}): return None y = torch.empty(tuple(visit.gate.shape), dtype=torch.bfloat16, device=visit.gate.device) return {"gate": visit.gate, "sinks": visit.sinks, "y": y, "_visit": visit}
def gate_commit(g, out): """After the gated launch(es) of gate_begin's kwargs: the visit's gate_sink returns y (out stays unwritten).""" visit = g["_visit"] visit.gated = (out, g["y"]) STATS["gated"] += 1 _log_once("gated_first_global", f"first gated global prefill launch ({visit.tokens} rows, packed reader)")
def make_gate_sink(stock): """inkling2_attn's gate_sink: after a gated launch in this visit, return its BF16 y (the FP32 out it was handed was never written, so anything else is an error); every other call is the stock function."""
def gate_sink(output, gate, lse, sinks, *, output_dtype, head_groups=None): visit = _CTX.get() done = visit.gated if visit is not None else None if done is None: return stock(output, gate, lse, sinks, output_dtype=output_dtype, head_groups=head_groups) out, y = done visit.gated = None if (output.data_ptr() != out.data_ptr() or output.numel() != out.numel() or head_groups is not None or gate is not visit.gate or sinks is not visit.sinks or tuple(y.shape) != tuple(gate.shape)): raise RuntimeError("inkling_attn: gate_sink did not receive the gated visit's attention output") import torch
if output_dtype != torch.bfloat16: raise RuntimeError("inkling_attn: gated epilogue writes BF16, gate_sink asked for another dtype") return y
gate_sink.__wrapped__ = stock setattr(gate_sink, MARK, True) return gate_sink
def patch_sm120(module): stock = getattr(module, "_flash_attn_varlen_func", None) if stock is None: raise RuntimeError(f"inkling_attn: {SM120_MODULE}._flash_attn_varlen_func is missing") if getattr(stock, MARK, False): return False module._flash_attn_varlen_func = make_varlen(stock) return True
def patch_common_attn(module): import inspect
cls = getattr(module, "RelLogitsProj", None) fwd = getattr(cls, "forward", None) if cls is not None else None if fwd is None: raise RuntimeError(f"inkling_attn: {COMMON_ATTN_MODULE}.RelLogitsProj.forward is missing") params = list(inspect.signature(inspect.unwrap(fwd)).parameters) if params[:3] != ["self", "r_out", "log_scaling_tau"]: raise RuntimeError(f"inkling_attn: RelLogitsProj.forward signature changed: {params}") prev = cls.__call__ if getattr(prev, MARK, False): return False cls.__call__ = make_rel_call(prev) return True
def patch_attn(module, kinds): import importlib
cls = getattr(module, "Inkling2Attention", None) prev = getattr(cls, "_forward", None) if cls is not None else None get_attn_backend = getattr(module, "get_attn_backend", None) get_model = getattr(module, "get_model", None) if prev is None or get_attn_backend is None or get_model is None: raise RuntimeError( f"inkling_attn: {ATTN_MODULE}.Inkling2Attention._forward, get_attn_backend or get_model is missing" ) if getattr(prev, MARK, False): return False in_breakable = getattr(importlib.import_module(BREAKABLE_MODULE), "is_in_breakable_cuda_graph", None) if in_breakable is None: raise RuntimeError(f"inkling_attn: {BREAKABLE_MODULE}.is_in_breakable_cuda_graph is missing") cp_active = getattr(importlib.import_module(CP_MODULE), "is_cp_active", None) if cp_active is None: raise RuntimeError(f"inkling_attn: {CP_MODULE}.is_cp_active is missing") cls._forward = make_forward(prev, get_attn_backend, get_model, in_breakable, frozenset(kinds), cp_active) if GATE_OFF_FOR_LOGGING: _log_once("gate_off", "gated epilogue OFF: SGLANG_KERNEL_API_LOGLEVEL is set (it reads the FA4 output buffer)") if GATE: gs = getattr(module, "gate_sink", None) if gs is None: raise RuntimeError(f"inkling_attn: {ATTN_MODULE}.gate_sink is missing (INKLING_ATTN_GATE)") if not getattr(gs, MARK, False): module.gate_sink = make_gate_sink(gs) _log_once("gate", "gated epilogue on: " + ("sliding-window and global" if GATE_ALL else "sliding-window") + " prefill visits run gate_sink inside the attention kernel") return True123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354"""CPU tests of inkling_attn's install logic (no torch, no GPU).
python3 -m unittest discover -s inkling_attn/tests (from the overlay directory) INKLING_ATTN_SGLANG_ROOT=/path/to/sglang additionally checks the patch targets of that source tree."""import osimport sysimport tempfileimport unittest
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))))
import inkling_attn # noqa: E402
class ParseLevers(unittest.TestCase): def test_values(self): self.assertEqual(inkling_attn.parse_levers(""), ()) self.assertEqual(inkling_attn.parse_levers("0"), ()) self.assertEqual(inkling_attn.parse_levers("prefill_swa"), ("prefill_swa",)) self.assertEqual(inkling_attn.parse_levers("all"), ("prefill_swa", "prefill_global")) self.assertEqual(inkling_attn.parse_levers(" prefill_global , prefill_swa,prefill_swa"), ("prefill_global", "prefill_swa")) with self.assertRaises(RuntimeError): inkling_attn.parse_levers("prefill_swa,decode")
class SourceChecks(unittest.TestCase): def _tree(self, drop=None): root = tempfile.mkdtemp() for rel, needles in inkling_attn._SOURCE_CHECKS: path = os.path.join(root, rel) os.makedirs(os.path.dirname(path), exist_ok=True) with open(path, "a", encoding="utf-8") as f: for n in needles: if n != drop: f.write(n + "\n") return root
def test_complete_tree_passes(self): inkling_attn.check_sources(self._tree())
def test_missing_needle_fails(self): needle = inkling_attn._SOURCE_CHECKS[0][1][2] with self.assertRaises(RuntimeError): inkling_attn.check_sources(self._tree(drop=needle))
@unittest.skipUnless(os.environ.get("INKLING_ATTN_SGLANG_ROOT"), "no sglang tree given") def test_real_tree(self): inkling_attn.check_sources(os.environ["INKLING_ATTN_SGLANG_ROOT"])
if __name__ == "__main__": unittest.main()123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118"""CPU check of the per-request 4/8-warp split (ops.W8_FROM): a mirror of the kernel's work-item loop and selectionblock in csrc/attn_kernel.cuh
if (p.sel_mode != 0) { pre = (long long)seq_k[b] - sq; if ((pre >= sel_keys) != (sel_mode == 2)) return; }
and of the two launches in csrc/inkling_attn_ext.cu (grid8: sel_mode 2, 128-row blocks, ceil(T/128) + n_req tiles;grid: sel_mode 1, 64-row blocks). T (rows of q) is independent of cu_seqlens_q. Checks, per head: - the union of the two launches writes exactly the physical rows the single 4-warp launch writes, each once; - every request goes entirely to the launch its unclamped prefix (seqused_k - its rows) selects.
Run: python3 overlay/inkling_attn/tests/test_w8split_cpu.py (or pytest)"""import random
def launch_rows(cu_q, seq_k, T, pt_cols, page_size, bm, sel_mode, sel_keys): """[(physical row, request)] written by one launch (one head).""" n_req = len(cu_q) - 1 tiles = (T + bm - 1) // bm + n_req rows = [] for lin in range(tiles): tile = lin b, start, sq, prev_end = -1, 0, 0, 0 for i in range(n_req): s = max(cu_q[i], prev_end) e = min(cu_q[i + 1], T) ln = e - s if e > s else 0 prev_end = max(prev_end, e) nb = (ln + bm - 1) // bm if tile < nb: b, start, sq = i, s, ln break tile -= nb if b < 0: continue sk = min(max(seq_k[b], 0), pt_cols * page_size) # used by the attention itself, not by the selection del sk if sel_mode != 0: pre = seq_k[b] - sq if (pre >= sel_keys) != (sel_mode == 2): continue m0 = tile * bm rows += [(start + r, b) for r in range(m0, min(m0 + bm, sq))] return rows
def request_rows(cu_q, T): """rows each request owns under the kernel's guards: [max(cu[i], prev_end), min(cu[i+1], T)).""" out, prev_end = [], 0 for i in range(len(cu_q) - 1): s, e = max(cu_q[i], prev_end), min(cu_q[i + 1], T) prev_end = max(prev_end, e) out.append(max(0, e - s)) return out
def check(cu_q, seq_k, T, pt_cols, page_size, w8_from): single = launch_rows(cu_q, seq_k, T, pt_cols, page_size, 64, 0, 0) r8 = launch_rows(cu_q, seq_k, T, pt_cols, page_size, 128, 2, w8_from) r4 = launch_rows(cu_q, seq_k, T, pt_cols, page_size, 64, 1, w8_from) phys = [r for r, _ in r8 + r4] assert len(phys) == len(set(phys)), "a physical row is written twice" assert sorted(r8 + r4) == sorted(single), "the split writes other rows than the single launch" lens = request_rows(cu_q, T) for b, sq in enumerate(lens): if sq == 0: continue want8 = seq_k[b] - sq >= w8_from owners = {"8" for _, rb in r8 if rb == b} | {"4" for _, rb in r4 if rb == b} assert owners == ({"8"} if want8 else {"4"}), (b, owners, want8)
def test_random(): rng = random.Random(0) for _ in range(4000): page_size = rng.choice([64, 128]) n_req = rng.randint(1, 6) sqs = [rng.choice([0, 1, 7, 63, 64, 65, 127, 128, 129, 300, 2048]) for _ in range(n_req)] w8_from = rng.choice([1, 64, 128, 1000, 131072]) pre = [rng.choice([0, 5, w8_from - 1, w8_from, w8_from + 1, 2 * w8_from, 300000]) for _ in range(n_req)] seq_k = [s + max(p, 0) for s, p in zip(sqs, pre)] if rng.random() < 0.15: seq_k[rng.randrange(n_req)] = rng.choice([0, 3]) # inconsistent metadata (sk < sq) cu = [0] for s in sqs: cu.append(cu[-1] + s) if rng.random() < 0.1 and cu[-1] > 0: cu[rng.randrange(1, len(cu))] -= rng.randint(1, 70) # non-monotone cu_seqlens: the kernel's guards apply cu = [max(0, c) for c in cu] T = max(cu) + rng.choice([0, 0, 1, 63, 200]) # q rows independent of cu_seqlens_q (padded buckets) if rng.random() < 0.1: T = max(0, max(cu) - rng.randint(1, 100)) # cu_seqlens_q beyond q: guarded by total_q pt_cols = (max(max(seq_k), 1) + page_size - 1) // page_size if rng.random() < 0.15: pt_cols = max(1, pt_cols // 4) # page table narrower than seq_k: attention clamps, selection does not check(cu, seq_k, T, pt_cols, page_size, w8_from)
def test_threshold_direction(): # one request exactly at / one below the threshold: owners must be 8 / 4 warps r8 = launch_rows([0, 100, 200], [100 + 1000, 100 + 999], 256, 64, 128, 128, 2, 1000) r4 = launch_rows([0, 100, 200], [100 + 1000, 100 + 999], 256, 64, 128, 64, 1, 1000) assert {b for _, b in r8} == {0} and {b for _, b in r4} == {1} # clamped page table: sq 16, seqused_k 256, capacity 128 keys, W8_FROM 128 -> 8 warps assert {b for _, b in launch_rows([0, 16], [256], 16, 1, 128, 128, 2, 128)} == {0}
def test_serving_shapes(): for pfx in (0, 131071, 131072, 262144, 1048576 - 8192): check([0, 8192], [8192 + pfx], 8192, 8192, 128, 131072) check([0, 100, 4196, 8192], [100 + 300000, 4096 + 7, 3996 + 131072], 8192, 8192, 128, 131072)
if __name__ == "__main__": test_random() test_threshold_direction() test_serving_shapes() print("ok")123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197# inkling_cert: certified greedy argmax of the target LM head
On greedy verify steps only the argmax of each row's 201,024 logits matters. This package reads a 6-bit copy ofthe head (358 MB) instead of pico's coded head (715 MB), bounds every logit rigorously, and runs pico's exact headGEMV only on the 16-row tiles that can hold the argmax. Every other logit is written as -inf. The stock softcap,padding mask and argmax then run unchanged and return the same token as the full head, bit for bit.
Status (2026-11-21): written, CPU-tested (21 tests), and GPU-checked on GB10 with real weights:`tools/gpu_check_cert.py` PASS, `tools/smoke_hooks.py` PASS (all hooks land on the image's sglang, cert outsidepico). Not yet run in a serving boot: the next step is `INKLING_CERT_HEAD=check` for a few thousand steps, then anA/B against `=0`.
## GPU check (2026-11-21, GB10, real head, 5,983 real LM-head rows from the CPU oracle)
| gate | result ||---|---|| 6-bit copy decodes to the quantised head (by the kernel's rule); tables finite | ok || screen accumulation error / model (C_ACC ||D|| ||x||), 512 rows x 201,024 ids | max 0.0002 || pico accumulation error / model (C_ACC ||W|| ||x||) | max 0.0004 || s - B <= pico <= s + B for every logit | 0 outside; max abs(pico - s) / B = 0.13 || certified token == full-head token (stock softcap, mask, argmax), M = 8 | 5,976 rows, 0 mismatches, 747/747 steps certified || same, M = 16 | 5,968 rows, 0 mismatches, 373/373 certified || computed tiles bit-identical to pico's full head, others -inf | 0 bad steps || `on` = 0 equals pico's full head bit for bit | ok || near-tie rows (x along W_a + W_b, norms 150-800) | 2,048 rows, 0 mismatches || duplicate head rows (1 pair in the vocab): exact tie resolves to the lower id | ok || CUDA graph replay == eager, 40 steps with `on` toggled | ok |
Candidate tiles per step: M = 8 mean 57.6, p50 29, p90 96, p99 238, max 9,639 (one flat row; still exact, justslower). M = 16: mean 105, p50 52, p99 433.
Microbench (L2 flushed with a 256 MiB read before each rep, CUDA events, median of 30):
| | M = 8 | M = 16 ||---|---:|---:|| pico full head (current `lmhead`) | 2.898 ms (247 GB/s) | 3.036 ms (236 GB/s) || certified path, median-candidate batch (18 / 30 tiles) | **1.671 ms** | **1.730 ms** || certified path, p90 batch (40 / 61 tiles) | 1.680 ms | 1.730 ms || screen alone (screen + rowmax + select) | 1.569 ms = 228 GB/s of 358 MB | 1.618 ms = 221 GB/s || `on` = 0 step (full head through the masked kernel) | 2.971 ms | 3.027 ms |
Final kernel (`gpu4.log`). Saving per certified step: -1.23 ms at c1 and -1.31 ms at c2. A persistent grid-stride screen (96-384 CTAs, xloaded once per CTA) was tried and rejected: 140 GB/s at M = 8 and 202 at M = 16, because the x loads then goahead of the weight stream. A step that is not eligible pays about +90 us overpico.
## Switch
| env | default | meaning ||---|---|---|| `INKLING_CERT_HEAD` | unset (off) | `1`: certified head on eligible steps; `check`: serve pico's full head, build the certified result beside it and count token mismatches (must stay 0); `0`: off || `INKLING_CERT_HEAD_LOG_EVERY` | 2000 | counter line every N verify steps (0 = never) || `INKLING_CERT_HEAD_CACHE` | `~/.cache/inkling-cert` | extension build cache |
The package needs `INKLING_PICO12` with `lmhead`, installed first. pico's GEMV is both the exact pass and thefallback, and the certified token must equal pico's.
Arming in `sitecustomize.py`, after the `INKLING_PICO12` block:
```python if _on("INKLING_CERT_HEAD"): # after inkling_pico12: wraps its lm-head function and reads its coded head import inkling_cert inkling_cert.install()```
`_on()` already treats `check` as on, and `install()` reads the mode itself. `scripts/launch.sh` passes thevariable through `SGLANG_ENV` (`-e INKLING_CERT_HEAD=1`); `scripts/launch.sh` sets it from `CERT_HEAD`.
## Measured before building (kill-check)
Real LM-head inputs: 5,983 rows from the CPU oracle (`engine/ref/inkling2_ref.py`, FP32). They come fromteacher-forcing the 16 speedbench greedy transcripts, rounded to BF16. The real unembedding was used. Script:`results/kbench/round2/cert/cand_count.py`. The head rows have norm 1.00 and ||x|| is about 223. The top logit has a median of50.7, and the gap to the second logit has a median of 13.6.
| screen | MB read | bound B (median) | candidate tiles / step c1 (mean, p99, max) | c2 (mean, p99) | est. ms ||---|---:|---:|---|---|---:|| INT8 per row | 471 | 2.0 | 13, 25, 26 | | 2.06 || **INT6, FP16 scale per 192** | **358** | **6.2** | **43, 236, 606** | **78, 328** | **1.59** || INT6, FP16 scale per 32 | 382 | 5.0 | 23, 92, 213 | 43, 138 | 1.68 || INT7, scale per 192 | 416 | 3.1 | 14, 37, 52 | 26, 57 | 1.82 || INT5, scale per 32 | 324 | 10.4 | 305, 1638, 2279 | | 1.52 (heavy tail) || INT4, scale per 32 | 290 | 21 | ~10k (everything) | | dead |
The estimate charges screen bytes at 235 GB/s, candidate tiles at 57 KB each at 200 GB/s, plus 50 us of smallkernels. pico's full head is 2.90 ms at 8 rows. The measured screen error is about 1.4 % of the bound, because theCauchy-Schwarz bound is far from tight. Only the very peaked logits make it work.
## Per step (M <= 16 verify rows, all in the verify CUDA graph)
| kernel | what ||---|---|| `k_screen` (12564 CTAs x 12 warps) | Computes s = x . D^T from the 6-bit copy with BF16 MMAs. Each warp covers one 192-value group and scales its partial by the group's FP16 scale. ||x_g|| is computed from the same registers. Epilogue: B, then lo/hi, then the max of lo and of hi per (row, 16-row tile) over the real vocab. A non-finite value sets a flag. || `k_rowmax` | T[m] = max lo, H[m] = max hi || `k_select` | Per tile: a mask byte, set when some row has hi >= T - delta in that tile. All tiles are set when the step is not eligible (`on` = 0), a value was non-finite, or a row fails the softcap range test. Also updates the counters. || `k_exact` | pico's `gemv16_body<kBF16X, mt 2>` on the masked CTAs. This is the code of pico's coded-head GEMV (the same file, compiled into this extension) and gives its bits. Every other CTA writes -inf. |
Then the stock code continues: `fused_softcap` in place, ids >= `vocab_size` set to -inf, and the folded greedyaccept's argmax.
## Why the token is the same (cert_math.py has the full statement)
1. **Bound.** |pico - <W_v, x>| <= C_ACC ||W_v|| ||x|| and |s - <D_v, x>| <= C_ACC ||D_v|| ||x||, where C_ACC = (K/16 * 17 + 32) 2^-23 is the tensor-core accumulation model (an assumption, measured by the GPU check; pico12's own check already gates pico at (K/16 + 32) 2^-23). Also |<W_v - D_v, x>| <= sum_g ||R_vg|| ||x_g|| (Cauchy-Schwarz per group). Every table is rounded up, and every FP32 step is inflated, so lo <= l <= hi.2. **The winner is computed.** Let w be the stock token and u the id with lo_u = T. If l_w >= l_u, then hi_w >= T. Otherwise f(l_w) >= f(l_u) with l_w < l_u, where f is the stock FP32 softcap, which is monotone only up to E = 2^-14. Then l_u - l_w <= delta = 2 * 2E / exp(-2L/30) on the range L checked on the device, so hi_w >= T - delta.3. **No -inf beats it.** f(-inf) = -30, and f(l_w) >= 30 tanh(T/30) - E > -30 under the range test (|T|, |H| up to about 160; real logits are 50-70).4. **Ties.** Computed ids hold the stock values. The set of maximisers among them therefore contains w, the lowest stock maximiser, and nothing below it. The stock argmax (lowest index) returns w.
x is finite, so every logit is finite and no NaN reaches the argmax. A non-finite screen value forces the fullhead anyway.
## When the certified path runs (`on` = 1)
The device flag is written before each verify replay by the `TargetVerifyExecutor.run_non_compact` wrapper. It is1 only when all of these hold:- `begin_static_step(bs, armed)` was called with `armed = fold_eligible`. That means a static-mode step whose in-graph folded greedy accept is used: all requests greedy, `verify_logits_adjustments_are_noop` (no penalties, logit bias, grammar mask or custom processor), and no grammar.- The batch has no `return_logprob`, no watermark candidates and no sampling-mask capture.- None of the DSpark debug observers that read the verify logits is set (checked at load; the package disables itself if one is).
`begin_step` (compact mode, idle participation) sets it to 0. Eager forwards (no graph) always compute the fullhead. The first eager call per row bucket goes through these kernels in full-fallback mode, and later eager callsgo straight to pico. Rows > 16 (c3 and up) never reach here: pico itself takes only 1-16.
### On the DFLASH worker (`dflash.py`, `SPEC=dflash2`, launch `CERT_DFLASH` / `CERT_WIDE_DFLASH`)
DFLASH has no verify epilogue: its accept runs eagerly after the target-verify graph, as the argmax of the verifylogits on greedy batches. A wrapper of `DFlashWorkerV2.forward_batch_generation` marks the step, and a wrapper of`TpModelWorker.forward_batch_generation` sets `on` right before that step's target verify to`batch_ok(batch)` and `DFlashWorkerV2._can_skip_verify_logits(batch, sampling_info)` (all greedy, no grammar,logprobs, logit adjustments or selector sample), and back to 0 right after it, so no other replay reads a stale 1.- Narrow head (<= 16 rows): it writes pico's exact logits on the candidate tiles and -inf elsewhere, so the stock argmax over the verify logits returns the certified token. Under the verify cap (`inkling_vcap` on DFLASH, `STATE.src_index`), dead rows are given their anchor's hidden row before the screen, selected on the device by `on`, so they add no candidate tiles; live rows keep their own rows and no accept reads a dead row's token.- Wide head (17..`INKLING_CERT_WIDE_MAX_ROWS` rows): the certified IDs, which the wide head returns instead of writing the logits, are looked up after each target-verify replay (`DecodeCudaGraphRunner._process_output_after_replay`, from the replayed graph's own output) and passed to `DFlashWorkerV2._accept_block` as its target prediction. A wide replay whose IDs cannot be identified stops the server; the compact ragged verify layout is refused.- Check mode (`CERT_DFLASH=check`): 34,808 rows, 0 mismatches.
## Patch points
| target | what ||---|---|| `models/inkling2.py: Inkling2LogitsProcessor._get_logits` | marks target-verify calls (`forward_mode.is_target_verify()`) || `models/inkling2.py: Inkling2ForConditionalGeneration.post_load_weights` | after pico coded the head: builds the 6-bit copy and the tables on the GPU (chunked, float64), runs the self-test (full fallback == pico bit for bit, certified argmax == full argmax on random rows at M = 8 and 16; this also loads every kernel before capture), and logs one line || `layers/quantization/unquant.py: sm12x_fp32_lm_head` | wraps pico's wrapper. It takes target-verify calls that pico would take, as long as the processor has softcap 30, no `logit_scale`, no TP gather, and `vocab_size` <= rows. Everything else goes to pico or stock. || `speculative/dspark_components/dspark_verify.py: DsparkVerifyEpilogue.begin_static_step / begin_step, TargetVerifyExecutor.run_non_compact` | the per-step device flag (above) and the periodic counter line |
Source strings are checked at `install()`, and attributes when each module is imported. A mismatch exits with 78.TP > 1 disables the package with a log line.
Coexistence:- `inkling_pico12`: required, and its wrapper sits inside ours.- `inkling_vcap`: under DSpark, independent: dead rows are still verify rows with real hidden states, and their logits are certified like the others. Under DFLASH, see above (dead rows take their anchor's row).- `inkling_draftbytes`: the draft head is not touched.
## Cost and memory
- Extra memory is 358 MB (Q 347.4, scales 4.8, residual norms 4.8, row norms 0.8) plus about 1.7 MB of buffers.- A step that is not eligible (`on` = 0: sampled, logprobs, ...) costs pico's head plus about 20-30 us. The screen and row-max kernels return at once, and the masked kernel runs every tile (pico's full head). An eligible step that fails the range test pays the screen and the full head; this is never seen on real rows.
## Reviews and logs
- GPU logs (GB10): `results/kbench/round2/cert/gpu2.log` (first PASS), `gpu3.log` (persistent variant, rejected), `gpu4.log` (final kernel).
## Files
| path | origin ||---|---|| `csrc/cert_ext.cu`, `*.py`, `tests/`, `tools/` | ours (ported in spirit from our GLM-5.3-Flash `glm_cert_head.py` / `cert_math.py`) || pico's `gemv16.cu`, `common.cuh`, `dsk.h`, `check.h` | not copied: `#include`d from `../inkling_pico12/third_party/pico` (MIT, Copyright (c) 2026 Andy Shu) |
## Checks
- CPU: `python3 -m unittest discover -s inkling_cert/tests -v` from `overlay/` (needs numpy and torch). It covers pack/unpack, the lane/MMA k-mapping of the packed layout, tables (torch vs numpy), bound coverage, adversarial screen errors, exact ties, softcap ties, padded ids, range fallback and the fill.- GPU: `python3 inkling_cert/tools/gpu_check_cert.py --model /model --hidden DIR`, where DIR holds real LM-head input rows as `.npz`. It gates the packing, the accumulation model (screen and pico vs FP64), coverage (lo <= pico <= hi for every logit), and token identity on every real row at M = 8 and 16. It also gates near-tie rows, duplicate head rows, computed tiles bit-identical to pico, `on` = 0 equal to pico, and graph replay equal to eager. It then benches.123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172"""Inkling-2-Mini on DGX Spark: certified greedy argmax of the target LM head (exact; see README.md).
INKLING_CERT_HEAD=1 | check | 0 (default: unset -> install() does nothing)
1 greedy target-verify steps (the in-graph folded greedy accept, no logprobs / grammar / penalties / logit bias / watermark / sampling masks) read a 6-bit copy of the head (358 MB) plus pico's exact head GEMV on the candidate tiles instead of pico's whole coded head (715 MB); every other step runs the head unchanged.check serve pico's full head; build the certified result beside it and count token mismatches (must be 0).
INKLING_CERT_WIDE=1 with INKLING_CERT_HEAD=1 also certifies 17–192 rowswhen the packed, unsplit inkling_wide head would serve the same call. INKLING_CERT_WIDE_MAX_ROWS largest verify batch (rows, 17..192) the wide path serves (default WIDE_MAX_ROWS_DEFAULT); larger batches run the head unchanged INKLING_CERT_WIDE_STATS=1 diagnostic: count wide outcomes (certified / unsafe / too many / off) and the candidate-tile union per batch size in the graph, logged with the counters line
Needs INKLING_PICO12 with `lmhead` armed first (pico's GEMV is the exact pass and the fallback). Other settings: INKLING_CERT_HEAD_LOG_EVERY counters line every N verify steps (default 2000, 0 = never) INKLING_CERT_HEAD_CACHE extension build cache (default ~/.cache/inkling-cert)"""
import importlib.utilimport osimport sys
STATE = {"installed": False, "mode": "0", "cfg": None}
_SOURCE_CHECKS = ( ("srt/layers/quantization/unquant.py", ("def sm12x_fp32_lm_head(", "def sm12x_fp32_lm_head_applies(")), ("srt/layers/logits_processor.py", ("sm12x_fp32_lm_head_applies(hidden_states, lm_head.weight, out)", "logits = self._compute_lm_head(")), ("srt/models/inkling2.py", ("class Inkling2LogitsProcessor(", "def _get_logits(", "fused_softcap(logits, self.shard_softcap)", "logits[..., self.config.vocab_size :] = float(\"-inf\")", "def post_load_weights(")), ("srt/speculative/dspark_components/dspark_verify.py", ("class DsparkVerifyEpilogue:", "def begin_static_step(self, bs: int, armed: bool)", "def begin_step(self, verify_lens, armed: bool)", "def run_non_compact(", "target_predict = sampling_argmax(logits).view(-1)")), ("srt/speculative/dspark_components/dspark_worker_v2.py", ("self._verify_epilogue.begin_static_step(bs, fold_eligible)", "and (sampling_info is None or sampling_info.is_all_greedy)", "and verify_logits_adjustments_are_noop(sampling_info)", "compute_spec_logprobs(")),)
_WIDE_SOURCE_CHECKS = ( ("kernels/ops/activation/softcap.py", ("x = x / softcapping_value", "x = libdevice.tanh(x)", "x = x * softcapping_value")), ("kernels/ops/speculative/dspark/dspark_accept.py", ("target_predict: Optional[torch.Tensor] = None", "if target_predict is None:")), ("srt/speculative/dspark_components/dspark_verify.py", ("AcceptGreedy.execute(", "target_logits=logits", "logits=out.next_token_logits")), ("srt/model_executor/runner/decode_cuda_graph_runner.py", ("class DecodeCudaGraphRunner(", "def execute(", "output = self.backend.replay(")),)
UNQUANT = "sglang.srt.layers.quantization.unquant"MODEL = "sglang.srt.models.inkling2"VERIFY = "sglang.srt.speculative.dspark_components.dspark_verify"GRAPH_RUNNER = "sglang.srt.model_executor.runner.decode_cuda_graph_runner"
def _log(msg): sys.stderr.write(f"[inkling_cert pid={os.getpid()}] {msg}\n") sys.stderr.flush()
# Largest verify batch (rows) the wide certified head serves; larger batches run the head unchanged. GB10 sweep# 2026-11-24 (tools/gpu_check_certwide.py, CW_ROWS 64..192, real head, captured rows): at 129-192 rows the screen# runs the 12-row-group kernel at 1 CTA/SM (143 registers) and takes 4.85-5.92 ms, so even a fully certified batch# is 0.09-0.19 ms slower than the dense head at 136/160/176/192 rows (+0.01 at 144); at 128 rows (2 CTAs/SM) the# certified head wins 1.65 ms and loses 2.70 ms on an overflow (break-even at a 38 % fallback rate).WIDE_MAX_ROWS_DEFAULT = 128
def parse_mode(value): v = (value or "").strip().lower() if v in ("", "0", "off", "none", "false", "no"): return "0" if v in ("1", "on", "true", "yes"): return "1" if v == "check": return "check" raise RuntimeError(f"inkling_cert: INKLING_CERT_HEAD={value!r}: 1, check or 0")
def config_from_env(env): raw = env.get("INKLING_CERT_HEAD_LOG_EVERY", "").strip() try: every = int(raw) if raw else 2000 except ValueError as exc: raise RuntimeError(f"inkling_cert: INKLING_CERT_HEAD_LOG_EVERY={raw!r}") from exc cache = env.get("INKLING_CERT_HEAD_CACHE", "").strip() or os.path.join(os.path.expanduser("~"), ".cache", "inkling-cert") wide = parse_mode(env.get("INKLING_CERT_WIDE", "")) if wide == "check": raise RuntimeError("inkling_cert: INKLING_CERT_WIDE accepts 0 or 1") raw = env.get("INKLING_CERT_WIDE_MAX_ROWS", "").strip() try: max_rows = int(raw) if raw else WIDE_MAX_ROWS_DEFAULT except ValueError as exc: raise RuntimeError(f"inkling_cert: INKLING_CERT_WIDE_MAX_ROWS={raw!r}") from exc if not 17 <= max_rows <= 192: raise RuntimeError(f"inkling_cert: INKLING_CERT_WIDE_MAX_ROWS={max_rows} outside 17..192") stats = parse_mode(env.get("INKLING_CERT_WIDE_STATS", "")) if stats == "check": raise RuntimeError("inkling_cert: INKLING_CERT_WIDE_STATS accepts 0 or 1") return {"log_every": max(0, every), "cache_dir": cache, "wide": wide == "1", "wide_max_rows": max_rows, "wide_stats": stats == "1"}
def check_sources(root=None, wide=False): if root is None: spec = importlib.util.find_spec("sglang") if spec is None or not spec.submodule_search_locations: raise RuntimeError("inkling_cert: the sglang package is not importable") root = list(spec.submodule_search_locations)[0] checks = _SOURCE_CHECKS + (_WIDE_SOURCE_CHECKS if wide else ()) for rel, needles in checks: path = os.path.join(root, rel) try: with open(path, encoding="utf-8") as f: text = f.read() except OSError as exc: raise RuntimeError(f"inkling_cert: patch target {path} is missing") from exc missing = [n for n in needles if n not in text] if missing: raise RuntimeError(f"inkling_cert: patch target {path} lacks {missing}")
def _callback(name): def run(module): try: from . import patches
if patches.STATE["cfg"] is None: patches.STATE.update(mode=STATE["mode"], cfg=STATE["cfg"], log=_log) except BaseException as exc: # noqa: BLE001 _log(f"FATAL importing the patches: {exc!r}") os._exit(78) patches._guarded(getattr(patches, name))(module)
run.__name__ = f"inkling_cert.{name}" return run
def install(env=None, sglang_root=None): """Arm INKLING_CERT_HEAD. Idempotent; returns the mode ("0" = nothing armed).""" if STATE["installed"]: return STATE["mode"] env = os.environ if env is None else env mode = parse_mode(env.get("INKLING_CERT_HEAD", "")) STATE["installed"] = True STATE["mode"] = mode if mode == "0": return mode pico = sys.modules.get("inkling_pico12") if pico is None or "lmhead" not in tuple(pico.STATE.get("levers", ())): raise RuntimeError("inkling_cert: INKLING_CERT_HEAD needs inkling_pico12 installed first with `lmhead`") STATE["cfg"] = config_from_env(env) if STATE["cfg"]["wide"]: wide = sys.modules.get("inkling_wide") if mode != "1" or wide is None or "lmhead" not in tuple(wide.STATE.get("levers", ())): raise RuntimeError("inkling_cert: INKLING_CERT_WIDE needs INKLING_CERT_HEAD=1 and INKLING_WIDE with lmhead") check_sources(sglang_root, wide=STATE["cfg"]["wide"]) from . import _hook
for module, cb in ((UNQUANT, "patch_unquant"), (MODEL, "patch_model"), (VERIFY, "patch_verify")): _hook.when_imported(module, _callback(cb)) if STATE["cfg"]["wide"]: _hook.when_imported(GRAPH_RUNNER, _callback("patch_graph_runner")) # DFLASH worker (SPEC=dflash2): per-step arming on greedy verify steps (dflash.py); inert under DSpark _hook.when_imported("sglang.srt.speculative.dflash_worker_v2", _callback("patch_dflash_worker")) _hook.when_imported("sglang.srt.managers.tp_worker", _callback("patch_dflash_tp_worker")) return mode123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778"""Post-import hooks: run a callback right after a module finishes executing.
The overlay must not import sglang (and torch) in every Python process that thecontainer starts, so patches are attached to their target modules lazily. If thetarget module is already imported when the hook is registered, the callback runsimmediately. A callback that raises makes the import of its target fail."""
import importlib.abcimport sysimport threading
_lock = threading.RLock()_callbacks: dict[str, list] = {}_finder = None
class _Loader(importlib.abc.Loader): def __init__(self, inner, name): self._inner = inner self._name = name
def create_module(self, spec): create = getattr(self._inner, "create_module", None) return create(spec) if create is not None else None
def exec_module(self, module): self._inner.exec_module(module) _run(self._name, module)
def __getattr__(self, attr): # get_source, get_filename, is_package, ... for inspect / linecache. return getattr(self._inner, attr)
class _Finder(importlib.abc.MetaPathFinder): def __init__(self): self._busy = set()
def find_spec(self, fullname, path, target=None): if fullname not in _callbacks or fullname in self._busy: return None self._busy.add(fullname) try: spec = None for finder in sys.meta_path: if finder is self or not hasattr(finder, "find_spec"): continue spec = finder.find_spec(fullname, path, target) if spec is not None: break finally: self._busy.discard(fullname) if spec is None or spec.loader is None: return None spec.loader = _Loader(spec.loader, fullname) return spec
def _run(name, module): with _lock: callbacks = _callbacks.pop(name, []) for callback in callbacks: callback(module)
def when_imported(name, callback): """Call callback(module) once module `name` has been imported.""" global _finder with _lock: module = sys.modules.get(name) if module is None: _callbacks.setdefault(name, []).append(callback) if _finder is None: _finder = _Finder() sys.meta_path.insert(0, _finder) return callback(module)123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102"""Build (or reuse) the inkling_cert CUDA extension with torch.utils.cpp_extension.
The only source is csrc/cert_ext.cu; it #includes pico's gemv16.cu from inkling_pico12's vendored copy(../inkling_pico12/third_party/pico, MIT, Andy Shu), so the exact pass is compiled from the very file the`lmhead` GEMV is built from. Flags are pico's. The build directory is <cache>/<tag>, <tag> a hash of every sourceand header, the flags, torch's and CUDA's versions. <cache> = INKLING_CERT_CACHE (default ~/.cache/inkling-cert).
python3 -m inkling_cert.build # build now (in the container, no GPU needed); prints the path"""
import hashlibimport osimport sysimport time
HERE = os.path.dirname(os.path.abspath(__file__))PICO = os.path.join(os.path.dirname(HERE), "inkling_pico12", "third_party", "pico")SOURCES = (os.path.join(HERE, "csrc", "cert_ext.cu"),)HEADERS = ( os.path.join(HERE, "csrc", "screen6.cuh"), os.path.join(HERE, "csrc", "certwide_screen.cuh"), os.path.join(PICO, "kernels", "gemv16.cu"), os.path.join(PICO, "kernels", "dsk.h"), os.path.join(PICO, "kernels", "common.cuh"), os.path.join(PICO, "common", "check.h"),)NAME = "inkling_cert_ext"_UNDEF = ( "-U__CUDA_NO_HALF_OPERATORS__", "-U__CUDA_NO_HALF_CONVERSIONS__", "-U__CUDA_NO_BFLOAT16_CONVERSIONS__", "-U__CUDA_NO_HALF2_OPERATORS__",)
def default_cache_dir(): return os.path.join(os.path.expanduser("~"), ".cache", "inkling-cert")
def cuda_flags(std="c++20", arch="121a"): return [f"-gencode=arch=compute_{arch},code=sm_{arch}", "-O3", f"-std={std}", "--expt-relaxed-constexpr", "-lineinfo", *_UNDEF]
def build_tag(flags, torch_version, cuda_version): h = hashlib.sha256() for path in SOURCES + HEADERS: with open(path, "rb") as f: h.update(os.path.basename(path).encode() + b"\0" + f.read() + b"\0") h.update("\0".join(flags).encode()) h.update(f"\0{torch_version}\0{cuda_version}".encode()) return h.hexdigest()[:16]
_EXT = NoneINFO = {}
def load(cache_dir=None, std="c++20", arch="121a", verbose=False): global _EXT if _EXT is not None: return _EXT import torch from torch.utils import cpp_extension
missing = [p for p in SOURCES + HEADERS if not os.path.isfile(p)] if missing: raise RuntimeError(f"inkling_cert: sources missing (inkling_pico12 must sit next to inkling_cert): {missing}") flags = cuda_flags(std, arch) tag = build_tag(flags, torch.__version__, torch.version.cuda) build_dir = os.path.join(cache_dir or default_cache_dir(), tag) os.makedirs(build_dir, exist_ok=True) cached = any(f.endswith(".so") and f.startswith(NAME) for f in os.listdir(build_dir)) t0 = time.monotonic() try: ext = cpp_extension.load(name=NAME, sources=list(SOURCES), extra_cuda_cflags=flags, extra_include_paths=[PICO], build_directory=build_dir, verbose=verbose) except Exception as exc: # noqa: BLE001 raise RuntimeError(f"inkling_cert: building the extension in {build_dir} failed: {exc}") from exc for attr in ("screen", "exact", "prepare_certwide", "screen_wide", "screen_wide_info", "debug_select_wide"): if not callable(getattr(ext, attr, None)): raise RuntimeError(f"inkling_cert: extension in {build_dir} lacks {attr}()") INFO.update(build_dir=build_dir, cached=cached, seconds=time.monotonic() - t0, tag=tag) _EXT = ext return ext
def main(argv=None): import argparse
p = argparse.ArgumentParser(description=__doc__.splitlines()[0]) p.add_argument("--cache", default=os.environ.get("INKLING_CERT_CACHE") or default_cache_dir()) p.add_argument("--verbose", action="store_true") a = p.parse_args(argv) load(a.cache, verbose=a.verbose) print(f"inkling_cert extension {'reused' if INFO['cached'] else 'built'} in {INFO['seconds']:.1f} s: " f"{INFO['build_dir']}") return 0
if __name__ == "__main__": sys.exit(main())123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163"""NumPy model of the certified greedy LM-head argmax (what cert_ext.cu computes), for the CPU tests and as thestatement of the argument. No torch, no sglang.
Stock pipeline (the reference the certificate must reproduce), per verify row m: l = pico's FP32 head GEMV of x_m (inkling_pico12 `lmhead`), f(l) = fl(fl(tanh(fl(l / c))) * c) (stock softcap, c = 30), y_v = f(l_v) for v < v_real and -inf for the padded ids, token = the lowest v with y_v = max y (the stock argmax kernel's tie rule; with finite x every l is finite, so there is no NaN).
Certified pipeline: screen s_v ~ <D_v, x> (6-bit copy), B_v = sum_g Rt[g, v] ||x_g|| + CN Nv[v] ||x||, lo = s - B - slop, hi = s + B + slop; T = max_{v < v_real} lo_v; H = max hi. select tile (16 ids) is computed iff some row has a tile member with hi >= T - delta, where delta (from T, H) makes every pair a < b in [T - DMAX, H] with f(a) >= f(b) satisfy b - a <= delta. Not certifiable (all tiles computed): the step is not eligible, a non-finite value, or the range test fails. exact computed tiles hold pico's l (the same kernel body: the same bits); every other id holds -inf. Then the stock softcap, padding mask and argmax run unchanged.
Why the token is the same. (1) |acc - <W_v, x>| and |s - <D_v, x>| are both <= C_ACC * N_v * ||x|| (accumulationmodel below; flushed subnormal inputs or products add at most K * 2^-126 * (||W_v||_1 + ||x||_1), covered by theabsolute slop while ||x|| <= 2^20, which the screen checks) and |<W_v - D_v, x>| <= sum_g ||R_vg|| ||x_g||(Cauchy-Schwarz per group), so lo_v <= l_v <= hi_v. (2) Let w be the stock token and u the id with lo_u = T, soT <= l_u <= hi_u <= H, and f(l_w) >= f(l_u) with |f - g| <= E, g = c tanh(. / c) increasing. If l_w >= l_u thenhi_w >= l_w >= l_u >= T. Otherwise g(l_u) - g(l_w) <= 2E. Every y in [l_u - DMAX, l_u] has |y| <= L = max(|T| + DMAX,|H|) and g' = sech^2(y / c) >= exp(-2L / c) there; if l_u - l_w > DMAX then g(l_u) - g(l_w) >= DMAX exp(-2L / c)>= delta exp(-2L / c) = 4E > 2E (the device checks delta <= DMAX), a contradiction; so l_u - l_w <= DMAX and then(l_u - l_w) exp(-2L / c) <= 2E, i.e. l_u - l_w <= delta / 2. Either way hi_w >= l_w >= T - delta: w's tile iscomputed. (3) Every other id holds -inf, f(-inf) = -c, and y_w >= f(l_u) >= g(T) - E >= -c + c exp(-2L / c) - E > -c(the device checks c exp(-2L / c) > 8E), so no uncomputed id reaches the maximum. (4) Computed ids hold the stockvalues, so the maximum and the set of ids attaining it among computed ids are the stock ones restricted to computedids, and that set contains w, the lowest stock maximiser. Hence the stock argmax returns w on the certified buffer.E = 2^-14 covers Triton's div.full (<= 2 ulp), libdevice tanhf (<= 2 ulp) and the final multiply for every |l|(about 2.5e-5 at |f| ~ 30; tanhf saturates exactly to +-1 for large |l|).
Accumulation model (an ASSUMPTION about the tensor cores, validated on the GPU): products of BF16 values are exact inFP32, and each chained m16n8k16 MMA step adds at most 17 rounding errors of one FP32 ulp of the running magnitude(Fasi, Higham, Mikaitis, Pranesh 2021); with K / 16 chained steps and the cross-warp FP32 sums this givesC_ACC = (K / 16 * 17 + 32) * 2^-23 per unit of sum |w_k x_k| <= ||w|| ||x||. inkling_pico12's GPU check alreadygates pico's head against FP64 with the tighter (K / 16 + 32) * 2^-23; tools/gpu_check_cert.py measures both thescreen and the exact pass against FP64 and against this bound."""
import math
import numpy as np
K = 2304GROUP = 192NGROUPS = K // GROUPTILE = 16QMAX = 31C_ACC = (K / 16 * 17 + 32) * 2.0 ** -23CN = 2.0 * C_ACC # exact path + screenCAP = 30.0 # final_logit_softcappingE_SOFTCAP = 2.0 ** -14 # |stock f(l) - c tanh(l / c)| (div.full + libdevice tanhf + one multiply: ~2.5e-5)TWO_E = 2.0 * E_SOFTCAPDMAX = 16.0INFL = 1.0 + 2.0 ** -16X_ABS = 2.0 ** -58 # covers squares of tiny activations that underflow in FP32
def f32(a): return np.asarray(a, dtype=np.float32)
def bf16_round(a): u = np.ascontiguousarray(a, dtype=np.float32).view(np.uint32).astype(np.uint64) r = ((u >> 16) & 1) + 0x7FFF return ((u + r) >> 16 << 16).astype(np.uint32).view(np.float32)
def round_up_f16(x): h = np.asarray(x, dtype=np.float64).astype(np.float16) bump = h.astype(np.float64) < x return np.where(bump, np.nextafter(h, np.float16(np.inf)), h).astype(np.float16)
def round_up_f32(x): f = np.asarray(x, dtype=np.float64).astype(np.float32) bump = f.astype(np.float64) < x return np.where(bump, np.nextafter(f, np.float32(np.inf)), f).astype(np.float32)
def quantize(W): """W [V, K] -> (q int8, sc fp16 [V, NGROUPS], D float64).""" V = W.shape[0] w = W.astype(np.float64).reshape(V, NGROUPS, GROUP) amax = np.abs(w).max(-1) sc = round_up_f16(amax / QMAX) s = sc.astype(np.float64) q = np.where(s[..., None] > 0, np.clip(np.rint(w / np.where(s > 0, s, 1)[..., None]), -QMAX, QMAX), 0) return q.reshape(V, K).astype(np.int8), sc, (q * s[..., None]).reshape(V, K)
def tables(W, D): V = W.shape[0] R = (W.astype(np.float64) - D).reshape(V, NGROUPS, GROUP) rt = round_up_f16(np.sqrt((R ** 2).sum(-1)) * (1 + 2.0 ** -40)) nv = round_up_f32(np.maximum(np.linalg.norm(W.astype(np.float64), axis=1), np.linalg.norm(D, axis=1)) * (1 + 2.0 ** -40)) return rt, nv
def screen(x, D, rt, nv, v_real, s_err=None): """-> (lo, hi) float32 [M, V], mirrors the kernel epilogue. s_err: an injected screen error (tests).""" M = x.shape[0] x64 = x.astype(np.float64) s = x64 @ D.T if s_err is not None: s = s + s_err s = f32(s) xg2 = f32((x64.reshape(M, NGROUPS, GROUP) ** 2).sum(-1)) xg2 = f32(np.where(xg2 < 2.0 ** -126, 0.0, xg2)) # worst case: everything below the normal range is lost xg = f32(np.sqrt(xg2) * np.float32(INFL) + np.float32(X_ABS)) xn = f32(np.sqrt(xg2.sum(-1, dtype=np.float32)) * np.float32(INFL) + np.float32(4 * X_ABS)) b = f32(xg.astype(np.float64) @ rt.astype(np.float64).T) b = f32((b * np.float32(INFL) + np.float32(CN) * nv[None, :] * xn[:, None]) * np.float32(INFL)) slop = f32((np.abs(s) + b) * np.float32(2.0 ** -20) + np.float32(1e-30)) lo, hi = f32(s - b - slop), f32(s + b + slop) lo[:, v_real:] = -np.inf hi[:, v_real:] = -np.inf return lo, hi
def select(lo, hi, on=True, bad=False): """-> (tile mask bool [V/16], certified bool). Mirrors k_rowmax + k_select.""" M, V = lo.shape T, H = lo.max(1), hi.max(1) ht = hi.reshape(M, V // TILE, TILE).max(-1) full = (not on) or bad thr = np.empty(M, np.float32) for m in range(M): L = max(abs(float(T[m])) + DMAX, abs(float(H[m]))) ex = math.exp(-2.0 * L / CAP) delta = 2.0 * TWO_E / max(ex, 1e-30) ok = math.isfinite(T[m]) and math.isfinite(H[m]) and L < 1e4 and delta <= DMAX and CAP * ex > 4 * TWO_E full |= not ok thr[m] = T[m] - (delta if ok else 0.0) if full: return np.ones(V // TILE, bool), False return (ht >= thr[:, None]).any(0), True
def softcap(l): """The stock softcap in FP32 (division, tanh, multiply each rounded once).""" l = f32(l) with np.errstate(invalid="ignore", over="ignore"): return f32(f32(np.tanh(f32(l / np.float32(CAP)))) * np.float32(CAP))
def stock_token(l, v_real, f=softcap): y = f(l) y[..., v_real:] = -np.inf return y.argmax(-1) # numpy argmax: first maximum = lowest id (no NaN here)
def certified_buffer(l, mask): buf = np.full_like(l, -np.inf, dtype=np.float32) cols = np.repeat(mask, TILE) buf[:, cols] = l[:, cols] return buf
def certified_token(l, mask, v_real, f=softcap): return stock_token(certified_buffer(l, mask), v_real, f)123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140"""Certified packed head for 17–192 activation rows. The public result is token IDs."""
import threading
import torch
from . import cert_math, quant
MIN_ROWS = 17MAX_ROWS = 192MAX_TILES = 2048PARTS = 16# Give each path 2 * C_ACC to cover the compounded rounding model.CN = 4 * cert_math.C_ACCMAX_WEIGHT_NORM = 2.0**28ABS_SLOP = 2.0**-78
CERTIFIED, UNSAFE, TOO_MANY, OFF, INVALID = range(5)
def weight_radius(tables): """Upper bound on ||W-D|| + CN * max(||W||, ||D||), one FP32 value per vocab ID.""" nv = tables["nv"] if not bool((nv <= MAX_WEIGHT_NORM).all()): raise ValueError("inkling_certwide: weight norms outside the supported range") r = tables["rt"].double().square().sum(0).sqrt() + CN * nv.double() return quant.round_up_f32(r * (1.0 + 2.0**-40)).contiguous()
class CertWide: """Caller-owned fallback logit buffer. Launches and scratch are fixed under graph capture.
All serving replays and gate writes use one host thread and CUDA stream. Standalone callers must maintain the same ordering through reduction. """
def __init__(self, screen_ext, wide_ext, entry, tables, capacity=MAX_TILES): from . import certwide_reduce
self.screen_ext, self.wide_ext, self.entry = screen_ext, wide_ext, entry self.reduce = certwide_reduce.reduce self.q, self.sc = tables["q"], tables["sc"] self.radius = weight_radius(tables) self.V = entry.n if entry.k != cert_math.K or self.V <= 0 or self.V % cert_math.TILE: raise ValueError("inkling_certwide: invalid packed head geometry") self._replay_owner = None self._owner_lock = threading.Lock() self.ntiles = self.V // cert_math.TILE self.capacity = min(int(capacity), self.ntiles) if self.capacity < 1: raise ValueError("inkling_certwide: tile capacity must be positive") device = self.q.device self.lower = torch.empty((MAX_ROWS, self.ntiles), dtype=torch.float32, device=device) self.upper = torch.empty_like(self.lower) self.norms = torch.empty(MAX_ROWS, dtype=torch.float32, device=device) self.threshold = torch.empty_like(self.norms) self.state = torch.empty(2, dtype=torch.int32, device=device) self.tiles = torch.empty(self.capacity, dtype=torch.int32, device=device) self.groups = torch.empty_like(self.tiles) self.sparse = torch.empty((MAX_ROWS, self.capacity * cert_math.TILE), dtype=torch.float32, device=device) self.partial = torch.empty((MAX_ROWS, PARTS), dtype=torch.int64, device=device) self.empty = torch.empty(0, dtype=torch.float32, device=device) self.stats = None # optional [MAX_ROWS + 1, 5 outcomes, UNION_BUCKETS] int64 (enable_stats) self.counting = True # False while the startup / reload self-tests run screen_ext.prepare_certwide(device.index) wide_ext.prepare_certwide(device.index)
def require_replay_stream(self): stream = torch.cuda.current_stream(self.q.device) owner = (threading.current_thread(), stream) with self._owner_lock: if self._replay_owner is None: self._replay_owner = owner elif self._replay_owner != owner: raise RuntimeError("inkling_certwide: verify gate and replay must use the owning thread and CUDA stream")
def screen(self, x, on, v_real, debug=None, *, three_stages=False): s, lo, hi = (self.empty,) * 3 if debug is None else debug self.screen_ext.screen_wide( x, self.q, self.sc, self.radius, self.V, v_real, self.norms, self.lower, self.upper, self.threshold, on, self.state, self.tiles, self.groups, s, lo, hi, cert_math.CAP, cert_math.TWO_E, cert_math.DMAX, three_stages, )
def exact(self, x, fallback, v_real, settings): self.wide_ext.certwide_exact( x, self.entry.buf, fallback, self.sparse[:x.shape[0]], self.state, self.tiles, self.groups, self.entry.n, v_real, settings.mt, settings.mg, settings.pfd, )
def run(self, x, fallback, on, v_real, settings, *, debug=None, capped=None, three_stages=False): """Return [M] int64 IDs. On fallback only, also write capped, masked logits.""" m = x.shape[0] if capped is not None and (capped.shape != self.sparse.shape or capped.device != self.sparse.device or capped.dtype != self.sparse.dtype or not capped.is_contiguous()): raise ValueError("inkling_certwide: invalid capped debug buffer") ids = torch.empty(m, dtype=torch.int64, device=x.device) self.screen(x, on, v_real, debug, three_stages=three_stages) self.exact(x, fallback, v_real, settings) self.reduce(fallback, self.sparse, self.state, self.tiles, self.groups, self.partial, ids, v_real, cert_math.CAP, capped) if self.stats is not None and self.counting: self._count(m) return ids
UNION_STEP = 256 # tiles per union bucket UNION_BUCKETS = 17 # the last one holds unions >= 16 * UNION_STEP (> the 2048-tile capacity)
def enable_stats(self): """Diagnostic counters, written inside the graph after each run (three small launches, no sync).""" device = self.state.device self.stats = torch.zeros((MAX_ROWS + 1, 5, self.UNION_BUCKETS), dtype=torch.int64, device=device) self._one = torch.ones(1, dtype=torch.int64, device=device)
def _count(self, m): reason = self.state[0:1].clamp(0, 4).long() # CERTIFIED, UNSAFE, TOO_MANY, OFF, INVALID bucket = torch.div(self.state[1:2], self.UNION_STEP, rounding_mode="floor").clamp_(0, self.UNION_BUCKETS - 1) self.stats[m].view(-1).index_add_(0, reason * self.UNION_BUCKETS + bucket.long(), self._one)
def describe_stats(self, host): names = ("cert", "unsafe", "too_many", "off", "invalid") parts = [] for m in range(host.shape[0]): per = host[m] if int(per.sum()) == 0: continue counts = " ".join(f"{names[r]}={int(per[r].sum())}" for r in range(5) if int(per[r].sum())) union = ",".join(f"{b * self.UNION_STEP}+:{int(per[:3, b].sum())}" for b in range(self.UNION_BUCKETS) if int(per[:3, b].sum())) parts.append(f"M={m}: {counts} (union tiles {union})") return "; ".join(parts) if parts else "none"
def refresh(self, entry, tables): # The graph captures the table and packed-buffer addresses. if (entry.n != self.V or entry.k != self.entry.k or self.entry.buf.data_ptr() != entry.buf.data_ptr()): raise ValueError("inkling_certwide: reload changed a graph buffer address") self.radius.copy_(weight_radius(tables)) self.entry = entry1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374"""CPU model of the wide certificate's intervals and candidate selection."""
import numpy as np
from . import cert_math as cmfrom .certwide import ABS_SLOP, CN, MAX_WEIGHT_NORM
def weight_radius(rt, nv): """rt is [vocab, 12] and already rounded up, as is nv [vocab].""" if not np.all(nv <= MAX_WEIGHT_NORM): raise ValueError("weight norms outside the supported range") radius = np.sqrt(np.square(rt.astype(np.float64)).sum(-1)) + CN * nv.astype(np.float64) return cm.round_up_f32(radius * (1 + 2.0**-40))
def activation_norm(x): x64 = x.astype(np.float64) norm = np.linalg.norm(x64, axis=-1).astype(np.float32) return norm * np.float32(cm.INFL) + np.float32(4 * cm.X_ABS)
def intervals(screen, norm, radius): """Reference intervals for FP32 screen logits. Absolute slop covers FTZ.""" b = cm.round_up_f32(norm.astype(np.float64)[:, None] * radius.astype(np.float64)[None, :]) s = screen.astype(np.float32, copy=False) e = (np.abs(s) + b) * np.float32(2.0**-20) + np.float32(ABS_SLOP) return s - b - e, s + b + e
def derivative_lower(L): """CPU model of the device's downward-rounded repeated squaring.""" z = np.nextafter(2 * L.astype(np.float64) / cm.CAP, np.inf) base = np.nextafter(1 - np.minimum(z, 32) * 2.0**-20, -np.inf) for _ in range(20): base = np.nextafter(base * base, -np.inf) return np.where(z <= 32, -cm.round_up_f32(-base), np.float32(0))
def thresholds(T, H): """Return an inclusive cutoff and a safe flag per row.""" with np.errstate(invalid="ignore", divide="ignore", under="ignore", over="ignore"): L = np.maximum(cm.round_up_f32(np.abs(T.astype(np.float64)) + cm.DMAX), np.abs(H)) slope = derivative_lower(L) delta = cm.round_up_f32(2.0 * cm.TWO_E / slope.astype(np.float64)) rounded_down = -cm.round_up_f32(delta.astype(np.float64) - T.astype(np.float64)) ok = np.isfinite(T) & np.isfinite(H) & (delta <= cm.DMAX) return rounded_down, ok
def select(lo, hi, v_real, capacity, norm, on=True): """Return (row mask, union mask, wide activation-group mask, sparse route).""" m, v = lo.shape ht = hi.copy() ht[:, v_real:] = -np.inf ht = ht.reshape(m, v // cm.TILE, cm.TILE).max(-1) thr, ok = thresholds(lo[:, :v_real].max(-1), ht.max(-1)) rows = (ht >= thr[:, None]) & (np.arange(v // cm.TILE) * cm.TILE < v_real) union = rows.any(0) groups = np.zeros(v // cm.TILE, np.uint16) for start in range(0, m, 16): groups |= rows[start:start + 16].any(0).astype(np.uint16) << (start // 16) count = int(union.sum()) sparse = on and np.all(ok & (norm <= 2.0**20)) and 0 < count <= capacity and count < len(union) return rows, union, groups, bool(sparse)
def compact_token(logits, v_real, groups, f=cm.softcap): """Model the CUDA reduction, including its lowest-ID rule and NaN handling.""" m, _ = logits.shape tile = np.arange(v_real) // cm.TILE live = (groups[tile][None, :] & (1 << (np.arange(m) // 16))[:, None]) != 0 capped = f(logits[:, :v_real]) return np.where(live & ~np.isnan(capped), capped, -np.inf).argmax(-1)1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768"""Device-gated softcap and argmax over the compact or fallback wide head."""
import triton as trimport triton.language as tlfrom triton.language.extra import libdevice
@tr.jitdef _key(value, col): # Match the stock CUDA argmax. NaNs never win and both signs of zero tie. value = tl.where(value == value, value, -float("inf")) bits = tl.where(value == 0.0, 0, value.to(tl.uint32, bitcast=True)).to(tl.uint32) ordered = tl.where((bits & 0x80000000) != 0, ~bits, bits ^ 0x80000000) return (ordered.to(tl.uint64) << 32) | (~col.to(tl.uint32)).to(tl.uint64)
@tr.jitdef _partials(Dense, Sparse, State, Tiles, Groups, Partial, Capped, cap, N: tl.constexpr, REAL: tl.constexpr, SLOTS: tl.constexpr, PARTS: tl.constexpr, BLOCK: tl.constexpr, EMIT: tl.constexpr): row = tl.program_id(0) row64 = row.to(tl.int64) part = tl.program_id(1) best = tl.full((BLOCK,), 0, tl.uint64) if tl.load(State) == 0: count = tl.load(State + 1) * 16 for base in range(part * BLOCK, count, PARTS * BLOCK): idx = base + tl.arange(0, BLOCK) tile = tl.load(Tiles + idx // 16, idx < count, other=0) gr = tl.load(Groups + idx // 16, idx < count, other=0) col = tile * 16 + idx % 16 valid = ((gr >> (row // 16)) & 1) != 0 valid = valid & (idx < count) & (col < REAL) x = tl.load(Sparse + row64 * (SLOTS * 16) + idx, valid, other=0) # Same Triton FP32 division, libdevice tanh, and multiply as # sglang.kernels.ops.activation.softcap (dynamic FP32 cap). y = libdevice.tanh(x / cap) * cap if EMIT: tl.store(Capped + row64 * (SLOTS * 16) + idx, y, valid) best = tl.maximum(best, tl.where(valid, _key(y, col), 0)) else: # Ineligible replays can have consumers of logits after the graph. # Publish the normal capped and padded output for every fallback. for base in range(part * BLOCK, N, PARTS * BLOCK): col = base.to(tl.int64) + tl.arange(0, BLOCK) ptr = Dense + row64 * N + col x = tl.load(ptr, col < N, other=0) y = libdevice.tanh(x / cap) * cap y = tl.where(col < REAL, y, -float("inf")) tl.store(ptr, y, col < N) best = tl.maximum(best, tl.where(col < REAL, _key(y, col), 0)) tl.store(Partial + row * PARTS + part, tl.max(best, 0))
@tr.jitdef _finish(Partial, Out, PARTS: tl.constexpr): row = tl.program_id(0) bitkey = tl.max(tl.load(Partial + row * PARTS + tl.arange(0, PARTS)).to(tl.uint64), 0) tl.store(Out + row, (~bitkey.to(tl.uint32)).to(tl.int64))
def reduce(dense, sparse, state, tiles, groups, partial, ids, v_real, cap, capped=None): parts = partial.shape[1] _partials[(ids.numel(), parts)]( dense, sparse, state, tiles, groups, partial, sparse if capped is None else capped, cap, dense.shape[1], v_real, tiles.numel(), parts, 512, capped is not None, num_warps=4, ) _finish[(ids.numel(),)](partial, ids, parts, num_warps=1)123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549// inkling_cert: certified greedy argmax of the target LM head (FP32 logits) on GB10. Ours, except the exact pass:// it runs pico's coded-head GEMV body (gemv16_body, kBF16X; pico by Andy Shu, MIT, vendored by inkling_pico12 in// third_party/pico and compiled into this extension from that same copy) on the CTAs a device mask selects.//// Per step, for the M <= 16 verify rows x [M][K] (K = 2304) and the V-row head (V % 16 == 0):// screen s = x . D^T from a 6-bit copy D of the head (q in [-31, 31], one FP16 scale per row and 192-value group),// the bound B = sum_g Rt[g][v] ||x_g|| + CN * Nv[v] ||x|| (Rt: residual group norms, Nv: max(||W_v||, ||D_v||),// both rounded up), lo / hi = s -+ (B + slop); per pico CTA tile of 16 vocab rows and per row m: the max of lo// and of hi over the tile's real-vocab rows (lt / ht); a non-finite s or B sets flags[1].// rowmax T[m] = max lo, H[m] = max hi over all tiles.// select per tile: mask = 1 if the step is not certifiable (on == 0, flags[1], a row outside the softcap range),// else OR over rows of (ht[m][tile] >= T[m] - delta[m]); counters.// exact pico's head GEMV for the masked tiles (its own arithmetic, the bits of the full call); every other tile's// outputs are set to -inf.// No host sync, no allocation, fixed grids: CUDA-graph safe. The bound and its proof: ../README.md, ../cert_math.py.#include <torch/extension.h>
#include <ATen/cuda/CUDAContext.h>#include <c10/cuda/CUDAException.h>#include <c10/cuda/CUDAGuard.h>#include <cuda_fp16.h>#include <cuda_runtime.h>
#include <cstdint>#include <tuple>#include <type_traits>
#include "kernels/gemv16.cu" // pico (MIT): gemv16_body, mma_bf16, streaming loads (this TU's own copy)
#include "screen6.cuh"#include "certwide_screen.cuh"
namespace cert {
using namespace screen6;
template <int RB>__global__ void __launch_bounds__(32 * kGroups) k_screen(const __nv_bfloat16* __restrict__ x, int M, const uint8_t* __restrict__ Q, const uint16_t* __restrict__ SC, const uint16_t* __restrict__ RT, const float* __restrict__ NV, int V, int v_real, float cn, float* __restrict__ lt, float* __restrict__ ht, int ncta, int* __restrict__ flags, const int* __restrict__ on, float* __restrict__ sdbg, float* __restrict__ bdbg) { constexpr bool kHi = RB > 8; if (*on == 0) return; // not eligible: select computes every tile, lt / ht are not read __shared__ float red[kGroups][RB][kRowsCta]; __shared__ float xg2[kGroups][RB]; const int warp = threadIdx.x >> 5, lane = threadIdx.x & 31, g = lane >> 2, t = lane & 3; const bool live = g < M, live2 = kHi && g + 8 < M; // one 16-row tile per CTA (a persistent grid-stride variant with x loaded once measured 140-200 GB/s: the x // loads then precede the weight stream) const int cta = blockIdx.x, n_cta = cta * kRowsCta;
// weights first: 2 tiles x 3 steps, 12 bytes each per lane uint2 wn[2][kStepsPerGroup]; uint32_t wh[2][kStepsPerGroup];#pragma unroll for (int i = 0; i < 2; ++i) { const size_t tile = (size_t)(n_cta / 8 + i) * kSteps;#pragma unroll for (int u = 0; u < kStepsPerGroup; ++u) { const uint8_t* base = Q + (tile + warp * kStepsPerGroup + u) * kTileBytes; wn[i][u] = dsk::ldg_stream64(base + 8 * lane); wh[i][u] = dsk::ldg_stream32(base + 256 + 4 * lane); } } // activations: row g (and g + 8), the lane's 16 values of each step const int k0 = warp * kGroup + 16 * t; uint4 xa[kStepsPerGroup][2], xb[kStepsPerGroup][2];#pragma unroll for (int u = 0; u < kStepsPerGroup; ++u) { const __nv_bfloat16* xr = x + (size_t)(live ? g : 0) * kK + k0 + u * kStep; xa[u][0] = live ? __ldg(reinterpret_cast<const uint4*>(xr)) : make_uint4(0, 0, 0, 0); xa[u][1] = live ? __ldg(reinterpret_cast<const uint4*>(xr + 8)) : make_uint4(0, 0, 0, 0); if constexpr (kHi) { const __nv_bfloat16* xr2 = x + (size_t)(live2 ? g + 8 : 0) * kK + k0 + u * kStep; xb[u][0] = live2 ? __ldg(reinterpret_cast<const uint4*>(xr2)) : make_uint4(0, 0, 0, 0); xb[u][1] = live2 ? __ldg(reinterpret_cast<const uint4*>(xr2 + 8)) : make_uint4(0, 0, 0, 0); } else { xb[u][0] = xb[u][1] = make_uint4(0, 0, 0, 0); } } // ||x_g||^2 of this warp's group (sum of the lane's squares, then over the 4 lanes of a row) float sq = 0.f, sq2 = 0.f;#pragma unroll for (int u = 0; u < kStepsPerGroup; ++u)#pragma unroll for (int h = 0; h < 2; ++h) { const uint32_t* a = &xa[u][h].x; const uint32_t* b = &xb[u][h].x;#pragma unroll for (int j = 0; j < 4; ++j) { const float a0 = dsk::bf16_lo(a[j]), a1 = dsk::bf16_hi(a[j]); sq = fmaf(a0, a0, fmaf(a1, a1, sq)); if constexpr (kHi) { const float b0 = dsk::bf16_lo(b[j]), b1 = dsk::bf16_hi(b[j]); sq2 = fmaf(b0, b0, fmaf(b1, b1, sq2)); } } } sq += __shfl_xor_sync(0xffffffffu, sq, 1); sq += __shfl_xor_sync(0xffffffffu, sq, 2); if constexpr (kHi) { sq2 += __shfl_xor_sync(0xffffffffu, sq2, 1); sq2 += __shfl_xor_sync(0xffffffffu, sq2, 2); } if (t == 0) { if (g < RB) xg2[warp][g] = live ? sq : 0.f; if constexpr (kHi) xg2[warp][g + 8] = live2 ? sq2 : 0.f; }
float c[2][4];#pragma unroll for (int i = 0; i < 2; ++i) c[i][0] = c[i][1] = c[i][2] = c[i][3] = 0.f;#pragma unroll for (int u = 0; u < kStepsPerGroup; ++u)#pragma unroll for (int j4 = 0; j4 < 4; ++j4) { const uint4& av = xa[u][j4 >> 1]; const uint4& bv = xb[u][j4 >> 1]; const uint32_t a0 = (j4 & 1) ? av.z : av.x, a2 = (j4 & 1) ? av.w : av.y; const uint32_t a1 = (j4 & 1) ? bv.z : bv.x, a3 = (j4 & 1) ? bv.w : bv.y;#pragma unroll for (int i = 0; i < 2; ++i) { const uint32_t nib = (j4 < 2) ? wn[i][u].x : wn[i][u].y; const uint32_t b0 = six_pair(nib, wh[i][u], 2 * j4), b1 = six_pair(nib, wh[i][u], 2 * j4 + 1); dsk::mma_bf16(c[i], a0, a1, a2, a3, b0, b1); } } // group scale (fp16, [kGroups][V]) of the lane's two columns per tile, then the partials to shared memory#pragma unroll for (int i = 0; i < 2; ++i) { const int n = n_cta + 8 * i + 2 * t; const uint32_t s2 = __ldg(reinterpret_cast<const uint32_t*>(SC + (size_t)warp * V + n)); const float s0 = half_to_float_u16((uint16_t)(s2 & 0xFFFFu)), s1 = half_to_float_u16((uint16_t)(s2 >> 16)); const int r = 8 * i + 2 * t; if (g < RB) { red[warp][g][r] = c[i][0] * s0; red[warp][g][r + 1] = c[i][1] * s1; } if constexpr (kHi) { red[warp][g + 8][r] = c[i][2] * s0; red[warp][g + 8][r + 1] = c[i][3] * s1; } } __syncthreads();
// epilogue: one thread per (row m, column r) of the CTA, m < RB const int e = threadIdx.x; if (e < RB * kRowsCta) { const int m = e / kRowsCta, r = e % kRowsCta, n = n_cta + r; float s = 0.f;#pragma unroll for (int w = 0; w < kGroups; ++w) s += red[w][m][r]; float b = 0.f, xx = 0.f;#pragma unroll for (int w = 0; w < kGroups; ++w) { const float q2 = xg2[w][m]; xx += q2; // >= ||x_g||: fp32 sum of 192 squares (relative error < 2^-16 after sqrt), sqrt rounding, and squares that // underflow (each < 2^-126 is at worst lost: 192 * 2^-126 < 2^-116, sqrt < 2^-58) const float xg = sqrtf(q2) * kInfl + kXAbs; b = fmaf(half_to_float_u16(__ldg(RT + (size_t)w * V + n)), xg, b); } const float xn = sqrtf(xx) * kInfl + 4.f * kXAbs; b = (b * kInfl + cn * __ldg(NV + n) * xn) * kInfl; const float slop = (fabsf(s) + b) * (1.0f / 1048576.0f) + 1e-30f; float lo = s - b - slop, hi = s + b + slop; const bool real = m < M && n < v_real; if (sdbg != nullptr && m < M) sdbg[(size_t)m * V + n] = s, bdbg[(size_t)m * V + n] = b; // GPU check only // outside the supported domain (non-finite, or ||x|| > 2^20 where the absolute underflow allowance in slop would // no longer cover flushed subnormal products): the whole step takes the full head if (m < M && n < V && !(isfinite(s) && isfinite(b) && xn <= 1048576.f)) atomicOr(flags + 1, 1); lo = real ? lo : -INFINITY; hi = real ? hi : -INFINITY; // max over the 16 columns of row m: 16 consecutive lanes#pragma unroll for (int o = 8; o >= 1; o >>= 1) { lo = fmaxf(lo, __shfl_xor_sync(0xffffffffu, lo, o)); hi = fmaxf(hi, __shfl_xor_sync(0xffffffffu, hi, o)); } if (r == 0 && m < M) { lt[(size_t)m * ncta + cta] = lo; ht[(size_t)m * ncta + cta] = hi; } }}
// T[m] = max lo, H[m] = max hi over the tiles (grid M, 1024 threads)__global__ void __launch_bounds__(1024) k_rowmax(const float* __restrict__ lt, const float* __restrict__ ht, int ncta, float* __restrict__ tm, float* __restrict__ hm, const int* __restrict__ on) { __shared__ float sl[32], sh[32]; const int m = blockIdx.x; if (*on == 0) return; float lo = -INFINITY, hi = -INFINITY; for (int i = threadIdx.x; i < ncta; i += blockDim.x) { lo = fmaxf(lo, lt[(size_t)m * ncta + i]); hi = fmaxf(hi, ht[(size_t)m * ncta + i]); } lo = dsk::warp_max(lo); hi = dsk::warp_max(hi); if ((threadIdx.x & 31) == 0) sl[threadIdx.x >> 5] = lo, sh[threadIdx.x >> 5] = hi; __syncthreads(); if (threadIdx.x < 32) { lo = threadIdx.x < (int)(blockDim.x >> 5) ? sl[threadIdx.x] : -INFINITY; hi = threadIdx.x < (int)(blockDim.x >> 5) ? sh[threadIdx.x] : -INFINITY; lo = dsk::warp_max(lo); hi = dsk::warp_max(hi); if (threadIdx.x == 0) tm[m] = lo, hm[m] = hi; }}
// Softcap margin. The stock path applies f(l) = fl(fl(tanh(fl(l / c))) * c) (Triton: div.full, libdevice tanhf),// |f(l) - c tanh(l / c)| <= E. With every relevant logit in [T - DMAX, H] and |T| + DMAX, |H| <= L:// f(a) >= f(b), a < b => b - a <= 2E / min sech^2 <= 2E / exp(-2L / c) (sech^2 y >= exp(-2|y|));// we use delta = 2 * 2E / exp(-2L / c) (2x margin for __expf), and require delta <= DMAX;// and the -inf fill (f = -c) stays below every candidate maximum when c (1 - tanh(L / c)) >= c exp(-2L / c) > E;// we require c exp(-2L / c) > 4 * 2E.__global__ void __launch_bounds__(256) k_select(const float* __restrict__ ht, int ncta, int M, const float* __restrict__ tm, const float* __restrict__ hm, const int* __restrict__ on, int* __restrict__ flags, uint8_t* __restrict__ mask, unsigned long long* __restrict__ stats, float cap, float two_e, float dmax) { __shared__ float thr[16]; __shared__ int full_s; __shared__ int cnt; if (threadIdx.x == 0) { int full = (*on == 0) || (flags[1] != 0); cnt = 0; for (int m = 0; m < M && !full; ++m) { const float T = tm[m], H = hm[m]; const float L = fmaxf(fabsf(T) + dmax, fabsf(H)); const float ex = __expf(-2.f * L / cap); // sech^2(L / c) >= ex const float delta = 2.f * two_e / fmaxf(ex, 1e-30f); // 2x the bound 2E / ex const bool ok = isfinite(T) && isfinite(H) && L < 1e4f && delta <= dmax && cap * ex > 4.f * two_e; if (!ok) full = 1; thr[m] = T - (ok ? delta : 0.f); } full_s = full; } __syncthreads(); const int full = full_s; const int tile = blockIdx.x * blockDim.x + threadIdx.x; int set = 0; if (tile < ncta) { if (full) { set = 1; } else { for (int m = 0; m < M; ++m) set |= ht[(size_t)m * ncta + tile] >= thr[m]; } mask[tile] = (uint8_t)set; } if (!full && set) atomicAdd(&cnt, 1); __syncthreads(); if (threadIdx.x == 0) { if (!full && cnt) atomicAdd(stats + 0, (unsigned long long)cnt); if (blockIdx.x == 0) { if (*on == 0) atomicAdd(stats + 4, 1ULL); else if (full) atomicAdd(stats + 2, 1ULL); else atomicAdd(stats + 1, 1ULL); flags[2] = (*on != 0) && !full; // certified step (read by the check mode) } }}
// pico's coded-head GEMV (gemv_bf16x, mt 2, wn 1) on the masked CTAs; -inf for the others. Same body, template// arguments and launch bounds as pico's k_gemv16 (RB 8) / k_gemv16_r16 (RB 16).template <int RB>__device__ __forceinline__ void exact_cta(const uint8_t* __restrict__ mask, const __nv_bfloat16* __restrict__ x, int M, const uint8_t* __restrict__ X, int N, int K, float* __restrict__ yf, int wk, int* __restrict__ flags) { if (blockIdx.x == 0 && threadIdx.x == 0) flags[1] = 0; // the screen's non-finite flag (select has read it) if (!mask[blockIdx.x]) { const int n_cta = blockIdx.x * kRowsCta; for (int idx = threadIdx.x; idx < M * kRowsCta; idx += blockDim.x) yf[(size_t)(idx / kRowsCta) * N + n_cta + idx % kRowsCta] = -INFINITY; return; } dsk::gemv16_body<dsk::kBF16X, 2, false, false, RB>(x, M, X, nullptr, N, K, N, yf, nullptr, nullptr, nullptr, 1, wk, dsk::NormIn{});}
__global__ void __launch_bounds__(512) k_exact8(const uint8_t* __restrict__ mask, const __nv_bfloat16* __restrict__ x, int M, const uint8_t* __restrict__ X, int N, int K, float* __restrict__ yf, int wk, int* __restrict__ flags) { exact_cta<dsk::kLowRows>(mask, x, M, X, N, K, yf, wk, flags);}
__global__ void __launch_bounds__(512, 1) k_exact16(const uint8_t* __restrict__ mask, const __nv_bfloat16* __restrict__ x, int M, const uint8_t* __restrict__ X, int N, int K, float* __restrict__ yf, int wk, int* __restrict__ flags) { exact_cta<dsk::kMaxRows>(mask, x, M, X, N, K, yf, wk, flags);}
} // namespace cert
namespace {
void check_x(const torch::Tensor& x) { TORCH_CHECK(x.is_cuda() && x.scalar_type() == at::kBFloat16 && x.dim() == 2 && x.size(1) == cert::kK, "inkling_cert: x must be CUDA bf16 [M, 2304]"); TORCH_CHECK(x.size(0) >= 1 && x.size(0) <= 16, "inkling_cert: rows ", x.size(0), " not in [1, 16]"); TORCH_CHECK(x.stride(1) == 1 && (x.size(0) == 1 || x.stride(0) == cert::kK), "inkling_cert: x rows not contiguous"); TORCH_CHECK(reinterpret_cast<uintptr_t>(x.data_ptr()) % 16 == 0, "inkling_cert: x not 16-byte aligned");}
void check_dev(const torch::Tensor& t, const torch::Tensor& like, at::ScalarType dt, int64_t numel, const char* what) { TORCH_CHECK(t.is_cuda() && t.device() == like.device() && t.scalar_type() == dt && t.is_contiguous() && t.numel() >= numel, "inkling_cert: bad ", what);}
// screen + rowmax + select (the candidate mask for exact())void screen(const torch::Tensor& x, const torch::Tensor& q, const torch::Tensor& sc, const torch::Tensor& rt, const torch::Tensor& nv, int64_t V, int64_t v_real, double cn, const torch::Tensor& lt, const torch::Tensor& ht, const torch::Tensor& tm, const torch::Tensor& hm, const torch::Tensor& on, const torch::Tensor& flags, const torch::Tensor& mask, const torch::Tensor& stats, double cap, double two_e, double dmax, const torch::Tensor& sdbg, const torch::Tensor& bdbg) { check_x(x); const int64_t M = x.size(0), ncta = V / cert::kRowsCta; TORCH_CHECK(V % cert::kRowsCta == 0 && v_real <= V && v_real > 0, "inkling_cert: V=", V, " v_real=", v_real); check_dev(q, x, at::kByte, V * cert::kK * 3 / 4, "q"); check_dev(sc, x, at::kHalf, cert::kGroups * V, "sc"); check_dev(rt, x, at::kHalf, cert::kGroups * V, "rt"); check_dev(nv, x, at::kFloat, V, "nv"); check_dev(lt, x, at::kFloat, M * ncta, "lt"); check_dev(ht, x, at::kFloat, M * ncta, "ht"); check_dev(tm, x, at::kFloat, M, "tm"); check_dev(hm, x, at::kFloat, M, "hm"); check_dev(on, x, at::kInt, 1, "on"); check_dev(flags, x, at::kInt, 4, "flags"); check_dev(mask, x, at::kByte, ncta, "mask"); check_dev(stats, x, at::kLong, 8, "stats"); const c10::cuda::CUDAGuard guard(x.device()); const auto st = at::cuda::getCurrentCUDAStream(); const auto* xp = reinterpret_cast<const __nv_bfloat16*>(x.data_ptr()); const auto* scp = reinterpret_cast<const uint16_t*>(sc.data_ptr()); const auto* rtp = reinterpret_cast<const uint16_t*>(rt.data_ptr()); float* sd = nullptr; float* bd = nullptr; if (sdbg.numel() > 0) { check_dev(sdbg, x, at::kFloat, M * V, "sdbg"); check_dev(bdbg, x, at::kFloat, M * V, "bdbg"); sd = sdbg.data_ptr<float>(); bd = bdbg.data_ptr<float>(); } if (M <= 8) cert::k_screen<8><<<ncta, 32 * cert::kGroups, 0, st>>>(xp, (int)M, q.data_ptr<uint8_t>(), scp, rtp, nv.data_ptr<float>(), (int)V, (int)v_real, (float)cn, lt.data_ptr<float>(), ht.data_ptr<float>(), (int)ncta, flags.data_ptr<int>(), on.data_ptr<int>(), sd, bd); else cert::k_screen<16><<<ncta, 32 * cert::kGroups, 0, st>>>(xp, (int)M, q.data_ptr<uint8_t>(), scp, rtp, nv.data_ptr<float>(), (int)V, (int)v_real, (float)cn, lt.data_ptr<float>(), ht.data_ptr<float>(), (int)ncta, flags.data_ptr<int>(), on.data_ptr<int>(), sd, bd); C10_CUDA_KERNEL_LAUNCH_CHECK(); cert::k_rowmax<<<M, 1024, 0, st>>>(lt.data_ptr<float>(), ht.data_ptr<float>(), (int)ncta, tm.data_ptr<float>(), hm.data_ptr<float>(), on.data_ptr<int>()); C10_CUDA_KERNEL_LAUNCH_CHECK(); cert::k_select<<<(ncta + 255) / 256, 256, 0, st>>>(ht.data_ptr<float>(), (int)ncta, (int)M, tm.data_ptr<float>(), hm.data_ptr<float>(), on.data_ptr<int>(), flags.data_ptr<int>(), mask.data_ptr<uint8_t>(), reinterpret_cast<unsigned long long*>(stats.data_ptr<int64_t>()), (float)cap, (float)two_e, (float)dmax); C10_CUDA_KERNEL_LAUNCH_CHECK();}
// out[M, N] = pico's coded head GEMV on the masked CTAs, -inf elsewherevoid exact(const torch::Tensor& x, const torch::Tensor& packed, int64_t N, int64_t K, const torch::Tensor& mask, const torch::Tensor& out, int64_t wk, const torch::Tensor& flags) { check_x(x); TORCH_CHECK(K == cert::kK && N % cert::kRowsCta == 0, "inkling_cert: exact N=", N, " K=", K); TORCH_CHECK(wk >= 1 && wk <= 16 && wk <= K / 32, "inkling_cert: wk=", wk); TORCH_CHECK(packed.is_cuda() && packed.scalar_type() == at::kByte && packed.is_contiguous(), "inkling_cert: packed"); check_dev(mask, x, at::kByte, N / cert::kRowsCta, "mask"); check_dev(flags, x, at::kInt, 4, "flags"); TORCH_CHECK(out.is_cuda() && out.scalar_type() == at::kFloat && out.dim() == 2 && out.size(0) == x.size(0) && out.size(1) == N && out.stride(1) == 1 && (out.size(0) == 1 || out.stride(0) == N), "inkling_cert: out must be fp32 [M, N] with contiguous rows"); const c10::cuda::CUDAGuard guard(x.device()); const auto st = at::cuda::getCurrentCUDAStream(); const int M = (int)x.size(0); const auto* xp = reinterpret_cast<const __nv_bfloat16*>(x.data_ptr()); const int ncta = (int)(N / cert::kRowsCta); if (M <= dsk::kLowRows) { const size_t smem = (size_t)wk * dsk::kLowRows * cert::kRowsCta * sizeof(float); cert::k_exact8<<<ncta, 32 * wk, smem, st>>>(mask.data_ptr<uint8_t>(), xp, M, packed.data_ptr<uint8_t>(), (int)N, (int)K, out.data_ptr<float>(), (int)wk, flags.data_ptr<int>()); } else { const size_t smem = (size_t)wk * dsk::kMaxRows * cert::kRowsCta * sizeof(float); cert::k_exact16<<<ncta, 32 * wk, smem, st>>>(mask.data_ptr<uint8_t>(), xp, M, packed.data_ptr<uint8_t>(), (int)N, (int)K, out.data_ptr<float>(), (int)wk, flags.data_ptr<int>()); } C10_CUDA_KERNEL_LAUNCH_CHECK();}
template <int MR, int Stages>void prepare_screen_wide() { C10_CUDA_CHECK(cudaFuncSetAttribute(certwide::k_screen_wide<MR, Stages>, cudaFuncAttributeMaxDynamicSharedMemorySize, Stages * MR * 16 * certwide::kRowBytes));}
void prepare_certwide(int64_t device) { const c10::cuda::CUDAGuard guard((c10::DeviceIndex)device); prepare_screen_wide<4, 3>(); prepare_screen_wide<8, 3>(); prepare_screen_wide<12, 2>(); prepare_screen_wide<12, 3>();}
template <typename Fn>auto dispatch_screen_wide(int M, bool three_stages, Fn launch) { using Three = std::integral_constant<int, 3>; if (M <= 64) return launch(std::integral_constant<int, 4>{}, Three{}); if (M <= 128) return launch(std::integral_constant<int, 8>{}, Three{}); if (three_stages) return launch(std::integral_constant<int, 12>{}, Three{}); return launch(std::integral_constant<int, 12>{}, std::integral_constant<int, 2>{});}
std::tuple<int, size_t, int, int> screen_wide_info(int64_t device, int M, bool three_stages) { using namespace certwide; TORCH_CHECK(M >= 17 && M <= kMaxM, "inkling_certwide: unsupported screen rows"); const c10::cuda::CUDAGuard guard((c10::DeviceIndex)device); return dispatch_screen_wide(M, three_stages, [](auto bucket, auto stages) { constexpr int MR = decltype(bucket)::value, Stages = decltype(stages)::value; constexpr int smem = Stages * MR * 16 * kRowBytes; auto kernel = k_screen_wide<MR, Stages>; cudaFuncAttributes attr{}; int blocks = 0; C10_CUDA_CHECK(cudaFuncGetAttributes(&attr, kernel)); C10_CUDA_CHECK(cudaOccupancyMaxActiveBlocksPerMultiprocessor(&blocks, kernel, kThreads, smem)); return std::make_tuple(attr.numRegs, attr.localSizeBytes, smem, blocks); });}
void select_wide(const torch::Tensor& lower, const torch::Tensor& upper, const torch::Tensor& threshold, const torch::Tensor& state, const torch::Tensor& tiles, const torch::Tensor& groups, int M, int ntiles, float cap, float two_e, float dmax, cudaStream_t st) { using namespace certwide; auto* sp = state.data_ptr<int>(); k_threshold<<<M, 256, 0, st>>>(lower.data_ptr<float>(), upper.data_ptr<float>(), ntiles, threshold.data_ptr<float>(), sp, cap, two_e, dmax); C10_CUDA_KERNEL_LAUNCH_CHECK(); const int capacity = tiles.numel(); k_candidates<<<(ntiles + 255) / 256, 256, 0, st>>>(upper.data_ptr<float>(), threshold.data_ptr<float>(), M, ntiles, sp, tiles.data_ptr<int>(), groups.data_ptr<int>(), capacity); C10_CUDA_KERNEL_LAUNCH_CHECK(); k_finish<<<1, 1, 0, st>>>(sp, capacity, ntiles); C10_CUDA_KERNEL_LAUNCH_CHECK();}
void debug_select_wide(const torch::Tensor& lower, const torch::Tensor& upper, const torch::Tensor& threshold, const torch::Tensor& state, const torch::Tensor& tiles, const torch::Tensor& groups, double cap, double two_e, double dmax) { TORCH_CHECK(lower.dim() == 2 && lower.size(0) > 0 && lower.size(0) <= certwide::kMaxM && lower.size(1) > 0 && lower.size(1) <= INT32_MAX / 16 && lower.sizes() == upper.sizes() && tiles.numel() > 0 && tiles.numel() <= lower.size(1), "inkling_certwide: bad debug maxima shape"); const int M = lower.size(0), ntiles = lower.size(1); check_dev(lower, lower, at::kFloat, lower.numel(), "lower"); check_dev(upper, lower, at::kFloat, lower.numel(), "upper"); check_dev(threshold, lower, at::kFloat, M, "threshold"); check_dev(state, lower, at::kInt, 2, "state"); check_dev(tiles, lower, at::kInt, tiles.numel(), "tiles"); check_dev(groups, lower, at::kInt, tiles.numel(), "groups"); const c10::cuda::CUDAGuard guard(lower.device()); const auto st = at::cuda::getCurrentCUDAStream(); C10_CUDA_CHECK(cudaMemsetAsync(state.data_ptr<int>(), 0, 2 * sizeof(int), st)); select_wide(lower, upper, threshold, state, tiles, groups, M, ntiles, cap, two_e, dmax, st);}
void screen_wide(const torch::Tensor& x, const torch::Tensor& q, const torch::Tensor& sc, const torch::Tensor& radius, int64_t V, int64_t v_real, const torch::Tensor& norms, const torch::Tensor& lower, const torch::Tensor& upper, const torch::Tensor& threshold, const torch::Tensor& on, const torch::Tensor& state, const torch::Tensor& tiles, const torch::Tensor& groups, const torch::Tensor& dbg_s, const torch::Tensor& dbg_lo, const torch::Tensor& dbg_hi, double cap, double two_e, double dmax, bool three_stages) { using namespace certwide; TORCH_CHECK(x.dim() == 2 && x.size(0) >= 17 && x.size(0) <= kMaxM && x.size(1) == kK, "inkling_certwide: x must be [17..192, 2304]"); const int M = (int)x.size(0); const int64_t ntiles = V / 16, capacity = tiles.numel(); TORCH_CHECK(V > 0 && V <= INT32_MAX && V % 16 == 0 && v_real > 0 && v_real <= V && capacity > 0 && capacity <= ntiles, "inkling_certwide: bad vocab or capacity"); check_dev(x, x, at::kBFloat16, M * kK, "x"); check_dev(q, x, at::kByte, V * kK * 3 / 4, "q"); check_dev(sc, x, at::kHalf, kGroups * V, "sc"); check_dev(radius, x, at::kFloat, V, "radius"); check_dev(norms, x, at::kFloat, M, "norms"); check_dev(lower, x, at::kFloat, M * ntiles, "lower"); check_dev(upper, x, at::kFloat, M * ntiles, "upper"); check_dev(threshold, x, at::kFloat, M, "threshold"); check_dev(on, x, at::kInt, 1, "on"); check_dev(state, x, at::kInt, 2, "state"); check_dev(tiles, x, at::kInt, capacity, "tiles"); check_dev(groups, x, at::kInt, capacity, "groups"); TORCH_CHECK(reinterpret_cast<uintptr_t>(x.data_ptr()) % 16 == 0 && reinterpret_cast<uintptr_t>(q.data_ptr()) % 8 == 0, "inkling_certwide: misaligned screen input"); float* sd = nullptr; float* ld = nullptr; float* hd = nullptr; if (dbg_s.numel() || dbg_lo.numel() || dbg_hi.numel()) { check_dev(dbg_s, x, at::kFloat, M * V, "debug screen logits"); check_dev(dbg_lo, x, at::kFloat, M * V, "debug lower endpoints"); check_dev(dbg_hi, x, at::kFloat, M * V, "debug upper endpoints"); TORCH_CHECK(reinterpret_cast<uintptr_t>(dbg_s.data_ptr()) % 8 == 0 && reinterpret_cast<uintptr_t>(dbg_lo.data_ptr()) % 8 == 0 && reinterpret_cast<uintptr_t>(dbg_hi.data_ptr()) % 8 == 0, "inkling_certwide: misaligned float2 debug output"); sd = dbg_s.data_ptr<float>(); ld = dbg_lo.data_ptr<float>(); hd = dbg_hi.data_ptr<float>(); } const c10::cuda::CUDAGuard guard(x.device()); const auto st = at::cuda::getCurrentCUDAStream(); const auto* xp = reinterpret_cast<const __nv_bfloat16*>(x.data_ptr()); const auto* scp = reinterpret_cast<const uint16_t*>(sc.data_ptr()); auto* sp = state.data_ptr<int>(); C10_CUDA_CHECK(cudaMemsetAsync(sp, 0, 2 * sizeof(int), st)); k_norm<<<M, 256, 0, st>>>(xp, norms.data_ptr<float>(), sp, on.data_ptr<int>()); C10_CUDA_KERNEL_LAUNCH_CHECK(); auto launch = [&](auto bucket, auto stages) { constexpr int MR = decltype(bucket)::value; constexpr int Stages = decltype(stages)::value; k_screen_wide<MR, Stages><<<(V + kCols - 1) / kCols, kThreads, Stages * MR * 16 * kRowBytes, st>>>( xp, q.data_ptr<uint8_t>(), scp, radius.data_ptr<float>(), norms.data_ptr<float>(), M, (int)V, (int)v_real, lower.data_ptr<float>(), upper.data_ptr<float>(), sp, sd, ld, hd); }; dispatch_screen_wide(M, three_stages, launch); C10_CUDA_KERNEL_LAUNCH_CHECK(); select_wide(lower, upper, threshold, state, tiles, groups, M, (int)ntiles, cap, two_e, dmax, st);}
} // namespace
PYBIND11_MODULE(TORCH_EXTENSION_NAME, m) { m.doc() = "inkling_cert: certified greedy LM-head argmax (6-bit screen + pico's exact head GEMV on candidates)"; m.def("screen", &screen, "6-bit screen, row maxima and candidate mask"); m.def("screen_wide", &screen_wide, "batched 6-bit screen and candidate compaction"); m.def("screen_wide_info", &screen_wide_info, "registers, local bytes, dynamic shared bytes and resident blocks per SM"); m.def("debug_select_wide", &debug_select_wide, "select candidates from supplied tile maxima"); m.def("prepare_certwide", &prepare_certwide, "prepare batched screen kernels"); m.def("exact", &exact, "pico's coded head GEMV on the masked CTAs, -inf elsewhere"); m.attr("K") = cert::kK; m.attr("GROUP") = cert::kGroup; m.attr("ROWS_CTA") = cert::kRowsCta;}LICENSEAdded+201
NOTICEAdded+20
README.mdAdded+179
SHA256SUMSAdded
THIRD_PARTY_NOTICES.mdAdded+38
drafter-mix/BUILT_FROMAdded+1
drafter-mix/Inkling-2-Mini-DFlash2-mix.safetensorsAdded+3
drafter-mix/LICENSEAdded+201
drafter-mix/NOTICEAdded+22
drafter-mix/SHA256SUMSAdded+1
drafter/LICENSEAdded+201
drafter/NOTICEAdded+29
drafter/README.mdAdded+7
drafter/SHA256SUMSAdded+2
drafter/config.jsonAdded+68
drafter/model.safetensorsAdded+3
licenses/CUTLASS-LICENSE.txtAdded+34
licenses/FLASH-ATTENTION-LICENSE.txtAdded+29
recipe/README.mdAdded+52
recipe/RELEASE_NOTES.mdAdded+40
recipe/base-1fb4134b.sha256Added+12
recipe/profiles/agentic.rowAdded+1
recipe/profiles/long.rowAdded+1
recipe/serve.shAdded+71
recipe/stack/SHA256SUMSAdded+775
recipe/stack/cands/n292-v2-v297-pk3c/recipe/CREDITS.mdAdded+94
recipe/stack/cands/n292-v2-v297-pk3c/recipe/LICENSEAdded+21
recipe/stack/cands/n292-v2-v297-pk3c/recipe/NOTICEAdded+54
recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_attn/CREDITS.knapcio-v2.9.3.mdAdded+94
recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_attn/LICENSE.knapcio-v2.9.3Added+21
recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_attn/NOTICE.knapcio-v2.9.3Added+54
recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_attn/README.mdAdded+164
recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_attn/__init__.pyAdded+170
recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_attn/_hook.pyAdded+83
recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_attn/build.pyAdded+102
recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_attn/csrc/attn_kernel.cuhAdded+555
recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_attn/csrc/inkling_attn_ext.cuAdded+326
recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_attn/ops.pyAdded+76
recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_attn/patch.pyAdded+562
recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_attn/tests/test_install.pyAdded+54
recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_attn/tests/test_w8split_cpu.pyAdded+118
recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_cert/README.mdAdded+197
recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_cert/__init__.pyAdded+172
recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_cert/_hook.pyAdded+78
recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_cert/build.pyAdded+102
recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_cert/cert_math.pyAdded+163
recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_cert/certwide.pyAdded+140
recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_cert/certwide_math.pyAdded+74
recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_cert/certwide_reduce.pyAdded+68
recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_cert/csrc/cert_ext.cuAdded+549