diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..261eeb9e9f8b2b4b0d119366dda99c6fd7d35c64 --- /dev/null +++ b/LICENSE @@ -0,0 +1,201 @@ + 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. diff --git a/NOTICE b/NOTICE new file mode 100644 index 0000000000000000000000000000000000000000..b78081839de18b324e1e8dbeb3343b3fb054c456 --- /dev/null +++ b/NOTICE @@ -0,0 +1,20 @@ +Inkling-2-Mini on one NVIDIA DGX Spark: SGLang serving recipe and the t5a DFlash2 draft model +Copyright 2026 Diffbot + +Licensed under the Apache License, Version 2.0 (the "License"); you may not use the files of this repository except in +compliance 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. diff --git a/README.md b/README.md new file mode 100644 index 0000000000000000000000000000000000000000..93d853853d245194103575f64c7e2ec5a0b90c8d --- /dev/null +++ b/README.md @@ -0,0 +1,179 @@ +--- +license: apache-2.0 +base_model: thinkingmachines/Inkling-2-Mini +pipeline_tag: text-generation +tags: +- 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 single +NVIDIA 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 transformers +reference implementation, which dequantizes the NVFP4 / MXFP8 experts and computes in BF16 activations; there is no BF16 release +of this model. Each server is teacher-forced on the same token windows of three public corpora (neutral text, code, agentic) and +scored on the second half of each window from its top-20 log probabilities (a lower bound on the full KL). All three engines sit +near 0.006 nats because all three run the experts with quantized activations, as the checkpoint is meant to be served. This +recipe reads slightly higher than both stock engines (table above). The target model verifies every drafted token, but the +outputs 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 4 +sessions 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 raw +wall-time ratios. The engines do not emit the same number of tokens (last row), so the ratios are not normalized for output +length. Time to first token is measured to the first content, reasoning or tool-call delta. A tool call that arrives in one +piece reports its whole generation time there, so the two median rows mix generation with first-token time; read them as +indicative. + +## 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, the +model'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. Fresh +prefill = the first request on a prompt; decode = (400 - 16) tokens over the time difference of a 400-token and a 16-token +request 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 of +an 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 Spark +needs; 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). + +```bash +hf download diffbot/Inkling-2-Mini-DFlash2-t5a-DGX-Spark --local-dir ~/models/Inkling-2-Mini-DFlash2-t5a-DGX-Spark +hf download thinkingmachines/Inkling-2-Mini --revision 1fb4134b9a74f9681054f4ef82e4bf1f458a2337 --local-dir ~/models/Inkling-2-Mini +MODEL_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 the +cache in `~/.cache/inkling2-mini-t5a`. `bash recipe/serve.sh stop` stops it. Settings (port, API key, memory fraction, the +long-context profile) are documented at the top of `recipe/serve.sh`; `recipe/README.md` explains the stack. + +```bash +curl -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 large +running. The speed tables above were measured with the agentic profile, not this one. What its boot test on one DGX Spark +showed (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 first +boot 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 ` 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 for +Inkling-2-Mini to verify. We fine-tuned it from Inkling-2-Mini-DFlash2-Global (L13), itself derived from Inco AI's +Inkling-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-source +repositories and code from tool outputs, asked with the same instruction as the long-context table. The eval1 sessions and the +code corpus behind the long-context table were excluded from the training data (by session, by file path and by overlapping +6-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's +Inkling-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-Clause +and Apache-2.0 licenses, listed in `THIRD_PARTY_NOTICES.md`. Changes and history: `recipe/RELEASE_NOTES.md`. + diff --git a/SHA256SUMS b/SHA256SUMS new file mode 100644 index 0000000000000000000000000000000000000000..e5b611a4ca8b77e3dd639f0577c17a47c709ea84 --- /dev/null +++ b/SHA256SUMS @@ -0,0 +1,801 @@ +c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4 LICENSE +cd4490cf621c2aa7a99d0930605cadf14397e16895e665ddf7ba2d080988246a NOTICE +1b92ad7594144c9f64908a5e5221e2379e144b7ec8f255a106d945ddd0a2c6f9 README.md +22be8aa866c40cfe11260cdfce2c63b9823c8e70a33e167e1db5f719be5e8dbe THIRD_PARTY_NOTICES.md +383f8a0b723141f09ad1ed88f2b23a9fa99a421666a60c20068e4914e891377e drafter-mix/BUILT_FROM +c6c42710f9d890776d73706f81527f175b748a85d772606c2b248a6066f5cc2d drafter-mix/Inkling-2-Mini-DFlash2-mix.safetensors +c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4 drafter-mix/LICENSE +52b62794984d7a44f1d41eb1cc7b0a1e4716d578cd5582da1793d99cce055c71 drafter-mix/NOTICE +a3e991d6fe11d0709cbf704bd223d8892b363fb6fcc9d58032c1ec0e83dbb138 drafter-mix/SHA256SUMS +c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4 drafter/LICENSE +0add1e261731277a55a533551f40a01d11cbed50d46a9c490d23944ddaa2969b drafter/NOTICE +1a46f6e33b05292c1af5b847e63b79bc8d0f830ea54348549b7f1dcfa4c2f606 drafter/README.md +abb2810865e6b86c7428cad774efbc0f2aca2336758104eb604ec50b1054931d drafter/SHA256SUMS +df8b1f466b0a35d6badc3e292ae94009727fe397c4335c296e99c5b86df4b4a9 drafter/config.json +a22381fd44acb5b2e0a583a20537641099dc16c59b6b7c7cab7e61faa0e9e43a drafter/model.safetensors +ad1513ca983da737a6843364ad19e8424a56d860736c2da773b8c5be527e1475 licenses/CUTLASS-LICENSE.txt +8c9ccb96c065e706135b6cbad279b721da6156e51f3a5f27c6b3329af9416d73 licenses/FLASH-ATTENTION-LICENSE.txt +1080d1f297ff3d7dbd82210621ff1068493dd879d4d5b706065b10ffcbac9c56 recipe/README.md +46462b1c81ff353f5e0b6adf6729252e3dea2bca0c928f4c71881ff21ec05d4e recipe/RELEASE_NOTES.md +7b82e3f674b6cf3ce1bcb062079276e0cf7e4c15789d0d8a4afc75551a3f89d0 recipe/base-1fb4134b.sha256 +32d517f85a574b94d8c74d75ee75c23da312cb32f0563823790882071821ca7f recipe/profiles/agentic.row +a74d40060926471dfb078b56d4c3fe8156e67ed782032b6898520b1b3a2968d2 recipe/profiles/long.row +fd2a7fa7fce01cb4404b6133f4fed48597223638068933cc0e627d5b834ec15a recipe/serve.sh +e70b595e4d96f2666728ff70ba9521df54645099fa84b82e16518997776771bd recipe/stack/SHA256SUMS +61a59cd6f4d9b31abd76da83f67b5797f4a1f5e5ec9ce866e78fdcd8692896eb recipe/stack/cands/n292-v2-v297-pk3c/recipe/CREDITS.md +1a87a7afb937c54991860f623a0365882a854cf08bf058e6efd60e87488fcddd recipe/stack/cands/n292-v2-v297-pk3c/recipe/LICENSE +398c1c6b775c7865ad1c50f1cc73ed01116a4d8e213ed3bcf7eff0bc2d268642 recipe/stack/cands/n292-v2-v297-pk3c/recipe/NOTICE +61a59cd6f4d9b31abd76da83f67b5797f4a1f5e5ec9ce866e78fdcd8692896eb recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_attn/CREDITS.knapcio-v2.9.3.md +1a87a7afb937c54991860f623a0365882a854cf08bf058e6efd60e87488fcddd recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_attn/LICENSE.knapcio-v2.9.3 +398c1c6b775c7865ad1c50f1cc73ed01116a4d8e213ed3bcf7eff0bc2d268642 recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_attn/NOTICE.knapcio-v2.9.3 +4d3f0b284bde7c3a066f1134ec52d1896512804aa92d311b0fb48659cc617bd6 recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_attn/README.md +f7c0b49cfd8e4047947118882ae79b001dfc1486e4dd9ee92e544e89c83c70ca recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_attn/__init__.py +ab12eae066bc1cc54662498a1d7d53aa468619997fc204e6a14ba26715977a0c recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_attn/_hook.py +3cf30a00b0670b0babb2024b85ec88508e66562fe1901e9b2bc51b86275b3a8a recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_attn/build.py +ecd499f8ab53c0d2e03942fd1ef9ba4165ea16b276fbb26b9a5bfbfa078da34a recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_attn/csrc/attn_kernel.cuh +e10f9d601a09d438749189902a4da13411a4318610de2c87d90c0335cec80995 recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_attn/csrc/inkling_attn_ext.cu +8b097c56fbe2b6facb41e80e97e0fd6198fcb0a85460f127a716731b3ae8a921 recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_attn/ops.py +fa70374aba0e5f826993c98cbf4303a0b515f9457b60461dc3f8da30c64f9892 recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_attn/patch.py +0424895a98d8a22a9cdce8c3ac32dd00ce0000c6292e0b6a732848ffc4b426ea recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_attn/tests/test_install.py +9884d1befc3894d1f5f4b4c8b34df827a4bd752232f046673af05db33494009a recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_attn/tests/test_w8split_cpu.py +eb0c172281bf706ade1554a37192d0bf59db643bc1b0cefb7b863b4e93231a4b recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_cert/README.md +5882400af5a589496e782828387924f5e833ebace1356cf72ea720799975d31e recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_cert/__init__.py +ee0ef2ccad715b6614ee88fedd6f5a5a67291e6c76e3fed8c9bf4bf663209858 recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_cert/_hook.py +54869935ed0fc96e98a78e8422b62282693f3231db2883e780a1e0d816f44efd recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_cert/build.py +a254d8f11b5fa27c01c3d5df3584dc703a5140d202955cc963064b2aca5e8677 recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_cert/cert_math.py +0e6a597b3ff6dc12b01e9247906604262006cf2094b7358dab49bc6dd2fa9177 recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_cert/certwide.py +957d0dd2a18d5ac7de6fc88e937052852549750e669af9ebc40abb753c81328d recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_cert/certwide_math.py +dc2b48f09ba8ab465daf9ad63fbc728dbcd01b725798f0a634f8af411022f07b recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_cert/certwide_reduce.py +e2f40277fe04993deed769348905e2e911dcbe218f6f6298c677977e91951669 recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_cert/csrc/cert_ext.cu +88a27a25adb3e0a2553e82cbc30a0c8a02dcf84635048baba921a746fb4cf175 recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_cert/csrc/certwide_screen.cuh +e062ec37ea4eef60f7dd7be2f42b6e2541b06dcdcadc3e255cc1e1fec56ee2ca recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_cert/csrc/screen6.cuh +8398ac6708c32f5fe2224a15e3495708e0760d79564208c822c7bdf9a93ccf92 recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_cert/dflash.py +9d4fd4e0867b28d19bde7c1a47a6dbc462691dee38ab2f34073f454838b374b1 recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_cert/ops.py +2b6ba45d552282da40e2d1d380707dc26ad679eb114fb0bd1c533fe6944a4b2e recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_cert/patches.py +56274922d9aaa203ef2b5bd3dff7d7f3973d562b1f47541dc833669a10b7eeb8 recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_cert/quant.py +689f292b6e85042db4d7f700ef39573dcc1f441683abcae71e5074109c6e8168 recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_cert/tests/test_cert.py +7eec9ed58f35f5ae644b15ead34fc384fe5f1d8eee47f6fe1dd580a9d896e825 recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_cert/tests/test_certwide.py +131940bc65d9c1efca8ccf4816e9f5ae615394510f7bdd70d550cb0200a7e12a recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_cert/tests/test_dflash.py +9c582d423bee68dd253422ad91c42ad6e9d494c67030b0e09e2e660549b2ad83 recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_cert/tests/test_patches.py +089b23ba89259410f7f4c5a73d6a261ac928a44add4f5debeabc84a5b7a9c364 recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_cert/tools/gpu_check_cert.py +1b41188139e5e59c0d1138efbc218aa5469c2b3570fdce2a7f2b790589f991ea recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_cert/tools/smoke_hooks.py +269984f2e0628a6387af93a27350f6ccd53691d6ebc6ff63b4efd83a536fd1c7 recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_dfaccept/README.md +24eb31b321286bef5e99130e3b083ddfe8faafcb342c052305c5a98a5d7d9f59 recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_dfaccept/__init__.py +ab12eae066bc1cc54662498a1d7d53aa468619997fc204e6a14ba26715977a0c recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_dfaccept/_hook.py +7ba089479db0974c09b76f1042f9131bb944e309343d72867c089e9faa3760fe recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_dfaccept/core.py +251128ff0efd9eb43e6a8225570e89d08b6e6b7c7b0cd3d1d8392050a3d9f563 recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_dfaccept/patches.py +5eb381c6c5137f7a670130ad22fe406706dedb095d0a9817f15d57ecddb809e8 recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_dfbytes/README.md +7cf77494d835269f88a704f0eaca2518ff2fda31c60d32d371b757f0db88ec66 recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_dfbytes/__init__.py +ab12eae066bc1cc54662498a1d7d53aa468619997fc204e6a14ba26715977a0c recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_dfbytes/_hook.py +aca345f7e98de7509e7b507e4d401c8692db76687f3ab9116538261f7b143dcb recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_dfbytes/ctx8.py +cebe39ac06717ae5735ff4f839c1e5992a2b2f4ab50d4f98a062baa9c2f4a415 recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_dfbytes/patches.py +f126616fd8682f570af7bdf7ec26e807d40c61051a8049d3e3efa16f94369798 recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_dftail/__init__.py +ab12eae066bc1cc54662498a1d7d53aa468619997fc204e6a14ba26715977a0c recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_dftail/_hook.py +ae77c2c3723aa2cdb32d9f26eea67ee82a44a6c55282483416ed2c801af40296 recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_dftail/_sources.py +6cd072ae1ca44714816b874c733805ea8c3be511a23715829e63298ed8dfd566 recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_dftail/bpatch.py +b23bdb11c23c0cc06297899ca7e71a3f1be781052726427c1b5000e27afb8b0b recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_dftail/snapshot.py +e3b1e2f5194051bba30e455756c6b1943f5aacd03599ce1fa4b1b542844c0663 recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_draftbytes/README.md +8dd8abba6fa60514f4a68c64f54dd8cffedffbaa0982f4d4847be7627e3389c2 recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_draftbytes/__init__.py +812d99b5844ca99e56fa11394663733404441d35c3b42e804d8884a604eab6df recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_draftbytes/_hooks.py +ae8f4cb9cccea61a658bf3de2e0a4ef2cb0d01213915c5ce1732087100976ceb recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_draftbytes/_opts.py +06a22262122f4cc0b9bbf1497b98ab2f331175c2b407fc572284935d228788a5 recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_draftbytes/_triton.py +c3d8459315b854912142d8b6deb7a2d903cee5913bcf2ee6ddb059faeebf9c13 recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_draftbytes/csrc/w8gemv.cu +2430b0bbe643063b7b842df20b5058ca07db302e37e0f199770ffa3fc49a1c3e recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_draftbytes/dwin.py +32bbb9a854451827e7633b19d0bb534e697fbd6c8ee6e76dae412d2dda464a4d recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_draftbytes/hotvocab/inkling2-mini-hot-r2.json +bab4e585eaff5c71e86eaa79bf5a0b9a11fa4bcbbca1495286b29d037d443ef4 recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_draftbytes/ops.py +da084e9753f9d9a80876ac94595a375ec625302e23fac51a72fdc33e681e9cec recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_draftbytes/patches.py +cd3a06f12f2c22cbd73d62b24836eb8fb43b2d57e423ed3b4a18bb0b5df4a6e2 recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_draftbytes/quant.py +f0fbc7e4b44e513c724d7381f6d12b04838cc3826c547be51b36fe1b47c48860 recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_draftbytes/rnnhoist.py +65acc6c881f54a868270eec9e2acdd552fe0158da010dfb001ad112929360682 recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_draftbytes/tau.py +40db95bd0174f5a3d9f732a1e742ff022384884046b1da095e3b76d528f38c28 recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_draftbytes/timing.py +cb76bf7c8ae6b78337483d6e3145b4aadb076db528a7777e95fdc95e804f4346 recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_draftbytes/w8gemv.py +84c62ef2bad39eb126b3f03e356aa8e7149ce00cdef07b441bb8a3066544daef recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_kernels/README.md +cf121c574ddc27aa1ff24138814b25990cf9e6426fe5ac91f08166c9b944073e recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_kernels/__init__.py +ee0ef2ccad715b6614ee88fedd6f5a5a67291e6c76e3fed8c9bf4bf663209858 recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_kernels/_hook.py +75dafe2d6bfbeb65193bbab71f1c915ebca4e3919edb540898f93cf9f7594b7e recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_kernels/moe_tiles.py +97d9379d33afc634a1a91e41e2fef1bda8d1609d19fe58ff95d2adafb5808d6b recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_kernels/qkvr_gemv.py +9886b5e338556024c03dd58a31b14e9e5f03e094609b547915e324f44605857f recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_kv12/README.md +41daa1fc09a60a324539affd7ec9667a0350020fc6633f8c068fec9dc5f78ee0 recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_kv12/__init__.py +ab12eae066bc1cc54662498a1d7d53aa468619997fc204e6a14ba26715977a0c recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_kv12/_hook.py +bc8941909122c51bcc80cb1b37fda233061c0c50c180e031aba3a8c7789e7691 recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_kv12/ops.py +d4514e3786f2dd98370a6126733239344f94280c4b89d7126536b99b66352283 recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_kv12/patch.py +4c035d2a7cfc45f17cf9fb39341a6fa85bc4634b3926725f7d23cd9501808012 recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_kv12s/__init__.py +dd08112a15db424731b25bb3dd8e5d27a688033896fb11269e3c021e6e0f2bdf recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_kv12s/attention.py +6f96ca7ed4d69503bb2e83f95ddf08b201b510acf9cc1b034f724125a726a214 recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_kv12s/check_data.py +10932369507cd317ee7f1ad1966433bfbcb34da2106b795b6b580a60a85e159f recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_kv12s/device.py +616a0ab680b3b259128a39dfeb77d7b8b77ed7cb6bef74d890e0487f38ee507a recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_kv12s/patch.py +3554c61d7da8134766ed41206239065ba1e7b5df3b38a390a66a931876cf4533 recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_kv12s/pressure.py +d0ad1f533a820b97d19ffbc420c8f490497c38641bb48f7328206299aa48f145 recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_kv12s/segsum.py +7d8d61c362c645a610e65d4ccba7e0dce8d46dcd150a27df5d2546fb37093661 recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_kv12s/static.py +37b1fd7d544955e98c4d8ee1d16f4e49e2f945dc18b137b894b1fd5cbe7ce102 recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_kv12s/storage.py +a7a4ce407859b7f31120608314ae7d9f8df8244ef309dcd9cd3aae689f731f0c recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_kv12s/swa_layout.py +bb72def3d71f7cf145079bc5edc4f8ee1a208f15780928b806337826d81bda8d recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_noexp/__init__.py +ab12eae066bc1cc54662498a1d7d53aa468619997fc204e6a14ba26715977a0c recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_noexp/_hook.py +d6207856ed7b8146c9842cbebac87b652a05f9e0c83dd84ef644d7edb4d55c42 recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_noexp/_mask.py +81752701087d7a56045ab97627e3e2ceaf039099d5b561c061321a22acf6b689 recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_padx/__init__.py +ab12eae066bc1cc54662498a1d7d53aa468619997fc204e6a14ba26715977a0c recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_padx/_hook.py +51823f619e768163dbfa547165e7af04ddf93af35ff13e6b8ff0ef02abaaf686 recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_padx/patches.py +2710527dfb9c184e3cc77780c6d69ab64b22bba032daa2087736302d54c5b0d7 recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_pcopy/__init__.py +ab12eae066bc1cc54662498a1d7d53aa468619997fc204e6a14ba26715977a0c recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_pcopy/_hook.py +c210ac609cd5ff936aed7b0d582b5a89dc059cfaab93dc91ad7cd6a445866062 recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_pcopy/_sources.py +2b9b808117ef4b23884652c9a199258bebaacfb485199d434304969ae1f33353 recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_pcopy/fixtures.py +26a153b5ffa4ee27159401581b109872b91216cbd36db8d6f1e04bf43c3ca2f7 recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_pcopy/fused.py +26e1cdbb37a8d7f58d7b92c42270e151d08822d3e9797130dbbb19d483b1352e recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_pcopy/history.py +079f558fe7ddc02f8bd320d71fa329e569bf3e1ecc2c9a419fe32f62b7139192 recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_pcopy/matcher.py +14b3d2fda0fbc5a7a640187872ec77c072f2ba723de74983ab5a63b10fa85545 recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_pcopy/patch.py +89a122d26a44d635e94586af6dfdb50c53f48a462d7ea02395b293fb1ef9c6d3 recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_pcopy/rule.py +61a59cd6f4d9b31abd76da83f67b5797f4a1f5e5ec9ce866e78fdcd8692896eb recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_pfuse/CREDITS.md.knapcio-v2.9.3 +1a87a7afb937c54991860f623a0365882a854cf08bf058e6efd60e87488fcddd recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_pfuse/LICENSE.knapcio-v2.9.3 +398c1c6b775c7865ad1c50f1cc73ed01116a4d8e213ed3bcf7eff0bc2d268642 recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_pfuse/NOTICE.knapcio-v2.9.3 +aa5869a0f6a177c6cda7280c4a2564097a06f02b3e260c4a25cd24a8c6193018 recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_pfuse/README.md +9820ebf80c8ffff40d14244fdab623d1511ea8fc751a1fa8c17f759fade25f9d recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_pfuse/__init__.py +ab12eae066bc1cc54662498a1d7d53aa468619997fc204e6a14ba26715977a0c recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_pfuse/_hook.py +7e47cfd76d45851d371aa23e089deba31c99823e2296ca145522b4d801583b7e recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_pfuse/_triton_mix.py +1930979f4bdc1b97bac83cc95dc4c15ab726b0ce69f11baeda9cf753011c7e41 recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_pfuse/_triton_sconv.py +d3b81190b2622e5a437c823af4ae16e0ebf1e8b631c7a9432bc1e71503bd01ce recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_pfuse/layer.py +508f34216dec13dcc30d77c08cd09d10f7d20bbbb28bb031e90414c7b25d3f8b recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_pfuse/mix.py +32fe8bcacf8d6fc64ee401b014c421c4cdc0d5c6d342a50a489bf65891cbfd5a recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_pfuse/tools/attrib_prefill.py +1ff7a611ad3a7e6ee9955f5ece2fc8778b5e37186bec785bf304e68f997300a3 recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_pfuse/tools/bench_loop.py +467bc7d06db2756307d7da7fc7289c7ff2a2f08d4ec1550cad57b6dcf1bbd73f recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_pfuse/tools/gpu_check_pfuse.py +63f3bbbdc63686529c2ed70ef5a94cbe66ab761a985799f58e27d9aaedacfad8 recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_pfuse/tools/sweep_mix.py +61a59cd6f4d9b31abd76da83f67b5797f4a1f5e5ec9ce866e78fdcd8692896eb recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_phoist/CREDITS.md.knapcio-v2.9.3 +1a87a7afb937c54991860f623a0365882a854cf08bf058e6efd60e87488fcddd recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_phoist/LICENSE.knapcio-v2.9.3 +398c1c6b775c7865ad1c50f1cc73ed01116a4d8e213ed3bcf7eff0bc2d268642 recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_phoist/NOTICE.knapcio-v2.9.3 +26eb3a17f9a426fb11dfec4e294dd2ed187b7104bf36e7588a9d6df8ee63134b recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_phoist/__init__.py +ab12eae066bc1cc54662498a1d7d53aa468619997fc204e6a14ba26715977a0c recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_phoist/_hook.py +ca8c58f123ea47200ca9306f1e043fae10672f381cf96e7685f5f6adff3e953a recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_phoist/phoist.py +f55d49b173b3f6ef080ce2dcc563333f193dfcbf75a7e8f7f6f5b353e4be7576 recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_phoist/phoist_triton.py +a12fbe61a792b2c2c7597b259ab99a0b9656922865a9a24836d92f17e121f876 recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_pico12/README.md +8aeb4211fa86cc155ac12af76eedea7963e96c1f43c766e3c749bcfba35ac370 recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_pico12/__init__.py +ee0ef2ccad715b6614ee88fedd6f5a5a67291e6c76e3fed8c9bf4bf663209858 recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_pico12/_hook.py +0b9cd153d788be7ffed98a8bd0d7b4fbab6222f1e3c06961865a01a6cd991c44 recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_pico12/build.py +aab4b5396310f0f0cbe21c1fcd5906e25b8c62f18689685c48ff5f530622c7c8 recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_pico12/csrc/pico12_ext.cu +8babed542f329a5040a02167d6d30e880d35a4f334b457adff8489dfa198800a recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_pico12/csrc/pico12_range.cu +97329931d0e392fc5ac1292657bb9852bae973fd4336ec47dcea626bd78a09cd recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_pico12/ops.py +1d91c866aaa329e6045d2161a776ba6e2064f3f81b8a6a6903f0bb6c6cc3608e recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_pico12/patches.py +fb9c7ecee826335f6014f5f2040b5abe132a86aa6e43f1545bb1e5db19cea16b recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_pico12/third_party/pico/LICENSE +60b3ad14b8d2291101c82f3cc8c0653a6e778b1db9abfe463992dd3737550b4f recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_pico12/third_party/pico/common/check.h +5d96f43891a930cffa23c8649a79d28d019f7597bf5b2ac51e46eb6de5ff6e87 recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_pico12/third_party/pico/kernels/common.cuh +baa1d8d7ff69d0f132acbfba354eb35dc4e5011b5f3e1ae3d177d6d1dcfb5256 recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_pico12/third_party/pico/kernels/dsk.h +91230a0b0783d2af5da87d6476e60c2dc2d94d60879998e54db547dc6f01982d recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_pico12/third_party/pico/kernels/gemv16.cu +61a59cd6f4d9b31abd76da83f67b5797f4a1f5e5ec9ce866e78fdcd8692896eb recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_prologue/CREDITS.knapcio-v2.9.3.md +1a87a7afb937c54991860f623a0365882a854cf08bf058e6efd60e87488fcddd recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_prologue/LICENSE.knapcio-v2.9.3 +398c1c6b775c7865ad1c50f1cc73ed01116a4d8e213ed3bcf7eff0bc2d268642 recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_prologue/NOTICE.knapcio-v2.9.3 +d807c304d543312f6c3c3e2f1d40a3dcedc982c8bef30a34ca891fe6c7956fbe recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_prologue/__init__.py +ab12eae066bc1cc54662498a1d7d53aa468619997fc204e6a14ba26715977a0c recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_prologue/_hook.py +d83c5b71d817b66804bfaa2c7108a96b4374033102b709639555456feed6478d recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_prologue/_triton.py +fed63858ca1872cf9fc4122cff02af670e297b972df4d075c929c77613b7f6c4 recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_ptouch/__init__.py +ab12eae066bc1cc54662498a1d7d53aa468619997fc204e6a14ba26715977a0c recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_ptouch/_hook.py +b8dfe59c5b140d6a9804be846b06cb4ec07746bb0176ff8b2637177c9487806f recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_rsfix/README.md +edf339d321b72e9207204143906526677b6beacb179e1399ac9dc183ba29bd72 recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_rsfix/__init__.py +2a1eabd10f7e964a53fe76b66254873fcfd461b0d32f7277db42457d7d65990a recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_rsfix/_hook.py +c4e84d4ef8e7343e1563617814c65d0d71fbe19915461d73245818f83e9d1e6c recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_rsfix/_sources.py +e4dfce68cae58f71a0658410fe88e6520f94d6c389f8d57e482dacea363509d8 recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_rsfix/blockwise.py +9530622cde80e49864d60a50342ff1850e6c6389eb1baa0207d68ba6a388005c recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_rsfix/markov.py +93da51652aa8ec27396610a10724b6571e5de8d4ee08e236677c9e98604db951 recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_rsfix/reference.py +61e81094be26a6f8a46f07f1b062b07eab246a52553ed094ba147813d92dd513 recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_rsfix/reject.py +d5607344cacbcf77fb4cdcc6ce9de49a4290bbf85281f78c9c397a2984dc06eb recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_rsfix/selector.py +63c5e7852205045be8bca6e84160df8f2f4dd4f44a8093a6a5a04d9fffbca47e recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_vattn/README.md +a08d05ffbd94bdb1c94194432d927b1f30035fa6f23fcc2adc7de36b2930c78c recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_vattn/__init__.py +ab12eae066bc1cc54662498a1d7d53aa468619997fc204e6a14ba26715977a0c recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_vattn/_hook.py +63aad1d099fec3f2b66a0ffd8d3709a564644edac2d4f25c1c33018be3dd6f25 recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_vattn/ops.py +4f18599a0ad748f7f6a507f165ac72327e733eb082fd6276995b9e4474869652 recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_vattn/patch.py +66f94a7e6143ee5bde5e8f83aefe4333ad9d701282b411f0c30091eff637b3b7 recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_vcap/README.md +6a39653aa552d2035e4700918cf7e6dd488881c46cd4d52a3edf8424fe7f3cbd recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_vcap/__init__.py +01b543f9ea35fd83b4ef34d681b86f6aedd3fc9cbc26b270fb98d3159025c4c2 recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_vcap/config.py +bbe0288dd145ba12f1d7312b7def82a7dc0f76c31b5dfa3e2236730eba177b79 recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_vcap/dfcap.py +9caf5d3ca057b622e4cca6e35456f7435f9e1d1e5df692f491e12271014d8aed recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_vcap/dfcheck.py +f7d2389c58143c3ea661616d82f42e1c7b55b8f95c78dcb424c45d205c4d2203 recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_vcap/dflash.py +41cd33472898d7ad98bcbaae2eaf5c27238069b6cdd7815528c932795673e5da recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_vcap/dfsteplog.py +bda7d9e386db34eb3f3a8c8aeda249b91ff8ec27d176c23fb5574e80ec81c431 recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_vcap/fastprobs.py +d364b1bc5a27dd747b08095030670ac085205454b548ba54b453f96872cd90bb recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_vcap/fused.py +897b421d153acd9c0494e084e0d8227804a00f5d24c245646dec74079c422b84 recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_vcap/fused_accept.py +0a928a2c9b2677ce1a359da34d444b40ff38cc6a01c8f44c5723dbaabb6751e5 recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_vcap/importhook.py +2738304eeff01b7d21c700c7408b24e1c429ad912fdc6e58952cf5a1d2a80963 recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_vcap/logic.py +9ba4bf5aeafcc3d1e58adecbad230cbfa128079c6577843a6e28e40866258a20 recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_vcap/patches.py +21082944e6df1a1eb5d288c226562278d8b493ea37cb6ccbf6a8a98bcaa93cce recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_vcap/policies/df-SLDF1-sm.json +b9505b8e00284277b8354cf72a406d8bc2b465d8619f51f44e8609964093b5ee recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_vcap/policies/df-SLDF2x.json +ab43150b4ff972b9975192761515e843088f8838b765090c888f1c3e79334e9f recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_vcap/policies/r2-theta004.json +359b404bd41371397ec8948ece4700d10e1e2b6271301e47439dc4cd83198310 recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_vcap/policyfile.py +982f86bb234ebfd5ca7f37304ae9bf78b5fa90969e75357a5a44905f8a708f49 recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_vcap/state.py +c7f51ebddeba0c2cb5a11bf8075fec231f081ef58ffd0e2c93097a70ebbca04a recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_vcap/v3_kernels.py +4cd0f8e5854e5ed4f1745e6a56aaeba679c4ec4bc17352960f1f01fe3b8f8cf0 recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_wide/README.md +e473be74143084bca38efb0fce7b281b63239471bc43e99692863dd53b85dd16 recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_wide/__init__.py +ee0ef2ccad715b6614ee88fedd6f5a5a67291e6c76e3fed8c9bf4bf663209858 recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_wide/_hook.py +409563a58078e003f0f61c39162dca23563d08cf6fe3e6ecd53211b30538bd12 recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_wide/build.py +640625aed9282589c3c32b06f0b57be48efd230c88425a4264748fed3f23eb15 recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_wide/csrc/bf16x_format.cuh +a281cb85d1867e5acd8dfe7c8d3b2f1b68b5cb1d3091ad6445eba09d66341e94 recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_wide/csrc/wide_ext.cu +3b12f4ef0077ccc61f4867a1369a66fc2a3b10e791c19f4323956756086418cd recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_wide/ops.py +0deb113320ff36523d0e5a25851c3d27aa9412ed5b74d3fd74288504e0404e09 recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_wide/patches.py +5b3f3070eab76b167d3ac2a7f03cfea9e59901e45dbe3a01059cbe5d423bcdbc recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_wide/tests/fake_wide_ext.py +b436a3347e2e274fc146d5ed6969f489415fa60f0fc0f58593fd0875d1ddfd87 recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_wide/tests/test_wide.py +fb9c7ecee826335f6014f5f2040b5abe132a86aa6e43f1545bb1e5db19cea16b recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_wide/third_party/pico/LICENSE +b37e3528ad0ca2dcbd2ab38ee4be67ec88980e769c4a5dbddfa5b45624f28fa7 recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_wide/tools/gpu_check_wide.py +ff089d1ab9f66eb5ee40a3f77a6193120abc064d9eb97a60e495a5ec3fa743eb recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_wide/tools/gpu_integration_wide.py +7c4ee1a5c11e621b374a4cabe855842cb0b8d6efdf0b766e842bd1b3de3cd2f3 recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/sitecustomize.py +94dff41c4a23af9e57243750d82d08be918de563b63b4d42a41c859051a34426 recipe/stack/cands/n292-v2-v297-pk3c/recipe/patch/inkling2_attn.py +64914ef9213420b37bdb361dfb3bdadb5ff07994deda96c548762e006927bd44 recipe/stack/cands/n292-v2-v297-pk3c/recipe/patch/inkling2_loop.py +70d8797b523b0fcdaad6e709e14bfc4bbdcc735a4b49824b430997ff1018dd78 recipe/stack/cands/n292-v2-v297-pk3c/recipe/patch/inkling2_loop_model.py +29d1f5cb5101a7a0aac48c4b1f15252acaba01a404c6e2475c6c798f0797d997 recipe/stack/cands/n292-v2-v297-pk3c/recipe/patch/n105_rnnhoist.py +9d0231ebab913cb3b3956c421ae5f4f69d2661728f1f8d3b3d64755f9e455f63 recipe/stack/cands/n292-v2-v297-pk3c/recipe/patch/n13_attn_global.py +7d6f1ab93c1252e891446df090e414c6aa975ca480a360b5ac65fb6d16c8be9a recipe/stack/cands/n292-v2-v297-pk3c/recipe/patch/n13_fwd.py +1801287d6696437fa6417c335decf0f4b9deb7391b4d4e4fd8e5c893cf272333 recipe/stack/cands/n292-v2-v297-pk3c/recipe/patch/n140_kern.py +6b69991a90d2ca2a6196d4d1d28014983614a6030d8a38d43aa08c7a29f49f65 recipe/stack/cands/n292-v2-v297-pk3c/recipe/patch/n14_moe.py +8e2d7b61a2ffee1e5bbdaf3f2406a202f13e3a9d96df0f849d35af4d781cac62 recipe/stack/cands/n292-v2-v297-pk3c/recipe/patch/n14_quant.cuh +a67d3cacb45d4a981add4407552b030c8bdf08dabb7e136f555b21475aa3126a recipe/stack/cands/n292-v2-v297-pk3c/recipe/patch/n15_fused.py +e8373342b54dfccbe4c04fd21e137172286b902b07ed6f5037deeb95eb70c9ef recipe/stack/cands/n292-v2-v297-pk3c/recipe/patch/n32_attn_local.py +571c3e4a819b27e175091b7af099e972bc4c38b6eac3f1af1ff4e88b6b662746 recipe/stack/cands/n292-v2-v297-pk3c/recipe/patch/n32_fwd.py +65f51937ca44728959542ca4ed7456973b45e7f32bd54934e44a49ee256630c4 recipe/stack/cands/n292-v2-v297-pk3c/recipe/patch/n35_w8.py +aa79c3095959d385dc1c6f9fdcf7558a73547fcc31c4f6460c6e77cbc9327605 recipe/stack/cands/n292-v2-v297-pk3c/recipe/patch/n35_w8gemv.py +b4cc2402f4c0eee56dc4ce9721043b6d16ed04e932f94848b395f3873f58cb59 recipe/stack/cands/n292-v2-v297-pk3c/recipe/patch/n37_tiles.py +5b1a90477bb2ed2dddf31b3adbc8cb200538335854ddb99ce59ecdf3dbfadfac recipe/stack/cands/n292-v2-v297-pk3c/recipe/patch/n50b_fused.py +1dc6b870ef8c25dd40615930cbf62dfec0e29c5d6b785eb8d42d532ea4a9cd04 recipe/stack/cands/n292-v2-v297-pk3c/recipe/patch/n52_band.cuh +e4118504ce8a210f8d4ef86d1be579dd4d73e4161bb0c9e4264811ad51999140 recipe/stack/cands/n292-v2-v297-pk3c/recipe/patch/n52_moe.py +3523d5fe6549aec71d853c0713403fbdc15984e08c3e5820c2a790a6ede84855 recipe/stack/cands/n292-v2-v297-pk3c/recipe/patch/n64_attn_global.py +eefba4b83410c246441d74d5311deacc6da6e4405d28e3c5b5fa344d4d29eb81 recipe/stack/cands/n292-v2-v297-pk3c/recipe/patch/n64a_fwd.py +cca0cd0d7b860ed4cc78a98651264ecb8fd20793055e58323c2623b8531b6d0d recipe/stack/cands/n292-v2-v297-pk3c/recipe/patch/n64b_fwd.py +d1b88fb14a0d18ccff2ed53b79dcfcb1a2565e50e6cf625053bf39cdc9f1ecd9 recipe/stack/cands/n292-v2-v297-pk3c/recipe/patch/n66fb.py +b7abf0229b9d40558dc6dd576fb300bec9e0a6b9c173b458881111ff0bc89206 recipe/stack/cands/n292-v2-v297-pk3c/recipe/patch/n71_resnorm.py +91f1bb6066a4e5abf77253e23816783880ea38cff649aebd844157b60268c5e7 recipe/stack/cands/n292-v2-v297-pk3c/recipe/patch/n71_sconvres.py +d4411fd151e6212a0feb14ed41457be3c976b92a8f5c981cbc2d1a890075eb7b recipe/stack/cands/n292-v2-v297-pk3c/recipe/patch/n75_c12.py +71fd33a2a119db28c4ca8a24d75e9678131c87b327d095a329fdad18bc03e29a recipe/stack/cands/n292-v2-v297-pk3c/recipe/patch/n75_cuda.py +00bece24b9b910eb33d1f85fe1e60b2685a2ac4dfb5f5136d891b9db668968f7 recipe/stack/cands/n292-v2-v297-pk3c/recipe/patch/n75_install.py +17349b269f1eb7f2551fac79b9e8020b10708410156a08e1b959c8e53f491f79 recipe/stack/cands/n292-v2-v297-pk3c/recipe/patch/n78_head.py +9447c05ffbf888a1aea1a7da467399f572f1d684f142f24c4cccfacefcd353f8 recipe/stack/cands/n292-v2-v297-pk3c/recipe/patch/n78_kern.py +efe43e40ebccb20b31398ef7b7a4e70e0dd1a6192a95904ebb70fb6a8f3d3b73 recipe/stack/cands/n292-v2-v297-pk3c/recipe/patch/n80_cuda.py +cd2d6ef590744ee69cd3b2dfdff9c42cf957eef291f858c3054f1b651b84943f recipe/stack/cands/n292-v2-v297-pk3c/recipe/patch/n80_draft.py +9ba4c20f9fa95c8d9a337f4eeea6abae50e142f747d4dde618712f04e127f56f recipe/stack/cands/n292-v2-v297-pk3c/recipe/patch/n86_riders.py +25030bef80b49e72d46355799e7febea0867ea57aed711f7c9ae28159a81f390 recipe/stack/cands/n292-v2-v297-pk3c/recipe/serve/inkling2_mtp.py +c71f08ef804dc439f08eca133bd2591868c60e535d06819cda55033785bf195f recipe/stack/cands/n292-v2-v297-pk3c/recipe/serve/serve.sh +1bccd9dadf233cd9af15aa63a8d2cc22e0706983355a00e380731d09a5bdb682 recipe/stack/cands/n292-v2-v297-pk3c/recipe/serve/sl.json +61a59cd6f4d9b31abd76da83f67b5797f4a1f5e5ec9ce866e78fdcd8692896eb recipe/stack/cands/n343a-s2-verify-scodes/CREDITS.md +1a87a7afb937c54991860f623a0365882a854cf08bf058e6efd60e87488fcddd recipe/stack/cands/n343a-s2-verify-scodes/LICENSE +398c1c6b775c7865ad1c50f1cc73ed01116a4d8e213ed3bcf7eff0bc2d268642 recipe/stack/cands/n343a-s2-verify-scodes/NOTICE +e07ff88a0574411792e46cebe6bdd276ca1745c440c5c36bff221c72e2d9e190 recipe/stack/cands/n343a-s2-verify-scodes/overlay/inkling_scodes/README.md +34a6e1f889e463443f62aac75b5ba075f8893a2656ba6db992426251cb94dcf0 recipe/stack/cands/n343a-s2-verify-scodes/overlay/inkling_scodes/__init__.py +ee0ef2ccad715b6614ee88fedd6f5a5a67291e6c76e3fed8c9bf4bf663209858 recipe/stack/cands/n343a-s2-verify-scodes/overlay/inkling_scodes/_hook.py +ea07c7f27e5fa867156d316e434ba0a8126a663b54f1a569f675172f18361421 recipe/stack/cands/n343a-s2-verify-scodes/overlay/inkling_scodes/csrc/scodes_args.h +8cb82134421f71f05c629ffd95383748e0ac19fb071b31699a1c432771a781b5 recipe/stack/cands/n343a-s2-verify-scodes/overlay/inkling_scodes/csrc/scodes_binding.cu +060f5b9d3250ca4d2261ded10839ea0010748ecf715cda6fe6ed7af959ce5cca recipe/stack/cands/n343a-s2-verify-scodes/overlay/inkling_scodes/csrc/scodes_group_gemm.cuh +428d428016a533597539acf1d908d5fccc3eba049b71a25ec7049b95b6893d8c recipe/stack/cands/n343a-s2-verify-scodes/overlay/inkling_scodes/csrc/scodes_inst_128_128.cu +c808f4b1e8992dd76a67a00ca6d0fd8f0f762ea05e644f5295c9709f5d565349 recipe/stack/cands/n343a-s2-verify-scodes/overlay/inkling_scodes/csrc/scodes_inst_32_128.cu +39eccddb7294c16dea572ed64e3bdff8d3ee468dd4e98c45bc05c8a387565918 recipe/stack/cands/n343a-s2-verify-scodes/overlay/inkling_scodes/csrc/scodes_inst_32_256.cu +9c6c0ff50971a322ad90de53d27a28e5519b3c0d99134e0c9cdad8f7eff4869c recipe/stack/cands/n343a-s2-verify-scodes/overlay/inkling_scodes/csrc/scodes_inst_64_128.cu +ad5769b8154581a1c7f72abee12fc95486dae9a0332d632887896ba0cd3179a3 recipe/stack/cands/n343a-s2-verify-scodes/overlay/inkling_scodes/csrc/scodes_inst_64_256.cu +4b56d68d7a7fc99932447f14cc4c83542b74ed50bb49bc41bf200c49b2da4ebf recipe/stack/cands/n343a-s2-verify-scodes/overlay/inkling_scodes/csrc/scodes_sm120_mma_array.hpp +9374f3758c08772d6cb7b73885234108bdda93e6184184e784a9589e5cc9cf6c recipe/stack/cands/n343a-s2-verify-scodes/overlay/inkling_scodes/encode.py +e863a5a1d92f938cac6b23cb52d66a4bde210c495940e117f5c8839e5a74fb22 recipe/stack/cands/n343a-s2-verify-scodes/overlay/inkling_scodes/kernel.py +e446d09f6e4d582a4daaccc06f556e184f6919398f62933b6eb30a4f48c6d1d8 recipe/stack/cands/n361-s3b-p/overlay_n320/inkling_n320s/__init__.py +c7095f22f861b691071abb1c4303ac97e7431d7744f7c1c441eed16df5da552f recipe/stack/cands/n361-s3b-p/overlay_n320/inkling_n329/__init__.py +7f57e8170a49f4bf179c9ccf50b59a4570e0fd5f6e54d890faf8bded7e847396 recipe/stack/cands/n361-s3b-p/overlay_n320/inkling_n329/n329_rows.py +b93d559f1b964104903f96dcb4508020dcdcc65b012c885bf9e2505c92c89701 recipe/stack/cands/n361-s3b-p/overlay_n320/inkling_n329/n329_rows_ctl.py +53a039ef443368a80a306757a3009181a7e9c15c41770efccf5f58895f836ebc recipe/stack/cands/n361-s3b-p/overlay_n320/inkling_n351/__init__.py +fbae72358a1bdc41225f5d00e37c7e8013a5660c4c4e2cdd39a05525f2ee2aeb recipe/stack/cands/n361-s3b-p/overlay_n320/n351_quant.cuh +172e5b9281facac196160b287aa56a9a3eb79a0fcbf87f0e94c776c0e0520863 recipe/stack/cands/n361-s3b-p/overlay_n320/sitecustomize.py +61a59cd6f4d9b31abd76da83f67b5797f4a1f5e5ec9ce866e78fdcd8692896eb recipe/stack/cands/n361-s3b-p/recipe/CREDITS.md +1a87a7afb937c54991860f623a0365882a854cf08bf058e6efd60e87488fcddd recipe/stack/cands/n361-s3b-p/recipe/LICENSE +398c1c6b775c7865ad1c50f1cc73ed01116a4d8e213ed3bcf7eff0bc2d268642 recipe/stack/cands/n361-s3b-p/recipe/NOTICE +cfc7749b96f63bd31c3c42b5c471bf756814053e847c10f3eb003417bc523d30 recipe/stack/cands/n361-s3b-p/recipe/draft-mix/LICENSE +298b4ff803f06cbb4024bd5cdcc53dfa1ba06825936d31a776ef70fe6d30c2a0 recipe/stack/cands/n361-s3b-p/recipe/draft-mix/NOTICE +61a59cd6f4d9b31abd76da83f67b5797f4a1f5e5ec9ce866e78fdcd8692896eb recipe/stack/cands/n361-s3b-p/recipe/overlay/inkling_attn/CREDITS.knapcio-v2.9.3.md +1a87a7afb937c54991860f623a0365882a854cf08bf058e6efd60e87488fcddd recipe/stack/cands/n361-s3b-p/recipe/overlay/inkling_attn/LICENSE.knapcio-v2.9.3 +398c1c6b775c7865ad1c50f1cc73ed01116a4d8e213ed3bcf7eff0bc2d268642 recipe/stack/cands/n361-s3b-p/recipe/overlay/inkling_attn/NOTICE.knapcio-v2.9.3 +4d3f0b284bde7c3a066f1134ec52d1896512804aa92d311b0fb48659cc617bd6 recipe/stack/cands/n361-s3b-p/recipe/overlay/inkling_attn/README.md +f7c0b49cfd8e4047947118882ae79b001dfc1486e4dd9ee92e544e89c83c70ca recipe/stack/cands/n361-s3b-p/recipe/overlay/inkling_attn/__init__.py +ab12eae066bc1cc54662498a1d7d53aa468619997fc204e6a14ba26715977a0c recipe/stack/cands/n361-s3b-p/recipe/overlay/inkling_attn/_hook.py +3cf30a00b0670b0babb2024b85ec88508e66562fe1901e9b2bc51b86275b3a8a recipe/stack/cands/n361-s3b-p/recipe/overlay/inkling_attn/build.py +ecd499f8ab53c0d2e03942fd1ef9ba4165ea16b276fbb26b9a5bfbfa078da34a recipe/stack/cands/n361-s3b-p/recipe/overlay/inkling_attn/csrc/attn_kernel.cuh +e10f9d601a09d438749189902a4da13411a4318610de2c87d90c0335cec80995 recipe/stack/cands/n361-s3b-p/recipe/overlay/inkling_attn/csrc/inkling_attn_ext.cu +8b097c56fbe2b6facb41e80e97e0fd6198fcb0a85460f127a716731b3ae8a921 recipe/stack/cands/n361-s3b-p/recipe/overlay/inkling_attn/ops.py +fa70374aba0e5f826993c98cbf4303a0b515f9457b60461dc3f8da30c64f9892 recipe/stack/cands/n361-s3b-p/recipe/overlay/inkling_attn/patch.py +0424895a98d8a22a9cdce8c3ac32dd00ce0000c6292e0b6a732848ffc4b426ea recipe/stack/cands/n361-s3b-p/recipe/overlay/inkling_attn/tests/test_install.py +9884d1befc3894d1f5f4b4c8b34df827a4bd752232f046673af05db33494009a recipe/stack/cands/n361-s3b-p/recipe/overlay/inkling_attn/tests/test_w8split_cpu.py +eb0c172281bf706ade1554a37192d0bf59db643bc1b0cefb7b863b4e93231a4b recipe/stack/cands/n361-s3b-p/recipe/overlay/inkling_cert/README.md +5882400af5a589496e782828387924f5e833ebace1356cf72ea720799975d31e recipe/stack/cands/n361-s3b-p/recipe/overlay/inkling_cert/__init__.py +ee0ef2ccad715b6614ee88fedd6f5a5a67291e6c76e3fed8c9bf4bf663209858 recipe/stack/cands/n361-s3b-p/recipe/overlay/inkling_cert/_hook.py +54869935ed0fc96e98a78e8422b62282693f3231db2883e780a1e0d816f44efd recipe/stack/cands/n361-s3b-p/recipe/overlay/inkling_cert/build.py +a254d8f11b5fa27c01c3d5df3584dc703a5140d202955cc963064b2aca5e8677 recipe/stack/cands/n361-s3b-p/recipe/overlay/inkling_cert/cert_math.py +0e6a597b3ff6dc12b01e9247906604262006cf2094b7358dab49bc6dd2fa9177 recipe/stack/cands/n361-s3b-p/recipe/overlay/inkling_cert/certwide.py +957d0dd2a18d5ac7de6fc88e937052852549750e669af9ebc40abb753c81328d recipe/stack/cands/n361-s3b-p/recipe/overlay/inkling_cert/certwide_math.py +dc2b48f09ba8ab465daf9ad63fbc728dbcd01b725798f0a634f8af411022f07b recipe/stack/cands/n361-s3b-p/recipe/overlay/inkling_cert/certwide_reduce.py +e2f40277fe04993deed769348905e2e911dcbe218f6f6298c677977e91951669 recipe/stack/cands/n361-s3b-p/recipe/overlay/inkling_cert/csrc/cert_ext.cu +88a27a25adb3e0a2553e82cbc30a0c8a02dcf84635048baba921a746fb4cf175 recipe/stack/cands/n361-s3b-p/recipe/overlay/inkling_cert/csrc/certwide_screen.cuh +e062ec37ea4eef60f7dd7be2f42b6e2541b06dcdcadc3e255cc1e1fec56ee2ca recipe/stack/cands/n361-s3b-p/recipe/overlay/inkling_cert/csrc/screen6.cuh +8398ac6708c32f5fe2224a15e3495708e0760d79564208c822c7bdf9a93ccf92 recipe/stack/cands/n361-s3b-p/recipe/overlay/inkling_cert/dflash.py +9d4fd4e0867b28d19bde7c1a47a6dbc462691dee38ab2f34073f454838b374b1 recipe/stack/cands/n361-s3b-p/recipe/overlay/inkling_cert/ops.py +2b6ba45d552282da40e2d1d380707dc26ad679eb114fb0bd1c533fe6944a4b2e recipe/stack/cands/n361-s3b-p/recipe/overlay/inkling_cert/patches.py +56274922d9aaa203ef2b5bd3dff7d7f3973d562b1f47541dc833669a10b7eeb8 recipe/stack/cands/n361-s3b-p/recipe/overlay/inkling_cert/quant.py +689f292b6e85042db4d7f700ef39573dcc1f441683abcae71e5074109c6e8168 recipe/stack/cands/n361-s3b-p/recipe/overlay/inkling_cert/tests/test_cert.py +7eec9ed58f35f5ae644b15ead34fc384fe5f1d8eee47f6fe1dd580a9d896e825 recipe/stack/cands/n361-s3b-p/recipe/overlay/inkling_cert/tests/test_certwide.py +131940bc65d9c1efca8ccf4816e9f5ae615394510f7bdd70d550cb0200a7e12a recipe/stack/cands/n361-s3b-p/recipe/overlay/inkling_cert/tests/test_dflash.py +9c582d423bee68dd253422ad91c42ad6e9d494c67030b0e09e2e660549b2ad83 recipe/stack/cands/n361-s3b-p/recipe/overlay/inkling_cert/tests/test_patches.py +089b23ba89259410f7f4c5a73d6a261ac928a44add4f5debeabc84a5b7a9c364 recipe/stack/cands/n361-s3b-p/recipe/overlay/inkling_cert/tools/gpu_check_cert.py +1b41188139e5e59c0d1138efbc218aa5469c2b3570fdce2a7f2b790589f991ea recipe/stack/cands/n361-s3b-p/recipe/overlay/inkling_cert/tools/smoke_hooks.py +269984f2e0628a6387af93a27350f6ccd53691d6ebc6ff63b4efd83a536fd1c7 recipe/stack/cands/n361-s3b-p/recipe/overlay/inkling_dfaccept/README.md +24eb31b321286bef5e99130e3b083ddfe8faafcb342c052305c5a98a5d7d9f59 recipe/stack/cands/n361-s3b-p/recipe/overlay/inkling_dfaccept/__init__.py +ab12eae066bc1cc54662498a1d7d53aa468619997fc204e6a14ba26715977a0c recipe/stack/cands/n361-s3b-p/recipe/overlay/inkling_dfaccept/_hook.py +7ba089479db0974c09b76f1042f9131bb944e309343d72867c089e9faa3760fe recipe/stack/cands/n361-s3b-p/recipe/overlay/inkling_dfaccept/core.py +251128ff0efd9eb43e6a8225570e89d08b6e6b7c7b0cd3d1d8392050a3d9f563 recipe/stack/cands/n361-s3b-p/recipe/overlay/inkling_dfaccept/patches.py +5eb381c6c5137f7a670130ad22fe406706dedb095d0a9817f15d57ecddb809e8 recipe/stack/cands/n361-s3b-p/recipe/overlay/inkling_dfbytes/README.md +7cf77494d835269f88a704f0eaca2518ff2fda31c60d32d371b757f0db88ec66 recipe/stack/cands/n361-s3b-p/recipe/overlay/inkling_dfbytes/__init__.py +ab12eae066bc1cc54662498a1d7d53aa468619997fc204e6a14ba26715977a0c recipe/stack/cands/n361-s3b-p/recipe/overlay/inkling_dfbytes/_hook.py +aca345f7e98de7509e7b507e4d401c8692db76687f3ab9116538261f7b143dcb recipe/stack/cands/n361-s3b-p/recipe/overlay/inkling_dfbytes/ctx8.py +cebe39ac06717ae5735ff4f839c1e5992a2b2f4ab50d4f98a062baa9c2f4a415 recipe/stack/cands/n361-s3b-p/recipe/overlay/inkling_dfbytes/patches.py +f126616fd8682f570af7bdf7ec26e807d40c61051a8049d3e3efa16f94369798 recipe/stack/cands/n361-s3b-p/recipe/overlay/inkling_dftail/__init__.py +ab12eae066bc1cc54662498a1d7d53aa468619997fc204e6a14ba26715977a0c recipe/stack/cands/n361-s3b-p/recipe/overlay/inkling_dftail/_hook.py +ae77c2c3723aa2cdb32d9f26eea67ee82a44a6c55282483416ed2c801af40296 recipe/stack/cands/n361-s3b-p/recipe/overlay/inkling_dftail/_sources.py +6cd072ae1ca44714816b874c733805ea8c3be511a23715829e63298ed8dfd566 recipe/stack/cands/n361-s3b-p/recipe/overlay/inkling_dftail/bpatch.py +b23bdb11c23c0cc06297899ca7e71a3f1be781052726427c1b5000e27afb8b0b recipe/stack/cands/n361-s3b-p/recipe/overlay/inkling_dftail/snapshot.py +e3b1e2f5194051bba30e455756c6b1943f5aacd03599ce1fa4b1b542844c0663 recipe/stack/cands/n361-s3b-p/recipe/overlay/inkling_draftbytes/README.md +8dd8abba6fa60514f4a68c64f54dd8cffedffbaa0982f4d4847be7627e3389c2 recipe/stack/cands/n361-s3b-p/recipe/overlay/inkling_draftbytes/__init__.py +812d99b5844ca99e56fa11394663733404441d35c3b42e804d8884a604eab6df recipe/stack/cands/n361-s3b-p/recipe/overlay/inkling_draftbytes/_hooks.py +ae8f4cb9cccea61a658bf3de2e0a4ef2cb0d01213915c5ce1732087100976ceb recipe/stack/cands/n361-s3b-p/recipe/overlay/inkling_draftbytes/_opts.py +06a22262122f4cc0b9bbf1497b98ab2f331175c2b407fc572284935d228788a5 recipe/stack/cands/n361-s3b-p/recipe/overlay/inkling_draftbytes/_triton.py +c3d8459315b854912142d8b6deb7a2d903cee5913bcf2ee6ddb059faeebf9c13 recipe/stack/cands/n361-s3b-p/recipe/overlay/inkling_draftbytes/csrc/w8gemv.cu +2430b0bbe643063b7b842df20b5058ca07db302e37e0f199770ffa3fc49a1c3e recipe/stack/cands/n361-s3b-p/recipe/overlay/inkling_draftbytes/dwin.py +32bbb9a854451827e7633b19d0bb534e697fbd6c8ee6e76dae412d2dda464a4d recipe/stack/cands/n361-s3b-p/recipe/overlay/inkling_draftbytes/hotvocab/inkling2-mini-hot-r2.json +bab4e585eaff5c71e86eaa79bf5a0b9a11fa4bcbbca1495286b29d037d443ef4 recipe/stack/cands/n361-s3b-p/recipe/overlay/inkling_draftbytes/ops.py +da084e9753f9d9a80876ac94595a375ec625302e23fac51a72fdc33e681e9cec recipe/stack/cands/n361-s3b-p/recipe/overlay/inkling_draftbytes/patches.py +cd3a06f12f2c22cbd73d62b24836eb8fb43b2d57e423ed3b4a18bb0b5df4a6e2 recipe/stack/cands/n361-s3b-p/recipe/overlay/inkling_draftbytes/quant.py +f0fbc7e4b44e513c724d7381f6d12b04838cc3826c547be51b36fe1b47c48860 recipe/stack/cands/n361-s3b-p/recipe/overlay/inkling_draftbytes/rnnhoist.py +65acc6c881f54a868270eec9e2acdd552fe0158da010dfb001ad112929360682 recipe/stack/cands/n361-s3b-p/recipe/overlay/inkling_draftbytes/tau.py +40db95bd0174f5a3d9f732a1e742ff022384884046b1da095e3b76d528f38c28 recipe/stack/cands/n361-s3b-p/recipe/overlay/inkling_draftbytes/timing.py +cb76bf7c8ae6b78337483d6e3145b4aadb076db528a7777e95fdc95e804f4346 recipe/stack/cands/n361-s3b-p/recipe/overlay/inkling_draftbytes/w8gemv.py +84c62ef2bad39eb126b3f03e356aa8e7149ce00cdef07b441bb8a3066544daef recipe/stack/cands/n361-s3b-p/recipe/overlay/inkling_kernels/README.md +cf121c574ddc27aa1ff24138814b25990cf9e6426fe5ac91f08166c9b944073e recipe/stack/cands/n361-s3b-p/recipe/overlay/inkling_kernels/__init__.py +ee0ef2ccad715b6614ee88fedd6f5a5a67291e6c76e3fed8c9bf4bf663209858 recipe/stack/cands/n361-s3b-p/recipe/overlay/inkling_kernels/_hook.py +75dafe2d6bfbeb65193bbab71f1c915ebca4e3919edb540898f93cf9f7594b7e recipe/stack/cands/n361-s3b-p/recipe/overlay/inkling_kernels/moe_tiles.py +97d9379d33afc634a1a91e41e2fef1bda8d1609d19fe58ff95d2adafb5808d6b recipe/stack/cands/n361-s3b-p/recipe/overlay/inkling_kernels/qkvr_gemv.py +9886b5e338556024c03dd58a31b14e9e5f03e094609b547915e324f44605857f recipe/stack/cands/n361-s3b-p/recipe/overlay/inkling_kv12/README.md +41daa1fc09a60a324539affd7ec9667a0350020fc6633f8c068fec9dc5f78ee0 recipe/stack/cands/n361-s3b-p/recipe/overlay/inkling_kv12/__init__.py +ab12eae066bc1cc54662498a1d7d53aa468619997fc204e6a14ba26715977a0c recipe/stack/cands/n361-s3b-p/recipe/overlay/inkling_kv12/_hook.py +bc8941909122c51bcc80cb1b37fda233061c0c50c180e031aba3a8c7789e7691 recipe/stack/cands/n361-s3b-p/recipe/overlay/inkling_kv12/ops.py +d4514e3786f2dd98370a6126733239344f94280c4b89d7126536b99b66352283 recipe/stack/cands/n361-s3b-p/recipe/overlay/inkling_kv12/patch.py +4c035d2a7cfc45f17cf9fb39341a6fa85bc4634b3926725f7d23cd9501808012 recipe/stack/cands/n361-s3b-p/recipe/overlay/inkling_kv12s/__init__.py +dd08112a15db424731b25bb3dd8e5d27a688033896fb11269e3c021e6e0f2bdf recipe/stack/cands/n361-s3b-p/recipe/overlay/inkling_kv12s/attention.py +6f96ca7ed4d69503bb2e83f95ddf08b201b510acf9cc1b034f724125a726a214 recipe/stack/cands/n361-s3b-p/recipe/overlay/inkling_kv12s/check_data.py +10932369507cd317ee7f1ad1966433bfbcb34da2106b795b6b580a60a85e159f recipe/stack/cands/n361-s3b-p/recipe/overlay/inkling_kv12s/device.py +616a0ab680b3b259128a39dfeb77d7b8b77ed7cb6bef74d890e0487f38ee507a recipe/stack/cands/n361-s3b-p/recipe/overlay/inkling_kv12s/patch.py +3554c61d7da8134766ed41206239065ba1e7b5df3b38a390a66a931876cf4533 recipe/stack/cands/n361-s3b-p/recipe/overlay/inkling_kv12s/pressure.py +d0ad1f533a820b97d19ffbc420c8f490497c38641bb48f7328206299aa48f145 recipe/stack/cands/n361-s3b-p/recipe/overlay/inkling_kv12s/segsum.py +7d8d61c362c645a610e65d4ccba7e0dce8d46dcd150a27df5d2546fb37093661 recipe/stack/cands/n361-s3b-p/recipe/overlay/inkling_kv12s/static.py +37b1fd7d544955e98c4d8ee1d16f4e49e2f945dc18b137b894b1fd5cbe7ce102 recipe/stack/cands/n361-s3b-p/recipe/overlay/inkling_kv12s/storage.py +a7a4ce407859b7f31120608314ae7d9f8df8244ef309dcd9cd3aae689f731f0c recipe/stack/cands/n361-s3b-p/recipe/overlay/inkling_kv12s/swa_layout.py +5b2d5c191cffda9cb772e493514b06b8e87e94e46fdbf36b1ad4b5a9ac4487da recipe/stack/cands/n361-s3b-p/recipe/overlay/inkling_mixdraft/__init__.py +83a952e187fb34e111798adf45ebf18a2e3546b6647657f4ea0effe3370192da recipe/stack/cands/n361-s3b-p/recipe/overlay/inkling_mixdraft/kernel.py +df3f862c7d93b8be6e82498afeb62e3144d15b7a0c876a96ba464f4c9f71cd4d recipe/stack/cands/n361-s3b-p/recipe/overlay/inkling_mixdraft/linear.py +bb72def3d71f7cf145079bc5edc4f8ee1a208f15780928b806337826d81bda8d recipe/stack/cands/n361-s3b-p/recipe/overlay/inkling_noexp/__init__.py +ab12eae066bc1cc54662498a1d7d53aa468619997fc204e6a14ba26715977a0c recipe/stack/cands/n361-s3b-p/recipe/overlay/inkling_noexp/_hook.py +d6207856ed7b8146c9842cbebac87b652a05f9e0c83dd84ef644d7edb4d55c42 recipe/stack/cands/n361-s3b-p/recipe/overlay/inkling_noexp/_mask.py +81752701087d7a56045ab97627e3e2ceaf039099d5b561c061321a22acf6b689 recipe/stack/cands/n361-s3b-p/recipe/overlay/inkling_padx/__init__.py +ab12eae066bc1cc54662498a1d7d53aa468619997fc204e6a14ba26715977a0c recipe/stack/cands/n361-s3b-p/recipe/overlay/inkling_padx/_hook.py +51823f619e768163dbfa547165e7af04ddf93af35ff13e6b8ff0ef02abaaf686 recipe/stack/cands/n361-s3b-p/recipe/overlay/inkling_padx/patches.py +2710527dfb9c184e3cc77780c6d69ab64b22bba032daa2087736302d54c5b0d7 recipe/stack/cands/n361-s3b-p/recipe/overlay/inkling_pcopy/__init__.py +ab12eae066bc1cc54662498a1d7d53aa468619997fc204e6a14ba26715977a0c recipe/stack/cands/n361-s3b-p/recipe/overlay/inkling_pcopy/_hook.py +c210ac609cd5ff936aed7b0d582b5a89dc059cfaab93dc91ad7cd6a445866062 recipe/stack/cands/n361-s3b-p/recipe/overlay/inkling_pcopy/_sources.py +2b9b808117ef4b23884652c9a199258bebaacfb485199d434304969ae1f33353 recipe/stack/cands/n361-s3b-p/recipe/overlay/inkling_pcopy/fixtures.py +26a153b5ffa4ee27159401581b109872b91216cbd36db8d6f1e04bf43c3ca2f7 recipe/stack/cands/n361-s3b-p/recipe/overlay/inkling_pcopy/fused.py +26e1cdbb37a8d7f58d7b92c42270e151d08822d3e9797130dbbb19d483b1352e recipe/stack/cands/n361-s3b-p/recipe/overlay/inkling_pcopy/history.py +079f558fe7ddc02f8bd320d71fa329e569bf3e1ecc2c9a419fe32f62b7139192 recipe/stack/cands/n361-s3b-p/recipe/overlay/inkling_pcopy/matcher.py +14b3d2fda0fbc5a7a640187872ec77c072f2ba723de74983ab5a63b10fa85545 recipe/stack/cands/n361-s3b-p/recipe/overlay/inkling_pcopy/patch.py +89a122d26a44d635e94586af6dfdb50c53f48a462d7ea02395b293fb1ef9c6d3 recipe/stack/cands/n361-s3b-p/recipe/overlay/inkling_pcopy/rule.py +61a59cd6f4d9b31abd76da83f67b5797f4a1f5e5ec9ce866e78fdcd8692896eb recipe/stack/cands/n361-s3b-p/recipe/overlay/inkling_pfuse/CREDITS.md.knapcio-v2.9.3 +1a87a7afb937c54991860f623a0365882a854cf08bf058e6efd60e87488fcddd recipe/stack/cands/n361-s3b-p/recipe/overlay/inkling_pfuse/LICENSE.knapcio-v2.9.3 +398c1c6b775c7865ad1c50f1cc73ed01116a4d8e213ed3bcf7eff0bc2d268642 recipe/stack/cands/n361-s3b-p/recipe/overlay/inkling_pfuse/NOTICE.knapcio-v2.9.3 +aa5869a0f6a177c6cda7280c4a2564097a06f02b3e260c4a25cd24a8c6193018 recipe/stack/cands/n361-s3b-p/recipe/overlay/inkling_pfuse/README.md +9820ebf80c8ffff40d14244fdab623d1511ea8fc751a1fa8c17f759fade25f9d recipe/stack/cands/n361-s3b-p/recipe/overlay/inkling_pfuse/__init__.py +ab12eae066bc1cc54662498a1d7d53aa468619997fc204e6a14ba26715977a0c recipe/stack/cands/n361-s3b-p/recipe/overlay/inkling_pfuse/_hook.py +7e47cfd76d45851d371aa23e089deba31c99823e2296ca145522b4d801583b7e recipe/stack/cands/n361-s3b-p/recipe/overlay/inkling_pfuse/_triton_mix.py +1930979f4bdc1b97bac83cc95dc4c15ab726b0ce69f11baeda9cf753011c7e41 recipe/stack/cands/n361-s3b-p/recipe/overlay/inkling_pfuse/_triton_sconv.py +d3b81190b2622e5a437c823af4ae16e0ebf1e8b631c7a9432bc1e71503bd01ce recipe/stack/cands/n361-s3b-p/recipe/overlay/inkling_pfuse/layer.py +508f34216dec13dcc30d77c08cd09d10f7d20bbbb28bb031e90414c7b25d3f8b recipe/stack/cands/n361-s3b-p/recipe/overlay/inkling_pfuse/mix.py +32fe8bcacf8d6fc64ee401b014c421c4cdc0d5c6d342a50a489bf65891cbfd5a recipe/stack/cands/n361-s3b-p/recipe/overlay/inkling_pfuse/tools/attrib_prefill.py +1ff7a611ad3a7e6ee9955f5ece2fc8778b5e37186bec785bf304e68f997300a3 recipe/stack/cands/n361-s3b-p/recipe/overlay/inkling_pfuse/tools/bench_loop.py +467bc7d06db2756307d7da7fc7289c7ff2a2f08d4ec1550cad57b6dcf1bbd73f recipe/stack/cands/n361-s3b-p/recipe/overlay/inkling_pfuse/tools/gpu_check_pfuse.py +63f3bbbdc63686529c2ed70ef5a94cbe66ab761a985799f58e27d9aaedacfad8 recipe/stack/cands/n361-s3b-p/recipe/overlay/inkling_pfuse/tools/sweep_mix.py +61a59cd6f4d9b31abd76da83f67b5797f4a1f5e5ec9ce866e78fdcd8692896eb recipe/stack/cands/n361-s3b-p/recipe/overlay/inkling_phoist/CREDITS.md.knapcio-v2.9.3 +1a87a7afb937c54991860f623a0365882a854cf08bf058e6efd60e87488fcddd recipe/stack/cands/n361-s3b-p/recipe/overlay/inkling_phoist/LICENSE.knapcio-v2.9.3 +398c1c6b775c7865ad1c50f1cc73ed01116a4d8e213ed3bcf7eff0bc2d268642 recipe/stack/cands/n361-s3b-p/recipe/overlay/inkling_phoist/NOTICE.knapcio-v2.9.3 +26eb3a17f9a426fb11dfec4e294dd2ed187b7104bf36e7588a9d6df8ee63134b recipe/stack/cands/n361-s3b-p/recipe/overlay/inkling_phoist/__init__.py +ab12eae066bc1cc54662498a1d7d53aa468619997fc204e6a14ba26715977a0c recipe/stack/cands/n361-s3b-p/recipe/overlay/inkling_phoist/_hook.py +ca8c58f123ea47200ca9306f1e043fae10672f381cf96e7685f5f6adff3e953a recipe/stack/cands/n361-s3b-p/recipe/overlay/inkling_phoist/phoist.py +f55d49b173b3f6ef080ce2dcc563333f193dfcbf75a7e8f7f6f5b353e4be7576 recipe/stack/cands/n361-s3b-p/recipe/overlay/inkling_phoist/phoist_triton.py +a12fbe61a792b2c2c7597b259ab99a0b9656922865a9a24836d92f17e121f876 recipe/stack/cands/n361-s3b-p/recipe/overlay/inkling_pico12/README.md +8aeb4211fa86cc155ac12af76eedea7963e96c1f43c766e3c749bcfba35ac370 recipe/stack/cands/n361-s3b-p/recipe/overlay/inkling_pico12/__init__.py +ee0ef2ccad715b6614ee88fedd6f5a5a67291e6c76e3fed8c9bf4bf663209858 recipe/stack/cands/n361-s3b-p/recipe/overlay/inkling_pico12/_hook.py +0b9cd153d788be7ffed98a8bd0d7b4fbab6222f1e3c06961865a01a6cd991c44 recipe/stack/cands/n361-s3b-p/recipe/overlay/inkling_pico12/build.py +aab4b5396310f0f0cbe21c1fcd5906e25b8c62f18689685c48ff5f530622c7c8 recipe/stack/cands/n361-s3b-p/recipe/overlay/inkling_pico12/csrc/pico12_ext.cu +8babed542f329a5040a02167d6d30e880d35a4f334b457adff8489dfa198800a recipe/stack/cands/n361-s3b-p/recipe/overlay/inkling_pico12/csrc/pico12_range.cu +97329931d0e392fc5ac1292657bb9852bae973fd4336ec47dcea626bd78a09cd recipe/stack/cands/n361-s3b-p/recipe/overlay/inkling_pico12/ops.py +1d91c866aaa329e6045d2161a776ba6e2064f3f81b8a6a6903f0bb6c6cc3608e recipe/stack/cands/n361-s3b-p/recipe/overlay/inkling_pico12/patches.py +fb9c7ecee826335f6014f5f2040b5abe132a86aa6e43f1545bb1e5db19cea16b recipe/stack/cands/n361-s3b-p/recipe/overlay/inkling_pico12/third_party/pico/LICENSE +60b3ad14b8d2291101c82f3cc8c0653a6e778b1db9abfe463992dd3737550b4f recipe/stack/cands/n361-s3b-p/recipe/overlay/inkling_pico12/third_party/pico/common/check.h +5d96f43891a930cffa23c8649a79d28d019f7597bf5b2ac51e46eb6de5ff6e87 recipe/stack/cands/n361-s3b-p/recipe/overlay/inkling_pico12/third_party/pico/kernels/common.cuh +baa1d8d7ff69d0f132acbfba354eb35dc4e5011b5f3e1ae3d177d6d1dcfb5256 recipe/stack/cands/n361-s3b-p/recipe/overlay/inkling_pico12/third_party/pico/kernels/dsk.h +91230a0b0783d2af5da87d6476e60c2dc2d94d60879998e54db547dc6f01982d recipe/stack/cands/n361-s3b-p/recipe/overlay/inkling_pico12/third_party/pico/kernels/gemv16.cu +61a59cd6f4d9b31abd76da83f67b5797f4a1f5e5ec9ce866e78fdcd8692896eb recipe/stack/cands/n361-s3b-p/recipe/overlay/inkling_prologue/CREDITS.knapcio-v2.9.3.md +1a87a7afb937c54991860f623a0365882a854cf08bf058e6efd60e87488fcddd recipe/stack/cands/n361-s3b-p/recipe/overlay/inkling_prologue/LICENSE.knapcio-v2.9.3 +398c1c6b775c7865ad1c50f1cc73ed01116a4d8e213ed3bcf7eff0bc2d268642 recipe/stack/cands/n361-s3b-p/recipe/overlay/inkling_prologue/NOTICE.knapcio-v2.9.3 +d807c304d543312f6c3c3e2f1d40a3dcedc982c8bef30a34ca891fe6c7956fbe recipe/stack/cands/n361-s3b-p/recipe/overlay/inkling_prologue/__init__.py +ab12eae066bc1cc54662498a1d7d53aa468619997fc204e6a14ba26715977a0c recipe/stack/cands/n361-s3b-p/recipe/overlay/inkling_prologue/_hook.py +d83c5b71d817b66804bfaa2c7108a96b4374033102b709639555456feed6478d recipe/stack/cands/n361-s3b-p/recipe/overlay/inkling_prologue/_triton.py +fed63858ca1872cf9fc4122cff02af670e297b972df4d075c929c77613b7f6c4 recipe/stack/cands/n361-s3b-p/recipe/overlay/inkling_ptouch/__init__.py +ab12eae066bc1cc54662498a1d7d53aa468619997fc204e6a14ba26715977a0c recipe/stack/cands/n361-s3b-p/recipe/overlay/inkling_ptouch/_hook.py +b8dfe59c5b140d6a9804be846b06cb4ec07746bb0176ff8b2637177c9487806f recipe/stack/cands/n361-s3b-p/recipe/overlay/inkling_rsfix/README.md +edf339d321b72e9207204143906526677b6beacb179e1399ac9dc183ba29bd72 recipe/stack/cands/n361-s3b-p/recipe/overlay/inkling_rsfix/__init__.py +2a1eabd10f7e964a53fe76b66254873fcfd461b0d32f7277db42457d7d65990a recipe/stack/cands/n361-s3b-p/recipe/overlay/inkling_rsfix/_hook.py +c4e84d4ef8e7343e1563617814c65d0d71fbe19915461d73245818f83e9d1e6c recipe/stack/cands/n361-s3b-p/recipe/overlay/inkling_rsfix/_sources.py +e4dfce68cae58f71a0658410fe88e6520f94d6c389f8d57e482dacea363509d8 recipe/stack/cands/n361-s3b-p/recipe/overlay/inkling_rsfix/blockwise.py +9530622cde80e49864d60a50342ff1850e6c6389eb1baa0207d68ba6a388005c recipe/stack/cands/n361-s3b-p/recipe/overlay/inkling_rsfix/markov.py +93da51652aa8ec27396610a10724b6571e5de8d4ee08e236677c9e98604db951 recipe/stack/cands/n361-s3b-p/recipe/overlay/inkling_rsfix/reference.py +61e81094be26a6f8a46f07f1b062b07eab246a52553ed094ba147813d92dd513 recipe/stack/cands/n361-s3b-p/recipe/overlay/inkling_rsfix/reject.py +d5607344cacbcf77fb4cdcc6ce9de49a4290bbf85281f78c9c397a2984dc06eb recipe/stack/cands/n361-s3b-p/recipe/overlay/inkling_rsfix/selector.py +63c5e7852205045be8bca6e84160df8f2f4dd4f44a8093a6a5a04d9fffbca47e recipe/stack/cands/n361-s3b-p/recipe/overlay/inkling_vattn/README.md +a08d05ffbd94bdb1c94194432d927b1f30035fa6f23fcc2adc7de36b2930c78c recipe/stack/cands/n361-s3b-p/recipe/overlay/inkling_vattn/__init__.py +ab12eae066bc1cc54662498a1d7d53aa468619997fc204e6a14ba26715977a0c recipe/stack/cands/n361-s3b-p/recipe/overlay/inkling_vattn/_hook.py +63aad1d099fec3f2b66a0ffd8d3709a564644edac2d4f25c1c33018be3dd6f25 recipe/stack/cands/n361-s3b-p/recipe/overlay/inkling_vattn/ops.py +4f18599a0ad748f7f6a507f165ac72327e733eb082fd6276995b9e4474869652 recipe/stack/cands/n361-s3b-p/recipe/overlay/inkling_vattn/patch.py +66f94a7e6143ee5bde5e8f83aefe4333ad9d701282b411f0c30091eff637b3b7 recipe/stack/cands/n361-s3b-p/recipe/overlay/inkling_vcap/README.md +6a39653aa552d2035e4700918cf7e6dd488881c46cd4d52a3edf8424fe7f3cbd recipe/stack/cands/n361-s3b-p/recipe/overlay/inkling_vcap/__init__.py +01b543f9ea35fd83b4ef34d681b86f6aedd3fc9cbc26b270fb98d3159025c4c2 recipe/stack/cands/n361-s3b-p/recipe/overlay/inkling_vcap/config.py +bbe0288dd145ba12f1d7312b7def82a7dc0f76c31b5dfa3e2236730eba177b79 recipe/stack/cands/n361-s3b-p/recipe/overlay/inkling_vcap/dfcap.py +9caf5d3ca057b622e4cca6e35456f7435f9e1d1e5df692f491e12271014d8aed recipe/stack/cands/n361-s3b-p/recipe/overlay/inkling_vcap/dfcheck.py +f7d2389c58143c3ea661616d82f42e1c7b55b8f95c78dcb424c45d205c4d2203 recipe/stack/cands/n361-s3b-p/recipe/overlay/inkling_vcap/dflash.py +41cd33472898d7ad98bcbaae2eaf5c27238069b6cdd7815528c932795673e5da recipe/stack/cands/n361-s3b-p/recipe/overlay/inkling_vcap/dfsteplog.py +bda7d9e386db34eb3f3a8c8aeda249b91ff8ec27d176c23fb5574e80ec81c431 recipe/stack/cands/n361-s3b-p/recipe/overlay/inkling_vcap/fastprobs.py +d364b1bc5a27dd747b08095030670ac085205454b548ba54b453f96872cd90bb recipe/stack/cands/n361-s3b-p/recipe/overlay/inkling_vcap/fused.py +897b421d153acd9c0494e084e0d8227804a00f5d24c245646dec74079c422b84 recipe/stack/cands/n361-s3b-p/recipe/overlay/inkling_vcap/fused_accept.py +0a928a2c9b2677ce1a359da34d444b40ff38cc6a01c8f44c5723dbaabb6751e5 recipe/stack/cands/n361-s3b-p/recipe/overlay/inkling_vcap/importhook.py +2738304eeff01b7d21c700c7408b24e1c429ad912fdc6e58952cf5a1d2a80963 recipe/stack/cands/n361-s3b-p/recipe/overlay/inkling_vcap/logic.py +9ba4bf5aeafcc3d1e58adecbad230cbfa128079c6577843a6e28e40866258a20 recipe/stack/cands/n361-s3b-p/recipe/overlay/inkling_vcap/patches.py +21082944e6df1a1eb5d288c226562278d8b493ea37cb6ccbf6a8a98bcaa93cce recipe/stack/cands/n361-s3b-p/recipe/overlay/inkling_vcap/policies/df-SLDF1-sm.json +b9505b8e00284277b8354cf72a406d8bc2b465d8619f51f44e8609964093b5ee recipe/stack/cands/n361-s3b-p/recipe/overlay/inkling_vcap/policies/df-SLDF2x.json +ab43150b4ff972b9975192761515e843088f8838b765090c888f1c3e79334e9f recipe/stack/cands/n361-s3b-p/recipe/overlay/inkling_vcap/policies/r2-theta004.json +359b404bd41371397ec8948ece4700d10e1e2b6271301e47439dc4cd83198310 recipe/stack/cands/n361-s3b-p/recipe/overlay/inkling_vcap/policyfile.py +982f86bb234ebfd5ca7f37304ae9bf78b5fa90969e75357a5a44905f8a708f49 recipe/stack/cands/n361-s3b-p/recipe/overlay/inkling_vcap/state.py +c7f51ebddeba0c2cb5a11bf8075fec231f081ef58ffd0e2c93097a70ebbca04a recipe/stack/cands/n361-s3b-p/recipe/overlay/inkling_vcap/v3_kernels.py +4cd0f8e5854e5ed4f1745e6a56aaeba679c4ec4bc17352960f1f01fe3b8f8cf0 recipe/stack/cands/n361-s3b-p/recipe/overlay/inkling_wide/README.md +e473be74143084bca38efb0fce7b281b63239471bc43e99692863dd53b85dd16 recipe/stack/cands/n361-s3b-p/recipe/overlay/inkling_wide/__init__.py +ee0ef2ccad715b6614ee88fedd6f5a5a67291e6c76e3fed8c9bf4bf663209858 recipe/stack/cands/n361-s3b-p/recipe/overlay/inkling_wide/_hook.py +409563a58078e003f0f61c39162dca23563d08cf6fe3e6ecd53211b30538bd12 recipe/stack/cands/n361-s3b-p/recipe/overlay/inkling_wide/build.py +640625aed9282589c3c32b06f0b57be48efd230c88425a4264748fed3f23eb15 recipe/stack/cands/n361-s3b-p/recipe/overlay/inkling_wide/csrc/bf16x_format.cuh +a281cb85d1867e5acd8dfe7c8d3b2f1b68b5cb1d3091ad6445eba09d66341e94 recipe/stack/cands/n361-s3b-p/recipe/overlay/inkling_wide/csrc/wide_ext.cu +3b12f4ef0077ccc61f4867a1369a66fc2a3b10e791c19f4323956756086418cd recipe/stack/cands/n361-s3b-p/recipe/overlay/inkling_wide/ops.py +0deb113320ff36523d0e5a25851c3d27aa9412ed5b74d3fd74288504e0404e09 recipe/stack/cands/n361-s3b-p/recipe/overlay/inkling_wide/patches.py +5b3f3070eab76b167d3ac2a7f03cfea9e59901e45dbe3a01059cbe5d423bcdbc recipe/stack/cands/n361-s3b-p/recipe/overlay/inkling_wide/tests/fake_wide_ext.py +b436a3347e2e274fc146d5ed6969f489415fa60f0fc0f58593fd0875d1ddfd87 recipe/stack/cands/n361-s3b-p/recipe/overlay/inkling_wide/tests/test_wide.py +fb9c7ecee826335f6014f5f2040b5abe132a86aa6e43f1545bb1e5db19cea16b recipe/stack/cands/n361-s3b-p/recipe/overlay/inkling_wide/third_party/pico/LICENSE +b37e3528ad0ca2dcbd2ab38ee4be67ec88980e769c4a5dbddfa5b45624f28fa7 recipe/stack/cands/n361-s3b-p/recipe/overlay/inkling_wide/tools/gpu_check_wide.py +ff089d1ab9f66eb5ee40a3f77a6193120abc064d9eb97a60e495a5ec3fa743eb recipe/stack/cands/n361-s3b-p/recipe/overlay/inkling_wide/tools/gpu_integration_wide.py +65acb522ac26d4bdacff65abacf544479da47d7bc6d43ed97b319972a36b560a recipe/stack/cands/n361-s3b-p/recipe/overlay/sitecustomize.py +1f64526e4dcec5cd6d3cd3d842ebbf74035e4f34b64aeb7d761693b8198bd924 recipe/stack/cands/n361-s3b-p/recipe/patch/inkling2_attn.py +64914ef9213420b37bdb361dfb3bdadb5ff07994deda96c548762e006927bd44 recipe/stack/cands/n361-s3b-p/recipe/patch/inkling2_loop.py +70d8797b523b0fcdaad6e709e14bfc4bbdcc735a4b49824b430997ff1018dd78 recipe/stack/cands/n361-s3b-p/recipe/patch/inkling2_loop_model.py +29d1f5cb5101a7a0aac48c4b1f15252acaba01a404c6e2475c6c798f0797d997 recipe/stack/cands/n361-s3b-p/recipe/patch/n105_rnnhoist.py +9d0231ebab913cb3b3956c421ae5f4f69d2661728f1f8d3b3d64755f9e455f63 recipe/stack/cands/n361-s3b-p/recipe/patch/n13_attn_global.py +7d6f1ab93c1252e891446df090e414c6aa975ca480a360b5ac65fb6d16c8be9a recipe/stack/cands/n361-s3b-p/recipe/patch/n13_fwd.py +1801287d6696437fa6417c335decf0f4b9deb7391b4d4e4fd8e5c893cf272333 recipe/stack/cands/n361-s3b-p/recipe/patch/n140_kern.py +6b69991a90d2ca2a6196d4d1d28014983614a6030d8a38d43aa08c7a29f49f65 recipe/stack/cands/n361-s3b-p/recipe/patch/n14_moe.py +8e2d7b61a2ffee1e5bbdaf3f2406a202f13e3a9d96df0f849d35af4d781cac62 recipe/stack/cands/n361-s3b-p/recipe/patch/n14_quant.cuh +a67d3cacb45d4a981add4407552b030c8bdf08dabb7e136f555b21475aa3126a recipe/stack/cands/n361-s3b-p/recipe/patch/n15_fused.py +e8373342b54dfccbe4c04fd21e137172286b902b07ed6f5037deeb95eb70c9ef recipe/stack/cands/n361-s3b-p/recipe/patch/n32_attn_local.py +571c3e4a819b27e175091b7af099e972bc4c38b6eac3f1af1ff4e88b6b662746 recipe/stack/cands/n361-s3b-p/recipe/patch/n32_fwd.py +65f51937ca44728959542ca4ed7456973b45e7f32bd54934e44a49ee256630c4 recipe/stack/cands/n361-s3b-p/recipe/patch/n35_w8.py +aa79c3095959d385dc1c6f9fdcf7558a73547fcc31c4f6460c6e77cbc9327605 recipe/stack/cands/n361-s3b-p/recipe/patch/n35_w8gemv.py +b4cc2402f4c0eee56dc4ce9721043b6d16ed04e932f94848b395f3873f58cb59 recipe/stack/cands/n361-s3b-p/recipe/patch/n37_tiles.py +5b1a90477bb2ed2dddf31b3adbc8cb200538335854ddb99ce59ecdf3dbfadfac recipe/stack/cands/n361-s3b-p/recipe/patch/n50b_fused.py +1dc6b870ef8c25dd40615930cbf62dfec0e29c5d6b785eb8d42d532ea4a9cd04 recipe/stack/cands/n361-s3b-p/recipe/patch/n52_band.cuh +e4118504ce8a210f8d4ef86d1be579dd4d73e4161bb0c9e4264811ad51999140 recipe/stack/cands/n361-s3b-p/recipe/patch/n52_moe.py +3523d5fe6549aec71d853c0713403fbdc15984e08c3e5820c2a790a6ede84855 recipe/stack/cands/n361-s3b-p/recipe/patch/n64_attn_global.py +eefba4b83410c246441d74d5311deacc6da6e4405d28e3c5b5fa344d4d29eb81 recipe/stack/cands/n361-s3b-p/recipe/patch/n64a_fwd.py +cca0cd0d7b860ed4cc78a98651264ecb8fd20793055e58323c2623b8531b6d0d recipe/stack/cands/n361-s3b-p/recipe/patch/n64b_fwd.py +d1b88fb14a0d18ccff2ed53b79dcfcb1a2565e50e6cf625053bf39cdc9f1ecd9 recipe/stack/cands/n361-s3b-p/recipe/patch/n66fb.py +b7abf0229b9d40558dc6dd576fb300bec9e0a6b9c173b458881111ff0bc89206 recipe/stack/cands/n361-s3b-p/recipe/patch/n71_resnorm.py +91f1bb6066a4e5abf77253e23816783880ea38cff649aebd844157b60268c5e7 recipe/stack/cands/n361-s3b-p/recipe/patch/n71_sconvres.py +d4411fd151e6212a0feb14ed41457be3c976b92a8f5c981cbc2d1a890075eb7b recipe/stack/cands/n361-s3b-p/recipe/patch/n75_c12.py +71fd33a2a119db28c4ca8a24d75e9678131c87b327d095a329fdad18bc03e29a recipe/stack/cands/n361-s3b-p/recipe/patch/n75_cuda.py +00bece24b9b910eb33d1f85fe1e60b2685a2ac4dfb5f5136d891b9db668968f7 recipe/stack/cands/n361-s3b-p/recipe/patch/n75_install.py +17349b269f1eb7f2551fac79b9e8020b10708410156a08e1b959c8e53f491f79 recipe/stack/cands/n361-s3b-p/recipe/patch/n78_head.py +9447c05ffbf888a1aea1a7da467399f572f1d684f142f24c4cccfacefcd353f8 recipe/stack/cands/n361-s3b-p/recipe/patch/n78_kern.py +efe43e40ebccb20b31398ef7b7a4e70e0dd1a6192a95904ebb70fb6a8f3d3b73 recipe/stack/cands/n361-s3b-p/recipe/patch/n80_cuda.py +cd2d6ef590744ee69cd3b2dfdff9c42cf957eef291f858c3054f1b651b84943f recipe/stack/cands/n361-s3b-p/recipe/patch/n80_draft.py +9ba4c20f9fa95c8d9a337f4eeea6abae50e142f747d4dde618712f04e127f56f recipe/stack/cands/n361-s3b-p/recipe/patch/n86_riders.py +25030bef80b49e72d46355799e7febea0867ea57aed711f7c9ae28159a81f390 recipe/stack/cands/n361-s3b-p/recipe/serve/inkling2_mtp.py +c71f08ef804dc439f08eca133bd2591868c60e535d06819cda55033785bf195f recipe/stack/cands/n361-s3b-p/recipe/serve/serve.sh +1bccd9dadf233cd9af15aa63a8d2cc22e0706983355a00e380731d09a5bdb682 recipe/stack/cands/n361-s3b-p/recipe/serve/sl.json +e446d09f6e4d582a4daaccc06f556e184f6919398f62933b6eb30a4f48c6d1d8 recipe/stack/cands/n362j-e35d7419/overlay_n362j/inkling_n320s/__init__.py +c7095f22f861b691071abb1c4303ac97e7431d7744f7c1c441eed16df5da552f recipe/stack/cands/n362j-e35d7419/overlay_n362j/inkling_n329/__init__.py +7f57e8170a49f4bf179c9ccf50b59a4570e0fd5f6e54d890faf8bded7e847396 recipe/stack/cands/n362j-e35d7419/overlay_n362j/inkling_n329/n329_rows.py +b93d559f1b964104903f96dcb4508020dcdcc65b012c885bf9e2505c92c89701 recipe/stack/cands/n362j-e35d7419/overlay_n362j/inkling_n329/n329_rows_ctl.py +53a039ef443368a80a306757a3009181a7e9c15c41770efccf5f58895f836ebc recipe/stack/cands/n362j-e35d7419/overlay_n362j/inkling_n351/__init__.py +21c6bb2fb7a4f89883d7e3a7a961fa3dc70214add3946eea0453ce9ca5eb1bc8 recipe/stack/cands/n362j-e35d7419/overlay_n362j/inkling_n355/__init__.py +008b6b876291608b74d67cd8cf8a1388fd3ff834e3f09eccf5aaa4aadc39d605 recipe/stack/cands/n362j-e35d7419/overlay_n362j/inkling_n381/__init__.py +61a59cd6f4d9b31abd76da83f67b5797f4a1f5e5ec9ce866e78fdcd8692896eb recipe/stack/cands/n362j-e35d7419/overlay_n362j/inkling_n389/CREDITS.knapcio-v2.9.3.md +1a87a7afb937c54991860f623a0365882a854cf08bf058e6efd60e87488fcddd recipe/stack/cands/n362j-e35d7419/overlay_n362j/inkling_n389/LICENSE.knapcio-v2.9.3 +398c1c6b775c7865ad1c50f1cc73ed01116a4d8e213ed3bcf7eff0bc2d268642 recipe/stack/cands/n362j-e35d7419/overlay_n362j/inkling_n389/NOTICE.knapcio-v2.9.3 +d2244f97dadfcac0397db826a15785ab3c2c8223936542793bd899b95ded96b4 recipe/stack/cands/n362j-e35d7419/overlay_n362j/inkling_n389/NOTICE.n389 +218f78d74077c1ccfbe6f57c97198dd27febe31b8eda0104f7150dbbcf189dc0 recipe/stack/cands/n362j-e35d7419/overlay_n362j/inkling_n389/__init__.py +60bfcb1846f6ff35cb49914112b968b7ed064749bbfabe1e53f5d0b8fa99b3dc recipe/stack/cands/n362j-e35d7419/overlay_n362j/inkling_n389/n389_fold.py +fbae72358a1bdc41225f5d00e37c7e8013a5660c4c4e2cdd39a05525f2ee2aeb recipe/stack/cands/n362j-e35d7419/overlay_n362j/n351_quant.cuh +f52c80f1a1809cbc9023eec0bc80ed8b75ae7f8c38d2821ee9ee944f3776cb12 recipe/stack/cands/n362j-e35d7419/overlay_n362j/n355_quant.cuh +906b487474bbb2823e8b022ed6e6309d486c2dede36ba6cd626987d5d01682ce recipe/stack/cands/n362j-e35d7419/overlay_n362j/n381c_band.cuh +d0e71fae12062a48d86e8c32c74057dad55030eba16595637a667d47f7faed91 recipe/stack/cands/n362j-e35d7419/overlay_n362j/sitecustomize.py +e01c50cbc6fd57a4a80fdb31c7953fda1a31189caa7406578af95282f68160fb recipe/stack/cands/n419ab-6d18f8eb/df-r1b2.json +e446d09f6e4d582a4daaccc06f556e184f6919398f62933b6eb30a4f48c6d1d8 recipe/stack/cands/n419c-8f01ac06/overlay_n419c/inkling_n320s/__init__.py +c7095f22f861b691071abb1c4303ac97e7431d7744f7c1c441eed16df5da552f recipe/stack/cands/n419c-8f01ac06/overlay_n419c/inkling_n329/__init__.py +7f57e8170a49f4bf179c9ccf50b59a4570e0fd5f6e54d890faf8bded7e847396 recipe/stack/cands/n419c-8f01ac06/overlay_n419c/inkling_n329/n329_rows.py +b93d559f1b964104903f96dcb4508020dcdcc65b012c885bf9e2505c92c89701 recipe/stack/cands/n419c-8f01ac06/overlay_n419c/inkling_n329/n329_rows_ctl.py +53a039ef443368a80a306757a3009181a7e9c15c41770efccf5f58895f836ebc recipe/stack/cands/n419c-8f01ac06/overlay_n419c/inkling_n351/__init__.py +21c6bb2fb7a4f89883d7e3a7a961fa3dc70214add3946eea0453ce9ca5eb1bc8 recipe/stack/cands/n419c-8f01ac06/overlay_n419c/inkling_n355/__init__.py +008b6b876291608b74d67cd8cf8a1388fd3ff834e3f09eccf5aaa4aadc39d605 recipe/stack/cands/n419c-8f01ac06/overlay_n419c/inkling_n381/__init__.py +61a59cd6f4d9b31abd76da83f67b5797f4a1f5e5ec9ce866e78fdcd8692896eb recipe/stack/cands/n419c-8f01ac06/overlay_n419c/inkling_n389/CREDITS.knapcio-v2.9.3.md +1a87a7afb937c54991860f623a0365882a854cf08bf058e6efd60e87488fcddd recipe/stack/cands/n419c-8f01ac06/overlay_n419c/inkling_n389/LICENSE.knapcio-v2.9.3 +398c1c6b775c7865ad1c50f1cc73ed01116a4d8e213ed3bcf7eff0bc2d268642 recipe/stack/cands/n419c-8f01ac06/overlay_n419c/inkling_n389/NOTICE.knapcio-v2.9.3 +d2244f97dadfcac0397db826a15785ab3c2c8223936542793bd899b95ded96b4 recipe/stack/cands/n419c-8f01ac06/overlay_n419c/inkling_n389/NOTICE.n389 +218f78d74077c1ccfbe6f57c97198dd27febe31b8eda0104f7150dbbcf189dc0 recipe/stack/cands/n419c-8f01ac06/overlay_n419c/inkling_n389/__init__.py +60bfcb1846f6ff35cb49914112b968b7ed064749bbfabe1e53f5d0b8fa99b3dc recipe/stack/cands/n419c-8f01ac06/overlay_n419c/inkling_n389/n389_fold.py +fb1dbfad967ba0dde9ef5388065522c25f7b941767d8a9c7b38772c82ed504f2 recipe/stack/cands/n419c-8f01ac06/overlay_n419c/inkling_n395/CREDITS.n395.md +1495e1e757ef4d0925a2350563cf5754bb23c51701a8ec4fb3c5cdcbedae6747 recipe/stack/cands/n419c-8f01ac06/overlay_n419c/inkling_n395/LICENSE.sglang +5231b461b3afdf993dcf18e8bf9ba0d2224862bf2d18bc1595786305a37a0b08 recipe/stack/cands/n419c-8f01ac06/overlay_n419c/inkling_n395/NOTICE.n395 +159aa3fb6a260f9d31f59f6f0cee8d788fb6df89ef878b67704362964511ef3d recipe/stack/cands/n419c-8f01ac06/overlay_n419c/inkling_n395/__init__.py +f91db648419151f0ea309ff118a42671fb6f57c2f407fb3c29ae5fab8c3013e6 recipe/stack/cands/n419c-8f01ac06/overlay_n419c/inkling_n395/n395_fold.py +e3c66465c3b4073378524540f526db49f63d0b48431c02f9f7deebe8df23cea0 recipe/stack/cands/n419c-8f01ac06/overlay_n419c/inkling_n395/n438_fold.py +0e6c97c168fbe1a87166ac0f87c013a4f2a056d0171de7992e44b99ee97a212a recipe/stack/cands/n419c-8f01ac06/overlay_n419c/inkling_n437/__init__.py +fbae72358a1bdc41225f5d00e37c7e8013a5660c4c4e2cdd39a05525f2ee2aeb recipe/stack/cands/n419c-8f01ac06/overlay_n419c/n351_quant.cuh +f52c80f1a1809cbc9023eec0bc80ed8b75ae7f8c38d2821ee9ee944f3776cb12 recipe/stack/cands/n419c-8f01ac06/overlay_n419c/n355_quant.cuh +906b487474bbb2823e8b022ed6e6309d486c2dede36ba6cd626987d5d01682ce recipe/stack/cands/n419c-8f01ac06/overlay_n419c/n381c_band.cuh +bf46f120897ec6fed90ab204d23a9be5ae4d507d832b6a0ff99c56e0463ad2d7 recipe/stack/cands/n419c-8f01ac06/overlay_n419c/sitecustomize.py +8e3b8e0156229c28f335bc7f8a171567839652343c0750e3c1053cdc64ab2e38 recipe/stack/cands/n419j3-2416d17a/overlay_dfglobal/inkling_dfglobal/__init__.py +ab12eae066bc1cc54662498a1d7d53aa468619997fc204e6a14ba26715977a0c recipe/stack/cands/n419j3-2416d17a/overlay_dfglobal/inkling_dfglobal/_hook.py +e446d09f6e4d582a4daaccc06f556e184f6919398f62933b6eb30a4f48c6d1d8 recipe/stack/cands/n419j3-2416d17a/overlay_n419j/inkling_n320s/__init__.py +c7095f22f861b691071abb1c4303ac97e7431d7744f7c1c441eed16df5da552f recipe/stack/cands/n419j3-2416d17a/overlay_n419j/inkling_n329/__init__.py +7f57e8170a49f4bf179c9ccf50b59a4570e0fd5f6e54d890faf8bded7e847396 recipe/stack/cands/n419j3-2416d17a/overlay_n419j/inkling_n329/n329_rows.py +b93d559f1b964104903f96dcb4508020dcdcc65b012c885bf9e2505c92c89701 recipe/stack/cands/n419j3-2416d17a/overlay_n419j/inkling_n329/n329_rows_ctl.py +53a039ef443368a80a306757a3009181a7e9c15c41770efccf5f58895f836ebc recipe/stack/cands/n419j3-2416d17a/overlay_n419j/inkling_n351/__init__.py +21c6bb2fb7a4f89883d7e3a7a961fa3dc70214add3946eea0453ce9ca5eb1bc8 recipe/stack/cands/n419j3-2416d17a/overlay_n419j/inkling_n355/__init__.py +008b6b876291608b74d67cd8cf8a1388fd3ff834e3f09eccf5aaa4aadc39d605 recipe/stack/cands/n419j3-2416d17a/overlay_n419j/inkling_n381/__init__.py +61a59cd6f4d9b31abd76da83f67b5797f4a1f5e5ec9ce866e78fdcd8692896eb recipe/stack/cands/n419j3-2416d17a/overlay_n419j/inkling_n389/CREDITS.knapcio-v2.9.3.md +1a87a7afb937c54991860f623a0365882a854cf08bf058e6efd60e87488fcddd recipe/stack/cands/n419j3-2416d17a/overlay_n419j/inkling_n389/LICENSE.knapcio-v2.9.3 +398c1c6b775c7865ad1c50f1cc73ed01116a4d8e213ed3bcf7eff0bc2d268642 recipe/stack/cands/n419j3-2416d17a/overlay_n419j/inkling_n389/NOTICE.knapcio-v2.9.3 +d2244f97dadfcac0397db826a15785ab3c2c8223936542793bd899b95ded96b4 recipe/stack/cands/n419j3-2416d17a/overlay_n419j/inkling_n389/NOTICE.n389 +218f78d74077c1ccfbe6f57c97198dd27febe31b8eda0104f7150dbbcf189dc0 recipe/stack/cands/n419j3-2416d17a/overlay_n419j/inkling_n389/__init__.py +60bfcb1846f6ff35cb49914112b968b7ed064749bbfabe1e53f5d0b8fa99b3dc recipe/stack/cands/n419j3-2416d17a/overlay_n419j/inkling_n389/n389_fold.py +fbae72358a1bdc41225f5d00e37c7e8013a5660c4c4e2cdd39a05525f2ee2aeb recipe/stack/cands/n419j3-2416d17a/overlay_n419j/n351_quant.cuh +f52c80f1a1809cbc9023eec0bc80ed8b75ae7f8c38d2821ee9ee944f3776cb12 recipe/stack/cands/n419j3-2416d17a/overlay_n419j/n355_quant.cuh +906b487474bbb2823e8b022ed6e6309d486c2dede36ba6cd626987d5d01682ce recipe/stack/cands/n419j3-2416d17a/overlay_n419j/n381c_band.cuh +d551992419fd5498de5acfe99fb28c9e5695d869e7cdac00c47b0728b12ebd94 recipe/stack/cands/n419j3-2416d17a/overlay_n419j/sitecustomize.py +ac94bb9163aa7ee6b467f8dcc5e3d51ab8aab3d2ab509ab11e3c63895561f3c1 recipe/stack/cands/n419j3-2416d17a/overlay_pcopyro/inkling_pcopyro/__init__.py +61a59cd6f4d9b31abd76da83f67b5797f4a1f5e5ec9ce866e78fdcd8692896eb recipe/stack/cands/n419j3-2416d17a/recipe/CREDITS.md +1a87a7afb937c54991860f623a0365882a854cf08bf058e6efd60e87488fcddd recipe/stack/cands/n419j3-2416d17a/recipe/LICENSE +398c1c6b775c7865ad1c50f1cc73ed01116a4d8e213ed3bcf7eff0bc2d268642 recipe/stack/cands/n419j3-2416d17a/recipe/NOTICE +61a59cd6f4d9b31abd76da83f67b5797f4a1f5e5ec9ce866e78fdcd8692896eb recipe/stack/cands/n419j3-2416d17a/recipe/overlay/inkling_attn/CREDITS.knapcio-v2.9.3.md +1a87a7afb937c54991860f623a0365882a854cf08bf058e6efd60e87488fcddd recipe/stack/cands/n419j3-2416d17a/recipe/overlay/inkling_attn/LICENSE.knapcio-v2.9.3 +398c1c6b775c7865ad1c50f1cc73ed01116a4d8e213ed3bcf7eff0bc2d268642 recipe/stack/cands/n419j3-2416d17a/recipe/overlay/inkling_attn/NOTICE.knapcio-v2.9.3 +4d3f0b284bde7c3a066f1134ec52d1896512804aa92d311b0fb48659cc617bd6 recipe/stack/cands/n419j3-2416d17a/recipe/overlay/inkling_attn/README.md +f7c0b49cfd8e4047947118882ae79b001dfc1486e4dd9ee92e544e89c83c70ca recipe/stack/cands/n419j3-2416d17a/recipe/overlay/inkling_attn/__init__.py +ab12eae066bc1cc54662498a1d7d53aa468619997fc204e6a14ba26715977a0c recipe/stack/cands/n419j3-2416d17a/recipe/overlay/inkling_attn/_hook.py +3cf30a00b0670b0babb2024b85ec88508e66562fe1901e9b2bc51b86275b3a8a recipe/stack/cands/n419j3-2416d17a/recipe/overlay/inkling_attn/build.py +ecd499f8ab53c0d2e03942fd1ef9ba4165ea16b276fbb26b9a5bfbfa078da34a recipe/stack/cands/n419j3-2416d17a/recipe/overlay/inkling_attn/csrc/attn_kernel.cuh +e10f9d601a09d438749189902a4da13411a4318610de2c87d90c0335cec80995 recipe/stack/cands/n419j3-2416d17a/recipe/overlay/inkling_attn/csrc/inkling_attn_ext.cu +8b097c56fbe2b6facb41e80e97e0fd6198fcb0a85460f127a716731b3ae8a921 recipe/stack/cands/n419j3-2416d17a/recipe/overlay/inkling_attn/ops.py +fa70374aba0e5f826993c98cbf4303a0b515f9457b60461dc3f8da30c64f9892 recipe/stack/cands/n419j3-2416d17a/recipe/overlay/inkling_attn/patch.py +0424895a98d8a22a9cdce8c3ac32dd00ce0000c6292e0b6a732848ffc4b426ea recipe/stack/cands/n419j3-2416d17a/recipe/overlay/inkling_attn/tests/test_install.py +9884d1befc3894d1f5f4b4c8b34df827a4bd752232f046673af05db33494009a recipe/stack/cands/n419j3-2416d17a/recipe/overlay/inkling_attn/tests/test_w8split_cpu.py +eb0c172281bf706ade1554a37192d0bf59db643bc1b0cefb7b863b4e93231a4b recipe/stack/cands/n419j3-2416d17a/recipe/overlay/inkling_cert/README.md +5882400af5a589496e782828387924f5e833ebace1356cf72ea720799975d31e recipe/stack/cands/n419j3-2416d17a/recipe/overlay/inkling_cert/__init__.py +ee0ef2ccad715b6614ee88fedd6f5a5a67291e6c76e3fed8c9bf4bf663209858 recipe/stack/cands/n419j3-2416d17a/recipe/overlay/inkling_cert/_hook.py +54869935ed0fc96e98a78e8422b62282693f3231db2883e780a1e0d816f44efd recipe/stack/cands/n419j3-2416d17a/recipe/overlay/inkling_cert/build.py +a254d8f11b5fa27c01c3d5df3584dc703a5140d202955cc963064b2aca5e8677 recipe/stack/cands/n419j3-2416d17a/recipe/overlay/inkling_cert/cert_math.py +0e6a597b3ff6dc12b01e9247906604262006cf2094b7358dab49bc6dd2fa9177 recipe/stack/cands/n419j3-2416d17a/recipe/overlay/inkling_cert/certwide.py +957d0dd2a18d5ac7de6fc88e937052852549750e669af9ebc40abb753c81328d recipe/stack/cands/n419j3-2416d17a/recipe/overlay/inkling_cert/certwide_math.py +dc2b48f09ba8ab465daf9ad63fbc728dbcd01b725798f0a634f8af411022f07b recipe/stack/cands/n419j3-2416d17a/recipe/overlay/inkling_cert/certwide_reduce.py +e2f40277fe04993deed769348905e2e911dcbe218f6f6298c677977e91951669 recipe/stack/cands/n419j3-2416d17a/recipe/overlay/inkling_cert/csrc/cert_ext.cu +88a27a25adb3e0a2553e82cbc30a0c8a02dcf84635048baba921a746fb4cf175 recipe/stack/cands/n419j3-2416d17a/recipe/overlay/inkling_cert/csrc/certwide_screen.cuh +e062ec37ea4eef60f7dd7be2f42b6e2541b06dcdcadc3e255cc1e1fec56ee2ca recipe/stack/cands/n419j3-2416d17a/recipe/overlay/inkling_cert/csrc/screen6.cuh +8398ac6708c32f5fe2224a15e3495708e0760d79564208c822c7bdf9a93ccf92 recipe/stack/cands/n419j3-2416d17a/recipe/overlay/inkling_cert/dflash.py +9d4fd4e0867b28d19bde7c1a47a6dbc462691dee38ab2f34073f454838b374b1 recipe/stack/cands/n419j3-2416d17a/recipe/overlay/inkling_cert/ops.py +2b6ba45d552282da40e2d1d380707dc26ad679eb114fb0bd1c533fe6944a4b2e recipe/stack/cands/n419j3-2416d17a/recipe/overlay/inkling_cert/patches.py +56274922d9aaa203ef2b5bd3dff7d7f3973d562b1f47541dc833669a10b7eeb8 recipe/stack/cands/n419j3-2416d17a/recipe/overlay/inkling_cert/quant.py +689f292b6e85042db4d7f700ef39573dcc1f441683abcae71e5074109c6e8168 recipe/stack/cands/n419j3-2416d17a/recipe/overlay/inkling_cert/tests/test_cert.py +7eec9ed58f35f5ae644b15ead34fc384fe5f1d8eee47f6fe1dd580a9d896e825 recipe/stack/cands/n419j3-2416d17a/recipe/overlay/inkling_cert/tests/test_certwide.py +131940bc65d9c1efca8ccf4816e9f5ae615394510f7bdd70d550cb0200a7e12a recipe/stack/cands/n419j3-2416d17a/recipe/overlay/inkling_cert/tests/test_dflash.py +9c582d423bee68dd253422ad91c42ad6e9d494c67030b0e09e2e660549b2ad83 recipe/stack/cands/n419j3-2416d17a/recipe/overlay/inkling_cert/tests/test_patches.py +089b23ba89259410f7f4c5a73d6a261ac928a44add4f5debeabc84a5b7a9c364 recipe/stack/cands/n419j3-2416d17a/recipe/overlay/inkling_cert/tools/gpu_check_cert.py +1b41188139e5e59c0d1138efbc218aa5469c2b3570fdce2a7f2b790589f991ea recipe/stack/cands/n419j3-2416d17a/recipe/overlay/inkling_cert/tools/smoke_hooks.py +269984f2e0628a6387af93a27350f6ccd53691d6ebc6ff63b4efd83a536fd1c7 recipe/stack/cands/n419j3-2416d17a/recipe/overlay/inkling_dfaccept/README.md +24eb31b321286bef5e99130e3b083ddfe8faafcb342c052305c5a98a5d7d9f59 recipe/stack/cands/n419j3-2416d17a/recipe/overlay/inkling_dfaccept/__init__.py +ab12eae066bc1cc54662498a1d7d53aa468619997fc204e6a14ba26715977a0c recipe/stack/cands/n419j3-2416d17a/recipe/overlay/inkling_dfaccept/_hook.py +7ba089479db0974c09b76f1042f9131bb944e309343d72867c089e9faa3760fe recipe/stack/cands/n419j3-2416d17a/recipe/overlay/inkling_dfaccept/core.py +251128ff0efd9eb43e6a8225570e89d08b6e6b7c7b0cd3d1d8392050a3d9f563 recipe/stack/cands/n419j3-2416d17a/recipe/overlay/inkling_dfaccept/patches.py +5eb381c6c5137f7a670130ad22fe406706dedb095d0a9817f15d57ecddb809e8 recipe/stack/cands/n419j3-2416d17a/recipe/overlay/inkling_dfbytes/README.md +7cf77494d835269f88a704f0eaca2518ff2fda31c60d32d371b757f0db88ec66 recipe/stack/cands/n419j3-2416d17a/recipe/overlay/inkling_dfbytes/__init__.py +ab12eae066bc1cc54662498a1d7d53aa468619997fc204e6a14ba26715977a0c recipe/stack/cands/n419j3-2416d17a/recipe/overlay/inkling_dfbytes/_hook.py +aca345f7e98de7509e7b507e4d401c8692db76687f3ab9116538261f7b143dcb recipe/stack/cands/n419j3-2416d17a/recipe/overlay/inkling_dfbytes/ctx8.py +cebe39ac06717ae5735ff4f839c1e5992a2b2f4ab50d4f98a062baa9c2f4a415 recipe/stack/cands/n419j3-2416d17a/recipe/overlay/inkling_dfbytes/patches.py +f126616fd8682f570af7bdf7ec26e807d40c61051a8049d3e3efa16f94369798 recipe/stack/cands/n419j3-2416d17a/recipe/overlay/inkling_dftail/__init__.py +ab12eae066bc1cc54662498a1d7d53aa468619997fc204e6a14ba26715977a0c recipe/stack/cands/n419j3-2416d17a/recipe/overlay/inkling_dftail/_hook.py +ae77c2c3723aa2cdb32d9f26eea67ee82a44a6c55282483416ed2c801af40296 recipe/stack/cands/n419j3-2416d17a/recipe/overlay/inkling_dftail/_sources.py +6cd072ae1ca44714816b874c733805ea8c3be511a23715829e63298ed8dfd566 recipe/stack/cands/n419j3-2416d17a/recipe/overlay/inkling_dftail/bpatch.py +b23bdb11c23c0cc06297899ca7e71a3f1be781052726427c1b5000e27afb8b0b recipe/stack/cands/n419j3-2416d17a/recipe/overlay/inkling_dftail/snapshot.py +e3b1e2f5194051bba30e455756c6b1943f5aacd03599ce1fa4b1b542844c0663 recipe/stack/cands/n419j3-2416d17a/recipe/overlay/inkling_draftbytes/README.md +8dd8abba6fa60514f4a68c64f54dd8cffedffbaa0982f4d4847be7627e3389c2 recipe/stack/cands/n419j3-2416d17a/recipe/overlay/inkling_draftbytes/__init__.py +812d99b5844ca99e56fa11394663733404441d35c3b42e804d8884a604eab6df recipe/stack/cands/n419j3-2416d17a/recipe/overlay/inkling_draftbytes/_hooks.py +ae8f4cb9cccea61a658bf3de2e0a4ef2cb0d01213915c5ce1732087100976ceb recipe/stack/cands/n419j3-2416d17a/recipe/overlay/inkling_draftbytes/_opts.py +06a22262122f4cc0b9bbf1497b98ab2f331175c2b407fc572284935d228788a5 recipe/stack/cands/n419j3-2416d17a/recipe/overlay/inkling_draftbytes/_triton.py +c3d8459315b854912142d8b6deb7a2d903cee5913bcf2ee6ddb059faeebf9c13 recipe/stack/cands/n419j3-2416d17a/recipe/overlay/inkling_draftbytes/csrc/w8gemv.cu +2430b0bbe643063b7b842df20b5058ca07db302e37e0f199770ffa3fc49a1c3e recipe/stack/cands/n419j3-2416d17a/recipe/overlay/inkling_draftbytes/dwin.py +32bbb9a854451827e7633b19d0bb534e697fbd6c8ee6e76dae412d2dda464a4d recipe/stack/cands/n419j3-2416d17a/recipe/overlay/inkling_draftbytes/hotvocab/inkling2-mini-hot-r2.json +bab4e585eaff5c71e86eaa79bf5a0b9a11fa4bcbbca1495286b29d037d443ef4 recipe/stack/cands/n419j3-2416d17a/recipe/overlay/inkling_draftbytes/ops.py +da084e9753f9d9a80876ac94595a375ec625302e23fac51a72fdc33e681e9cec recipe/stack/cands/n419j3-2416d17a/recipe/overlay/inkling_draftbytes/patches.py +cd3a06f12f2c22cbd73d62b24836eb8fb43b2d57e423ed3b4a18bb0b5df4a6e2 recipe/stack/cands/n419j3-2416d17a/recipe/overlay/inkling_draftbytes/quant.py +f0fbc7e4b44e513c724d7381f6d12b04838cc3826c547be51b36fe1b47c48860 recipe/stack/cands/n419j3-2416d17a/recipe/overlay/inkling_draftbytes/rnnhoist.py +65acc6c881f54a868270eec9e2acdd552fe0158da010dfb001ad112929360682 recipe/stack/cands/n419j3-2416d17a/recipe/overlay/inkling_draftbytes/tau.py +40db95bd0174f5a3d9f732a1e742ff022384884046b1da095e3b76d528f38c28 recipe/stack/cands/n419j3-2416d17a/recipe/overlay/inkling_draftbytes/timing.py +cb76bf7c8ae6b78337483d6e3145b4aadb076db528a7777e95fdc95e804f4346 recipe/stack/cands/n419j3-2416d17a/recipe/overlay/inkling_draftbytes/w8gemv.py +84c62ef2bad39eb126b3f03e356aa8e7149ce00cdef07b441bb8a3066544daef recipe/stack/cands/n419j3-2416d17a/recipe/overlay/inkling_kernels/README.md +cf121c574ddc27aa1ff24138814b25990cf9e6426fe5ac91f08166c9b944073e recipe/stack/cands/n419j3-2416d17a/recipe/overlay/inkling_kernels/__init__.py +ee0ef2ccad715b6614ee88fedd6f5a5a67291e6c76e3fed8c9bf4bf663209858 recipe/stack/cands/n419j3-2416d17a/recipe/overlay/inkling_kernels/_hook.py +75dafe2d6bfbeb65193bbab71f1c915ebca4e3919edb540898f93cf9f7594b7e recipe/stack/cands/n419j3-2416d17a/recipe/overlay/inkling_kernels/moe_tiles.py +97d9379d33afc634a1a91e41e2fef1bda8d1609d19fe58ff95d2adafb5808d6b recipe/stack/cands/n419j3-2416d17a/recipe/overlay/inkling_kernels/qkvr_gemv.py +9886b5e338556024c03dd58a31b14e9e5f03e094609b547915e324f44605857f recipe/stack/cands/n419j3-2416d17a/recipe/overlay/inkling_kv12/README.md +41daa1fc09a60a324539affd7ec9667a0350020fc6633f8c068fec9dc5f78ee0 recipe/stack/cands/n419j3-2416d17a/recipe/overlay/inkling_kv12/__init__.py +ab12eae066bc1cc54662498a1d7d53aa468619997fc204e6a14ba26715977a0c recipe/stack/cands/n419j3-2416d17a/recipe/overlay/inkling_kv12/_hook.py +bc8941909122c51bcc80cb1b37fda233061c0c50c180e031aba3a8c7789e7691 recipe/stack/cands/n419j3-2416d17a/recipe/overlay/inkling_kv12/ops.py +d4514e3786f2dd98370a6126733239344f94280c4b89d7126536b99b66352283 recipe/stack/cands/n419j3-2416d17a/recipe/overlay/inkling_kv12/patch.py +4c035d2a7cfc45f17cf9fb39341a6fa85bc4634b3926725f7d23cd9501808012 recipe/stack/cands/n419j3-2416d17a/recipe/overlay/inkling_kv12s/__init__.py +dd08112a15db424731b25bb3dd8e5d27a688033896fb11269e3c021e6e0f2bdf recipe/stack/cands/n419j3-2416d17a/recipe/overlay/inkling_kv12s/attention.py +6f96ca7ed4d69503bb2e83f95ddf08b201b510acf9cc1b034f724125a726a214 recipe/stack/cands/n419j3-2416d17a/recipe/overlay/inkling_kv12s/check_data.py +10932369507cd317ee7f1ad1966433bfbcb34da2106b795b6b580a60a85e159f recipe/stack/cands/n419j3-2416d17a/recipe/overlay/inkling_kv12s/device.py +616a0ab680b3b259128a39dfeb77d7b8b77ed7cb6bef74d890e0487f38ee507a recipe/stack/cands/n419j3-2416d17a/recipe/overlay/inkling_kv12s/patch.py +3554c61d7da8134766ed41206239065ba1e7b5df3b38a390a66a931876cf4533 recipe/stack/cands/n419j3-2416d17a/recipe/overlay/inkling_kv12s/pressure.py +d0ad1f533a820b97d19ffbc420c8f490497c38641bb48f7328206299aa48f145 recipe/stack/cands/n419j3-2416d17a/recipe/overlay/inkling_kv12s/segsum.py +7d8d61c362c645a610e65d4ccba7e0dce8d46dcd150a27df5d2546fb37093661 recipe/stack/cands/n419j3-2416d17a/recipe/overlay/inkling_kv12s/static.py +37b1fd7d544955e98c4d8ee1d16f4e49e2f945dc18b137b894b1fd5cbe7ce102 recipe/stack/cands/n419j3-2416d17a/recipe/overlay/inkling_kv12s/storage.py +a7a4ce407859b7f31120608314ae7d9f8df8244ef309dcd9cd3aae689f731f0c recipe/stack/cands/n419j3-2416d17a/recipe/overlay/inkling_kv12s/swa_layout.py +5b2d5c191cffda9cb772e493514b06b8e87e94e46fdbf36b1ad4b5a9ac4487da recipe/stack/cands/n419j3-2416d17a/recipe/overlay/inkling_mixdraft/__init__.py +83a952e187fb34e111798adf45ebf18a2e3546b6647657f4ea0effe3370192da recipe/stack/cands/n419j3-2416d17a/recipe/overlay/inkling_mixdraft/kernel.py +df3f862c7d93b8be6e82498afeb62e3144d15b7a0c876a96ba464f4c9f71cd4d recipe/stack/cands/n419j3-2416d17a/recipe/overlay/inkling_mixdraft/linear.py +bb72def3d71f7cf145079bc5edc4f8ee1a208f15780928b806337826d81bda8d recipe/stack/cands/n419j3-2416d17a/recipe/overlay/inkling_noexp/__init__.py +ab12eae066bc1cc54662498a1d7d53aa468619997fc204e6a14ba26715977a0c recipe/stack/cands/n419j3-2416d17a/recipe/overlay/inkling_noexp/_hook.py +d6207856ed7b8146c9842cbebac87b652a05f9e0c83dd84ef644d7edb4d55c42 recipe/stack/cands/n419j3-2416d17a/recipe/overlay/inkling_noexp/_mask.py +81752701087d7a56045ab97627e3e2ceaf039099d5b561c061321a22acf6b689 recipe/stack/cands/n419j3-2416d17a/recipe/overlay/inkling_padx/__init__.py +ab12eae066bc1cc54662498a1d7d53aa468619997fc204e6a14ba26715977a0c recipe/stack/cands/n419j3-2416d17a/recipe/overlay/inkling_padx/_hook.py +51823f619e768163dbfa547165e7af04ddf93af35ff13e6b8ff0ef02abaaf686 recipe/stack/cands/n419j3-2416d17a/recipe/overlay/inkling_padx/patches.py +2710527dfb9c184e3cc77780c6d69ab64b22bba032daa2087736302d54c5b0d7 recipe/stack/cands/n419j3-2416d17a/recipe/overlay/inkling_pcopy/__init__.py +ab12eae066bc1cc54662498a1d7d53aa468619997fc204e6a14ba26715977a0c recipe/stack/cands/n419j3-2416d17a/recipe/overlay/inkling_pcopy/_hook.py +c210ac609cd5ff936aed7b0d582b5a89dc059cfaab93dc91ad7cd6a445866062 recipe/stack/cands/n419j3-2416d17a/recipe/overlay/inkling_pcopy/_sources.py +2b9b808117ef4b23884652c9a199258bebaacfb485199d434304969ae1f33353 recipe/stack/cands/n419j3-2416d17a/recipe/overlay/inkling_pcopy/fixtures.py +26a153b5ffa4ee27159401581b109872b91216cbd36db8d6f1e04bf43c3ca2f7 recipe/stack/cands/n419j3-2416d17a/recipe/overlay/inkling_pcopy/fused.py +26e1cdbb37a8d7f58d7b92c42270e151d08822d3e9797130dbbb19d483b1352e recipe/stack/cands/n419j3-2416d17a/recipe/overlay/inkling_pcopy/history.py +079f558fe7ddc02f8bd320d71fa329e569bf3e1ecc2c9a419fe32f62b7139192 recipe/stack/cands/n419j3-2416d17a/recipe/overlay/inkling_pcopy/matcher.py +14b3d2fda0fbc5a7a640187872ec77c072f2ba723de74983ab5a63b10fa85545 recipe/stack/cands/n419j3-2416d17a/recipe/overlay/inkling_pcopy/patch.py +89a122d26a44d635e94586af6dfdb50c53f48a462d7ea02395b293fb1ef9c6d3 recipe/stack/cands/n419j3-2416d17a/recipe/overlay/inkling_pcopy/rule.py +61a59cd6f4d9b31abd76da83f67b5797f4a1f5e5ec9ce866e78fdcd8692896eb recipe/stack/cands/n419j3-2416d17a/recipe/overlay/inkling_pfuse/CREDITS.md.knapcio-v2.9.3 +1a87a7afb937c54991860f623a0365882a854cf08bf058e6efd60e87488fcddd recipe/stack/cands/n419j3-2416d17a/recipe/overlay/inkling_pfuse/LICENSE.knapcio-v2.9.3 +398c1c6b775c7865ad1c50f1cc73ed01116a4d8e213ed3bcf7eff0bc2d268642 recipe/stack/cands/n419j3-2416d17a/recipe/overlay/inkling_pfuse/NOTICE.knapcio-v2.9.3 +aa5869a0f6a177c6cda7280c4a2564097a06f02b3e260c4a25cd24a8c6193018 recipe/stack/cands/n419j3-2416d17a/recipe/overlay/inkling_pfuse/README.md +9820ebf80c8ffff40d14244fdab623d1511ea8fc751a1fa8c17f759fade25f9d recipe/stack/cands/n419j3-2416d17a/recipe/overlay/inkling_pfuse/__init__.py +ab12eae066bc1cc54662498a1d7d53aa468619997fc204e6a14ba26715977a0c recipe/stack/cands/n419j3-2416d17a/recipe/overlay/inkling_pfuse/_hook.py +7e47cfd76d45851d371aa23e089deba31c99823e2296ca145522b4d801583b7e recipe/stack/cands/n419j3-2416d17a/recipe/overlay/inkling_pfuse/_triton_mix.py +1930979f4bdc1b97bac83cc95dc4c15ab726b0ce69f11baeda9cf753011c7e41 recipe/stack/cands/n419j3-2416d17a/recipe/overlay/inkling_pfuse/_triton_sconv.py +d3b81190b2622e5a437c823af4ae16e0ebf1e8b631c7a9432bc1e71503bd01ce recipe/stack/cands/n419j3-2416d17a/recipe/overlay/inkling_pfuse/layer.py +508f34216dec13dcc30d77c08cd09d10f7d20bbbb28bb031e90414c7b25d3f8b recipe/stack/cands/n419j3-2416d17a/recipe/overlay/inkling_pfuse/mix.py +32fe8bcacf8d6fc64ee401b014c421c4cdc0d5c6d342a50a489bf65891cbfd5a recipe/stack/cands/n419j3-2416d17a/recipe/overlay/inkling_pfuse/tools/attrib_prefill.py +1ff7a611ad3a7e6ee9955f5ece2fc8778b5e37186bec785bf304e68f997300a3 recipe/stack/cands/n419j3-2416d17a/recipe/overlay/inkling_pfuse/tools/bench_loop.py +467bc7d06db2756307d7da7fc7289c7ff2a2f08d4ec1550cad57b6dcf1bbd73f recipe/stack/cands/n419j3-2416d17a/recipe/overlay/inkling_pfuse/tools/gpu_check_pfuse.py +63f3bbbdc63686529c2ed70ef5a94cbe66ab761a985799f58e27d9aaedacfad8 recipe/stack/cands/n419j3-2416d17a/recipe/overlay/inkling_pfuse/tools/sweep_mix.py +61a59cd6f4d9b31abd76da83f67b5797f4a1f5e5ec9ce866e78fdcd8692896eb recipe/stack/cands/n419j3-2416d17a/recipe/overlay/inkling_phoist/CREDITS.md.knapcio-v2.9.3 +1a87a7afb937c54991860f623a0365882a854cf08bf058e6efd60e87488fcddd recipe/stack/cands/n419j3-2416d17a/recipe/overlay/inkling_phoist/LICENSE.knapcio-v2.9.3 +398c1c6b775c7865ad1c50f1cc73ed01116a4d8e213ed3bcf7eff0bc2d268642 recipe/stack/cands/n419j3-2416d17a/recipe/overlay/inkling_phoist/NOTICE.knapcio-v2.9.3 +26eb3a17f9a426fb11dfec4e294dd2ed187b7104bf36e7588a9d6df8ee63134b recipe/stack/cands/n419j3-2416d17a/recipe/overlay/inkling_phoist/__init__.py +ab12eae066bc1cc54662498a1d7d53aa468619997fc204e6a14ba26715977a0c recipe/stack/cands/n419j3-2416d17a/recipe/overlay/inkling_phoist/_hook.py +ca8c58f123ea47200ca9306f1e043fae10672f381cf96e7685f5f6adff3e953a recipe/stack/cands/n419j3-2416d17a/recipe/overlay/inkling_phoist/phoist.py +f55d49b173b3f6ef080ce2dcc563333f193dfcbf75a7e8f7f6f5b353e4be7576 recipe/stack/cands/n419j3-2416d17a/recipe/overlay/inkling_phoist/phoist_triton.py +a12fbe61a792b2c2c7597b259ab99a0b9656922865a9a24836d92f17e121f876 recipe/stack/cands/n419j3-2416d17a/recipe/overlay/inkling_pico12/README.md +8aeb4211fa86cc155ac12af76eedea7963e96c1f43c766e3c749bcfba35ac370 recipe/stack/cands/n419j3-2416d17a/recipe/overlay/inkling_pico12/__init__.py +ee0ef2ccad715b6614ee88fedd6f5a5a67291e6c76e3fed8c9bf4bf663209858 recipe/stack/cands/n419j3-2416d17a/recipe/overlay/inkling_pico12/_hook.py +0b9cd153d788be7ffed98a8bd0d7b4fbab6222f1e3c06961865a01a6cd991c44 recipe/stack/cands/n419j3-2416d17a/recipe/overlay/inkling_pico12/build.py +aab4b5396310f0f0cbe21c1fcd5906e25b8c62f18689685c48ff5f530622c7c8 recipe/stack/cands/n419j3-2416d17a/recipe/overlay/inkling_pico12/csrc/pico12_ext.cu +8babed542f329a5040a02167d6d30e880d35a4f334b457adff8489dfa198800a recipe/stack/cands/n419j3-2416d17a/recipe/overlay/inkling_pico12/csrc/pico12_range.cu +97329931d0e392fc5ac1292657bb9852bae973fd4336ec47dcea626bd78a09cd recipe/stack/cands/n419j3-2416d17a/recipe/overlay/inkling_pico12/ops.py +1d91c866aaa329e6045d2161a776ba6e2064f3f81b8a6a6903f0bb6c6cc3608e recipe/stack/cands/n419j3-2416d17a/recipe/overlay/inkling_pico12/patches.py +fb9c7ecee826335f6014f5f2040b5abe132a86aa6e43f1545bb1e5db19cea16b recipe/stack/cands/n419j3-2416d17a/recipe/overlay/inkling_pico12/third_party/pico/LICENSE +60b3ad14b8d2291101c82f3cc8c0653a6e778b1db9abfe463992dd3737550b4f recipe/stack/cands/n419j3-2416d17a/recipe/overlay/inkling_pico12/third_party/pico/common/check.h +5d96f43891a930cffa23c8649a79d28d019f7597bf5b2ac51e46eb6de5ff6e87 recipe/stack/cands/n419j3-2416d17a/recipe/overlay/inkling_pico12/third_party/pico/kernels/common.cuh +baa1d8d7ff69d0f132acbfba354eb35dc4e5011b5f3e1ae3d177d6d1dcfb5256 recipe/stack/cands/n419j3-2416d17a/recipe/overlay/inkling_pico12/third_party/pico/kernels/dsk.h +91230a0b0783d2af5da87d6476e60c2dc2d94d60879998e54db547dc6f01982d recipe/stack/cands/n419j3-2416d17a/recipe/overlay/inkling_pico12/third_party/pico/kernels/gemv16.cu +61a59cd6f4d9b31abd76da83f67b5797f4a1f5e5ec9ce866e78fdcd8692896eb recipe/stack/cands/n419j3-2416d17a/recipe/overlay/inkling_prologue/CREDITS.knapcio-v2.9.3.md +1a87a7afb937c54991860f623a0365882a854cf08bf058e6efd60e87488fcddd recipe/stack/cands/n419j3-2416d17a/recipe/overlay/inkling_prologue/LICENSE.knapcio-v2.9.3 +398c1c6b775c7865ad1c50f1cc73ed01116a4d8e213ed3bcf7eff0bc2d268642 recipe/stack/cands/n419j3-2416d17a/recipe/overlay/inkling_prologue/NOTICE.knapcio-v2.9.3 +d807c304d543312f6c3c3e2f1d40a3dcedc982c8bef30a34ca891fe6c7956fbe recipe/stack/cands/n419j3-2416d17a/recipe/overlay/inkling_prologue/__init__.py +ab12eae066bc1cc54662498a1d7d53aa468619997fc204e6a14ba26715977a0c recipe/stack/cands/n419j3-2416d17a/recipe/overlay/inkling_prologue/_hook.py +d83c5b71d817b66804bfaa2c7108a96b4374033102b709639555456feed6478d recipe/stack/cands/n419j3-2416d17a/recipe/overlay/inkling_prologue/_triton.py +fed63858ca1872cf9fc4122cff02af670e297b972df4d075c929c77613b7f6c4 recipe/stack/cands/n419j3-2416d17a/recipe/overlay/inkling_ptouch/__init__.py +ab12eae066bc1cc54662498a1d7d53aa468619997fc204e6a14ba26715977a0c recipe/stack/cands/n419j3-2416d17a/recipe/overlay/inkling_ptouch/_hook.py +b8dfe59c5b140d6a9804be846b06cb4ec07746bb0176ff8b2637177c9487806f recipe/stack/cands/n419j3-2416d17a/recipe/overlay/inkling_rsfix/README.md +edf339d321b72e9207204143906526677b6beacb179e1399ac9dc183ba29bd72 recipe/stack/cands/n419j3-2416d17a/recipe/overlay/inkling_rsfix/__init__.py +2a1eabd10f7e964a53fe76b66254873fcfd461b0d32f7277db42457d7d65990a recipe/stack/cands/n419j3-2416d17a/recipe/overlay/inkling_rsfix/_hook.py +c4e84d4ef8e7343e1563617814c65d0d71fbe19915461d73245818f83e9d1e6c recipe/stack/cands/n419j3-2416d17a/recipe/overlay/inkling_rsfix/_sources.py +e4dfce68cae58f71a0658410fe88e6520f94d6c389f8d57e482dacea363509d8 recipe/stack/cands/n419j3-2416d17a/recipe/overlay/inkling_rsfix/blockwise.py +9530622cde80e49864d60a50342ff1850e6c6389eb1baa0207d68ba6a388005c recipe/stack/cands/n419j3-2416d17a/recipe/overlay/inkling_rsfix/markov.py +93da51652aa8ec27396610a10724b6571e5de8d4ee08e236677c9e98604db951 recipe/stack/cands/n419j3-2416d17a/recipe/overlay/inkling_rsfix/reference.py +61e81094be26a6f8a46f07f1b062b07eab246a52553ed094ba147813d92dd513 recipe/stack/cands/n419j3-2416d17a/recipe/overlay/inkling_rsfix/reject.py +d5607344cacbcf77fb4cdcc6ce9de49a4290bbf85281f78c9c397a2984dc06eb recipe/stack/cands/n419j3-2416d17a/recipe/overlay/inkling_rsfix/selector.py +63c5e7852205045be8bca6e84160df8f2f4dd4f44a8093a6a5a04d9fffbca47e recipe/stack/cands/n419j3-2416d17a/recipe/overlay/inkling_vattn/README.md +a08d05ffbd94bdb1c94194432d927b1f30035fa6f23fcc2adc7de36b2930c78c recipe/stack/cands/n419j3-2416d17a/recipe/overlay/inkling_vattn/__init__.py +ab12eae066bc1cc54662498a1d7d53aa468619997fc204e6a14ba26715977a0c recipe/stack/cands/n419j3-2416d17a/recipe/overlay/inkling_vattn/_hook.py +63aad1d099fec3f2b66a0ffd8d3709a564644edac2d4f25c1c33018be3dd6f25 recipe/stack/cands/n419j3-2416d17a/recipe/overlay/inkling_vattn/ops.py +4f18599a0ad748f7f6a507f165ac72327e733eb082fd6276995b9e4474869652 recipe/stack/cands/n419j3-2416d17a/recipe/overlay/inkling_vattn/patch.py +66f94a7e6143ee5bde5e8f83aefe4333ad9d701282b411f0c30091eff637b3b7 recipe/stack/cands/n419j3-2416d17a/recipe/overlay/inkling_vcap/README.md +6a39653aa552d2035e4700918cf7e6dd488881c46cd4d52a3edf8424fe7f3cbd recipe/stack/cands/n419j3-2416d17a/recipe/overlay/inkling_vcap/__init__.py +01b543f9ea35fd83b4ef34d681b86f6aedd3fc9cbc26b270fb98d3159025c4c2 recipe/stack/cands/n419j3-2416d17a/recipe/overlay/inkling_vcap/config.py +bbe0288dd145ba12f1d7312b7def82a7dc0f76c31b5dfa3e2236730eba177b79 recipe/stack/cands/n419j3-2416d17a/recipe/overlay/inkling_vcap/dfcap.py +9caf5d3ca057b622e4cca6e35456f7435f9e1d1e5df692f491e12271014d8aed recipe/stack/cands/n419j3-2416d17a/recipe/overlay/inkling_vcap/dfcheck.py +f7d2389c58143c3ea661616d82f42e1c7b55b8f95c78dcb424c45d205c4d2203 recipe/stack/cands/n419j3-2416d17a/recipe/overlay/inkling_vcap/dflash.py +41cd33472898d7ad98bcbaae2eaf5c27238069b6cdd7815528c932795673e5da recipe/stack/cands/n419j3-2416d17a/recipe/overlay/inkling_vcap/dfsteplog.py +bda7d9e386db34eb3f3a8c8aeda249b91ff8ec27d176c23fb5574e80ec81c431 recipe/stack/cands/n419j3-2416d17a/recipe/overlay/inkling_vcap/fastprobs.py +d364b1bc5a27dd747b08095030670ac085205454b548ba54b453f96872cd90bb recipe/stack/cands/n419j3-2416d17a/recipe/overlay/inkling_vcap/fused.py +897b421d153acd9c0494e084e0d8227804a00f5d24c245646dec74079c422b84 recipe/stack/cands/n419j3-2416d17a/recipe/overlay/inkling_vcap/fused_accept.py +0a928a2c9b2677ce1a359da34d444b40ff38cc6a01c8f44c5723dbaabb6751e5 recipe/stack/cands/n419j3-2416d17a/recipe/overlay/inkling_vcap/importhook.py +2738304eeff01b7d21c700c7408b24e1c429ad912fdc6e58952cf5a1d2a80963 recipe/stack/cands/n419j3-2416d17a/recipe/overlay/inkling_vcap/logic.py +9ba4bf5aeafcc3d1e58adecbad230cbfa128079c6577843a6e28e40866258a20 recipe/stack/cands/n419j3-2416d17a/recipe/overlay/inkling_vcap/patches.py +21082944e6df1a1eb5d288c226562278d8b493ea37cb6ccbf6a8a98bcaa93cce recipe/stack/cands/n419j3-2416d17a/recipe/overlay/inkling_vcap/policies/df-SLDF1-sm.json +b9505b8e00284277b8354cf72a406d8bc2b465d8619f51f44e8609964093b5ee recipe/stack/cands/n419j3-2416d17a/recipe/overlay/inkling_vcap/policies/df-SLDF2x.json +ab43150b4ff972b9975192761515e843088f8838b765090c888f1c3e79334e9f recipe/stack/cands/n419j3-2416d17a/recipe/overlay/inkling_vcap/policies/r2-theta004.json +359b404bd41371397ec8948ece4700d10e1e2b6271301e47439dc4cd83198310 recipe/stack/cands/n419j3-2416d17a/recipe/overlay/inkling_vcap/policyfile.py +982f86bb234ebfd5ca7f37304ae9bf78b5fa90969e75357a5a44905f8a708f49 recipe/stack/cands/n419j3-2416d17a/recipe/overlay/inkling_vcap/state.py +c7f51ebddeba0c2cb5a11bf8075fec231f081ef58ffd0e2c93097a70ebbca04a recipe/stack/cands/n419j3-2416d17a/recipe/overlay/inkling_vcap/v3_kernels.py +4cd0f8e5854e5ed4f1745e6a56aaeba679c4ec4bc17352960f1f01fe3b8f8cf0 recipe/stack/cands/n419j3-2416d17a/recipe/overlay/inkling_wide/README.md +e473be74143084bca38efb0fce7b281b63239471bc43e99692863dd53b85dd16 recipe/stack/cands/n419j3-2416d17a/recipe/overlay/inkling_wide/__init__.py +ee0ef2ccad715b6614ee88fedd6f5a5a67291e6c76e3fed8c9bf4bf663209858 recipe/stack/cands/n419j3-2416d17a/recipe/overlay/inkling_wide/_hook.py +409563a58078e003f0f61c39162dca23563d08cf6fe3e6ecd53211b30538bd12 recipe/stack/cands/n419j3-2416d17a/recipe/overlay/inkling_wide/build.py +640625aed9282589c3c32b06f0b57be48efd230c88425a4264748fed3f23eb15 recipe/stack/cands/n419j3-2416d17a/recipe/overlay/inkling_wide/csrc/bf16x_format.cuh +a281cb85d1867e5acd8dfe7c8d3b2f1b68b5cb1d3091ad6445eba09d66341e94 recipe/stack/cands/n419j3-2416d17a/recipe/overlay/inkling_wide/csrc/wide_ext.cu +3b12f4ef0077ccc61f4867a1369a66fc2a3b10e791c19f4323956756086418cd recipe/stack/cands/n419j3-2416d17a/recipe/overlay/inkling_wide/ops.py +0deb113320ff36523d0e5a25851c3d27aa9412ed5b74d3fd74288504e0404e09 recipe/stack/cands/n419j3-2416d17a/recipe/overlay/inkling_wide/patches.py +5b3f3070eab76b167d3ac2a7f03cfea9e59901e45dbe3a01059cbe5d423bcdbc recipe/stack/cands/n419j3-2416d17a/recipe/overlay/inkling_wide/tests/fake_wide_ext.py +b436a3347e2e274fc146d5ed6969f489415fa60f0fc0f58593fd0875d1ddfd87 recipe/stack/cands/n419j3-2416d17a/recipe/overlay/inkling_wide/tests/test_wide.py +fb9c7ecee826335f6014f5f2040b5abe132a86aa6e43f1545bb1e5db19cea16b recipe/stack/cands/n419j3-2416d17a/recipe/overlay/inkling_wide/third_party/pico/LICENSE +b37e3528ad0ca2dcbd2ab38ee4be67ec88980e769c4a5dbddfa5b45624f28fa7 recipe/stack/cands/n419j3-2416d17a/recipe/overlay/inkling_wide/tools/gpu_check_wide.py +ff089d1ab9f66eb5ee40a3f77a6193120abc064d9eb97a60e495a5ec3fa743eb recipe/stack/cands/n419j3-2416d17a/recipe/overlay/inkling_wide/tools/gpu_integration_wide.py +65acb522ac26d4bdacff65abacf544479da47d7bc6d43ed97b319972a36b560a recipe/stack/cands/n419j3-2416d17a/recipe/overlay/sitecustomize.py +1f64526e4dcec5cd6d3cd3d842ebbf74035e4f34b64aeb7d761693b8198bd924 recipe/stack/cands/n419j3-2416d17a/recipe/patch/inkling2_attn.py +64914ef9213420b37bdb361dfb3bdadb5ff07994deda96c548762e006927bd44 recipe/stack/cands/n419j3-2416d17a/recipe/patch/inkling2_loop.py +70d8797b523b0fcdaad6e709e14bfc4bbdcc735a4b49824b430997ff1018dd78 recipe/stack/cands/n419j3-2416d17a/recipe/patch/inkling2_loop_model.py +29d1f5cb5101a7a0aac48c4b1f15252acaba01a404c6e2475c6c798f0797d997 recipe/stack/cands/n419j3-2416d17a/recipe/patch/n105_rnnhoist.py +9d0231ebab913cb3b3956c421ae5f4f69d2661728f1f8d3b3d64755f9e455f63 recipe/stack/cands/n419j3-2416d17a/recipe/patch/n13_attn_global.py +7d6f1ab93c1252e891446df090e414c6aa975ca480a360b5ac65fb6d16c8be9a recipe/stack/cands/n419j3-2416d17a/recipe/patch/n13_fwd.py +1801287d6696437fa6417c335decf0f4b9deb7391b4d4e4fd8e5c893cf272333 recipe/stack/cands/n419j3-2416d17a/recipe/patch/n140_kern.py +6b69991a90d2ca2a6196d4d1d28014983614a6030d8a38d43aa08c7a29f49f65 recipe/stack/cands/n419j3-2416d17a/recipe/patch/n14_moe.py +8e2d7b61a2ffee1e5bbdaf3f2406a202f13e3a9d96df0f849d35af4d781cac62 recipe/stack/cands/n419j3-2416d17a/recipe/patch/n14_quant.cuh +a67d3cacb45d4a981add4407552b030c8bdf08dabb7e136f555b21475aa3126a recipe/stack/cands/n419j3-2416d17a/recipe/patch/n15_fused.py +e8373342b54dfccbe4c04fd21e137172286b902b07ed6f5037deeb95eb70c9ef recipe/stack/cands/n419j3-2416d17a/recipe/patch/n32_attn_local.py +571c3e4a819b27e175091b7af099e972bc4c38b6eac3f1af1ff4e88b6b662746 recipe/stack/cands/n419j3-2416d17a/recipe/patch/n32_fwd.py +65f51937ca44728959542ca4ed7456973b45e7f32bd54934e44a49ee256630c4 recipe/stack/cands/n419j3-2416d17a/recipe/patch/n35_w8.py +aa79c3095959d385dc1c6f9fdcf7558a73547fcc31c4f6460c6e77cbc9327605 recipe/stack/cands/n419j3-2416d17a/recipe/patch/n35_w8gemv.py +b4cc2402f4c0eee56dc4ce9721043b6d16ed04e932f94848b395f3873f58cb59 recipe/stack/cands/n419j3-2416d17a/recipe/patch/n37_tiles.py +5b1a90477bb2ed2dddf31b3adbc8cb200538335854ddb99ce59ecdf3dbfadfac recipe/stack/cands/n419j3-2416d17a/recipe/patch/n50b_fused.py +1dc6b870ef8c25dd40615930cbf62dfec0e29c5d6b785eb8d42d532ea4a9cd04 recipe/stack/cands/n419j3-2416d17a/recipe/patch/n52_band.cuh +e4118504ce8a210f8d4ef86d1be579dd4d73e4161bb0c9e4264811ad51999140 recipe/stack/cands/n419j3-2416d17a/recipe/patch/n52_moe.py +3523d5fe6549aec71d853c0713403fbdc15984e08c3e5820c2a790a6ede84855 recipe/stack/cands/n419j3-2416d17a/recipe/patch/n64_attn_global.py +eefba4b83410c246441d74d5311deacc6da6e4405d28e3c5b5fa344d4d29eb81 recipe/stack/cands/n419j3-2416d17a/recipe/patch/n64a_fwd.py +cca0cd0d7b860ed4cc78a98651264ecb8fd20793055e58323c2623b8531b6d0d recipe/stack/cands/n419j3-2416d17a/recipe/patch/n64b_fwd.py +d1b88fb14a0d18ccff2ed53b79dcfcb1a2565e50e6cf625053bf39cdc9f1ecd9 recipe/stack/cands/n419j3-2416d17a/recipe/patch/n66fb.py +b7abf0229b9d40558dc6dd576fb300bec9e0a6b9c173b458881111ff0bc89206 recipe/stack/cands/n419j3-2416d17a/recipe/patch/n71_resnorm.py +91f1bb6066a4e5abf77253e23816783880ea38cff649aebd844157b60268c5e7 recipe/stack/cands/n419j3-2416d17a/recipe/patch/n71_sconvres.py +d4411fd151e6212a0feb14ed41457be3c976b92a8f5c981cbc2d1a890075eb7b recipe/stack/cands/n419j3-2416d17a/recipe/patch/n75_c12.py +71fd33a2a119db28c4ca8a24d75e9678131c87b327d095a329fdad18bc03e29a recipe/stack/cands/n419j3-2416d17a/recipe/patch/n75_cuda.py +00bece24b9b910eb33d1f85fe1e60b2685a2ac4dfb5f5136d891b9db668968f7 recipe/stack/cands/n419j3-2416d17a/recipe/patch/n75_install.py +17349b269f1eb7f2551fac79b9e8020b10708410156a08e1b959c8e53f491f79 recipe/stack/cands/n419j3-2416d17a/recipe/patch/n78_head.py +9447c05ffbf888a1aea1a7da467399f572f1d684f142f24c4cccfacefcd353f8 recipe/stack/cands/n419j3-2416d17a/recipe/patch/n78_kern.py +efe43e40ebccb20b31398ef7b7a4e70e0dd1a6192a95904ebb70fb6a8f3d3b73 recipe/stack/cands/n419j3-2416d17a/recipe/patch/n80_cuda.py +cd2d6ef590744ee69cd3b2dfdff9c42cf957eef291f858c3054f1b651b84943f recipe/stack/cands/n419j3-2416d17a/recipe/patch/n80_draft.py +9ba4c20f9fa95c8d9a337f4eeea6abae50e142f747d4dde618712f04e127f56f recipe/stack/cands/n419j3-2416d17a/recipe/patch/n86_riders.py +25030bef80b49e72d46355799e7febea0867ea57aed711f7c9ae28159a81f390 recipe/stack/cands/n419j3-2416d17a/recipe/serve/inkling2_mtp.py +2b27a2b7797d41922869d0c3b95ba281ea812a70557d194782908ad247a74fe6 recipe/stack/cands/n419j3-2416d17a/recipe/serve/mixpin.sh +9c80d55f4f87c0f9b29222cf27c85c5a899be961f7c44b98c5d59e8f172215ce recipe/stack/cands/n419j3-2416d17a/recipe/serve/serve.sh +6e3fa6a41f6ceb0e80812e387488538ac8dc436851193a4dcdaecaeb93ab5e6b recipe/stack/cands/n419j3-2416d17a/recipe/serve/serve.sh.orig +1bccd9dadf233cd9af15aa63a8d2cc22e0706983355a00e380731d09a5bdb682 recipe/stack/cands/n419j3-2416d17a/recipe/serve/sl.json +14223ae2f3aa1d661da67cf0143ec33070d952a6e28a119e6cec64fcc0bebe50 recipe/stack/dflash2/sglang_inkling_dflash2.py +8faf65ddd79eaf419845e745c564eb36b4b955e137cb107a2b92fc685b37b50a recipe/test/clean-checkout.sh +153ed1095fae7fd3c9a4f9a9cbffd6ab35f2a9f554637de429ef046065580dd2 recipe/test/smoke.py diff --git a/THIRD_PARTY_NOTICES.md b/THIRD_PARTY_NOTICES.md new file mode 100644 index 0000000000000000000000000000000000000000..82ae0d068644ef4de87cce9cfebdb5f72a8bf4d1 --- /dev/null +++ b/THIRD_PARTY_NOTICES.md @@ -0,0 +1,38 @@ +# 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 of +the serving stack exactly as it was benchmarked; files in it were not edited for this release, so their comments and file names +are 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. diff --git a/drafter-mix/BUILT_FROM b/drafter-mix/BUILT_FROM new file mode 100644 index 0000000000000000000000000000000000000000..d4d1c84b6a464c32c2ced485120762399dd910b5 --- /dev/null +++ b/drafter-mix/BUILT_FROM @@ -0,0 +1 @@ +a22381fd44acb5b2e0a583a20537641099dc16c59b6b7c7cab7e61faa0e9e43a diff --git a/drafter-mix/Inkling-2-Mini-DFlash2-mix.safetensors b/drafter-mix/Inkling-2-Mini-DFlash2-mix.safetensors new file mode 100644 index 0000000000000000000000000000000000000000..cbe3fb66221147854db862044f9c2c9f210fdeea --- /dev/null +++ b/drafter-mix/Inkling-2-Mini-DFlash2-mix.safetensors @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c6c42710f9d890776d73706f81527f175b748a85d772606c2b248a6066f5cc2d +size 551600700 diff --git a/drafter-mix/LICENSE b/drafter-mix/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..261eeb9e9f8b2b4b0d119366dda99c6fd7d35c64 --- /dev/null +++ b/drafter-mix/LICENSE @@ -0,0 +1,201 @@ + 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. diff --git a/drafter-mix/NOTICE b/drafter-mix/NOTICE new file mode 100644 index 0000000000000000000000000000000000000000..4f8ef2b9b0cbd4838e4a0d4f9f01a3268540f675 --- /dev/null +++ b/drafter-mix/NOTICE @@ -0,0 +1,22 @@ +t5a (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 from +Inco 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. diff --git a/drafter-mix/SHA256SUMS b/drafter-mix/SHA256SUMS new file mode 100644 index 0000000000000000000000000000000000000000..67ab339dd559cb5eb3f8a86715798be32f08bba9 --- /dev/null +++ b/drafter-mix/SHA256SUMS @@ -0,0 +1 @@ +c6c42710f9d890776d73706f81527f175b748a85d772606c2b248a6066f5cc2d Inkling-2-Mini-DFlash2-mix.safetensors diff --git a/drafter/LICENSE b/drafter/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..261eeb9e9f8b2b4b0d119366dda99c6fd7d35c64 --- /dev/null +++ b/drafter/LICENSE @@ -0,0 +1,201 @@ + 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. diff --git a/drafter/NOTICE b/drafter/NOTICE new file mode 100644 index 0000000000000000000000000000000000000000..a8cc9316dae2dec46cb51128b322f97b44b8f38d --- /dev/null +++ b/drafter/NOTICE @@ -0,0 +1,29 @@ +t5a: 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. diff --git a/drafter/README.md b/drafter/README.md new file mode 100644 index 0000000000000000000000000000000000000000..28a9cb68d8f624d58e8d5b0e284571b07361775d --- /dev/null +++ b/drafter/README.md @@ -0,0 +1,7 @@ +# t5a drafter (BF16) + +A DFlash2 draft model for thinkingmachines/Inkling-2-Mini, fine-tuned from Inkling-2-Mini-DFlash2-Global (L13) on text generated by +Inkling-2-Mini (agentic coding sessions and long code-explanation data, with a smaller share of short coding prompts). Same +architecture 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`. diff --git a/drafter/SHA256SUMS b/drafter/SHA256SUMS new file mode 100644 index 0000000000000000000000000000000000000000..e08ded529fcd02bfade1c05be8444be4624e3181 --- /dev/null +++ b/drafter/SHA256SUMS @@ -0,0 +1,2 @@ +df8b1f466b0a35d6badc3e292ae94009727fe397c4335c296e99c5b86df4b4a9 config.json +a22381fd44acb5b2e0a583a20537641099dc16c59b6b7c7cab7e61faa0e9e43a model.safetensors diff --git a/drafter/config.json b/drafter/config.json new file mode 100644 index 0000000000000000000000000000000000000000..b14ad3ff5a5d6493f6563afcbcc2664990feccea --- /dev/null +++ b/drafter/config.json @@ -0,0 +1,68 @@ +{ + "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 + } +} diff --git a/drafter/model.safetensors b/drafter/model.safetensors new file mode 100644 index 0000000000000000000000000000000000000000..d1868fb34ad9bc4ea4ec8082836ce47d4793444c --- /dev/null +++ b/drafter/model.safetensors @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a22381fd44acb5b2e0a583a20537641099dc16c59b6b7c7cab7e61faa0e9e43a +size 989975648 diff --git a/licenses/CUTLASS-LICENSE.txt b/licenses/CUTLASS-LICENSE.txt new file mode 100644 index 0000000000000000000000000000000000000000..e971c5d22b9dafa2b83deaedff8350ca7e653d26 --- /dev/null +++ b/licenses/CUTLASS-LICENSE.txt @@ -0,0 +1,34 @@ +Copyright (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 without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list 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 documentation +and/or other materials provided with the distribution. + +3. 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, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF 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. diff --git a/licenses/FLASH-ATTENTION-LICENSE.txt b/licenses/FLASH-ATTENTION-LICENSE.txt new file mode 100644 index 0000000000000000000000000000000000000000..5860e4b33f3d9d85fc636137c559331d51783a5b --- /dev/null +++ b/licenses/FLASH-ATTENTION-LICENSE.txt @@ -0,0 +1,29 @@ +BSD 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 without +modification, 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, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/recipe/README.md b/recipe/README.md new file mode 100644 index 0000000000000000000000000000000000000000..a5dccc66d156fbf15d6507800fb0dbcbeed6afb9 --- /dev/null +++ b/recipe/README.md @@ -0,0 +1,52 @@ +# The recipe + +`serve.sh` is the only entry point. It runs the stock SGLang image `lmsysorg/sglang@sha256:efac853b…` (the Inkling-2-Mini +day-0 build) and mounts the files of `stack/` into it; nothing is built into the image and the base weights are mounted +read-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 ` 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//` | 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` reasoning +parser 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 the +host 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 + +```bash +DRY_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 the +launcher would execute (`docker-argv.log`) without running it. diff --git a/recipe/RELEASE_NOTES.md b/recipe/RELEASE_NOTES.md new file mode 100644 index 0000000000000000000000000000000000000000..517065abd298b59096cf054e00fcfa072b68bc27 --- /dev/null +++ b/recipe/RELEASE_NOTES.md @@ -0,0 +1,40 @@ +# 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. diff --git a/recipe/base-1fb4134b.sha256 b/recipe/base-1fb4134b.sha256 new file mode 100644 index 0000000000000000000000000000000000000000..4ce21bf22f948a1a3401c58345f294d4b855e3e4 --- /dev/null +++ b/recipe/base-1fb4134b.sha256 @@ -0,0 +1,12 @@ +65e60f51aa1284d4fb022584908c315270334d991828bb774af60584523539d1 model-00001-of-00001.safetensors +53a9035f3255945704b5857657cfb00c1165090c0641c4f782a0cbf268cc16dc chat_template.jinja +8216dd43157f5474cfff88f486a1e433fef703c674f694e485a86a761c412b1e config.json +a08737c07a65a8fdf69f7cf086576210e5aad4b241437090b26d7b0c4f7905f7 generation_config.json +7c656207d3ce37879c7be209a036b0dde43bf01f78159bff06880b868ed57143 hf_quant_config.json +c1631065b7b00787993522dddc66a68b3abee869192977fb3dcb796e63bc5838 model.safetensors.index.json +7c3b651317f01f73bcf4e1dceba66ef8b7e1a1eac6bc171e882e690a4b10a1d2 mtp.safetensors +d7350adce18c8be4b607f261c8f0f7eabbf720bb7aaf648a43d4f8372bbacc2d processor_config.json +c16f44b3594563d82743ddb0417a2be1bfe3e2000dfad2da4b8f32554593e1a0 special_tokens_map.json +bf09342d285139fd37ce10c70878af1d52cb390e9901e10248654293a80ee636 tokenizer_config.json +7f332727f9a3f093dd452a39cc978e6757627e5dad1b0673aa4e75174f236dd6 tokenizer.json +f170372dd655728909228220d77cf6b8104a59f38a91262a7d2c4027906ec0d8 tiktoken/tokenizer.model diff --git a/recipe/profiles/agentic.row b/recipe/profiles/agentic.row new file mode 100644 index 0000000000000000000000000000000000000000..e5d47e34e717d80b7c11c9981f35d9e7723c959f --- /dev/null +++ b/recipe/profiles/agentic.row @@ -0,0 +1 @@ +IMAGE=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.sh diff --git a/recipe/profiles/long.row b/recipe/profiles/long.row new file mode 100644 index 0000000000000000000000000000000000000000..a075b1c23fb93116bf9c6e883dba87aba9b7b6df --- /dev/null +++ b/recipe/profiles/long.row @@ -0,0 +1 @@ +IMAGE=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.sh diff --git a/recipe/serve.sh b/recipe/serve.sh new file mode 100644 index 0000000000000000000000000000000000000000..2b9253a14bbc24e86fdcf22d1a353c6ffe4534eb --- /dev/null +++ b/recipe/serve.sh @@ -0,0 +1,71 @@ +#!/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/.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 run +set -euo pipefail +R=$(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; fi +say() { 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 launcher +ROW=$(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"; fi +case "$ROW" in *@*@*) die "unfilled placeholder in $ROWF";; esac +export VLLM_NO_USAGE_STATS=1 DO_NOT_TRACK=1 +say "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 set +eval "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.1 +for 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 10 +done +die "not ready after 45 min; docker logs $NAME" diff --git a/recipe/stack/SHA256SUMS b/recipe/stack/SHA256SUMS new file mode 100644 index 0000000000000000000000000000000000000000..f14622ce74dc9464b2df876dae76a98645f638cd --- /dev/null +++ b/recipe/stack/SHA256SUMS @@ -0,0 +1,775 @@ +61a59cd6f4d9b31abd76da83f67b5797f4a1f5e5ec9ce866e78fdcd8692896eb cands/n292-v2-v297-pk3c/recipe/CREDITS.md +1a87a7afb937c54991860f623a0365882a854cf08bf058e6efd60e87488fcddd cands/n292-v2-v297-pk3c/recipe/LICENSE +398c1c6b775c7865ad1c50f1cc73ed01116a4d8e213ed3bcf7eff0bc2d268642 cands/n292-v2-v297-pk3c/recipe/NOTICE +61a59cd6f4d9b31abd76da83f67b5797f4a1f5e5ec9ce866e78fdcd8692896eb cands/n292-v2-v297-pk3c/recipe/overlay/inkling_attn/CREDITS.knapcio-v2.9.3.md +1a87a7afb937c54991860f623a0365882a854cf08bf058e6efd60e87488fcddd cands/n292-v2-v297-pk3c/recipe/overlay/inkling_attn/LICENSE.knapcio-v2.9.3 +398c1c6b775c7865ad1c50f1cc73ed01116a4d8e213ed3bcf7eff0bc2d268642 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_attn/NOTICE.knapcio-v2.9.3 +4d3f0b284bde7c3a066f1134ec52d1896512804aa92d311b0fb48659cc617bd6 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_attn/README.md +f7c0b49cfd8e4047947118882ae79b001dfc1486e4dd9ee92e544e89c83c70ca cands/n292-v2-v297-pk3c/recipe/overlay/inkling_attn/__init__.py +ab12eae066bc1cc54662498a1d7d53aa468619997fc204e6a14ba26715977a0c cands/n292-v2-v297-pk3c/recipe/overlay/inkling_attn/_hook.py +3cf30a00b0670b0babb2024b85ec88508e66562fe1901e9b2bc51b86275b3a8a cands/n292-v2-v297-pk3c/recipe/overlay/inkling_attn/build.py +ecd499f8ab53c0d2e03942fd1ef9ba4165ea16b276fbb26b9a5bfbfa078da34a cands/n292-v2-v297-pk3c/recipe/overlay/inkling_attn/csrc/attn_kernel.cuh +e10f9d601a09d438749189902a4da13411a4318610de2c87d90c0335cec80995 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_attn/csrc/inkling_attn_ext.cu +8b097c56fbe2b6facb41e80e97e0fd6198fcb0a85460f127a716731b3ae8a921 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_attn/ops.py +fa70374aba0e5f826993c98cbf4303a0b515f9457b60461dc3f8da30c64f9892 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_attn/patch.py +0424895a98d8a22a9cdce8c3ac32dd00ce0000c6292e0b6a732848ffc4b426ea cands/n292-v2-v297-pk3c/recipe/overlay/inkling_attn/tests/test_install.py +9884d1befc3894d1f5f4b4c8b34df827a4bd752232f046673af05db33494009a cands/n292-v2-v297-pk3c/recipe/overlay/inkling_attn/tests/test_w8split_cpu.py +eb0c172281bf706ade1554a37192d0bf59db643bc1b0cefb7b863b4e93231a4b cands/n292-v2-v297-pk3c/recipe/overlay/inkling_cert/README.md +5882400af5a589496e782828387924f5e833ebace1356cf72ea720799975d31e cands/n292-v2-v297-pk3c/recipe/overlay/inkling_cert/__init__.py +ee0ef2ccad715b6614ee88fedd6f5a5a67291e6c76e3fed8c9bf4bf663209858 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_cert/_hook.py +54869935ed0fc96e98a78e8422b62282693f3231db2883e780a1e0d816f44efd cands/n292-v2-v297-pk3c/recipe/overlay/inkling_cert/build.py +a254d8f11b5fa27c01c3d5df3584dc703a5140d202955cc963064b2aca5e8677 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_cert/cert_math.py +0e6a597b3ff6dc12b01e9247906604262006cf2094b7358dab49bc6dd2fa9177 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_cert/certwide.py +957d0dd2a18d5ac7de6fc88e937052852549750e669af9ebc40abb753c81328d cands/n292-v2-v297-pk3c/recipe/overlay/inkling_cert/certwide_math.py +dc2b48f09ba8ab465daf9ad63fbc728dbcd01b725798f0a634f8af411022f07b cands/n292-v2-v297-pk3c/recipe/overlay/inkling_cert/certwide_reduce.py +e2f40277fe04993deed769348905e2e911dcbe218f6f6298c677977e91951669 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_cert/csrc/cert_ext.cu +88a27a25adb3e0a2553e82cbc30a0c8a02dcf84635048baba921a746fb4cf175 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_cert/csrc/certwide_screen.cuh +e062ec37ea4eef60f7dd7be2f42b6e2541b06dcdcadc3e255cc1e1fec56ee2ca cands/n292-v2-v297-pk3c/recipe/overlay/inkling_cert/csrc/screen6.cuh +8398ac6708c32f5fe2224a15e3495708e0760d79564208c822c7bdf9a93ccf92 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_cert/dflash.py +9d4fd4e0867b28d19bde7c1a47a6dbc462691dee38ab2f34073f454838b374b1 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_cert/ops.py +2b6ba45d552282da40e2d1d380707dc26ad679eb114fb0bd1c533fe6944a4b2e cands/n292-v2-v297-pk3c/recipe/overlay/inkling_cert/patches.py +56274922d9aaa203ef2b5bd3dff7d7f3973d562b1f47541dc833669a10b7eeb8 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_cert/quant.py +689f292b6e85042db4d7f700ef39573dcc1f441683abcae71e5074109c6e8168 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_cert/tests/test_cert.py +7eec9ed58f35f5ae644b15ead34fc384fe5f1d8eee47f6fe1dd580a9d896e825 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_cert/tests/test_certwide.py +131940bc65d9c1efca8ccf4816e9f5ae615394510f7bdd70d550cb0200a7e12a cands/n292-v2-v297-pk3c/recipe/overlay/inkling_cert/tests/test_dflash.py +9c582d423bee68dd253422ad91c42ad6e9d494c67030b0e09e2e660549b2ad83 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_cert/tests/test_patches.py +089b23ba89259410f7f4c5a73d6a261ac928a44add4f5debeabc84a5b7a9c364 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_cert/tools/gpu_check_cert.py +1b41188139e5e59c0d1138efbc218aa5469c2b3570fdce2a7f2b790589f991ea cands/n292-v2-v297-pk3c/recipe/overlay/inkling_cert/tools/smoke_hooks.py +269984f2e0628a6387af93a27350f6ccd53691d6ebc6ff63b4efd83a536fd1c7 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_dfaccept/README.md +24eb31b321286bef5e99130e3b083ddfe8faafcb342c052305c5a98a5d7d9f59 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_dfaccept/__init__.py +ab12eae066bc1cc54662498a1d7d53aa468619997fc204e6a14ba26715977a0c cands/n292-v2-v297-pk3c/recipe/overlay/inkling_dfaccept/_hook.py +7ba089479db0974c09b76f1042f9131bb944e309343d72867c089e9faa3760fe cands/n292-v2-v297-pk3c/recipe/overlay/inkling_dfaccept/core.py +251128ff0efd9eb43e6a8225570e89d08b6e6b7c7b0cd3d1d8392050a3d9f563 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_dfaccept/patches.py +5eb381c6c5137f7a670130ad22fe406706dedb095d0a9817f15d57ecddb809e8 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_dfbytes/README.md +7cf77494d835269f88a704f0eaca2518ff2fda31c60d32d371b757f0db88ec66 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_dfbytes/__init__.py +ab12eae066bc1cc54662498a1d7d53aa468619997fc204e6a14ba26715977a0c cands/n292-v2-v297-pk3c/recipe/overlay/inkling_dfbytes/_hook.py +aca345f7e98de7509e7b507e4d401c8692db76687f3ab9116538261f7b143dcb cands/n292-v2-v297-pk3c/recipe/overlay/inkling_dfbytes/ctx8.py +cebe39ac06717ae5735ff4f839c1e5992a2b2f4ab50d4f98a062baa9c2f4a415 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_dfbytes/patches.py +f126616fd8682f570af7bdf7ec26e807d40c61051a8049d3e3efa16f94369798 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_dftail/__init__.py +ab12eae066bc1cc54662498a1d7d53aa468619997fc204e6a14ba26715977a0c cands/n292-v2-v297-pk3c/recipe/overlay/inkling_dftail/_hook.py +ae77c2c3723aa2cdb32d9f26eea67ee82a44a6c55282483416ed2c801af40296 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_dftail/_sources.py +6cd072ae1ca44714816b874c733805ea8c3be511a23715829e63298ed8dfd566 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_dftail/bpatch.py +b23bdb11c23c0cc06297899ca7e71a3f1be781052726427c1b5000e27afb8b0b cands/n292-v2-v297-pk3c/recipe/overlay/inkling_dftail/snapshot.py +e3b1e2f5194051bba30e455756c6b1943f5aacd03599ce1fa4b1b542844c0663 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_draftbytes/README.md +8dd8abba6fa60514f4a68c64f54dd8cffedffbaa0982f4d4847be7627e3389c2 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_draftbytes/__init__.py +812d99b5844ca99e56fa11394663733404441d35c3b42e804d8884a604eab6df cands/n292-v2-v297-pk3c/recipe/overlay/inkling_draftbytes/_hooks.py +ae8f4cb9cccea61a658bf3de2e0a4ef2cb0d01213915c5ce1732087100976ceb cands/n292-v2-v297-pk3c/recipe/overlay/inkling_draftbytes/_opts.py +06a22262122f4cc0b9bbf1497b98ab2f331175c2b407fc572284935d228788a5 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_draftbytes/_triton.py +c3d8459315b854912142d8b6deb7a2d903cee5913bcf2ee6ddb059faeebf9c13 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_draftbytes/csrc/w8gemv.cu +2430b0bbe643063b7b842df20b5058ca07db302e37e0f199770ffa3fc49a1c3e cands/n292-v2-v297-pk3c/recipe/overlay/inkling_draftbytes/dwin.py +32bbb9a854451827e7633b19d0bb534e697fbd6c8ee6e76dae412d2dda464a4d cands/n292-v2-v297-pk3c/recipe/overlay/inkling_draftbytes/hotvocab/inkling2-mini-hot-r2.json +bab4e585eaff5c71e86eaa79bf5a0b9a11fa4bcbbca1495286b29d037d443ef4 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_draftbytes/ops.py +da084e9753f9d9a80876ac94595a375ec625302e23fac51a72fdc33e681e9cec cands/n292-v2-v297-pk3c/recipe/overlay/inkling_draftbytes/patches.py +cd3a06f12f2c22cbd73d62b24836eb8fb43b2d57e423ed3b4a18bb0b5df4a6e2 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_draftbytes/quant.py +f0fbc7e4b44e513c724d7381f6d12b04838cc3826c547be51b36fe1b47c48860 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_draftbytes/rnnhoist.py +65acc6c881f54a868270eec9e2acdd552fe0158da010dfb001ad112929360682 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_draftbytes/tau.py +40db95bd0174f5a3d9f732a1e742ff022384884046b1da095e3b76d528f38c28 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_draftbytes/timing.py +cb76bf7c8ae6b78337483d6e3145b4aadb076db528a7777e95fdc95e804f4346 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_draftbytes/w8gemv.py +84c62ef2bad39eb126b3f03e356aa8e7149ce00cdef07b441bb8a3066544daef cands/n292-v2-v297-pk3c/recipe/overlay/inkling_kernels/README.md +cf121c574ddc27aa1ff24138814b25990cf9e6426fe5ac91f08166c9b944073e cands/n292-v2-v297-pk3c/recipe/overlay/inkling_kernels/__init__.py +ee0ef2ccad715b6614ee88fedd6f5a5a67291e6c76e3fed8c9bf4bf663209858 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_kernels/_hook.py +75dafe2d6bfbeb65193bbab71f1c915ebca4e3919edb540898f93cf9f7594b7e cands/n292-v2-v297-pk3c/recipe/overlay/inkling_kernels/moe_tiles.py +97d9379d33afc634a1a91e41e2fef1bda8d1609d19fe58ff95d2adafb5808d6b cands/n292-v2-v297-pk3c/recipe/overlay/inkling_kernels/qkvr_gemv.py +9886b5e338556024c03dd58a31b14e9e5f03e094609b547915e324f44605857f cands/n292-v2-v297-pk3c/recipe/overlay/inkling_kv12/README.md +41daa1fc09a60a324539affd7ec9667a0350020fc6633f8c068fec9dc5f78ee0 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_kv12/__init__.py +ab12eae066bc1cc54662498a1d7d53aa468619997fc204e6a14ba26715977a0c cands/n292-v2-v297-pk3c/recipe/overlay/inkling_kv12/_hook.py +bc8941909122c51bcc80cb1b37fda233061c0c50c180e031aba3a8c7789e7691 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_kv12/ops.py +d4514e3786f2dd98370a6126733239344f94280c4b89d7126536b99b66352283 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_kv12/patch.py +4c035d2a7cfc45f17cf9fb39341a6fa85bc4634b3926725f7d23cd9501808012 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_kv12s/__init__.py +dd08112a15db424731b25bb3dd8e5d27a688033896fb11269e3c021e6e0f2bdf cands/n292-v2-v297-pk3c/recipe/overlay/inkling_kv12s/attention.py +6f96ca7ed4d69503bb2e83f95ddf08b201b510acf9cc1b034f724125a726a214 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_kv12s/check_data.py +10932369507cd317ee7f1ad1966433bfbcb34da2106b795b6b580a60a85e159f cands/n292-v2-v297-pk3c/recipe/overlay/inkling_kv12s/device.py +616a0ab680b3b259128a39dfeb77d7b8b77ed7cb6bef74d890e0487f38ee507a cands/n292-v2-v297-pk3c/recipe/overlay/inkling_kv12s/patch.py +3554c61d7da8134766ed41206239065ba1e7b5df3b38a390a66a931876cf4533 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_kv12s/pressure.py +d0ad1f533a820b97d19ffbc420c8f490497c38641bb48f7328206299aa48f145 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_kv12s/segsum.py +7d8d61c362c645a610e65d4ccba7e0dce8d46dcd150a27df5d2546fb37093661 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_kv12s/static.py +37b1fd7d544955e98c4d8ee1d16f4e49e2f945dc18b137b894b1fd5cbe7ce102 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_kv12s/storage.py +a7a4ce407859b7f31120608314ae7d9f8df8244ef309dcd9cd3aae689f731f0c cands/n292-v2-v297-pk3c/recipe/overlay/inkling_kv12s/swa_layout.py +bb72def3d71f7cf145079bc5edc4f8ee1a208f15780928b806337826d81bda8d cands/n292-v2-v297-pk3c/recipe/overlay/inkling_noexp/__init__.py +ab12eae066bc1cc54662498a1d7d53aa468619997fc204e6a14ba26715977a0c cands/n292-v2-v297-pk3c/recipe/overlay/inkling_noexp/_hook.py +d6207856ed7b8146c9842cbebac87b652a05f9e0c83dd84ef644d7edb4d55c42 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_noexp/_mask.py +81752701087d7a56045ab97627e3e2ceaf039099d5b561c061321a22acf6b689 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_padx/__init__.py +ab12eae066bc1cc54662498a1d7d53aa468619997fc204e6a14ba26715977a0c cands/n292-v2-v297-pk3c/recipe/overlay/inkling_padx/_hook.py +51823f619e768163dbfa547165e7af04ddf93af35ff13e6b8ff0ef02abaaf686 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_padx/patches.py +2710527dfb9c184e3cc77780c6d69ab64b22bba032daa2087736302d54c5b0d7 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_pcopy/__init__.py +ab12eae066bc1cc54662498a1d7d53aa468619997fc204e6a14ba26715977a0c cands/n292-v2-v297-pk3c/recipe/overlay/inkling_pcopy/_hook.py +c210ac609cd5ff936aed7b0d582b5a89dc059cfaab93dc91ad7cd6a445866062 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_pcopy/_sources.py +2b9b808117ef4b23884652c9a199258bebaacfb485199d434304969ae1f33353 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_pcopy/fixtures.py +26a153b5ffa4ee27159401581b109872b91216cbd36db8d6f1e04bf43c3ca2f7 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_pcopy/fused.py +26e1cdbb37a8d7f58d7b92c42270e151d08822d3e9797130dbbb19d483b1352e cands/n292-v2-v297-pk3c/recipe/overlay/inkling_pcopy/history.py +079f558fe7ddc02f8bd320d71fa329e569bf3e1ecc2c9a419fe32f62b7139192 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_pcopy/matcher.py +14b3d2fda0fbc5a7a640187872ec77c072f2ba723de74983ab5a63b10fa85545 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_pcopy/patch.py +89a122d26a44d635e94586af6dfdb50c53f48a462d7ea02395b293fb1ef9c6d3 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_pcopy/rule.py +61a59cd6f4d9b31abd76da83f67b5797f4a1f5e5ec9ce866e78fdcd8692896eb cands/n292-v2-v297-pk3c/recipe/overlay/inkling_pfuse/CREDITS.md.knapcio-v2.9.3 +1a87a7afb937c54991860f623a0365882a854cf08bf058e6efd60e87488fcddd cands/n292-v2-v297-pk3c/recipe/overlay/inkling_pfuse/LICENSE.knapcio-v2.9.3 +398c1c6b775c7865ad1c50f1cc73ed01116a4d8e213ed3bcf7eff0bc2d268642 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_pfuse/NOTICE.knapcio-v2.9.3 +aa5869a0f6a177c6cda7280c4a2564097a06f02b3e260c4a25cd24a8c6193018 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_pfuse/README.md +9820ebf80c8ffff40d14244fdab623d1511ea8fc751a1fa8c17f759fade25f9d cands/n292-v2-v297-pk3c/recipe/overlay/inkling_pfuse/__init__.py +ab12eae066bc1cc54662498a1d7d53aa468619997fc204e6a14ba26715977a0c cands/n292-v2-v297-pk3c/recipe/overlay/inkling_pfuse/_hook.py +7e47cfd76d45851d371aa23e089deba31c99823e2296ca145522b4d801583b7e cands/n292-v2-v297-pk3c/recipe/overlay/inkling_pfuse/_triton_mix.py +1930979f4bdc1b97bac83cc95dc4c15ab726b0ce69f11baeda9cf753011c7e41 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_pfuse/_triton_sconv.py +d3b81190b2622e5a437c823af4ae16e0ebf1e8b631c7a9432bc1e71503bd01ce cands/n292-v2-v297-pk3c/recipe/overlay/inkling_pfuse/layer.py +508f34216dec13dcc30d77c08cd09d10f7d20bbbb28bb031e90414c7b25d3f8b cands/n292-v2-v297-pk3c/recipe/overlay/inkling_pfuse/mix.py +32fe8bcacf8d6fc64ee401b014c421c4cdc0d5c6d342a50a489bf65891cbfd5a cands/n292-v2-v297-pk3c/recipe/overlay/inkling_pfuse/tools/attrib_prefill.py +1ff7a611ad3a7e6ee9955f5ece2fc8778b5e37186bec785bf304e68f997300a3 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_pfuse/tools/bench_loop.py +467bc7d06db2756307d7da7fc7289c7ff2a2f08d4ec1550cad57b6dcf1bbd73f cands/n292-v2-v297-pk3c/recipe/overlay/inkling_pfuse/tools/gpu_check_pfuse.py +63f3bbbdc63686529c2ed70ef5a94cbe66ab761a985799f58e27d9aaedacfad8 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_pfuse/tools/sweep_mix.py +61a59cd6f4d9b31abd76da83f67b5797f4a1f5e5ec9ce866e78fdcd8692896eb cands/n292-v2-v297-pk3c/recipe/overlay/inkling_phoist/CREDITS.md.knapcio-v2.9.3 +1a87a7afb937c54991860f623a0365882a854cf08bf058e6efd60e87488fcddd cands/n292-v2-v297-pk3c/recipe/overlay/inkling_phoist/LICENSE.knapcio-v2.9.3 +398c1c6b775c7865ad1c50f1cc73ed01116a4d8e213ed3bcf7eff0bc2d268642 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_phoist/NOTICE.knapcio-v2.9.3 +26eb3a17f9a426fb11dfec4e294dd2ed187b7104bf36e7588a9d6df8ee63134b cands/n292-v2-v297-pk3c/recipe/overlay/inkling_phoist/__init__.py +ab12eae066bc1cc54662498a1d7d53aa468619997fc204e6a14ba26715977a0c cands/n292-v2-v297-pk3c/recipe/overlay/inkling_phoist/_hook.py +ca8c58f123ea47200ca9306f1e043fae10672f381cf96e7685f5f6adff3e953a cands/n292-v2-v297-pk3c/recipe/overlay/inkling_phoist/phoist.py +f55d49b173b3f6ef080ce2dcc563333f193dfcbf75a7e8f7f6f5b353e4be7576 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_phoist/phoist_triton.py +a12fbe61a792b2c2c7597b259ab99a0b9656922865a9a24836d92f17e121f876 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_pico12/README.md +8aeb4211fa86cc155ac12af76eedea7963e96c1f43c766e3c749bcfba35ac370 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_pico12/__init__.py +ee0ef2ccad715b6614ee88fedd6f5a5a67291e6c76e3fed8c9bf4bf663209858 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_pico12/_hook.py +0b9cd153d788be7ffed98a8bd0d7b4fbab6222f1e3c06961865a01a6cd991c44 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_pico12/build.py +aab4b5396310f0f0cbe21c1fcd5906e25b8c62f18689685c48ff5f530622c7c8 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_pico12/csrc/pico12_ext.cu +8babed542f329a5040a02167d6d30e880d35a4f334b457adff8489dfa198800a cands/n292-v2-v297-pk3c/recipe/overlay/inkling_pico12/csrc/pico12_range.cu +97329931d0e392fc5ac1292657bb9852bae973fd4336ec47dcea626bd78a09cd cands/n292-v2-v297-pk3c/recipe/overlay/inkling_pico12/ops.py +1d91c866aaa329e6045d2161a776ba6e2064f3f81b8a6a6903f0bb6c6cc3608e cands/n292-v2-v297-pk3c/recipe/overlay/inkling_pico12/patches.py +fb9c7ecee826335f6014f5f2040b5abe132a86aa6e43f1545bb1e5db19cea16b cands/n292-v2-v297-pk3c/recipe/overlay/inkling_pico12/third_party/pico/LICENSE +60b3ad14b8d2291101c82f3cc8c0653a6e778b1db9abfe463992dd3737550b4f cands/n292-v2-v297-pk3c/recipe/overlay/inkling_pico12/third_party/pico/common/check.h +5d96f43891a930cffa23c8649a79d28d019f7597bf5b2ac51e46eb6de5ff6e87 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_pico12/third_party/pico/kernels/common.cuh +baa1d8d7ff69d0f132acbfba354eb35dc4e5011b5f3e1ae3d177d6d1dcfb5256 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_pico12/third_party/pico/kernels/dsk.h +91230a0b0783d2af5da87d6476e60c2dc2d94d60879998e54db547dc6f01982d cands/n292-v2-v297-pk3c/recipe/overlay/inkling_pico12/third_party/pico/kernels/gemv16.cu +61a59cd6f4d9b31abd76da83f67b5797f4a1f5e5ec9ce866e78fdcd8692896eb cands/n292-v2-v297-pk3c/recipe/overlay/inkling_prologue/CREDITS.knapcio-v2.9.3.md +1a87a7afb937c54991860f623a0365882a854cf08bf058e6efd60e87488fcddd cands/n292-v2-v297-pk3c/recipe/overlay/inkling_prologue/LICENSE.knapcio-v2.9.3 +398c1c6b775c7865ad1c50f1cc73ed01116a4d8e213ed3bcf7eff0bc2d268642 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_prologue/NOTICE.knapcio-v2.9.3 +d807c304d543312f6c3c3e2f1d40a3dcedc982c8bef30a34ca891fe6c7956fbe cands/n292-v2-v297-pk3c/recipe/overlay/inkling_prologue/__init__.py +ab12eae066bc1cc54662498a1d7d53aa468619997fc204e6a14ba26715977a0c cands/n292-v2-v297-pk3c/recipe/overlay/inkling_prologue/_hook.py +d83c5b71d817b66804bfaa2c7108a96b4374033102b709639555456feed6478d cands/n292-v2-v297-pk3c/recipe/overlay/inkling_prologue/_triton.py +fed63858ca1872cf9fc4122cff02af670e297b972df4d075c929c77613b7f6c4 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_ptouch/__init__.py +ab12eae066bc1cc54662498a1d7d53aa468619997fc204e6a14ba26715977a0c cands/n292-v2-v297-pk3c/recipe/overlay/inkling_ptouch/_hook.py +b8dfe59c5b140d6a9804be846b06cb4ec07746bb0176ff8b2637177c9487806f cands/n292-v2-v297-pk3c/recipe/overlay/inkling_rsfix/README.md +edf339d321b72e9207204143906526677b6beacb179e1399ac9dc183ba29bd72 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_rsfix/__init__.py +2a1eabd10f7e964a53fe76b66254873fcfd461b0d32f7277db42457d7d65990a cands/n292-v2-v297-pk3c/recipe/overlay/inkling_rsfix/_hook.py +c4e84d4ef8e7343e1563617814c65d0d71fbe19915461d73245818f83e9d1e6c cands/n292-v2-v297-pk3c/recipe/overlay/inkling_rsfix/_sources.py +e4dfce68cae58f71a0658410fe88e6520f94d6c389f8d57e482dacea363509d8 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_rsfix/blockwise.py +9530622cde80e49864d60a50342ff1850e6c6389eb1baa0207d68ba6a388005c cands/n292-v2-v297-pk3c/recipe/overlay/inkling_rsfix/markov.py +93da51652aa8ec27396610a10724b6571e5de8d4ee08e236677c9e98604db951 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_rsfix/reference.py +61e81094be26a6f8a46f07f1b062b07eab246a52553ed094ba147813d92dd513 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_rsfix/reject.py +d5607344cacbcf77fb4cdcc6ce9de49a4290bbf85281f78c9c397a2984dc06eb cands/n292-v2-v297-pk3c/recipe/overlay/inkling_rsfix/selector.py +63c5e7852205045be8bca6e84160df8f2f4dd4f44a8093a6a5a04d9fffbca47e cands/n292-v2-v297-pk3c/recipe/overlay/inkling_vattn/README.md +a08d05ffbd94bdb1c94194432d927b1f30035fa6f23fcc2adc7de36b2930c78c cands/n292-v2-v297-pk3c/recipe/overlay/inkling_vattn/__init__.py +ab12eae066bc1cc54662498a1d7d53aa468619997fc204e6a14ba26715977a0c cands/n292-v2-v297-pk3c/recipe/overlay/inkling_vattn/_hook.py +63aad1d099fec3f2b66a0ffd8d3709a564644edac2d4f25c1c33018be3dd6f25 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_vattn/ops.py +4f18599a0ad748f7f6a507f165ac72327e733eb082fd6276995b9e4474869652 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_vattn/patch.py +66f94a7e6143ee5bde5e8f83aefe4333ad9d701282b411f0c30091eff637b3b7 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_vcap/README.md +6a39653aa552d2035e4700918cf7e6dd488881c46cd4d52a3edf8424fe7f3cbd cands/n292-v2-v297-pk3c/recipe/overlay/inkling_vcap/__init__.py +01b543f9ea35fd83b4ef34d681b86f6aedd3fc9cbc26b270fb98d3159025c4c2 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_vcap/config.py +bbe0288dd145ba12f1d7312b7def82a7dc0f76c31b5dfa3e2236730eba177b79 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_vcap/dfcap.py +9caf5d3ca057b622e4cca6e35456f7435f9e1d1e5df692f491e12271014d8aed cands/n292-v2-v297-pk3c/recipe/overlay/inkling_vcap/dfcheck.py +f7d2389c58143c3ea661616d82f42e1c7b55b8f95c78dcb424c45d205c4d2203 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_vcap/dflash.py +41cd33472898d7ad98bcbaae2eaf5c27238069b6cdd7815528c932795673e5da cands/n292-v2-v297-pk3c/recipe/overlay/inkling_vcap/dfsteplog.py +bda7d9e386db34eb3f3a8c8aeda249b91ff8ec27d176c23fb5574e80ec81c431 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_vcap/fastprobs.py +d364b1bc5a27dd747b08095030670ac085205454b548ba54b453f96872cd90bb cands/n292-v2-v297-pk3c/recipe/overlay/inkling_vcap/fused.py +897b421d153acd9c0494e084e0d8227804a00f5d24c245646dec74079c422b84 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_vcap/fused_accept.py +0a928a2c9b2677ce1a359da34d444b40ff38cc6a01c8f44c5723dbaabb6751e5 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_vcap/importhook.py +2738304eeff01b7d21c700c7408b24e1c429ad912fdc6e58952cf5a1d2a80963 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_vcap/logic.py +9ba4bf5aeafcc3d1e58adecbad230cbfa128079c6577843a6e28e40866258a20 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_vcap/patches.py +21082944e6df1a1eb5d288c226562278d8b493ea37cb6ccbf6a8a98bcaa93cce cands/n292-v2-v297-pk3c/recipe/overlay/inkling_vcap/policies/df-SLDF1-sm.json +b9505b8e00284277b8354cf72a406d8bc2b465d8619f51f44e8609964093b5ee cands/n292-v2-v297-pk3c/recipe/overlay/inkling_vcap/policies/df-SLDF2x.json +ab43150b4ff972b9975192761515e843088f8838b765090c888f1c3e79334e9f cands/n292-v2-v297-pk3c/recipe/overlay/inkling_vcap/policies/r2-theta004.json +359b404bd41371397ec8948ece4700d10e1e2b6271301e47439dc4cd83198310 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_vcap/policyfile.py +982f86bb234ebfd5ca7f37304ae9bf78b5fa90969e75357a5a44905f8a708f49 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_vcap/state.py +c7f51ebddeba0c2cb5a11bf8075fec231f081ef58ffd0e2c93097a70ebbca04a cands/n292-v2-v297-pk3c/recipe/overlay/inkling_vcap/v3_kernels.py +4cd0f8e5854e5ed4f1745e6a56aaeba679c4ec4bc17352960f1f01fe3b8f8cf0 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_wide/README.md +e473be74143084bca38efb0fce7b281b63239471bc43e99692863dd53b85dd16 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_wide/__init__.py +ee0ef2ccad715b6614ee88fedd6f5a5a67291e6c76e3fed8c9bf4bf663209858 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_wide/_hook.py +409563a58078e003f0f61c39162dca23563d08cf6fe3e6ecd53211b30538bd12 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_wide/build.py +640625aed9282589c3c32b06f0b57be48efd230c88425a4264748fed3f23eb15 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_wide/csrc/bf16x_format.cuh +a281cb85d1867e5acd8dfe7c8d3b2f1b68b5cb1d3091ad6445eba09d66341e94 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_wide/csrc/wide_ext.cu +3b12f4ef0077ccc61f4867a1369a66fc2a3b10e791c19f4323956756086418cd cands/n292-v2-v297-pk3c/recipe/overlay/inkling_wide/ops.py +0deb113320ff36523d0e5a25851c3d27aa9412ed5b74d3fd74288504e0404e09 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_wide/patches.py +5b3f3070eab76b167d3ac2a7f03cfea9e59901e45dbe3a01059cbe5d423bcdbc cands/n292-v2-v297-pk3c/recipe/overlay/inkling_wide/tests/fake_wide_ext.py +b436a3347e2e274fc146d5ed6969f489415fa60f0fc0f58593fd0875d1ddfd87 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_wide/tests/test_wide.py +fb9c7ecee826335f6014f5f2040b5abe132a86aa6e43f1545bb1e5db19cea16b cands/n292-v2-v297-pk3c/recipe/overlay/inkling_wide/third_party/pico/LICENSE +b37e3528ad0ca2dcbd2ab38ee4be67ec88980e769c4a5dbddfa5b45624f28fa7 cands/n292-v2-v297-pk3c/recipe/overlay/inkling_wide/tools/gpu_check_wide.py +ff089d1ab9f66eb5ee40a3f77a6193120abc064d9eb97a60e495a5ec3fa743eb cands/n292-v2-v297-pk3c/recipe/overlay/inkling_wide/tools/gpu_integration_wide.py +7c4ee1a5c11e621b374a4cabe855842cb0b8d6efdf0b766e842bd1b3de3cd2f3 cands/n292-v2-v297-pk3c/recipe/overlay/sitecustomize.py +94dff41c4a23af9e57243750d82d08be918de563b63b4d42a41c859051a34426 cands/n292-v2-v297-pk3c/recipe/patch/inkling2_attn.py +64914ef9213420b37bdb361dfb3bdadb5ff07994deda96c548762e006927bd44 cands/n292-v2-v297-pk3c/recipe/patch/inkling2_loop.py +70d8797b523b0fcdaad6e709e14bfc4bbdcc735a4b49824b430997ff1018dd78 cands/n292-v2-v297-pk3c/recipe/patch/inkling2_loop_model.py +29d1f5cb5101a7a0aac48c4b1f15252acaba01a404c6e2475c6c798f0797d997 cands/n292-v2-v297-pk3c/recipe/patch/n105_rnnhoist.py +9d0231ebab913cb3b3956c421ae5f4f69d2661728f1f8d3b3d64755f9e455f63 cands/n292-v2-v297-pk3c/recipe/patch/n13_attn_global.py +7d6f1ab93c1252e891446df090e414c6aa975ca480a360b5ac65fb6d16c8be9a cands/n292-v2-v297-pk3c/recipe/patch/n13_fwd.py +1801287d6696437fa6417c335decf0f4b9deb7391b4d4e4fd8e5c893cf272333 cands/n292-v2-v297-pk3c/recipe/patch/n140_kern.py +6b69991a90d2ca2a6196d4d1d28014983614a6030d8a38d43aa08c7a29f49f65 cands/n292-v2-v297-pk3c/recipe/patch/n14_moe.py +8e2d7b61a2ffee1e5bbdaf3f2406a202f13e3a9d96df0f849d35af4d781cac62 cands/n292-v2-v297-pk3c/recipe/patch/n14_quant.cuh +a67d3cacb45d4a981add4407552b030c8bdf08dabb7e136f555b21475aa3126a cands/n292-v2-v297-pk3c/recipe/patch/n15_fused.py +e8373342b54dfccbe4c04fd21e137172286b902b07ed6f5037deeb95eb70c9ef cands/n292-v2-v297-pk3c/recipe/patch/n32_attn_local.py +571c3e4a819b27e175091b7af099e972bc4c38b6eac3f1af1ff4e88b6b662746 cands/n292-v2-v297-pk3c/recipe/patch/n32_fwd.py +65f51937ca44728959542ca4ed7456973b45e7f32bd54934e44a49ee256630c4 cands/n292-v2-v297-pk3c/recipe/patch/n35_w8.py +aa79c3095959d385dc1c6f9fdcf7558a73547fcc31c4f6460c6e77cbc9327605 cands/n292-v2-v297-pk3c/recipe/patch/n35_w8gemv.py +b4cc2402f4c0eee56dc4ce9721043b6d16ed04e932f94848b395f3873f58cb59 cands/n292-v2-v297-pk3c/recipe/patch/n37_tiles.py +5b1a90477bb2ed2dddf31b3adbc8cb200538335854ddb99ce59ecdf3dbfadfac cands/n292-v2-v297-pk3c/recipe/patch/n50b_fused.py +1dc6b870ef8c25dd40615930cbf62dfec0e29c5d6b785eb8d42d532ea4a9cd04 cands/n292-v2-v297-pk3c/recipe/patch/n52_band.cuh +e4118504ce8a210f8d4ef86d1be579dd4d73e4161bb0c9e4264811ad51999140 cands/n292-v2-v297-pk3c/recipe/patch/n52_moe.py +3523d5fe6549aec71d853c0713403fbdc15984e08c3e5820c2a790a6ede84855 cands/n292-v2-v297-pk3c/recipe/patch/n64_attn_global.py +eefba4b83410c246441d74d5311deacc6da6e4405d28e3c5b5fa344d4d29eb81 cands/n292-v2-v297-pk3c/recipe/patch/n64a_fwd.py +cca0cd0d7b860ed4cc78a98651264ecb8fd20793055e58323c2623b8531b6d0d cands/n292-v2-v297-pk3c/recipe/patch/n64b_fwd.py +d1b88fb14a0d18ccff2ed53b79dcfcb1a2565e50e6cf625053bf39cdc9f1ecd9 cands/n292-v2-v297-pk3c/recipe/patch/n66fb.py +b7abf0229b9d40558dc6dd576fb300bec9e0a6b9c173b458881111ff0bc89206 cands/n292-v2-v297-pk3c/recipe/patch/n71_resnorm.py +91f1bb6066a4e5abf77253e23816783880ea38cff649aebd844157b60268c5e7 cands/n292-v2-v297-pk3c/recipe/patch/n71_sconvres.py +d4411fd151e6212a0feb14ed41457be3c976b92a8f5c981cbc2d1a890075eb7b cands/n292-v2-v297-pk3c/recipe/patch/n75_c12.py +71fd33a2a119db28c4ca8a24d75e9678131c87b327d095a329fdad18bc03e29a cands/n292-v2-v297-pk3c/recipe/patch/n75_cuda.py +00bece24b9b910eb33d1f85fe1e60b2685a2ac4dfb5f5136d891b9db668968f7 cands/n292-v2-v297-pk3c/recipe/patch/n75_install.py +17349b269f1eb7f2551fac79b9e8020b10708410156a08e1b959c8e53f491f79 cands/n292-v2-v297-pk3c/recipe/patch/n78_head.py +9447c05ffbf888a1aea1a7da467399f572f1d684f142f24c4cccfacefcd353f8 cands/n292-v2-v297-pk3c/recipe/patch/n78_kern.py +efe43e40ebccb20b31398ef7b7a4e70e0dd1a6192a95904ebb70fb6a8f3d3b73 cands/n292-v2-v297-pk3c/recipe/patch/n80_cuda.py +cd2d6ef590744ee69cd3b2dfdff9c42cf957eef291f858c3054f1b651b84943f cands/n292-v2-v297-pk3c/recipe/patch/n80_draft.py +9ba4c20f9fa95c8d9a337f4eeea6abae50e142f747d4dde618712f04e127f56f cands/n292-v2-v297-pk3c/recipe/patch/n86_riders.py +25030bef80b49e72d46355799e7febea0867ea57aed711f7c9ae28159a81f390 cands/n292-v2-v297-pk3c/recipe/serve/inkling2_mtp.py +c71f08ef804dc439f08eca133bd2591868c60e535d06819cda55033785bf195f cands/n292-v2-v297-pk3c/recipe/serve/serve.sh +1bccd9dadf233cd9af15aa63a8d2cc22e0706983355a00e380731d09a5bdb682 cands/n292-v2-v297-pk3c/recipe/serve/sl.json +61a59cd6f4d9b31abd76da83f67b5797f4a1f5e5ec9ce866e78fdcd8692896eb cands/n343a-s2-verify-scodes/CREDITS.md +1a87a7afb937c54991860f623a0365882a854cf08bf058e6efd60e87488fcddd cands/n343a-s2-verify-scodes/LICENSE +398c1c6b775c7865ad1c50f1cc73ed01116a4d8e213ed3bcf7eff0bc2d268642 cands/n343a-s2-verify-scodes/NOTICE +e07ff88a0574411792e46cebe6bdd276ca1745c440c5c36bff221c72e2d9e190 cands/n343a-s2-verify-scodes/overlay/inkling_scodes/README.md +34a6e1f889e463443f62aac75b5ba075f8893a2656ba6db992426251cb94dcf0 cands/n343a-s2-verify-scodes/overlay/inkling_scodes/__init__.py +ee0ef2ccad715b6614ee88fedd6f5a5a67291e6c76e3fed8c9bf4bf663209858 cands/n343a-s2-verify-scodes/overlay/inkling_scodes/_hook.py +ea07c7f27e5fa867156d316e434ba0a8126a663b54f1a569f675172f18361421 cands/n343a-s2-verify-scodes/overlay/inkling_scodes/csrc/scodes_args.h +8cb82134421f71f05c629ffd95383748e0ac19fb071b31699a1c432771a781b5 cands/n343a-s2-verify-scodes/overlay/inkling_scodes/csrc/scodes_binding.cu +060f5b9d3250ca4d2261ded10839ea0010748ecf715cda6fe6ed7af959ce5cca cands/n343a-s2-verify-scodes/overlay/inkling_scodes/csrc/scodes_group_gemm.cuh +428d428016a533597539acf1d908d5fccc3eba049b71a25ec7049b95b6893d8c cands/n343a-s2-verify-scodes/overlay/inkling_scodes/csrc/scodes_inst_128_128.cu +c808f4b1e8992dd76a67a00ca6d0fd8f0f762ea05e644f5295c9709f5d565349 cands/n343a-s2-verify-scodes/overlay/inkling_scodes/csrc/scodes_inst_32_128.cu +39eccddb7294c16dea572ed64e3bdff8d3ee468dd4e98c45bc05c8a387565918 cands/n343a-s2-verify-scodes/overlay/inkling_scodes/csrc/scodes_inst_32_256.cu +9c6c0ff50971a322ad90de53d27a28e5519b3c0d99134e0c9cdad8f7eff4869c cands/n343a-s2-verify-scodes/overlay/inkling_scodes/csrc/scodes_inst_64_128.cu +ad5769b8154581a1c7f72abee12fc95486dae9a0332d632887896ba0cd3179a3 cands/n343a-s2-verify-scodes/overlay/inkling_scodes/csrc/scodes_inst_64_256.cu +4b56d68d7a7fc99932447f14cc4c83542b74ed50bb49bc41bf200c49b2da4ebf cands/n343a-s2-verify-scodes/overlay/inkling_scodes/csrc/scodes_sm120_mma_array.hpp +9374f3758c08772d6cb7b73885234108bdda93e6184184e784a9589e5cc9cf6c cands/n343a-s2-verify-scodes/overlay/inkling_scodes/encode.py +e863a5a1d92f938cac6b23cb52d66a4bde210c495940e117f5c8839e5a74fb22 cands/n343a-s2-verify-scodes/overlay/inkling_scodes/kernel.py +e446d09f6e4d582a4daaccc06f556e184f6919398f62933b6eb30a4f48c6d1d8 cands/n361-s3b-p/overlay_n320/inkling_n320s/__init__.py +c7095f22f861b691071abb1c4303ac97e7431d7744f7c1c441eed16df5da552f cands/n361-s3b-p/overlay_n320/inkling_n329/__init__.py +7f57e8170a49f4bf179c9ccf50b59a4570e0fd5f6e54d890faf8bded7e847396 cands/n361-s3b-p/overlay_n320/inkling_n329/n329_rows.py +b93d559f1b964104903f96dcb4508020dcdcc65b012c885bf9e2505c92c89701 cands/n361-s3b-p/overlay_n320/inkling_n329/n329_rows_ctl.py +53a039ef443368a80a306757a3009181a7e9c15c41770efccf5f58895f836ebc cands/n361-s3b-p/overlay_n320/inkling_n351/__init__.py +fbae72358a1bdc41225f5d00e37c7e8013a5660c4c4e2cdd39a05525f2ee2aeb cands/n361-s3b-p/overlay_n320/n351_quant.cuh +172e5b9281facac196160b287aa56a9a3eb79a0fcbf87f0e94c776c0e0520863 cands/n361-s3b-p/overlay_n320/sitecustomize.py +61a59cd6f4d9b31abd76da83f67b5797f4a1f5e5ec9ce866e78fdcd8692896eb cands/n361-s3b-p/recipe/CREDITS.md +1a87a7afb937c54991860f623a0365882a854cf08bf058e6efd60e87488fcddd cands/n361-s3b-p/recipe/LICENSE +398c1c6b775c7865ad1c50f1cc73ed01116a4d8e213ed3bcf7eff0bc2d268642 cands/n361-s3b-p/recipe/NOTICE +cfc7749b96f63bd31c3c42b5c471bf756814053e847c10f3eb003417bc523d30 cands/n361-s3b-p/recipe/draft-mix/LICENSE +298b4ff803f06cbb4024bd5cdcc53dfa1ba06825936d31a776ef70fe6d30c2a0 cands/n361-s3b-p/recipe/draft-mix/NOTICE +61a59cd6f4d9b31abd76da83f67b5797f4a1f5e5ec9ce866e78fdcd8692896eb cands/n361-s3b-p/recipe/overlay/inkling_attn/CREDITS.knapcio-v2.9.3.md +1a87a7afb937c54991860f623a0365882a854cf08bf058e6efd60e87488fcddd cands/n361-s3b-p/recipe/overlay/inkling_attn/LICENSE.knapcio-v2.9.3 +398c1c6b775c7865ad1c50f1cc73ed01116a4d8e213ed3bcf7eff0bc2d268642 cands/n361-s3b-p/recipe/overlay/inkling_attn/NOTICE.knapcio-v2.9.3 +4d3f0b284bde7c3a066f1134ec52d1896512804aa92d311b0fb48659cc617bd6 cands/n361-s3b-p/recipe/overlay/inkling_attn/README.md +f7c0b49cfd8e4047947118882ae79b001dfc1486e4dd9ee92e544e89c83c70ca cands/n361-s3b-p/recipe/overlay/inkling_attn/__init__.py +ab12eae066bc1cc54662498a1d7d53aa468619997fc204e6a14ba26715977a0c cands/n361-s3b-p/recipe/overlay/inkling_attn/_hook.py +3cf30a00b0670b0babb2024b85ec88508e66562fe1901e9b2bc51b86275b3a8a cands/n361-s3b-p/recipe/overlay/inkling_attn/build.py +ecd499f8ab53c0d2e03942fd1ef9ba4165ea16b276fbb26b9a5bfbfa078da34a cands/n361-s3b-p/recipe/overlay/inkling_attn/csrc/attn_kernel.cuh +e10f9d601a09d438749189902a4da13411a4318610de2c87d90c0335cec80995 cands/n361-s3b-p/recipe/overlay/inkling_attn/csrc/inkling_attn_ext.cu +8b097c56fbe2b6facb41e80e97e0fd6198fcb0a85460f127a716731b3ae8a921 cands/n361-s3b-p/recipe/overlay/inkling_attn/ops.py +fa70374aba0e5f826993c98cbf4303a0b515f9457b60461dc3f8da30c64f9892 cands/n361-s3b-p/recipe/overlay/inkling_attn/patch.py +0424895a98d8a22a9cdce8c3ac32dd00ce0000c6292e0b6a732848ffc4b426ea cands/n361-s3b-p/recipe/overlay/inkling_attn/tests/test_install.py +9884d1befc3894d1f5f4b4c8b34df827a4bd752232f046673af05db33494009a cands/n361-s3b-p/recipe/overlay/inkling_attn/tests/test_w8split_cpu.py +eb0c172281bf706ade1554a37192d0bf59db643bc1b0cefb7b863b4e93231a4b cands/n361-s3b-p/recipe/overlay/inkling_cert/README.md +5882400af5a589496e782828387924f5e833ebace1356cf72ea720799975d31e cands/n361-s3b-p/recipe/overlay/inkling_cert/__init__.py +ee0ef2ccad715b6614ee88fedd6f5a5a67291e6c76e3fed8c9bf4bf663209858 cands/n361-s3b-p/recipe/overlay/inkling_cert/_hook.py +54869935ed0fc96e98a78e8422b62282693f3231db2883e780a1e0d816f44efd cands/n361-s3b-p/recipe/overlay/inkling_cert/build.py +a254d8f11b5fa27c01c3d5df3584dc703a5140d202955cc963064b2aca5e8677 cands/n361-s3b-p/recipe/overlay/inkling_cert/cert_math.py +0e6a597b3ff6dc12b01e9247906604262006cf2094b7358dab49bc6dd2fa9177 cands/n361-s3b-p/recipe/overlay/inkling_cert/certwide.py +957d0dd2a18d5ac7de6fc88e937052852549750e669af9ebc40abb753c81328d cands/n361-s3b-p/recipe/overlay/inkling_cert/certwide_math.py +dc2b48f09ba8ab465daf9ad63fbc728dbcd01b725798f0a634f8af411022f07b cands/n361-s3b-p/recipe/overlay/inkling_cert/certwide_reduce.py +e2f40277fe04993deed769348905e2e911dcbe218f6f6298c677977e91951669 cands/n361-s3b-p/recipe/overlay/inkling_cert/csrc/cert_ext.cu +88a27a25adb3e0a2553e82cbc30a0c8a02dcf84635048baba921a746fb4cf175 cands/n361-s3b-p/recipe/overlay/inkling_cert/csrc/certwide_screen.cuh +e062ec37ea4eef60f7dd7be2f42b6e2541b06dcdcadc3e255cc1e1fec56ee2ca cands/n361-s3b-p/recipe/overlay/inkling_cert/csrc/screen6.cuh +8398ac6708c32f5fe2224a15e3495708e0760d79564208c822c7bdf9a93ccf92 cands/n361-s3b-p/recipe/overlay/inkling_cert/dflash.py +9d4fd4e0867b28d19bde7c1a47a6dbc462691dee38ab2f34073f454838b374b1 cands/n361-s3b-p/recipe/overlay/inkling_cert/ops.py +2b6ba45d552282da40e2d1d380707dc26ad679eb114fb0bd1c533fe6944a4b2e cands/n361-s3b-p/recipe/overlay/inkling_cert/patches.py +56274922d9aaa203ef2b5bd3dff7d7f3973d562b1f47541dc833669a10b7eeb8 cands/n361-s3b-p/recipe/overlay/inkling_cert/quant.py +689f292b6e85042db4d7f700ef39573dcc1f441683abcae71e5074109c6e8168 cands/n361-s3b-p/recipe/overlay/inkling_cert/tests/test_cert.py +7eec9ed58f35f5ae644b15ead34fc384fe5f1d8eee47f6fe1dd580a9d896e825 cands/n361-s3b-p/recipe/overlay/inkling_cert/tests/test_certwide.py +131940bc65d9c1efca8ccf4816e9f5ae615394510f7bdd70d550cb0200a7e12a cands/n361-s3b-p/recipe/overlay/inkling_cert/tests/test_dflash.py +9c582d423bee68dd253422ad91c42ad6e9d494c67030b0e09e2e660549b2ad83 cands/n361-s3b-p/recipe/overlay/inkling_cert/tests/test_patches.py +089b23ba89259410f7f4c5a73d6a261ac928a44add4f5debeabc84a5b7a9c364 cands/n361-s3b-p/recipe/overlay/inkling_cert/tools/gpu_check_cert.py +1b41188139e5e59c0d1138efbc218aa5469c2b3570fdce2a7f2b790589f991ea cands/n361-s3b-p/recipe/overlay/inkling_cert/tools/smoke_hooks.py +269984f2e0628a6387af93a27350f6ccd53691d6ebc6ff63b4efd83a536fd1c7 cands/n361-s3b-p/recipe/overlay/inkling_dfaccept/README.md +24eb31b321286bef5e99130e3b083ddfe8faafcb342c052305c5a98a5d7d9f59 cands/n361-s3b-p/recipe/overlay/inkling_dfaccept/__init__.py +ab12eae066bc1cc54662498a1d7d53aa468619997fc204e6a14ba26715977a0c cands/n361-s3b-p/recipe/overlay/inkling_dfaccept/_hook.py +7ba089479db0974c09b76f1042f9131bb944e309343d72867c089e9faa3760fe cands/n361-s3b-p/recipe/overlay/inkling_dfaccept/core.py +251128ff0efd9eb43e6a8225570e89d08b6e6b7c7b0cd3d1d8392050a3d9f563 cands/n361-s3b-p/recipe/overlay/inkling_dfaccept/patches.py +5eb381c6c5137f7a670130ad22fe406706dedb095d0a9817f15d57ecddb809e8 cands/n361-s3b-p/recipe/overlay/inkling_dfbytes/README.md +7cf77494d835269f88a704f0eaca2518ff2fda31c60d32d371b757f0db88ec66 cands/n361-s3b-p/recipe/overlay/inkling_dfbytes/__init__.py +ab12eae066bc1cc54662498a1d7d53aa468619997fc204e6a14ba26715977a0c cands/n361-s3b-p/recipe/overlay/inkling_dfbytes/_hook.py +aca345f7e98de7509e7b507e4d401c8692db76687f3ab9116538261f7b143dcb cands/n361-s3b-p/recipe/overlay/inkling_dfbytes/ctx8.py +cebe39ac06717ae5735ff4f839c1e5992a2b2f4ab50d4f98a062baa9c2f4a415 cands/n361-s3b-p/recipe/overlay/inkling_dfbytes/patches.py +f126616fd8682f570af7bdf7ec26e807d40c61051a8049d3e3efa16f94369798 cands/n361-s3b-p/recipe/overlay/inkling_dftail/__init__.py +ab12eae066bc1cc54662498a1d7d53aa468619997fc204e6a14ba26715977a0c cands/n361-s3b-p/recipe/overlay/inkling_dftail/_hook.py +ae77c2c3723aa2cdb32d9f26eea67ee82a44a6c55282483416ed2c801af40296 cands/n361-s3b-p/recipe/overlay/inkling_dftail/_sources.py +6cd072ae1ca44714816b874c733805ea8c3be511a23715829e63298ed8dfd566 cands/n361-s3b-p/recipe/overlay/inkling_dftail/bpatch.py +b23bdb11c23c0cc06297899ca7e71a3f1be781052726427c1b5000e27afb8b0b cands/n361-s3b-p/recipe/overlay/inkling_dftail/snapshot.py +e3b1e2f5194051bba30e455756c6b1943f5aacd03599ce1fa4b1b542844c0663 cands/n361-s3b-p/recipe/overlay/inkling_draftbytes/README.md +8dd8abba6fa60514f4a68c64f54dd8cffedffbaa0982f4d4847be7627e3389c2 cands/n361-s3b-p/recipe/overlay/inkling_draftbytes/__init__.py +812d99b5844ca99e56fa11394663733404441d35c3b42e804d8884a604eab6df cands/n361-s3b-p/recipe/overlay/inkling_draftbytes/_hooks.py +ae8f4cb9cccea61a658bf3de2e0a4ef2cb0d01213915c5ce1732087100976ceb cands/n361-s3b-p/recipe/overlay/inkling_draftbytes/_opts.py +06a22262122f4cc0b9bbf1497b98ab2f331175c2b407fc572284935d228788a5 cands/n361-s3b-p/recipe/overlay/inkling_draftbytes/_triton.py +c3d8459315b854912142d8b6deb7a2d903cee5913bcf2ee6ddb059faeebf9c13 cands/n361-s3b-p/recipe/overlay/inkling_draftbytes/csrc/w8gemv.cu +2430b0bbe643063b7b842df20b5058ca07db302e37e0f199770ffa3fc49a1c3e cands/n361-s3b-p/recipe/overlay/inkling_draftbytes/dwin.py +32bbb9a854451827e7633b19d0bb534e697fbd6c8ee6e76dae412d2dda464a4d cands/n361-s3b-p/recipe/overlay/inkling_draftbytes/hotvocab/inkling2-mini-hot-r2.json +bab4e585eaff5c71e86eaa79bf5a0b9a11fa4bcbbca1495286b29d037d443ef4 cands/n361-s3b-p/recipe/overlay/inkling_draftbytes/ops.py +da084e9753f9d9a80876ac94595a375ec625302e23fac51a72fdc33e681e9cec cands/n361-s3b-p/recipe/overlay/inkling_draftbytes/patches.py +cd3a06f12f2c22cbd73d62b24836eb8fb43b2d57e423ed3b4a18bb0b5df4a6e2 cands/n361-s3b-p/recipe/overlay/inkling_draftbytes/quant.py +f0fbc7e4b44e513c724d7381f6d12b04838cc3826c547be51b36fe1b47c48860 cands/n361-s3b-p/recipe/overlay/inkling_draftbytes/rnnhoist.py +65acc6c881f54a868270eec9e2acdd552fe0158da010dfb001ad112929360682 cands/n361-s3b-p/recipe/overlay/inkling_draftbytes/tau.py +40db95bd0174f5a3d9f732a1e742ff022384884046b1da095e3b76d528f38c28 cands/n361-s3b-p/recipe/overlay/inkling_draftbytes/timing.py +cb76bf7c8ae6b78337483d6e3145b4aadb076db528a7777e95fdc95e804f4346 cands/n361-s3b-p/recipe/overlay/inkling_draftbytes/w8gemv.py +84c62ef2bad39eb126b3f03e356aa8e7149ce00cdef07b441bb8a3066544daef cands/n361-s3b-p/recipe/overlay/inkling_kernels/README.md +cf121c574ddc27aa1ff24138814b25990cf9e6426fe5ac91f08166c9b944073e cands/n361-s3b-p/recipe/overlay/inkling_kernels/__init__.py +ee0ef2ccad715b6614ee88fedd6f5a5a67291e6c76e3fed8c9bf4bf663209858 cands/n361-s3b-p/recipe/overlay/inkling_kernels/_hook.py +75dafe2d6bfbeb65193bbab71f1c915ebca4e3919edb540898f93cf9f7594b7e cands/n361-s3b-p/recipe/overlay/inkling_kernels/moe_tiles.py +97d9379d33afc634a1a91e41e2fef1bda8d1609d19fe58ff95d2adafb5808d6b cands/n361-s3b-p/recipe/overlay/inkling_kernels/qkvr_gemv.py +9886b5e338556024c03dd58a31b14e9e5f03e094609b547915e324f44605857f cands/n361-s3b-p/recipe/overlay/inkling_kv12/README.md +41daa1fc09a60a324539affd7ec9667a0350020fc6633f8c068fec9dc5f78ee0 cands/n361-s3b-p/recipe/overlay/inkling_kv12/__init__.py +ab12eae066bc1cc54662498a1d7d53aa468619997fc204e6a14ba26715977a0c cands/n361-s3b-p/recipe/overlay/inkling_kv12/_hook.py +bc8941909122c51bcc80cb1b37fda233061c0c50c180e031aba3a8c7789e7691 cands/n361-s3b-p/recipe/overlay/inkling_kv12/ops.py +d4514e3786f2dd98370a6126733239344f94280c4b89d7126536b99b66352283 cands/n361-s3b-p/recipe/overlay/inkling_kv12/patch.py +4c035d2a7cfc45f17cf9fb39341a6fa85bc4634b3926725f7d23cd9501808012 cands/n361-s3b-p/recipe/overlay/inkling_kv12s/__init__.py +dd08112a15db424731b25bb3dd8e5d27a688033896fb11269e3c021e6e0f2bdf cands/n361-s3b-p/recipe/overlay/inkling_kv12s/attention.py +6f96ca7ed4d69503bb2e83f95ddf08b201b510acf9cc1b034f724125a726a214 cands/n361-s3b-p/recipe/overlay/inkling_kv12s/check_data.py +10932369507cd317ee7f1ad1966433bfbcb34da2106b795b6b580a60a85e159f cands/n361-s3b-p/recipe/overlay/inkling_kv12s/device.py +616a0ab680b3b259128a39dfeb77d7b8b77ed7cb6bef74d890e0487f38ee507a cands/n361-s3b-p/recipe/overlay/inkling_kv12s/patch.py +3554c61d7da8134766ed41206239065ba1e7b5df3b38a390a66a931876cf4533 cands/n361-s3b-p/recipe/overlay/inkling_kv12s/pressure.py +d0ad1f533a820b97d19ffbc420c8f490497c38641bb48f7328206299aa48f145 cands/n361-s3b-p/recipe/overlay/inkling_kv12s/segsum.py +7d8d61c362c645a610e65d4ccba7e0dce8d46dcd150a27df5d2546fb37093661 cands/n361-s3b-p/recipe/overlay/inkling_kv12s/static.py +37b1fd7d544955e98c4d8ee1d16f4e49e2f945dc18b137b894b1fd5cbe7ce102 cands/n361-s3b-p/recipe/overlay/inkling_kv12s/storage.py +a7a4ce407859b7f31120608314ae7d9f8df8244ef309dcd9cd3aae689f731f0c cands/n361-s3b-p/recipe/overlay/inkling_kv12s/swa_layout.py +5b2d5c191cffda9cb772e493514b06b8e87e94e46fdbf36b1ad4b5a9ac4487da cands/n361-s3b-p/recipe/overlay/inkling_mixdraft/__init__.py +83a952e187fb34e111798adf45ebf18a2e3546b6647657f4ea0effe3370192da cands/n361-s3b-p/recipe/overlay/inkling_mixdraft/kernel.py +df3f862c7d93b8be6e82498afeb62e3144d15b7a0c876a96ba464f4c9f71cd4d cands/n361-s3b-p/recipe/overlay/inkling_mixdraft/linear.py +bb72def3d71f7cf145079bc5edc4f8ee1a208f15780928b806337826d81bda8d cands/n361-s3b-p/recipe/overlay/inkling_noexp/__init__.py +ab12eae066bc1cc54662498a1d7d53aa468619997fc204e6a14ba26715977a0c cands/n361-s3b-p/recipe/overlay/inkling_noexp/_hook.py +d6207856ed7b8146c9842cbebac87b652a05f9e0c83dd84ef644d7edb4d55c42 cands/n361-s3b-p/recipe/overlay/inkling_noexp/_mask.py +81752701087d7a56045ab97627e3e2ceaf039099d5b561c061321a22acf6b689 cands/n361-s3b-p/recipe/overlay/inkling_padx/__init__.py +ab12eae066bc1cc54662498a1d7d53aa468619997fc204e6a14ba26715977a0c cands/n361-s3b-p/recipe/overlay/inkling_padx/_hook.py +51823f619e768163dbfa547165e7af04ddf93af35ff13e6b8ff0ef02abaaf686 cands/n361-s3b-p/recipe/overlay/inkling_padx/patches.py +2710527dfb9c184e3cc77780c6d69ab64b22bba032daa2087736302d54c5b0d7 cands/n361-s3b-p/recipe/overlay/inkling_pcopy/__init__.py +ab12eae066bc1cc54662498a1d7d53aa468619997fc204e6a14ba26715977a0c cands/n361-s3b-p/recipe/overlay/inkling_pcopy/_hook.py +c210ac609cd5ff936aed7b0d582b5a89dc059cfaab93dc91ad7cd6a445866062 cands/n361-s3b-p/recipe/overlay/inkling_pcopy/_sources.py +2b9b808117ef4b23884652c9a199258bebaacfb485199d434304969ae1f33353 cands/n361-s3b-p/recipe/overlay/inkling_pcopy/fixtures.py +26a153b5ffa4ee27159401581b109872b91216cbd36db8d6f1e04bf43c3ca2f7 cands/n361-s3b-p/recipe/overlay/inkling_pcopy/fused.py +26e1cdbb37a8d7f58d7b92c42270e151d08822d3e9797130dbbb19d483b1352e cands/n361-s3b-p/recipe/overlay/inkling_pcopy/history.py +079f558fe7ddc02f8bd320d71fa329e569bf3e1ecc2c9a419fe32f62b7139192 cands/n361-s3b-p/recipe/overlay/inkling_pcopy/matcher.py +14b3d2fda0fbc5a7a640187872ec77c072f2ba723de74983ab5a63b10fa85545 cands/n361-s3b-p/recipe/overlay/inkling_pcopy/patch.py +89a122d26a44d635e94586af6dfdb50c53f48a462d7ea02395b293fb1ef9c6d3 cands/n361-s3b-p/recipe/overlay/inkling_pcopy/rule.py +61a59cd6f4d9b31abd76da83f67b5797f4a1f5e5ec9ce866e78fdcd8692896eb cands/n361-s3b-p/recipe/overlay/inkling_pfuse/CREDITS.md.knapcio-v2.9.3 +1a87a7afb937c54991860f623a0365882a854cf08bf058e6efd60e87488fcddd cands/n361-s3b-p/recipe/overlay/inkling_pfuse/LICENSE.knapcio-v2.9.3 +398c1c6b775c7865ad1c50f1cc73ed01116a4d8e213ed3bcf7eff0bc2d268642 cands/n361-s3b-p/recipe/overlay/inkling_pfuse/NOTICE.knapcio-v2.9.3 +aa5869a0f6a177c6cda7280c4a2564097a06f02b3e260c4a25cd24a8c6193018 cands/n361-s3b-p/recipe/overlay/inkling_pfuse/README.md +9820ebf80c8ffff40d14244fdab623d1511ea8fc751a1fa8c17f759fade25f9d cands/n361-s3b-p/recipe/overlay/inkling_pfuse/__init__.py +ab12eae066bc1cc54662498a1d7d53aa468619997fc204e6a14ba26715977a0c cands/n361-s3b-p/recipe/overlay/inkling_pfuse/_hook.py +7e47cfd76d45851d371aa23e089deba31c99823e2296ca145522b4d801583b7e cands/n361-s3b-p/recipe/overlay/inkling_pfuse/_triton_mix.py +1930979f4bdc1b97bac83cc95dc4c15ab726b0ce69f11baeda9cf753011c7e41 cands/n361-s3b-p/recipe/overlay/inkling_pfuse/_triton_sconv.py +d3b81190b2622e5a437c823af4ae16e0ebf1e8b631c7a9432bc1e71503bd01ce cands/n361-s3b-p/recipe/overlay/inkling_pfuse/layer.py +508f34216dec13dcc30d77c08cd09d10f7d20bbbb28bb031e90414c7b25d3f8b cands/n361-s3b-p/recipe/overlay/inkling_pfuse/mix.py +32fe8bcacf8d6fc64ee401b014c421c4cdc0d5c6d342a50a489bf65891cbfd5a cands/n361-s3b-p/recipe/overlay/inkling_pfuse/tools/attrib_prefill.py +1ff7a611ad3a7e6ee9955f5ece2fc8778b5e37186bec785bf304e68f997300a3 cands/n361-s3b-p/recipe/overlay/inkling_pfuse/tools/bench_loop.py +467bc7d06db2756307d7da7fc7289c7ff2a2f08d4ec1550cad57b6dcf1bbd73f cands/n361-s3b-p/recipe/overlay/inkling_pfuse/tools/gpu_check_pfuse.py +63f3bbbdc63686529c2ed70ef5a94cbe66ab761a985799f58e27d9aaedacfad8 cands/n361-s3b-p/recipe/overlay/inkling_pfuse/tools/sweep_mix.py +61a59cd6f4d9b31abd76da83f67b5797f4a1f5e5ec9ce866e78fdcd8692896eb cands/n361-s3b-p/recipe/overlay/inkling_phoist/CREDITS.md.knapcio-v2.9.3 +1a87a7afb937c54991860f623a0365882a854cf08bf058e6efd60e87488fcddd cands/n361-s3b-p/recipe/overlay/inkling_phoist/LICENSE.knapcio-v2.9.3 +398c1c6b775c7865ad1c50f1cc73ed01116a4d8e213ed3bcf7eff0bc2d268642 cands/n361-s3b-p/recipe/overlay/inkling_phoist/NOTICE.knapcio-v2.9.3 +26eb3a17f9a426fb11dfec4e294dd2ed187b7104bf36e7588a9d6df8ee63134b cands/n361-s3b-p/recipe/overlay/inkling_phoist/__init__.py +ab12eae066bc1cc54662498a1d7d53aa468619997fc204e6a14ba26715977a0c cands/n361-s3b-p/recipe/overlay/inkling_phoist/_hook.py +ca8c58f123ea47200ca9306f1e043fae10672f381cf96e7685f5f6adff3e953a cands/n361-s3b-p/recipe/overlay/inkling_phoist/phoist.py +f55d49b173b3f6ef080ce2dcc563333f193dfcbf75a7e8f7f6f5b353e4be7576 cands/n361-s3b-p/recipe/overlay/inkling_phoist/phoist_triton.py +a12fbe61a792b2c2c7597b259ab99a0b9656922865a9a24836d92f17e121f876 cands/n361-s3b-p/recipe/overlay/inkling_pico12/README.md +8aeb4211fa86cc155ac12af76eedea7963e96c1f43c766e3c749bcfba35ac370 cands/n361-s3b-p/recipe/overlay/inkling_pico12/__init__.py +ee0ef2ccad715b6614ee88fedd6f5a5a67291e6c76e3fed8c9bf4bf663209858 cands/n361-s3b-p/recipe/overlay/inkling_pico12/_hook.py +0b9cd153d788be7ffed98a8bd0d7b4fbab6222f1e3c06961865a01a6cd991c44 cands/n361-s3b-p/recipe/overlay/inkling_pico12/build.py +aab4b5396310f0f0cbe21c1fcd5906e25b8c62f18689685c48ff5f530622c7c8 cands/n361-s3b-p/recipe/overlay/inkling_pico12/csrc/pico12_ext.cu +8babed542f329a5040a02167d6d30e880d35a4f334b457adff8489dfa198800a cands/n361-s3b-p/recipe/overlay/inkling_pico12/csrc/pico12_range.cu +97329931d0e392fc5ac1292657bb9852bae973fd4336ec47dcea626bd78a09cd cands/n361-s3b-p/recipe/overlay/inkling_pico12/ops.py +1d91c866aaa329e6045d2161a776ba6e2064f3f81b8a6a6903f0bb6c6cc3608e cands/n361-s3b-p/recipe/overlay/inkling_pico12/patches.py +fb9c7ecee826335f6014f5f2040b5abe132a86aa6e43f1545bb1e5db19cea16b cands/n361-s3b-p/recipe/overlay/inkling_pico12/third_party/pico/LICENSE +60b3ad14b8d2291101c82f3cc8c0653a6e778b1db9abfe463992dd3737550b4f cands/n361-s3b-p/recipe/overlay/inkling_pico12/third_party/pico/common/check.h +5d96f43891a930cffa23c8649a79d28d019f7597bf5b2ac51e46eb6de5ff6e87 cands/n361-s3b-p/recipe/overlay/inkling_pico12/third_party/pico/kernels/common.cuh +baa1d8d7ff69d0f132acbfba354eb35dc4e5011b5f3e1ae3d177d6d1dcfb5256 cands/n361-s3b-p/recipe/overlay/inkling_pico12/third_party/pico/kernels/dsk.h +91230a0b0783d2af5da87d6476e60c2dc2d94d60879998e54db547dc6f01982d cands/n361-s3b-p/recipe/overlay/inkling_pico12/third_party/pico/kernels/gemv16.cu +61a59cd6f4d9b31abd76da83f67b5797f4a1f5e5ec9ce866e78fdcd8692896eb cands/n361-s3b-p/recipe/overlay/inkling_prologue/CREDITS.knapcio-v2.9.3.md +1a87a7afb937c54991860f623a0365882a854cf08bf058e6efd60e87488fcddd cands/n361-s3b-p/recipe/overlay/inkling_prologue/LICENSE.knapcio-v2.9.3 +398c1c6b775c7865ad1c50f1cc73ed01116a4d8e213ed3bcf7eff0bc2d268642 cands/n361-s3b-p/recipe/overlay/inkling_prologue/NOTICE.knapcio-v2.9.3 +d807c304d543312f6c3c3e2f1d40a3dcedc982c8bef30a34ca891fe6c7956fbe cands/n361-s3b-p/recipe/overlay/inkling_prologue/__init__.py +ab12eae066bc1cc54662498a1d7d53aa468619997fc204e6a14ba26715977a0c cands/n361-s3b-p/recipe/overlay/inkling_prologue/_hook.py +d83c5b71d817b66804bfaa2c7108a96b4374033102b709639555456feed6478d cands/n361-s3b-p/recipe/overlay/inkling_prologue/_triton.py +fed63858ca1872cf9fc4122cff02af670e297b972df4d075c929c77613b7f6c4 cands/n361-s3b-p/recipe/overlay/inkling_ptouch/__init__.py +ab12eae066bc1cc54662498a1d7d53aa468619997fc204e6a14ba26715977a0c cands/n361-s3b-p/recipe/overlay/inkling_ptouch/_hook.py +b8dfe59c5b140d6a9804be846b06cb4ec07746bb0176ff8b2637177c9487806f cands/n361-s3b-p/recipe/overlay/inkling_rsfix/README.md +edf339d321b72e9207204143906526677b6beacb179e1399ac9dc183ba29bd72 cands/n361-s3b-p/recipe/overlay/inkling_rsfix/__init__.py +2a1eabd10f7e964a53fe76b66254873fcfd461b0d32f7277db42457d7d65990a cands/n361-s3b-p/recipe/overlay/inkling_rsfix/_hook.py +c4e84d4ef8e7343e1563617814c65d0d71fbe19915461d73245818f83e9d1e6c cands/n361-s3b-p/recipe/overlay/inkling_rsfix/_sources.py +e4dfce68cae58f71a0658410fe88e6520f94d6c389f8d57e482dacea363509d8 cands/n361-s3b-p/recipe/overlay/inkling_rsfix/blockwise.py +9530622cde80e49864d60a50342ff1850e6c6389eb1baa0207d68ba6a388005c cands/n361-s3b-p/recipe/overlay/inkling_rsfix/markov.py +93da51652aa8ec27396610a10724b6571e5de8d4ee08e236677c9e98604db951 cands/n361-s3b-p/recipe/overlay/inkling_rsfix/reference.py +61e81094be26a6f8a46f07f1b062b07eab246a52553ed094ba147813d92dd513 cands/n361-s3b-p/recipe/overlay/inkling_rsfix/reject.py +d5607344cacbcf77fb4cdcc6ce9de49a4290bbf85281f78c9c397a2984dc06eb cands/n361-s3b-p/recipe/overlay/inkling_rsfix/selector.py +63c5e7852205045be8bca6e84160df8f2f4dd4f44a8093a6a5a04d9fffbca47e cands/n361-s3b-p/recipe/overlay/inkling_vattn/README.md +a08d05ffbd94bdb1c94194432d927b1f30035fa6f23fcc2adc7de36b2930c78c cands/n361-s3b-p/recipe/overlay/inkling_vattn/__init__.py +ab12eae066bc1cc54662498a1d7d53aa468619997fc204e6a14ba26715977a0c cands/n361-s3b-p/recipe/overlay/inkling_vattn/_hook.py +63aad1d099fec3f2b66a0ffd8d3709a564644edac2d4f25c1c33018be3dd6f25 cands/n361-s3b-p/recipe/overlay/inkling_vattn/ops.py +4f18599a0ad748f7f6a507f165ac72327e733eb082fd6276995b9e4474869652 cands/n361-s3b-p/recipe/overlay/inkling_vattn/patch.py +66f94a7e6143ee5bde5e8f83aefe4333ad9d701282b411f0c30091eff637b3b7 cands/n361-s3b-p/recipe/overlay/inkling_vcap/README.md +6a39653aa552d2035e4700918cf7e6dd488881c46cd4d52a3edf8424fe7f3cbd cands/n361-s3b-p/recipe/overlay/inkling_vcap/__init__.py +01b543f9ea35fd83b4ef34d681b86f6aedd3fc9cbc26b270fb98d3159025c4c2 cands/n361-s3b-p/recipe/overlay/inkling_vcap/config.py +bbe0288dd145ba12f1d7312b7def82a7dc0f76c31b5dfa3e2236730eba177b79 cands/n361-s3b-p/recipe/overlay/inkling_vcap/dfcap.py +9caf5d3ca057b622e4cca6e35456f7435f9e1d1e5df692f491e12271014d8aed cands/n361-s3b-p/recipe/overlay/inkling_vcap/dfcheck.py +f7d2389c58143c3ea661616d82f42e1c7b55b8f95c78dcb424c45d205c4d2203 cands/n361-s3b-p/recipe/overlay/inkling_vcap/dflash.py +41cd33472898d7ad98bcbaae2eaf5c27238069b6cdd7815528c932795673e5da cands/n361-s3b-p/recipe/overlay/inkling_vcap/dfsteplog.py +bda7d9e386db34eb3f3a8c8aeda249b91ff8ec27d176c23fb5574e80ec81c431 cands/n361-s3b-p/recipe/overlay/inkling_vcap/fastprobs.py +d364b1bc5a27dd747b08095030670ac085205454b548ba54b453f96872cd90bb cands/n361-s3b-p/recipe/overlay/inkling_vcap/fused.py +897b421d153acd9c0494e084e0d8227804a00f5d24c245646dec74079c422b84 cands/n361-s3b-p/recipe/overlay/inkling_vcap/fused_accept.py +0a928a2c9b2677ce1a359da34d444b40ff38cc6a01c8f44c5723dbaabb6751e5 cands/n361-s3b-p/recipe/overlay/inkling_vcap/importhook.py +2738304eeff01b7d21c700c7408b24e1c429ad912fdc6e58952cf5a1d2a80963 cands/n361-s3b-p/recipe/overlay/inkling_vcap/logic.py +9ba4bf5aeafcc3d1e58adecbad230cbfa128079c6577843a6e28e40866258a20 cands/n361-s3b-p/recipe/overlay/inkling_vcap/patches.py +21082944e6df1a1eb5d288c226562278d8b493ea37cb6ccbf6a8a98bcaa93cce cands/n361-s3b-p/recipe/overlay/inkling_vcap/policies/df-SLDF1-sm.json +b9505b8e00284277b8354cf72a406d8bc2b465d8619f51f44e8609964093b5ee cands/n361-s3b-p/recipe/overlay/inkling_vcap/policies/df-SLDF2x.json +ab43150b4ff972b9975192761515e843088f8838b765090c888f1c3e79334e9f cands/n361-s3b-p/recipe/overlay/inkling_vcap/policies/r2-theta004.json +359b404bd41371397ec8948ece4700d10e1e2b6271301e47439dc4cd83198310 cands/n361-s3b-p/recipe/overlay/inkling_vcap/policyfile.py +982f86bb234ebfd5ca7f37304ae9bf78b5fa90969e75357a5a44905f8a708f49 cands/n361-s3b-p/recipe/overlay/inkling_vcap/state.py +c7f51ebddeba0c2cb5a11bf8075fec231f081ef58ffd0e2c93097a70ebbca04a cands/n361-s3b-p/recipe/overlay/inkling_vcap/v3_kernels.py +4cd0f8e5854e5ed4f1745e6a56aaeba679c4ec4bc17352960f1f01fe3b8f8cf0 cands/n361-s3b-p/recipe/overlay/inkling_wide/README.md +e473be74143084bca38efb0fce7b281b63239471bc43e99692863dd53b85dd16 cands/n361-s3b-p/recipe/overlay/inkling_wide/__init__.py +ee0ef2ccad715b6614ee88fedd6f5a5a67291e6c76e3fed8c9bf4bf663209858 cands/n361-s3b-p/recipe/overlay/inkling_wide/_hook.py +409563a58078e003f0f61c39162dca23563d08cf6fe3e6ecd53211b30538bd12 cands/n361-s3b-p/recipe/overlay/inkling_wide/build.py +640625aed9282589c3c32b06f0b57be48efd230c88425a4264748fed3f23eb15 cands/n361-s3b-p/recipe/overlay/inkling_wide/csrc/bf16x_format.cuh +a281cb85d1867e5acd8dfe7c8d3b2f1b68b5cb1d3091ad6445eba09d66341e94 cands/n361-s3b-p/recipe/overlay/inkling_wide/csrc/wide_ext.cu +3b12f4ef0077ccc61f4867a1369a66fc2a3b10e791c19f4323956756086418cd cands/n361-s3b-p/recipe/overlay/inkling_wide/ops.py +0deb113320ff36523d0e5a25851c3d27aa9412ed5b74d3fd74288504e0404e09 cands/n361-s3b-p/recipe/overlay/inkling_wide/patches.py +5b3f3070eab76b167d3ac2a7f03cfea9e59901e45dbe3a01059cbe5d423bcdbc cands/n361-s3b-p/recipe/overlay/inkling_wide/tests/fake_wide_ext.py +b436a3347e2e274fc146d5ed6969f489415fa60f0fc0f58593fd0875d1ddfd87 cands/n361-s3b-p/recipe/overlay/inkling_wide/tests/test_wide.py +fb9c7ecee826335f6014f5f2040b5abe132a86aa6e43f1545bb1e5db19cea16b cands/n361-s3b-p/recipe/overlay/inkling_wide/third_party/pico/LICENSE +b37e3528ad0ca2dcbd2ab38ee4be67ec88980e769c4a5dbddfa5b45624f28fa7 cands/n361-s3b-p/recipe/overlay/inkling_wide/tools/gpu_check_wide.py +ff089d1ab9f66eb5ee40a3f77a6193120abc064d9eb97a60e495a5ec3fa743eb cands/n361-s3b-p/recipe/overlay/inkling_wide/tools/gpu_integration_wide.py +65acb522ac26d4bdacff65abacf544479da47d7bc6d43ed97b319972a36b560a cands/n361-s3b-p/recipe/overlay/sitecustomize.py +1f64526e4dcec5cd6d3cd3d842ebbf74035e4f34b64aeb7d761693b8198bd924 cands/n361-s3b-p/recipe/patch/inkling2_attn.py +64914ef9213420b37bdb361dfb3bdadb5ff07994deda96c548762e006927bd44 cands/n361-s3b-p/recipe/patch/inkling2_loop.py +70d8797b523b0fcdaad6e709e14bfc4bbdcc735a4b49824b430997ff1018dd78 cands/n361-s3b-p/recipe/patch/inkling2_loop_model.py +29d1f5cb5101a7a0aac48c4b1f15252acaba01a404c6e2475c6c798f0797d997 cands/n361-s3b-p/recipe/patch/n105_rnnhoist.py +9d0231ebab913cb3b3956c421ae5f4f69d2661728f1f8d3b3d64755f9e455f63 cands/n361-s3b-p/recipe/patch/n13_attn_global.py +7d6f1ab93c1252e891446df090e414c6aa975ca480a360b5ac65fb6d16c8be9a cands/n361-s3b-p/recipe/patch/n13_fwd.py +1801287d6696437fa6417c335decf0f4b9deb7391b4d4e4fd8e5c893cf272333 cands/n361-s3b-p/recipe/patch/n140_kern.py +6b69991a90d2ca2a6196d4d1d28014983614a6030d8a38d43aa08c7a29f49f65 cands/n361-s3b-p/recipe/patch/n14_moe.py +8e2d7b61a2ffee1e5bbdaf3f2406a202f13e3a9d96df0f849d35af4d781cac62 cands/n361-s3b-p/recipe/patch/n14_quant.cuh +a67d3cacb45d4a981add4407552b030c8bdf08dabb7e136f555b21475aa3126a cands/n361-s3b-p/recipe/patch/n15_fused.py +e8373342b54dfccbe4c04fd21e137172286b902b07ed6f5037deeb95eb70c9ef cands/n361-s3b-p/recipe/patch/n32_attn_local.py +571c3e4a819b27e175091b7af099e972bc4c38b6eac3f1af1ff4e88b6b662746 cands/n361-s3b-p/recipe/patch/n32_fwd.py +65f51937ca44728959542ca4ed7456973b45e7f32bd54934e44a49ee256630c4 cands/n361-s3b-p/recipe/patch/n35_w8.py +aa79c3095959d385dc1c6f9fdcf7558a73547fcc31c4f6460c6e77cbc9327605 cands/n361-s3b-p/recipe/patch/n35_w8gemv.py +b4cc2402f4c0eee56dc4ce9721043b6d16ed04e932f94848b395f3873f58cb59 cands/n361-s3b-p/recipe/patch/n37_tiles.py +5b1a90477bb2ed2dddf31b3adbc8cb200538335854ddb99ce59ecdf3dbfadfac cands/n361-s3b-p/recipe/patch/n50b_fused.py +1dc6b870ef8c25dd40615930cbf62dfec0e29c5d6b785eb8d42d532ea4a9cd04 cands/n361-s3b-p/recipe/patch/n52_band.cuh +e4118504ce8a210f8d4ef86d1be579dd4d73e4161bb0c9e4264811ad51999140 cands/n361-s3b-p/recipe/patch/n52_moe.py +3523d5fe6549aec71d853c0713403fbdc15984e08c3e5820c2a790a6ede84855 cands/n361-s3b-p/recipe/patch/n64_attn_global.py +eefba4b83410c246441d74d5311deacc6da6e4405d28e3c5b5fa344d4d29eb81 cands/n361-s3b-p/recipe/patch/n64a_fwd.py +cca0cd0d7b860ed4cc78a98651264ecb8fd20793055e58323c2623b8531b6d0d cands/n361-s3b-p/recipe/patch/n64b_fwd.py +d1b88fb14a0d18ccff2ed53b79dcfcb1a2565e50e6cf625053bf39cdc9f1ecd9 cands/n361-s3b-p/recipe/patch/n66fb.py +b7abf0229b9d40558dc6dd576fb300bec9e0a6b9c173b458881111ff0bc89206 cands/n361-s3b-p/recipe/patch/n71_resnorm.py +91f1bb6066a4e5abf77253e23816783880ea38cff649aebd844157b60268c5e7 cands/n361-s3b-p/recipe/patch/n71_sconvres.py +d4411fd151e6212a0feb14ed41457be3c976b92a8f5c981cbc2d1a890075eb7b cands/n361-s3b-p/recipe/patch/n75_c12.py +71fd33a2a119db28c4ca8a24d75e9678131c87b327d095a329fdad18bc03e29a cands/n361-s3b-p/recipe/patch/n75_cuda.py +00bece24b9b910eb33d1f85fe1e60b2685a2ac4dfb5f5136d891b9db668968f7 cands/n361-s3b-p/recipe/patch/n75_install.py +17349b269f1eb7f2551fac79b9e8020b10708410156a08e1b959c8e53f491f79 cands/n361-s3b-p/recipe/patch/n78_head.py +9447c05ffbf888a1aea1a7da467399f572f1d684f142f24c4cccfacefcd353f8 cands/n361-s3b-p/recipe/patch/n78_kern.py +efe43e40ebccb20b31398ef7b7a4e70e0dd1a6192a95904ebb70fb6a8f3d3b73 cands/n361-s3b-p/recipe/patch/n80_cuda.py +cd2d6ef590744ee69cd3b2dfdff9c42cf957eef291f858c3054f1b651b84943f cands/n361-s3b-p/recipe/patch/n80_draft.py +9ba4c20f9fa95c8d9a337f4eeea6abae50e142f747d4dde618712f04e127f56f cands/n361-s3b-p/recipe/patch/n86_riders.py +25030bef80b49e72d46355799e7febea0867ea57aed711f7c9ae28159a81f390 cands/n361-s3b-p/recipe/serve/inkling2_mtp.py +c71f08ef804dc439f08eca133bd2591868c60e535d06819cda55033785bf195f cands/n361-s3b-p/recipe/serve/serve.sh +1bccd9dadf233cd9af15aa63a8d2cc22e0706983355a00e380731d09a5bdb682 cands/n361-s3b-p/recipe/serve/sl.json +e446d09f6e4d582a4daaccc06f556e184f6919398f62933b6eb30a4f48c6d1d8 cands/n362j-e35d7419/overlay_n362j/inkling_n320s/__init__.py +c7095f22f861b691071abb1c4303ac97e7431d7744f7c1c441eed16df5da552f cands/n362j-e35d7419/overlay_n362j/inkling_n329/__init__.py +7f57e8170a49f4bf179c9ccf50b59a4570e0fd5f6e54d890faf8bded7e847396 cands/n362j-e35d7419/overlay_n362j/inkling_n329/n329_rows.py +b93d559f1b964104903f96dcb4508020dcdcc65b012c885bf9e2505c92c89701 cands/n362j-e35d7419/overlay_n362j/inkling_n329/n329_rows_ctl.py +53a039ef443368a80a306757a3009181a7e9c15c41770efccf5f58895f836ebc cands/n362j-e35d7419/overlay_n362j/inkling_n351/__init__.py +21c6bb2fb7a4f89883d7e3a7a961fa3dc70214add3946eea0453ce9ca5eb1bc8 cands/n362j-e35d7419/overlay_n362j/inkling_n355/__init__.py +008b6b876291608b74d67cd8cf8a1388fd3ff834e3f09eccf5aaa4aadc39d605 cands/n362j-e35d7419/overlay_n362j/inkling_n381/__init__.py +61a59cd6f4d9b31abd76da83f67b5797f4a1f5e5ec9ce866e78fdcd8692896eb cands/n362j-e35d7419/overlay_n362j/inkling_n389/CREDITS.knapcio-v2.9.3.md +1a87a7afb937c54991860f623a0365882a854cf08bf058e6efd60e87488fcddd cands/n362j-e35d7419/overlay_n362j/inkling_n389/LICENSE.knapcio-v2.9.3 +398c1c6b775c7865ad1c50f1cc73ed01116a4d8e213ed3bcf7eff0bc2d268642 cands/n362j-e35d7419/overlay_n362j/inkling_n389/NOTICE.knapcio-v2.9.3 +d2244f97dadfcac0397db826a15785ab3c2c8223936542793bd899b95ded96b4 cands/n362j-e35d7419/overlay_n362j/inkling_n389/NOTICE.n389 +218f78d74077c1ccfbe6f57c97198dd27febe31b8eda0104f7150dbbcf189dc0 cands/n362j-e35d7419/overlay_n362j/inkling_n389/__init__.py +60bfcb1846f6ff35cb49914112b968b7ed064749bbfabe1e53f5d0b8fa99b3dc cands/n362j-e35d7419/overlay_n362j/inkling_n389/n389_fold.py +fbae72358a1bdc41225f5d00e37c7e8013a5660c4c4e2cdd39a05525f2ee2aeb cands/n362j-e35d7419/overlay_n362j/n351_quant.cuh +f52c80f1a1809cbc9023eec0bc80ed8b75ae7f8c38d2821ee9ee944f3776cb12 cands/n362j-e35d7419/overlay_n362j/n355_quant.cuh +906b487474bbb2823e8b022ed6e6309d486c2dede36ba6cd626987d5d01682ce cands/n362j-e35d7419/overlay_n362j/n381c_band.cuh +d0e71fae12062a48d86e8c32c74057dad55030eba16595637a667d47f7faed91 cands/n362j-e35d7419/overlay_n362j/sitecustomize.py +e01c50cbc6fd57a4a80fdb31c7953fda1a31189caa7406578af95282f68160fb cands/n419ab-6d18f8eb/df-r1b2.json +e446d09f6e4d582a4daaccc06f556e184f6919398f62933b6eb30a4f48c6d1d8 cands/n419c-8f01ac06/overlay_n419c/inkling_n320s/__init__.py +c7095f22f861b691071abb1c4303ac97e7431d7744f7c1c441eed16df5da552f cands/n419c-8f01ac06/overlay_n419c/inkling_n329/__init__.py +7f57e8170a49f4bf179c9ccf50b59a4570e0fd5f6e54d890faf8bded7e847396 cands/n419c-8f01ac06/overlay_n419c/inkling_n329/n329_rows.py +b93d559f1b964104903f96dcb4508020dcdcc65b012c885bf9e2505c92c89701 cands/n419c-8f01ac06/overlay_n419c/inkling_n329/n329_rows_ctl.py +53a039ef443368a80a306757a3009181a7e9c15c41770efccf5f58895f836ebc cands/n419c-8f01ac06/overlay_n419c/inkling_n351/__init__.py +21c6bb2fb7a4f89883d7e3a7a961fa3dc70214add3946eea0453ce9ca5eb1bc8 cands/n419c-8f01ac06/overlay_n419c/inkling_n355/__init__.py +008b6b876291608b74d67cd8cf8a1388fd3ff834e3f09eccf5aaa4aadc39d605 cands/n419c-8f01ac06/overlay_n419c/inkling_n381/__init__.py +61a59cd6f4d9b31abd76da83f67b5797f4a1f5e5ec9ce866e78fdcd8692896eb cands/n419c-8f01ac06/overlay_n419c/inkling_n389/CREDITS.knapcio-v2.9.3.md +1a87a7afb937c54991860f623a0365882a854cf08bf058e6efd60e87488fcddd cands/n419c-8f01ac06/overlay_n419c/inkling_n389/LICENSE.knapcio-v2.9.3 +398c1c6b775c7865ad1c50f1cc73ed01116a4d8e213ed3bcf7eff0bc2d268642 cands/n419c-8f01ac06/overlay_n419c/inkling_n389/NOTICE.knapcio-v2.9.3 +d2244f97dadfcac0397db826a15785ab3c2c8223936542793bd899b95ded96b4 cands/n419c-8f01ac06/overlay_n419c/inkling_n389/NOTICE.n389 +218f78d74077c1ccfbe6f57c97198dd27febe31b8eda0104f7150dbbcf189dc0 cands/n419c-8f01ac06/overlay_n419c/inkling_n389/__init__.py +60bfcb1846f6ff35cb49914112b968b7ed064749bbfabe1e53f5d0b8fa99b3dc cands/n419c-8f01ac06/overlay_n419c/inkling_n389/n389_fold.py +fb1dbfad967ba0dde9ef5388065522c25f7b941767d8a9c7b38772c82ed504f2 cands/n419c-8f01ac06/overlay_n419c/inkling_n395/CREDITS.n395.md +1495e1e757ef4d0925a2350563cf5754bb23c51701a8ec4fb3c5cdcbedae6747 cands/n419c-8f01ac06/overlay_n419c/inkling_n395/LICENSE.sglang +5231b461b3afdf993dcf18e8bf9ba0d2224862bf2d18bc1595786305a37a0b08 cands/n419c-8f01ac06/overlay_n419c/inkling_n395/NOTICE.n395 +159aa3fb6a260f9d31f59f6f0cee8d788fb6df89ef878b67704362964511ef3d cands/n419c-8f01ac06/overlay_n419c/inkling_n395/__init__.py +f91db648419151f0ea309ff118a42671fb6f57c2f407fb3c29ae5fab8c3013e6 cands/n419c-8f01ac06/overlay_n419c/inkling_n395/n395_fold.py +e3c66465c3b4073378524540f526db49f63d0b48431c02f9f7deebe8df23cea0 cands/n419c-8f01ac06/overlay_n419c/inkling_n395/n438_fold.py +0e6c97c168fbe1a87166ac0f87c013a4f2a056d0171de7992e44b99ee97a212a cands/n419c-8f01ac06/overlay_n419c/inkling_n437/__init__.py +fbae72358a1bdc41225f5d00e37c7e8013a5660c4c4e2cdd39a05525f2ee2aeb cands/n419c-8f01ac06/overlay_n419c/n351_quant.cuh +f52c80f1a1809cbc9023eec0bc80ed8b75ae7f8c38d2821ee9ee944f3776cb12 cands/n419c-8f01ac06/overlay_n419c/n355_quant.cuh +906b487474bbb2823e8b022ed6e6309d486c2dede36ba6cd626987d5d01682ce cands/n419c-8f01ac06/overlay_n419c/n381c_band.cuh +bf46f120897ec6fed90ab204d23a9be5ae4d507d832b6a0ff99c56e0463ad2d7 cands/n419c-8f01ac06/overlay_n419c/sitecustomize.py +8e3b8e0156229c28f335bc7f8a171567839652343c0750e3c1053cdc64ab2e38 cands/n419j3-2416d17a/overlay_dfglobal/inkling_dfglobal/__init__.py +ab12eae066bc1cc54662498a1d7d53aa468619997fc204e6a14ba26715977a0c cands/n419j3-2416d17a/overlay_dfglobal/inkling_dfglobal/_hook.py +e446d09f6e4d582a4daaccc06f556e184f6919398f62933b6eb30a4f48c6d1d8 cands/n419j3-2416d17a/overlay_n419j/inkling_n320s/__init__.py +c7095f22f861b691071abb1c4303ac97e7431d7744f7c1c441eed16df5da552f cands/n419j3-2416d17a/overlay_n419j/inkling_n329/__init__.py +7f57e8170a49f4bf179c9ccf50b59a4570e0fd5f6e54d890faf8bded7e847396 cands/n419j3-2416d17a/overlay_n419j/inkling_n329/n329_rows.py +b93d559f1b964104903f96dcb4508020dcdcc65b012c885bf9e2505c92c89701 cands/n419j3-2416d17a/overlay_n419j/inkling_n329/n329_rows_ctl.py +53a039ef443368a80a306757a3009181a7e9c15c41770efccf5f58895f836ebc cands/n419j3-2416d17a/overlay_n419j/inkling_n351/__init__.py +21c6bb2fb7a4f89883d7e3a7a961fa3dc70214add3946eea0453ce9ca5eb1bc8 cands/n419j3-2416d17a/overlay_n419j/inkling_n355/__init__.py +008b6b876291608b74d67cd8cf8a1388fd3ff834e3f09eccf5aaa4aadc39d605 cands/n419j3-2416d17a/overlay_n419j/inkling_n381/__init__.py +61a59cd6f4d9b31abd76da83f67b5797f4a1f5e5ec9ce866e78fdcd8692896eb cands/n419j3-2416d17a/overlay_n419j/inkling_n389/CREDITS.knapcio-v2.9.3.md +1a87a7afb937c54991860f623a0365882a854cf08bf058e6efd60e87488fcddd cands/n419j3-2416d17a/overlay_n419j/inkling_n389/LICENSE.knapcio-v2.9.3 +398c1c6b775c7865ad1c50f1cc73ed01116a4d8e213ed3bcf7eff0bc2d268642 cands/n419j3-2416d17a/overlay_n419j/inkling_n389/NOTICE.knapcio-v2.9.3 +d2244f97dadfcac0397db826a15785ab3c2c8223936542793bd899b95ded96b4 cands/n419j3-2416d17a/overlay_n419j/inkling_n389/NOTICE.n389 +218f78d74077c1ccfbe6f57c97198dd27febe31b8eda0104f7150dbbcf189dc0 cands/n419j3-2416d17a/overlay_n419j/inkling_n389/__init__.py +60bfcb1846f6ff35cb49914112b968b7ed064749bbfabe1e53f5d0b8fa99b3dc cands/n419j3-2416d17a/overlay_n419j/inkling_n389/n389_fold.py +fbae72358a1bdc41225f5d00e37c7e8013a5660c4c4e2cdd39a05525f2ee2aeb cands/n419j3-2416d17a/overlay_n419j/n351_quant.cuh +f52c80f1a1809cbc9023eec0bc80ed8b75ae7f8c38d2821ee9ee944f3776cb12 cands/n419j3-2416d17a/overlay_n419j/n355_quant.cuh +906b487474bbb2823e8b022ed6e6309d486c2dede36ba6cd626987d5d01682ce cands/n419j3-2416d17a/overlay_n419j/n381c_band.cuh +d551992419fd5498de5acfe99fb28c9e5695d869e7cdac00c47b0728b12ebd94 cands/n419j3-2416d17a/overlay_n419j/sitecustomize.py +ac94bb9163aa7ee6b467f8dcc5e3d51ab8aab3d2ab509ab11e3c63895561f3c1 cands/n419j3-2416d17a/overlay_pcopyro/inkling_pcopyro/__init__.py +61a59cd6f4d9b31abd76da83f67b5797f4a1f5e5ec9ce866e78fdcd8692896eb cands/n419j3-2416d17a/recipe/CREDITS.md +1a87a7afb937c54991860f623a0365882a854cf08bf058e6efd60e87488fcddd cands/n419j3-2416d17a/recipe/LICENSE +398c1c6b775c7865ad1c50f1cc73ed01116a4d8e213ed3bcf7eff0bc2d268642 cands/n419j3-2416d17a/recipe/NOTICE +61a59cd6f4d9b31abd76da83f67b5797f4a1f5e5ec9ce866e78fdcd8692896eb cands/n419j3-2416d17a/recipe/overlay/inkling_attn/CREDITS.knapcio-v2.9.3.md +1a87a7afb937c54991860f623a0365882a854cf08bf058e6efd60e87488fcddd cands/n419j3-2416d17a/recipe/overlay/inkling_attn/LICENSE.knapcio-v2.9.3 +398c1c6b775c7865ad1c50f1cc73ed01116a4d8e213ed3bcf7eff0bc2d268642 cands/n419j3-2416d17a/recipe/overlay/inkling_attn/NOTICE.knapcio-v2.9.3 +4d3f0b284bde7c3a066f1134ec52d1896512804aa92d311b0fb48659cc617bd6 cands/n419j3-2416d17a/recipe/overlay/inkling_attn/README.md +f7c0b49cfd8e4047947118882ae79b001dfc1486e4dd9ee92e544e89c83c70ca cands/n419j3-2416d17a/recipe/overlay/inkling_attn/__init__.py +ab12eae066bc1cc54662498a1d7d53aa468619997fc204e6a14ba26715977a0c cands/n419j3-2416d17a/recipe/overlay/inkling_attn/_hook.py +3cf30a00b0670b0babb2024b85ec88508e66562fe1901e9b2bc51b86275b3a8a cands/n419j3-2416d17a/recipe/overlay/inkling_attn/build.py +ecd499f8ab53c0d2e03942fd1ef9ba4165ea16b276fbb26b9a5bfbfa078da34a cands/n419j3-2416d17a/recipe/overlay/inkling_attn/csrc/attn_kernel.cuh +e10f9d601a09d438749189902a4da13411a4318610de2c87d90c0335cec80995 cands/n419j3-2416d17a/recipe/overlay/inkling_attn/csrc/inkling_attn_ext.cu +8b097c56fbe2b6facb41e80e97e0fd6198fcb0a85460f127a716731b3ae8a921 cands/n419j3-2416d17a/recipe/overlay/inkling_attn/ops.py +fa70374aba0e5f826993c98cbf4303a0b515f9457b60461dc3f8da30c64f9892 cands/n419j3-2416d17a/recipe/overlay/inkling_attn/patch.py +0424895a98d8a22a9cdce8c3ac32dd00ce0000c6292e0b6a732848ffc4b426ea cands/n419j3-2416d17a/recipe/overlay/inkling_attn/tests/test_install.py +9884d1befc3894d1f5f4b4c8b34df827a4bd752232f046673af05db33494009a cands/n419j3-2416d17a/recipe/overlay/inkling_attn/tests/test_w8split_cpu.py +eb0c172281bf706ade1554a37192d0bf59db643bc1b0cefb7b863b4e93231a4b cands/n419j3-2416d17a/recipe/overlay/inkling_cert/README.md +5882400af5a589496e782828387924f5e833ebace1356cf72ea720799975d31e cands/n419j3-2416d17a/recipe/overlay/inkling_cert/__init__.py +ee0ef2ccad715b6614ee88fedd6f5a5a67291e6c76e3fed8c9bf4bf663209858 cands/n419j3-2416d17a/recipe/overlay/inkling_cert/_hook.py +54869935ed0fc96e98a78e8422b62282693f3231db2883e780a1e0d816f44efd cands/n419j3-2416d17a/recipe/overlay/inkling_cert/build.py +a254d8f11b5fa27c01c3d5df3584dc703a5140d202955cc963064b2aca5e8677 cands/n419j3-2416d17a/recipe/overlay/inkling_cert/cert_math.py +0e6a597b3ff6dc12b01e9247906604262006cf2094b7358dab49bc6dd2fa9177 cands/n419j3-2416d17a/recipe/overlay/inkling_cert/certwide.py +957d0dd2a18d5ac7de6fc88e937052852549750e669af9ebc40abb753c81328d cands/n419j3-2416d17a/recipe/overlay/inkling_cert/certwide_math.py +dc2b48f09ba8ab465daf9ad63fbc728dbcd01b725798f0a634f8af411022f07b cands/n419j3-2416d17a/recipe/overlay/inkling_cert/certwide_reduce.py +e2f40277fe04993deed769348905e2e911dcbe218f6f6298c677977e91951669 cands/n419j3-2416d17a/recipe/overlay/inkling_cert/csrc/cert_ext.cu +88a27a25adb3e0a2553e82cbc30a0c8a02dcf84635048baba921a746fb4cf175 cands/n419j3-2416d17a/recipe/overlay/inkling_cert/csrc/certwide_screen.cuh +e062ec37ea4eef60f7dd7be2f42b6e2541b06dcdcadc3e255cc1e1fec56ee2ca cands/n419j3-2416d17a/recipe/overlay/inkling_cert/csrc/screen6.cuh +8398ac6708c32f5fe2224a15e3495708e0760d79564208c822c7bdf9a93ccf92 cands/n419j3-2416d17a/recipe/overlay/inkling_cert/dflash.py +9d4fd4e0867b28d19bde7c1a47a6dbc462691dee38ab2f34073f454838b374b1 cands/n419j3-2416d17a/recipe/overlay/inkling_cert/ops.py +2b6ba45d552282da40e2d1d380707dc26ad679eb114fb0bd1c533fe6944a4b2e cands/n419j3-2416d17a/recipe/overlay/inkling_cert/patches.py +56274922d9aaa203ef2b5bd3dff7d7f3973d562b1f47541dc833669a10b7eeb8 cands/n419j3-2416d17a/recipe/overlay/inkling_cert/quant.py +689f292b6e85042db4d7f700ef39573dcc1f441683abcae71e5074109c6e8168 cands/n419j3-2416d17a/recipe/overlay/inkling_cert/tests/test_cert.py +7eec9ed58f35f5ae644b15ead34fc384fe5f1d8eee47f6fe1dd580a9d896e825 cands/n419j3-2416d17a/recipe/overlay/inkling_cert/tests/test_certwide.py +131940bc65d9c1efca8ccf4816e9f5ae615394510f7bdd70d550cb0200a7e12a cands/n419j3-2416d17a/recipe/overlay/inkling_cert/tests/test_dflash.py +9c582d423bee68dd253422ad91c42ad6e9d494c67030b0e09e2e660549b2ad83 cands/n419j3-2416d17a/recipe/overlay/inkling_cert/tests/test_patches.py +089b23ba89259410f7f4c5a73d6a261ac928a44add4f5debeabc84a5b7a9c364 cands/n419j3-2416d17a/recipe/overlay/inkling_cert/tools/gpu_check_cert.py +1b41188139e5e59c0d1138efbc218aa5469c2b3570fdce2a7f2b790589f991ea cands/n419j3-2416d17a/recipe/overlay/inkling_cert/tools/smoke_hooks.py +269984f2e0628a6387af93a27350f6ccd53691d6ebc6ff63b4efd83a536fd1c7 cands/n419j3-2416d17a/recipe/overlay/inkling_dfaccept/README.md +24eb31b321286bef5e99130e3b083ddfe8faafcb342c052305c5a98a5d7d9f59 cands/n419j3-2416d17a/recipe/overlay/inkling_dfaccept/__init__.py +ab12eae066bc1cc54662498a1d7d53aa468619997fc204e6a14ba26715977a0c cands/n419j3-2416d17a/recipe/overlay/inkling_dfaccept/_hook.py +7ba089479db0974c09b76f1042f9131bb944e309343d72867c089e9faa3760fe cands/n419j3-2416d17a/recipe/overlay/inkling_dfaccept/core.py +251128ff0efd9eb43e6a8225570e89d08b6e6b7c7b0cd3d1d8392050a3d9f563 cands/n419j3-2416d17a/recipe/overlay/inkling_dfaccept/patches.py +5eb381c6c5137f7a670130ad22fe406706dedb095d0a9817f15d57ecddb809e8 cands/n419j3-2416d17a/recipe/overlay/inkling_dfbytes/README.md +7cf77494d835269f88a704f0eaca2518ff2fda31c60d32d371b757f0db88ec66 cands/n419j3-2416d17a/recipe/overlay/inkling_dfbytes/__init__.py +ab12eae066bc1cc54662498a1d7d53aa468619997fc204e6a14ba26715977a0c cands/n419j3-2416d17a/recipe/overlay/inkling_dfbytes/_hook.py +aca345f7e98de7509e7b507e4d401c8692db76687f3ab9116538261f7b143dcb cands/n419j3-2416d17a/recipe/overlay/inkling_dfbytes/ctx8.py +cebe39ac06717ae5735ff4f839c1e5992a2b2f4ab50d4f98a062baa9c2f4a415 cands/n419j3-2416d17a/recipe/overlay/inkling_dfbytes/patches.py +f126616fd8682f570af7bdf7ec26e807d40c61051a8049d3e3efa16f94369798 cands/n419j3-2416d17a/recipe/overlay/inkling_dftail/__init__.py +ab12eae066bc1cc54662498a1d7d53aa468619997fc204e6a14ba26715977a0c cands/n419j3-2416d17a/recipe/overlay/inkling_dftail/_hook.py +ae77c2c3723aa2cdb32d9f26eea67ee82a44a6c55282483416ed2c801af40296 cands/n419j3-2416d17a/recipe/overlay/inkling_dftail/_sources.py +6cd072ae1ca44714816b874c733805ea8c3be511a23715829e63298ed8dfd566 cands/n419j3-2416d17a/recipe/overlay/inkling_dftail/bpatch.py +b23bdb11c23c0cc06297899ca7e71a3f1be781052726427c1b5000e27afb8b0b cands/n419j3-2416d17a/recipe/overlay/inkling_dftail/snapshot.py +e3b1e2f5194051bba30e455756c6b1943f5aacd03599ce1fa4b1b542844c0663 cands/n419j3-2416d17a/recipe/overlay/inkling_draftbytes/README.md +8dd8abba6fa60514f4a68c64f54dd8cffedffbaa0982f4d4847be7627e3389c2 cands/n419j3-2416d17a/recipe/overlay/inkling_draftbytes/__init__.py +812d99b5844ca99e56fa11394663733404441d35c3b42e804d8884a604eab6df cands/n419j3-2416d17a/recipe/overlay/inkling_draftbytes/_hooks.py +ae8f4cb9cccea61a658bf3de2e0a4ef2cb0d01213915c5ce1732087100976ceb cands/n419j3-2416d17a/recipe/overlay/inkling_draftbytes/_opts.py +06a22262122f4cc0b9bbf1497b98ab2f331175c2b407fc572284935d228788a5 cands/n419j3-2416d17a/recipe/overlay/inkling_draftbytes/_triton.py +c3d8459315b854912142d8b6deb7a2d903cee5913bcf2ee6ddb059faeebf9c13 cands/n419j3-2416d17a/recipe/overlay/inkling_draftbytes/csrc/w8gemv.cu +2430b0bbe643063b7b842df20b5058ca07db302e37e0f199770ffa3fc49a1c3e cands/n419j3-2416d17a/recipe/overlay/inkling_draftbytes/dwin.py +32bbb9a854451827e7633b19d0bb534e697fbd6c8ee6e76dae412d2dda464a4d cands/n419j3-2416d17a/recipe/overlay/inkling_draftbytes/hotvocab/inkling2-mini-hot-r2.json +bab4e585eaff5c71e86eaa79bf5a0b9a11fa4bcbbca1495286b29d037d443ef4 cands/n419j3-2416d17a/recipe/overlay/inkling_draftbytes/ops.py +da084e9753f9d9a80876ac94595a375ec625302e23fac51a72fdc33e681e9cec cands/n419j3-2416d17a/recipe/overlay/inkling_draftbytes/patches.py +cd3a06f12f2c22cbd73d62b24836eb8fb43b2d57e423ed3b4a18bb0b5df4a6e2 cands/n419j3-2416d17a/recipe/overlay/inkling_draftbytes/quant.py +f0fbc7e4b44e513c724d7381f6d12b04838cc3826c547be51b36fe1b47c48860 cands/n419j3-2416d17a/recipe/overlay/inkling_draftbytes/rnnhoist.py +65acc6c881f54a868270eec9e2acdd552fe0158da010dfb001ad112929360682 cands/n419j3-2416d17a/recipe/overlay/inkling_draftbytes/tau.py +40db95bd0174f5a3d9f732a1e742ff022384884046b1da095e3b76d528f38c28 cands/n419j3-2416d17a/recipe/overlay/inkling_draftbytes/timing.py +cb76bf7c8ae6b78337483d6e3145b4aadb076db528a7777e95fdc95e804f4346 cands/n419j3-2416d17a/recipe/overlay/inkling_draftbytes/w8gemv.py +84c62ef2bad39eb126b3f03e356aa8e7149ce00cdef07b441bb8a3066544daef cands/n419j3-2416d17a/recipe/overlay/inkling_kernels/README.md +cf121c574ddc27aa1ff24138814b25990cf9e6426fe5ac91f08166c9b944073e cands/n419j3-2416d17a/recipe/overlay/inkling_kernels/__init__.py +ee0ef2ccad715b6614ee88fedd6f5a5a67291e6c76e3fed8c9bf4bf663209858 cands/n419j3-2416d17a/recipe/overlay/inkling_kernels/_hook.py +75dafe2d6bfbeb65193bbab71f1c915ebca4e3919edb540898f93cf9f7594b7e cands/n419j3-2416d17a/recipe/overlay/inkling_kernels/moe_tiles.py +97d9379d33afc634a1a91e41e2fef1bda8d1609d19fe58ff95d2adafb5808d6b cands/n419j3-2416d17a/recipe/overlay/inkling_kernels/qkvr_gemv.py +9886b5e338556024c03dd58a31b14e9e5f03e094609b547915e324f44605857f cands/n419j3-2416d17a/recipe/overlay/inkling_kv12/README.md +41daa1fc09a60a324539affd7ec9667a0350020fc6633f8c068fec9dc5f78ee0 cands/n419j3-2416d17a/recipe/overlay/inkling_kv12/__init__.py +ab12eae066bc1cc54662498a1d7d53aa468619997fc204e6a14ba26715977a0c cands/n419j3-2416d17a/recipe/overlay/inkling_kv12/_hook.py +bc8941909122c51bcc80cb1b37fda233061c0c50c180e031aba3a8c7789e7691 cands/n419j3-2416d17a/recipe/overlay/inkling_kv12/ops.py +d4514e3786f2dd98370a6126733239344f94280c4b89d7126536b99b66352283 cands/n419j3-2416d17a/recipe/overlay/inkling_kv12/patch.py +4c035d2a7cfc45f17cf9fb39341a6fa85bc4634b3926725f7d23cd9501808012 cands/n419j3-2416d17a/recipe/overlay/inkling_kv12s/__init__.py +dd08112a15db424731b25bb3dd8e5d27a688033896fb11269e3c021e6e0f2bdf cands/n419j3-2416d17a/recipe/overlay/inkling_kv12s/attention.py +6f96ca7ed4d69503bb2e83f95ddf08b201b510acf9cc1b034f724125a726a214 cands/n419j3-2416d17a/recipe/overlay/inkling_kv12s/check_data.py +10932369507cd317ee7f1ad1966433bfbcb34da2106b795b6b580a60a85e159f cands/n419j3-2416d17a/recipe/overlay/inkling_kv12s/device.py +616a0ab680b3b259128a39dfeb77d7b8b77ed7cb6bef74d890e0487f38ee507a cands/n419j3-2416d17a/recipe/overlay/inkling_kv12s/patch.py +3554c61d7da8134766ed41206239065ba1e7b5df3b38a390a66a931876cf4533 cands/n419j3-2416d17a/recipe/overlay/inkling_kv12s/pressure.py +d0ad1f533a820b97d19ffbc420c8f490497c38641bb48f7328206299aa48f145 cands/n419j3-2416d17a/recipe/overlay/inkling_kv12s/segsum.py +7d8d61c362c645a610e65d4ccba7e0dce8d46dcd150a27df5d2546fb37093661 cands/n419j3-2416d17a/recipe/overlay/inkling_kv12s/static.py +37b1fd7d544955e98c4d8ee1d16f4e49e2f945dc18b137b894b1fd5cbe7ce102 cands/n419j3-2416d17a/recipe/overlay/inkling_kv12s/storage.py +a7a4ce407859b7f31120608314ae7d9f8df8244ef309dcd9cd3aae689f731f0c cands/n419j3-2416d17a/recipe/overlay/inkling_kv12s/swa_layout.py +5b2d5c191cffda9cb772e493514b06b8e87e94e46fdbf36b1ad4b5a9ac4487da cands/n419j3-2416d17a/recipe/overlay/inkling_mixdraft/__init__.py +83a952e187fb34e111798adf45ebf18a2e3546b6647657f4ea0effe3370192da cands/n419j3-2416d17a/recipe/overlay/inkling_mixdraft/kernel.py +df3f862c7d93b8be6e82498afeb62e3144d15b7a0c876a96ba464f4c9f71cd4d cands/n419j3-2416d17a/recipe/overlay/inkling_mixdraft/linear.py +bb72def3d71f7cf145079bc5edc4f8ee1a208f15780928b806337826d81bda8d cands/n419j3-2416d17a/recipe/overlay/inkling_noexp/__init__.py +ab12eae066bc1cc54662498a1d7d53aa468619997fc204e6a14ba26715977a0c cands/n419j3-2416d17a/recipe/overlay/inkling_noexp/_hook.py +d6207856ed7b8146c9842cbebac87b652a05f9e0c83dd84ef644d7edb4d55c42 cands/n419j3-2416d17a/recipe/overlay/inkling_noexp/_mask.py +81752701087d7a56045ab97627e3e2ceaf039099d5b561c061321a22acf6b689 cands/n419j3-2416d17a/recipe/overlay/inkling_padx/__init__.py +ab12eae066bc1cc54662498a1d7d53aa468619997fc204e6a14ba26715977a0c cands/n419j3-2416d17a/recipe/overlay/inkling_padx/_hook.py +51823f619e768163dbfa547165e7af04ddf93af35ff13e6b8ff0ef02abaaf686 cands/n419j3-2416d17a/recipe/overlay/inkling_padx/patches.py +2710527dfb9c184e3cc77780c6d69ab64b22bba032daa2087736302d54c5b0d7 cands/n419j3-2416d17a/recipe/overlay/inkling_pcopy/__init__.py +ab12eae066bc1cc54662498a1d7d53aa468619997fc204e6a14ba26715977a0c cands/n419j3-2416d17a/recipe/overlay/inkling_pcopy/_hook.py +c210ac609cd5ff936aed7b0d582b5a89dc059cfaab93dc91ad7cd6a445866062 cands/n419j3-2416d17a/recipe/overlay/inkling_pcopy/_sources.py +2b9b808117ef4b23884652c9a199258bebaacfb485199d434304969ae1f33353 cands/n419j3-2416d17a/recipe/overlay/inkling_pcopy/fixtures.py +26a153b5ffa4ee27159401581b109872b91216cbd36db8d6f1e04bf43c3ca2f7 cands/n419j3-2416d17a/recipe/overlay/inkling_pcopy/fused.py +26e1cdbb37a8d7f58d7b92c42270e151d08822d3e9797130dbbb19d483b1352e cands/n419j3-2416d17a/recipe/overlay/inkling_pcopy/history.py +079f558fe7ddc02f8bd320d71fa329e569bf3e1ecc2c9a419fe32f62b7139192 cands/n419j3-2416d17a/recipe/overlay/inkling_pcopy/matcher.py +14b3d2fda0fbc5a7a640187872ec77c072f2ba723de74983ab5a63b10fa85545 cands/n419j3-2416d17a/recipe/overlay/inkling_pcopy/patch.py +89a122d26a44d635e94586af6dfdb50c53f48a462d7ea02395b293fb1ef9c6d3 cands/n419j3-2416d17a/recipe/overlay/inkling_pcopy/rule.py +61a59cd6f4d9b31abd76da83f67b5797f4a1f5e5ec9ce866e78fdcd8692896eb cands/n419j3-2416d17a/recipe/overlay/inkling_pfuse/CREDITS.md.knapcio-v2.9.3 +1a87a7afb937c54991860f623a0365882a854cf08bf058e6efd60e87488fcddd cands/n419j3-2416d17a/recipe/overlay/inkling_pfuse/LICENSE.knapcio-v2.9.3 +398c1c6b775c7865ad1c50f1cc73ed01116a4d8e213ed3bcf7eff0bc2d268642 cands/n419j3-2416d17a/recipe/overlay/inkling_pfuse/NOTICE.knapcio-v2.9.3 +aa5869a0f6a177c6cda7280c4a2564097a06f02b3e260c4a25cd24a8c6193018 cands/n419j3-2416d17a/recipe/overlay/inkling_pfuse/README.md +9820ebf80c8ffff40d14244fdab623d1511ea8fc751a1fa8c17f759fade25f9d cands/n419j3-2416d17a/recipe/overlay/inkling_pfuse/__init__.py +ab12eae066bc1cc54662498a1d7d53aa468619997fc204e6a14ba26715977a0c cands/n419j3-2416d17a/recipe/overlay/inkling_pfuse/_hook.py +7e47cfd76d45851d371aa23e089deba31c99823e2296ca145522b4d801583b7e cands/n419j3-2416d17a/recipe/overlay/inkling_pfuse/_triton_mix.py +1930979f4bdc1b97bac83cc95dc4c15ab726b0ce69f11baeda9cf753011c7e41 cands/n419j3-2416d17a/recipe/overlay/inkling_pfuse/_triton_sconv.py +d3b81190b2622e5a437c823af4ae16e0ebf1e8b631c7a9432bc1e71503bd01ce cands/n419j3-2416d17a/recipe/overlay/inkling_pfuse/layer.py +508f34216dec13dcc30d77c08cd09d10f7d20bbbb28bb031e90414c7b25d3f8b cands/n419j3-2416d17a/recipe/overlay/inkling_pfuse/mix.py +32fe8bcacf8d6fc64ee401b014c421c4cdc0d5c6d342a50a489bf65891cbfd5a cands/n419j3-2416d17a/recipe/overlay/inkling_pfuse/tools/attrib_prefill.py +1ff7a611ad3a7e6ee9955f5ece2fc8778b5e37186bec785bf304e68f997300a3 cands/n419j3-2416d17a/recipe/overlay/inkling_pfuse/tools/bench_loop.py +467bc7d06db2756307d7da7fc7289c7ff2a2f08d4ec1550cad57b6dcf1bbd73f cands/n419j3-2416d17a/recipe/overlay/inkling_pfuse/tools/gpu_check_pfuse.py +63f3bbbdc63686529c2ed70ef5a94cbe66ab761a985799f58e27d9aaedacfad8 cands/n419j3-2416d17a/recipe/overlay/inkling_pfuse/tools/sweep_mix.py +61a59cd6f4d9b31abd76da83f67b5797f4a1f5e5ec9ce866e78fdcd8692896eb cands/n419j3-2416d17a/recipe/overlay/inkling_phoist/CREDITS.md.knapcio-v2.9.3 +1a87a7afb937c54991860f623a0365882a854cf08bf058e6efd60e87488fcddd cands/n419j3-2416d17a/recipe/overlay/inkling_phoist/LICENSE.knapcio-v2.9.3 +398c1c6b775c7865ad1c50f1cc73ed01116a4d8e213ed3bcf7eff0bc2d268642 cands/n419j3-2416d17a/recipe/overlay/inkling_phoist/NOTICE.knapcio-v2.9.3 +26eb3a17f9a426fb11dfec4e294dd2ed187b7104bf36e7588a9d6df8ee63134b cands/n419j3-2416d17a/recipe/overlay/inkling_phoist/__init__.py +ab12eae066bc1cc54662498a1d7d53aa468619997fc204e6a14ba26715977a0c cands/n419j3-2416d17a/recipe/overlay/inkling_phoist/_hook.py +ca8c58f123ea47200ca9306f1e043fae10672f381cf96e7685f5f6adff3e953a cands/n419j3-2416d17a/recipe/overlay/inkling_phoist/phoist.py +f55d49b173b3f6ef080ce2dcc563333f193dfcbf75a7e8f7f6f5b353e4be7576 cands/n419j3-2416d17a/recipe/overlay/inkling_phoist/phoist_triton.py +a12fbe61a792b2c2c7597b259ab99a0b9656922865a9a24836d92f17e121f876 cands/n419j3-2416d17a/recipe/overlay/inkling_pico12/README.md +8aeb4211fa86cc155ac12af76eedea7963e96c1f43c766e3c749bcfba35ac370 cands/n419j3-2416d17a/recipe/overlay/inkling_pico12/__init__.py +ee0ef2ccad715b6614ee88fedd6f5a5a67291e6c76e3fed8c9bf4bf663209858 cands/n419j3-2416d17a/recipe/overlay/inkling_pico12/_hook.py +0b9cd153d788be7ffed98a8bd0d7b4fbab6222f1e3c06961865a01a6cd991c44 cands/n419j3-2416d17a/recipe/overlay/inkling_pico12/build.py +aab4b5396310f0f0cbe21c1fcd5906e25b8c62f18689685c48ff5f530622c7c8 cands/n419j3-2416d17a/recipe/overlay/inkling_pico12/csrc/pico12_ext.cu +8babed542f329a5040a02167d6d30e880d35a4f334b457adff8489dfa198800a cands/n419j3-2416d17a/recipe/overlay/inkling_pico12/csrc/pico12_range.cu +97329931d0e392fc5ac1292657bb9852bae973fd4336ec47dcea626bd78a09cd cands/n419j3-2416d17a/recipe/overlay/inkling_pico12/ops.py +1d91c866aaa329e6045d2161a776ba6e2064f3f81b8a6a6903f0bb6c6cc3608e cands/n419j3-2416d17a/recipe/overlay/inkling_pico12/patches.py +fb9c7ecee826335f6014f5f2040b5abe132a86aa6e43f1545bb1e5db19cea16b cands/n419j3-2416d17a/recipe/overlay/inkling_pico12/third_party/pico/LICENSE +60b3ad14b8d2291101c82f3cc8c0653a6e778b1db9abfe463992dd3737550b4f cands/n419j3-2416d17a/recipe/overlay/inkling_pico12/third_party/pico/common/check.h +5d96f43891a930cffa23c8649a79d28d019f7597bf5b2ac51e46eb6de5ff6e87 cands/n419j3-2416d17a/recipe/overlay/inkling_pico12/third_party/pico/kernels/common.cuh +baa1d8d7ff69d0f132acbfba354eb35dc4e5011b5f3e1ae3d177d6d1dcfb5256 cands/n419j3-2416d17a/recipe/overlay/inkling_pico12/third_party/pico/kernels/dsk.h +91230a0b0783d2af5da87d6476e60c2dc2d94d60879998e54db547dc6f01982d cands/n419j3-2416d17a/recipe/overlay/inkling_pico12/third_party/pico/kernels/gemv16.cu +61a59cd6f4d9b31abd76da83f67b5797f4a1f5e5ec9ce866e78fdcd8692896eb cands/n419j3-2416d17a/recipe/overlay/inkling_prologue/CREDITS.knapcio-v2.9.3.md +1a87a7afb937c54991860f623a0365882a854cf08bf058e6efd60e87488fcddd cands/n419j3-2416d17a/recipe/overlay/inkling_prologue/LICENSE.knapcio-v2.9.3 +398c1c6b775c7865ad1c50f1cc73ed01116a4d8e213ed3bcf7eff0bc2d268642 cands/n419j3-2416d17a/recipe/overlay/inkling_prologue/NOTICE.knapcio-v2.9.3 +d807c304d543312f6c3c3e2f1d40a3dcedc982c8bef30a34ca891fe6c7956fbe cands/n419j3-2416d17a/recipe/overlay/inkling_prologue/__init__.py +ab12eae066bc1cc54662498a1d7d53aa468619997fc204e6a14ba26715977a0c cands/n419j3-2416d17a/recipe/overlay/inkling_prologue/_hook.py +d83c5b71d817b66804bfaa2c7108a96b4374033102b709639555456feed6478d cands/n419j3-2416d17a/recipe/overlay/inkling_prologue/_triton.py +fed63858ca1872cf9fc4122cff02af670e297b972df4d075c929c77613b7f6c4 cands/n419j3-2416d17a/recipe/overlay/inkling_ptouch/__init__.py +ab12eae066bc1cc54662498a1d7d53aa468619997fc204e6a14ba26715977a0c cands/n419j3-2416d17a/recipe/overlay/inkling_ptouch/_hook.py +b8dfe59c5b140d6a9804be846b06cb4ec07746bb0176ff8b2637177c9487806f cands/n419j3-2416d17a/recipe/overlay/inkling_rsfix/README.md +edf339d321b72e9207204143906526677b6beacb179e1399ac9dc183ba29bd72 cands/n419j3-2416d17a/recipe/overlay/inkling_rsfix/__init__.py +2a1eabd10f7e964a53fe76b66254873fcfd461b0d32f7277db42457d7d65990a cands/n419j3-2416d17a/recipe/overlay/inkling_rsfix/_hook.py +c4e84d4ef8e7343e1563617814c65d0d71fbe19915461d73245818f83e9d1e6c cands/n419j3-2416d17a/recipe/overlay/inkling_rsfix/_sources.py +e4dfce68cae58f71a0658410fe88e6520f94d6c389f8d57e482dacea363509d8 cands/n419j3-2416d17a/recipe/overlay/inkling_rsfix/blockwise.py +9530622cde80e49864d60a50342ff1850e6c6389eb1baa0207d68ba6a388005c cands/n419j3-2416d17a/recipe/overlay/inkling_rsfix/markov.py +93da51652aa8ec27396610a10724b6571e5de8d4ee08e236677c9e98604db951 cands/n419j3-2416d17a/recipe/overlay/inkling_rsfix/reference.py +61e81094be26a6f8a46f07f1b062b07eab246a52553ed094ba147813d92dd513 cands/n419j3-2416d17a/recipe/overlay/inkling_rsfix/reject.py +d5607344cacbcf77fb4cdcc6ce9de49a4290bbf85281f78c9c397a2984dc06eb cands/n419j3-2416d17a/recipe/overlay/inkling_rsfix/selector.py +63c5e7852205045be8bca6e84160df8f2f4dd4f44a8093a6a5a04d9fffbca47e cands/n419j3-2416d17a/recipe/overlay/inkling_vattn/README.md +a08d05ffbd94bdb1c94194432d927b1f30035fa6f23fcc2adc7de36b2930c78c cands/n419j3-2416d17a/recipe/overlay/inkling_vattn/__init__.py +ab12eae066bc1cc54662498a1d7d53aa468619997fc204e6a14ba26715977a0c cands/n419j3-2416d17a/recipe/overlay/inkling_vattn/_hook.py +63aad1d099fec3f2b66a0ffd8d3709a564644edac2d4f25c1c33018be3dd6f25 cands/n419j3-2416d17a/recipe/overlay/inkling_vattn/ops.py +4f18599a0ad748f7f6a507f165ac72327e733eb082fd6276995b9e4474869652 cands/n419j3-2416d17a/recipe/overlay/inkling_vattn/patch.py +66f94a7e6143ee5bde5e8f83aefe4333ad9d701282b411f0c30091eff637b3b7 cands/n419j3-2416d17a/recipe/overlay/inkling_vcap/README.md +6a39653aa552d2035e4700918cf7e6dd488881c46cd4d52a3edf8424fe7f3cbd cands/n419j3-2416d17a/recipe/overlay/inkling_vcap/__init__.py +01b543f9ea35fd83b4ef34d681b86f6aedd3fc9cbc26b270fb98d3159025c4c2 cands/n419j3-2416d17a/recipe/overlay/inkling_vcap/config.py +bbe0288dd145ba12f1d7312b7def82a7dc0f76c31b5dfa3e2236730eba177b79 cands/n419j3-2416d17a/recipe/overlay/inkling_vcap/dfcap.py +9caf5d3ca057b622e4cca6e35456f7435f9e1d1e5df692f491e12271014d8aed cands/n419j3-2416d17a/recipe/overlay/inkling_vcap/dfcheck.py +f7d2389c58143c3ea661616d82f42e1c7b55b8f95c78dcb424c45d205c4d2203 cands/n419j3-2416d17a/recipe/overlay/inkling_vcap/dflash.py +41cd33472898d7ad98bcbaae2eaf5c27238069b6cdd7815528c932795673e5da cands/n419j3-2416d17a/recipe/overlay/inkling_vcap/dfsteplog.py +bda7d9e386db34eb3f3a8c8aeda249b91ff8ec27d176c23fb5574e80ec81c431 cands/n419j3-2416d17a/recipe/overlay/inkling_vcap/fastprobs.py +d364b1bc5a27dd747b08095030670ac085205454b548ba54b453f96872cd90bb cands/n419j3-2416d17a/recipe/overlay/inkling_vcap/fused.py +897b421d153acd9c0494e084e0d8227804a00f5d24c245646dec74079c422b84 cands/n419j3-2416d17a/recipe/overlay/inkling_vcap/fused_accept.py +0a928a2c9b2677ce1a359da34d444b40ff38cc6a01c8f44c5723dbaabb6751e5 cands/n419j3-2416d17a/recipe/overlay/inkling_vcap/importhook.py +2738304eeff01b7d21c700c7408b24e1c429ad912fdc6e58952cf5a1d2a80963 cands/n419j3-2416d17a/recipe/overlay/inkling_vcap/logic.py +9ba4bf5aeafcc3d1e58adecbad230cbfa128079c6577843a6e28e40866258a20 cands/n419j3-2416d17a/recipe/overlay/inkling_vcap/patches.py +21082944e6df1a1eb5d288c226562278d8b493ea37cb6ccbf6a8a98bcaa93cce cands/n419j3-2416d17a/recipe/overlay/inkling_vcap/policies/df-SLDF1-sm.json +b9505b8e00284277b8354cf72a406d8bc2b465d8619f51f44e8609964093b5ee cands/n419j3-2416d17a/recipe/overlay/inkling_vcap/policies/df-SLDF2x.json +ab43150b4ff972b9975192761515e843088f8838b765090c888f1c3e79334e9f cands/n419j3-2416d17a/recipe/overlay/inkling_vcap/policies/r2-theta004.json +359b404bd41371397ec8948ece4700d10e1e2b6271301e47439dc4cd83198310 cands/n419j3-2416d17a/recipe/overlay/inkling_vcap/policyfile.py +982f86bb234ebfd5ca7f37304ae9bf78b5fa90969e75357a5a44905f8a708f49 cands/n419j3-2416d17a/recipe/overlay/inkling_vcap/state.py +c7f51ebddeba0c2cb5a11bf8075fec231f081ef58ffd0e2c93097a70ebbca04a cands/n419j3-2416d17a/recipe/overlay/inkling_vcap/v3_kernels.py +4cd0f8e5854e5ed4f1745e6a56aaeba679c4ec4bc17352960f1f01fe3b8f8cf0 cands/n419j3-2416d17a/recipe/overlay/inkling_wide/README.md +e473be74143084bca38efb0fce7b281b63239471bc43e99692863dd53b85dd16 cands/n419j3-2416d17a/recipe/overlay/inkling_wide/__init__.py +ee0ef2ccad715b6614ee88fedd6f5a5a67291e6c76e3fed8c9bf4bf663209858 cands/n419j3-2416d17a/recipe/overlay/inkling_wide/_hook.py +409563a58078e003f0f61c39162dca23563d08cf6fe3e6ecd53211b30538bd12 cands/n419j3-2416d17a/recipe/overlay/inkling_wide/build.py +640625aed9282589c3c32b06f0b57be48efd230c88425a4264748fed3f23eb15 cands/n419j3-2416d17a/recipe/overlay/inkling_wide/csrc/bf16x_format.cuh +a281cb85d1867e5acd8dfe7c8d3b2f1b68b5cb1d3091ad6445eba09d66341e94 cands/n419j3-2416d17a/recipe/overlay/inkling_wide/csrc/wide_ext.cu +3b12f4ef0077ccc61f4867a1369a66fc2a3b10e791c19f4323956756086418cd cands/n419j3-2416d17a/recipe/overlay/inkling_wide/ops.py +0deb113320ff36523d0e5a25851c3d27aa9412ed5b74d3fd74288504e0404e09 cands/n419j3-2416d17a/recipe/overlay/inkling_wide/patches.py +5b3f3070eab76b167d3ac2a7f03cfea9e59901e45dbe3a01059cbe5d423bcdbc cands/n419j3-2416d17a/recipe/overlay/inkling_wide/tests/fake_wide_ext.py +b436a3347e2e274fc146d5ed6969f489415fa60f0fc0f58593fd0875d1ddfd87 cands/n419j3-2416d17a/recipe/overlay/inkling_wide/tests/test_wide.py +fb9c7ecee826335f6014f5f2040b5abe132a86aa6e43f1545bb1e5db19cea16b cands/n419j3-2416d17a/recipe/overlay/inkling_wide/third_party/pico/LICENSE +b37e3528ad0ca2dcbd2ab38ee4be67ec88980e769c4a5dbddfa5b45624f28fa7 cands/n419j3-2416d17a/recipe/overlay/inkling_wide/tools/gpu_check_wide.py +ff089d1ab9f66eb5ee40a3f77a6193120abc064d9eb97a60e495a5ec3fa743eb cands/n419j3-2416d17a/recipe/overlay/inkling_wide/tools/gpu_integration_wide.py +65acb522ac26d4bdacff65abacf544479da47d7bc6d43ed97b319972a36b560a cands/n419j3-2416d17a/recipe/overlay/sitecustomize.py +1f64526e4dcec5cd6d3cd3d842ebbf74035e4f34b64aeb7d761693b8198bd924 cands/n419j3-2416d17a/recipe/patch/inkling2_attn.py +64914ef9213420b37bdb361dfb3bdadb5ff07994deda96c548762e006927bd44 cands/n419j3-2416d17a/recipe/patch/inkling2_loop.py +70d8797b523b0fcdaad6e709e14bfc4bbdcc735a4b49824b430997ff1018dd78 cands/n419j3-2416d17a/recipe/patch/inkling2_loop_model.py +29d1f5cb5101a7a0aac48c4b1f15252acaba01a404c6e2475c6c798f0797d997 cands/n419j3-2416d17a/recipe/patch/n105_rnnhoist.py +9d0231ebab913cb3b3956c421ae5f4f69d2661728f1f8d3b3d64755f9e455f63 cands/n419j3-2416d17a/recipe/patch/n13_attn_global.py +7d6f1ab93c1252e891446df090e414c6aa975ca480a360b5ac65fb6d16c8be9a cands/n419j3-2416d17a/recipe/patch/n13_fwd.py +1801287d6696437fa6417c335decf0f4b9deb7391b4d4e4fd8e5c893cf272333 cands/n419j3-2416d17a/recipe/patch/n140_kern.py +6b69991a90d2ca2a6196d4d1d28014983614a6030d8a38d43aa08c7a29f49f65 cands/n419j3-2416d17a/recipe/patch/n14_moe.py +8e2d7b61a2ffee1e5bbdaf3f2406a202f13e3a9d96df0f849d35af4d781cac62 cands/n419j3-2416d17a/recipe/patch/n14_quant.cuh +a67d3cacb45d4a981add4407552b030c8bdf08dabb7e136f555b21475aa3126a cands/n419j3-2416d17a/recipe/patch/n15_fused.py +e8373342b54dfccbe4c04fd21e137172286b902b07ed6f5037deeb95eb70c9ef cands/n419j3-2416d17a/recipe/patch/n32_attn_local.py +571c3e4a819b27e175091b7af099e972bc4c38b6eac3f1af1ff4e88b6b662746 cands/n419j3-2416d17a/recipe/patch/n32_fwd.py +65f51937ca44728959542ca4ed7456973b45e7f32bd54934e44a49ee256630c4 cands/n419j3-2416d17a/recipe/patch/n35_w8.py +aa79c3095959d385dc1c6f9fdcf7558a73547fcc31c4f6460c6e77cbc9327605 cands/n419j3-2416d17a/recipe/patch/n35_w8gemv.py +b4cc2402f4c0eee56dc4ce9721043b6d16ed04e932f94848b395f3873f58cb59 cands/n419j3-2416d17a/recipe/patch/n37_tiles.py +5b1a90477bb2ed2dddf31b3adbc8cb200538335854ddb99ce59ecdf3dbfadfac cands/n419j3-2416d17a/recipe/patch/n50b_fused.py +1dc6b870ef8c25dd40615930cbf62dfec0e29c5d6b785eb8d42d532ea4a9cd04 cands/n419j3-2416d17a/recipe/patch/n52_band.cuh +e4118504ce8a210f8d4ef86d1be579dd4d73e4161bb0c9e4264811ad51999140 cands/n419j3-2416d17a/recipe/patch/n52_moe.py +3523d5fe6549aec71d853c0713403fbdc15984e08c3e5820c2a790a6ede84855 cands/n419j3-2416d17a/recipe/patch/n64_attn_global.py +eefba4b83410c246441d74d5311deacc6da6e4405d28e3c5b5fa344d4d29eb81 cands/n419j3-2416d17a/recipe/patch/n64a_fwd.py +cca0cd0d7b860ed4cc78a98651264ecb8fd20793055e58323c2623b8531b6d0d cands/n419j3-2416d17a/recipe/patch/n64b_fwd.py +d1b88fb14a0d18ccff2ed53b79dcfcb1a2565e50e6cf625053bf39cdc9f1ecd9 cands/n419j3-2416d17a/recipe/patch/n66fb.py +b7abf0229b9d40558dc6dd576fb300bec9e0a6b9c173b458881111ff0bc89206 cands/n419j3-2416d17a/recipe/patch/n71_resnorm.py +91f1bb6066a4e5abf77253e23816783880ea38cff649aebd844157b60268c5e7 cands/n419j3-2416d17a/recipe/patch/n71_sconvres.py +d4411fd151e6212a0feb14ed41457be3c976b92a8f5c981cbc2d1a890075eb7b cands/n419j3-2416d17a/recipe/patch/n75_c12.py +71fd33a2a119db28c4ca8a24d75e9678131c87b327d095a329fdad18bc03e29a cands/n419j3-2416d17a/recipe/patch/n75_cuda.py +00bece24b9b910eb33d1f85fe1e60b2685a2ac4dfb5f5136d891b9db668968f7 cands/n419j3-2416d17a/recipe/patch/n75_install.py +17349b269f1eb7f2551fac79b9e8020b10708410156a08e1b959c8e53f491f79 cands/n419j3-2416d17a/recipe/patch/n78_head.py +9447c05ffbf888a1aea1a7da467399f572f1d684f142f24c4cccfacefcd353f8 cands/n419j3-2416d17a/recipe/patch/n78_kern.py +efe43e40ebccb20b31398ef7b7a4e70e0dd1a6192a95904ebb70fb6a8f3d3b73 cands/n419j3-2416d17a/recipe/patch/n80_cuda.py +cd2d6ef590744ee69cd3b2dfdff9c42cf957eef291f858c3054f1b651b84943f cands/n419j3-2416d17a/recipe/patch/n80_draft.py +9ba4c20f9fa95c8d9a337f4eeea6abae50e142f747d4dde618712f04e127f56f cands/n419j3-2416d17a/recipe/patch/n86_riders.py +25030bef80b49e72d46355799e7febea0867ea57aed711f7c9ae28159a81f390 cands/n419j3-2416d17a/recipe/serve/inkling2_mtp.py +2b27a2b7797d41922869d0c3b95ba281ea812a70557d194782908ad247a74fe6 cands/n419j3-2416d17a/recipe/serve/mixpin.sh +9c80d55f4f87c0f9b29222cf27c85c5a899be961f7c44b98c5d59e8f172215ce cands/n419j3-2416d17a/recipe/serve/serve.sh +6e3fa6a41f6ceb0e80812e387488538ac8dc436851193a4dcdaecaeb93ab5e6b cands/n419j3-2416d17a/recipe/serve/serve.sh.orig +1bccd9dadf233cd9af15aa63a8d2cc22e0706983355a00e380731d09a5bdb682 cands/n419j3-2416d17a/recipe/serve/sl.json +14223ae2f3aa1d661da67cf0143ec33070d952a6e28a119e6cec64fcc0bebe50 dflash2/sglang_inkling_dflash2.py diff --git a/recipe/stack/cands/n292-v2-v297-pk3c/recipe/CREDITS.md b/recipe/stack/cands/n292-v2-v297-pk3c/recipe/CREDITS.md new file mode 100644 index 0000000000000000000000000000000000000000..c21f38fd1177e6925575871e8052fa35d99fe663 --- /dev/null +++ b/recipe/stack/cands/n292-v2-v297-pk3c/recipe/CREDITS.md @@ -0,0 +1,94 @@ +# 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.1 +recipe), the batch-aware pay-for-rows rule and the certified greedy LM head (GLM-5.3-Flash recipe), FP8 / low-bit +draft 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. diff --git a/recipe/stack/cands/n292-v2-v297-pk3c/recipe/LICENSE b/recipe/stack/cands/n292-v2-v297-pk3c/recipe/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..272aceba2ac697cd358e703c7e849e738e9b83c3 --- /dev/null +++ b/recipe/stack/cands/n292-v2-v297-pk3c/recipe/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2026 Zbigniew Majewski + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, 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 THE +SOFTWARE. diff --git a/recipe/stack/cands/n292-v2-v297-pk3c/recipe/NOTICE b/recipe/stack/cands/n292-v2-v297-pk3c/recipe/NOTICE new file mode 100644 index 0000000000000000000000000000000000000000..d1ae19376d8e6f56690206da57d8a30de168440e --- /dev/null +++ b/recipe/stack/cands/n292-v2-v297-pk3c/recipe/NOTICE @@ -0,0 +1,54 @@ +Inkling-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; the +prompts 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. diff --git a/recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_attn/CREDITS.knapcio-v2.9.3.md b/recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_attn/CREDITS.knapcio-v2.9.3.md new file mode 100644 index 0000000000000000000000000000000000000000..c21f38fd1177e6925575871e8052fa35d99fe663 --- /dev/null +++ b/recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_attn/CREDITS.knapcio-v2.9.3.md @@ -0,0 +1,94 @@ +# 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.1 +recipe), the batch-aware pay-for-rows rule and the certified greedy LM head (GLM-5.3-Flash recipe), FP8 / low-bit +draft 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. diff --git a/recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_attn/LICENSE.knapcio-v2.9.3 b/recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_attn/LICENSE.knapcio-v2.9.3 new file mode 100644 index 0000000000000000000000000000000000000000..272aceba2ac697cd358e703c7e849e738e9b83c3 --- /dev/null +++ b/recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_attn/LICENSE.knapcio-v2.9.3 @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2026 Zbigniew Majewski + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, 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 THE +SOFTWARE. diff --git a/recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_attn/NOTICE.knapcio-v2.9.3 b/recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_attn/NOTICE.knapcio-v2.9.3 new file mode 100644 index 0000000000000000000000000000000000000000..d1ae19376d8e6f56690206da57d8a30de168440e --- /dev/null +++ b/recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_attn/NOTICE.knapcio-v2.9.3 @@ -0,0 +1,54 @@ +Inkling-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; the +prompts 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. diff --git a/recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_attn/README.md b/recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_attn/README.md new file mode 100644 index 0000000000000000000000000000000000000000..84f2346ef41f258c87b699dfe577386f3c506a01 --- /dev/null +++ b/recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_attn/README.md @@ -0,0 +1,164 @@ +# 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: each +warp 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), stages +the 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 its +B 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-warp +instantiation (BM 128, half the bytes per FLOP) holds ~69 TF/s at every prefix and computes every row +bit-identically. On global layers, for the BF16 loader and the packed-prefix loader alike, the binding launches two +grids per call (`launch_global`): requests whose prefix (seqused_k - new rows) is >= `INKLING_ATTN_W8_FROM` run on +8 warps, the others on 4; each CTA reads its request's lengths on the device and returns before any shared-memory +access when the other grid owns the request (no host sync, CUDA-graph capturable). `INKLING_ATTN_W8_FROM=0`, SWA +layers 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 and +online-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 application +and shear pads, the SM120 module selection, CP and breakable-graph helpers); a mismatch raises (exit 78 through +sitecustomize). `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 is +built when the model imports `inkling2_attn` (before any CUDA-graph capture), about 1 min on the first start, then +reused 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, chunks +with 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 not +written, 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 relative +excess 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 index +math (`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 in +docs/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-visit +times, 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). diff --git a/recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_attn/__init__.py b/recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_attn/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..789f18b8ffaa237c9f342de9540389b1b618d3bd --- /dev/null +++ b/recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_attn/__init__.py @@ -0,0 +1,170 @@ +"""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 measured +error 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 then +exits 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.util +import os +import 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 levers diff --git a/recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_attn/_hook.py b/recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_attn/_hook.py new file mode 100644 index 0000000000000000000000000000000000000000..d461a95a091b5c0581fc024013d31b28437df871 --- /dev/null +++ b/recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_attn/_hook.py @@ -0,0 +1,83 @@ +"""Post-import hooks: run a callback right after a module finishes executing. + +Patches attach lazily so that processes which never import the model pay nothing +and never import sglang or torch. If the target module is already imported, the +callback 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 the +loader the next one returned), so every package's callbacks run. +""" + +import importlib.abc +import sys +import 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) diff --git a/recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_attn/build.py b/recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_attn/build.py new file mode 100644 index 0000000000000000000000000000000000000000..e39d2649dd43f5a2a5f2cf609e1a0183f9b4bb4a --- /dev/null +++ b/recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_attn/build.py @@ -0,0 +1,102 @@ +"""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 +//, where is INKLING_ATTN_CACHE (default ~/.cache/inkling-attn, i.e. /root/.cache/inkling-attn +in the container) and hashes the sources, the flags and the torch / CUDA versions, so a changed input never +reuses 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 hashlib +import os +import sys +import 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 = None +INFO = {} + + +def load(cache_dir=None, arch="121a", verbose=False): + """Import the extension, building it first when / 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()) diff --git a/recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_attn/csrc/attn_kernel.cuh b/recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_attn/csrc/attn_kernel.cuh new file mode 100644 index 0000000000000000000000000000000000000000..84948f6c6ed4c76de2e97baed070638609deae93 --- /dev/null +++ b/recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_attn/csrc/attn_kernel.cuh @@ -0,0 +1,555 @@ +// 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 +#include + +namespace inkling_attn { + +constexpr int kD = 128; // head dim +constexpr int kBN = 64; // keys a tile +constexpr int kDRel = 16; // r / proj inner dim +constexpr 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(__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(&v); +} + +__device__ __forceinline__ uint32_t ld_u32(const __nv_bfloat16* p) { + return __ldg(reinterpret_cast(p)); +} + +__device__ __forceinline__ uint32_t ld_u16(const __nv_bfloat16* p) { + return static_cast(__ldg(reinterpret_cast(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(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(slot) * 2 * 128 * p.kv_heads * kD; + return *reinterpret_cast(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(ref - 1) * 128 * kD; + return *reinterpret_cast(src + row * kD + dim); + } + const auto sm = *reinterpret_cast(p.sm + start + element); + const uint32_t ex = *reinterpret_cast(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 +__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(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(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(min(static_cast(sk), static_cast(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(head) * p.q_sh; + const __nv_bfloat16* q1 = p.q + t1 * p.q_st + static_cast(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(head) * p.r_sh; + const __nv_bfloat16* rr1 = p.r + t1 * p.r_st + static_cast(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(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(target) = packed_vector(p, page, kind, kvh, slot0 + row, chunk * 8, ok); + } else { + const auto* src0 = base + static_cast(page_ok ? page : 0) * sp + static_cast(kvh) * sh; + const auto* src = ok ? src0 + static_cast(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(p.projp + static_cast(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(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(wbuf + rr * kD + (((cc >> 3) ^ (rr & 7)) * 8)) = + *reinterpret_cast(p.gate + t * p.g_st + static_cast(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(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(head) * p.o_sh; +#pragma unroll + for (int dn = 0; dn < 16; ++dn) { + *reinterpret_cast(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(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(p.y + t * p.y_st + static_cast(head) * kD + cc) = + *reinterpret_cast(wbuf + rr * kD + (((cc >> 3) ^ (rr & 7)) * 8)); + } + } + } +} + +} // namespace inkling_attn diff --git a/recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_attn/csrc/inkling_attn_ext.cu b/recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_attn/csrc/inkling_attn_ext.cu new file mode 100644 index 0000000000000000000000000000000000000000..54720cd6065772200a3a328d8f06787b9e8c9a8c --- /dev/null +++ b/recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_attn/csrc/inkling_attn_ext.cu @@ -0,0 +1,326 @@ +// 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 +#include + +#include +#include +#include + +#include "attn_kernel.cuh" + +namespace { + +using inkling_attn::Params; + +bool aligned(const void* p, size_t n) { return reinterpret_cast(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(y + r * y_st + c) = make_uint4(0, 0, 0, 0); + } +} + +template +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, + cudaFuncAttributeMaxDynamicSharedMemorySize, smem)); + configured[dev] = true; + } + inkling_attn::prefill_fwd<<>>(p); +} + +template +void launch(const Params& p, dim3 blocks, int64_t warps, cudaStream_t stream) { + if (warps == 8) launch_w(p, blocks, stream); + else launch_w(p, blocks, stream); +} + +// global layers: one launch, or the 8-warp (long prefixes) + 4-warp (the rest) pair +template +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(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(w8_from_keys); + launch(p8, dim3(static_cast(grid8)), 8, stream); + C10_CUDA_KERNEL_LAUNCH_CHECK(); + Params p4 = p; + p4.sel_mode = 1; + p4.sel_keys = static_cast(w8_from_keys); + launch(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& projp_buf, int64_t warps, + const c10::optional>& packed_kv, int64_t w8_from_keys, + const c10::optional& gate, const c10::optional& sinks, + const c10::optional& 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(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 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(); + p.ex = planes[1].data_ptr(); + p.esc = planes[2].data_ptr(); + p.off = planes[3].data_ptr(); + p.overflow_ref = planes[4].data_ptr(); + p.flags = planes[5].data_ptr(); + p.staging = reinterpret_cast(planes[6].data_ptr()); + p.overflow = reinterpret_cast(planes[7].data_ptr()); + p.packed_stride = planes[0].stride(0); + p.kv_heads = static_cast(hkv); + p.stage_slots = static_cast(planes[6].size(0)); + p.overflow_slots = static_cast(planes[7].size(0)); + } else { + p.k = reinterpret_cast(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(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(); + p.pt_s = page_table.stride(0); + p.cu_q = cu_q.data_ptr(); + p.seq_k = seq_k.data_ptr(); + p.n_req = static_cast(n_req); + p.r = reinterpret_cast(r.data_ptr()); + p.r_st = r.stride(0); + p.r_sh = r.stride(1); + p.proj = reinterpret_cast(proj.data_ptr()); + p.rel_extent = static_cast(proj.size(1)); + p.out = out.data_ptr(); + p.o_st = out.stride(0); + p.o_sh = out.stride(1); + p.lse = lse.data_ptr(); + p.lse_sh = lse.stride(0); + p.heads = static_cast(H); + p.group = static_cast(H / hkv); + p.page_size = static_cast(page_size); + p.total_q = static_cast(T); + p.pt_cols = static_cast(page_table.size(1)); + p.num_pages = static_cast(num_pages); + p.scale = static_cast(scale); + p.window_left = static_cast(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(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(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(g.data_ptr()); + p.g_st = g.stride(0); + p.sink = reinterpret_cast(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(pb.data_ptr()), pb1 = pb0 + pb.numel() * 2; + const auto pr0 = reinterpret_cast(proj.data_ptr()), pr1 = pr0 + proj.numel() * 2; + TORCH_CHECK(pb1 <= pr0 || pr1 <= pb0, "inkling_attn: projp buffer overlaps proj"); + p.projp = reinterpret_cast(pb.data_ptr()); + const int n = static_cast(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(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(std::min(T, 1024)); + zero_tail_rows<<>>(p.y, p.y_st, static_cast(H * inkling_attn::kD), p.cu_q, + static_cast(n_req), static_cast(T)); + C10_CUDA_KERNEL_LAUNCH_CHECK(); + } + if (packed_kv) { + if (gated) { + if (packed) launch_global(p, blocks, warps, w8_from_keys, grid8, stream); + else launch_global(p, blocks, warps, w8_from_keys, grid8, stream); + } else if (packed) launch_global(p, blocks, warps, w8_from_keys, grid8, stream); + else launch_global(p, blocks, warps, w8_from_keys, grid8, stream); + } else if (window_left >= 0) { + if (gated) { + if (packed) launch(p, blocks, warps, stream); + else launch(p, blocks, warps, stream); + } else if (packed) launch(p, blocks, warps, stream); + else launch(p, blocks, warps, stream); + } else { + if (gated) { + if (packed) launch_global(p, blocks, warps, w8_from_keys, grid8, stream); + else launch_global(p, blocks, warps, w8_from_keys, grid8, stream); + } else if (packed) launch_global(p, blocks, warps, w8_from_keys, grid8, stream); + else launch_global(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); +} diff --git a/recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_attn/ops.py b/recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_attn/ops.py new file mode 100644 index 0000000000000000000000000000000000000000..452b74f834fe525fde7714790940587699d587b2 --- /dev/null +++ b/recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_attn/ops.py @@ -0,0 +1,76 @@ +"""Python entry point of the inkling_attn kernel (imported on the GPU path only).""" + +from . import build + +D_REL = 16 +HEAD_DIM = 128 + + +import os + +WARPS = int(os.environ.get("INKLING_ATTN_WARPS", "4")) # 4: BM 64, 2 CTAs / SM; 8: BM 128, 1 CTA / SM +PACKED_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) diff --git a/recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_attn/patch.py b/recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_attn/patch.py new file mode 100644 index 0000000000000000000000000000000000000000..070ddae3a823b655ae36e7978d15e4b9edd6c8a7 --- /dev/null +++ b/recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_attn/patch.py @@ -0,0 +1,562 @@ +"""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 at +the 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_layout +wraps RelLogitsProj.forward. This package dispatches one level earlier, at RelLogitsProj.__call__ (before +nn.Module.__call__ reaches any forward wrapper), so in an eligible visit r is returned whatever order the two +packages were installed in; bias_layout's forward wrapper is not reached, its varlen wrapper sees a width-16 +rel_bias it did not make and passes it through, and layers this package does not take (e.g. global layers with +only prefill_swa armed) still get bias_layout's sheared bias. Should anything else consume an eligible visit +first, 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 which +FlashAttentionBackend._load_fa4_kernels uses the patched SM120 module, and no context-parallel extend. +""" + +import contextvars +import os +import sys +import 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 = 16 +HEAD_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 True diff --git a/recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_attn/tests/test_install.py b/recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_attn/tests/test_install.py new file mode 100644 index 0000000000000000000000000000000000000000..3f5b7aa3fc4540b7d6f4caeea5cde74dd69c6af7 --- /dev/null +++ b/recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_attn/tests/test_install.py @@ -0,0 +1,54 @@ +"""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 os +import sys +import tempfile +import 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() diff --git a/recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_attn/tests/test_w8split_cpu.py b/recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_attn/tests/test_w8split_cpu.py new file mode 100644 index 0000000000000000000000000000000000000000..ccbe6c2208f0482018787241ae4c8a2ac2e971d1 --- /dev/null +++ b/recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_attn/tests/test_w8split_cpu.py @@ -0,0 +1,118 @@ +"""CPU check of the per-request 4/8-warp split (ops.W8_FROM): a mirror of the kernel's work-item loop and selection +block 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") diff --git a/recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_cert/README.md b/recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_cert/README.md new file mode 100644 index 0000000000000000000000000000000000000000..a049a2a5a9a1e0bc10494f680569057c12090069 --- /dev/null +++ b/recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_cert/README.md @@ -0,0 +1,197 @@ +# 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 of +the head (358 MB) instead of pico's coded head (715 MB), bounds every logit rigorously, and runs pico's exact head +GEMV 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 outside +pico). Not yet run in a serving boot: the next step is `INKLING_CERT_HEAD=check` for a few thousand steps, then an +A/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, just +slower). 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, x +loaded once per CTA) was tried and rejected: 140 GB/s at M = 8 and 202 at M = 16, because the x loads then go +ahead of the weight stream. A step that is not eligible pays about +90 us over +pico. + +## 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 the +fallback, 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 the +variable 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 from +teacher-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 of +50.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 small +kernels. pico's full head is 2.90 ms at 8 rows. The measured screen error is about 1.4 % of the bound, because the +Cauchy-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` 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 greedy +accept's argmax. + +## Why the token is the same (cert_math.py has the full statement) + +1. **Bound.** |pico - | <= C_ACC ||W_v|| ||x|| and |s - | <= 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 || <= 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 full +head 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 is +1 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 full +head. The first eager call per row bucket goes through these kernels in full-fallback mode, and later eager calls +go 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 verify +logits 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. diff --git a/recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_cert/__init__.py b/recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_cert/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..57beab2da984105fe608ae89c156f97afca316b2 --- /dev/null +++ b/recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_cert/__init__.py @@ -0,0 +1,172 @@ +"""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 rows +when 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.util +import os +import 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 mode diff --git a/recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_cert/_hook.py b/recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_cert/_hook.py new file mode 100644 index 0000000000000000000000000000000000000000..d11eff38cb26fbad1c9ee6888c4ca8aab709dd8f --- /dev/null +++ b/recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_cert/_hook.py @@ -0,0 +1,78 @@ +"""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 the +container starts, so patches are attached to their target modules lazily. If the +target module is already imported when the hook is registered, the callback runs +immediately. A callback that raises makes the import of its target fail. +""" + +import importlib.abc +import sys +import 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) diff --git a/recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_cert/build.py b/recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_cert/build.py new file mode 100644 index 0000000000000000000000000000000000000000..f29f13c763db6acdf2998e99b4469f93725eeeb8 --- /dev/null +++ b/recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_cert/build.py @@ -0,0 +1,102 @@ +"""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 /, a hash of every source +and header, the flags, torch's and CUDA's versions. = INKLING_CERT_CACHE (default ~/.cache/inkling-cert). + + python3 -m inkling_cert.build # build now (in the container, no GPU needed); prints the path +""" + +import hashlib +import os +import sys +import 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 = None +INFO = {} + + +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()) diff --git a/recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_cert/cert_math.py b/recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_cert/cert_math.py new file mode 100644 index 0000000000000000000000000000000000000000..ec9cb8252422df39e98da87cc652a5f20575810d --- /dev/null +++ b/recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_cert/cert_math.py @@ -0,0 +1,163 @@ +"""NumPy model of the certified greedy LM-head argmax (what cert_ext.cu computes), for the CPU tests and as the +statement 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 ~ (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 - | and |s - | are both <= C_ACC * N_v * ||x|| (accumulation +model below; flushed subnormal inputs or products add at most K * 2^-126 * (||W_v||_1 + ||x||_1), covered by the +absolute slop while ||x|| <= 2^20, which the screen checks) and || <= 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, so +T <= 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 then +hi_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 is +computed. (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 stock +values, so the maximum and the set of ids attaining it among computed ids are the stock ones restricted to computed +ids, 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 in +FP32, 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 gives +C_ACC = (K / 16 * 17 + 32) * 2^-23 per unit of sum |w_k x_k| <= ||w|| ||x||. inkling_pico12's GPU check already +gates pico's head against FP64 with the tighter (K / 16 + 32) * 2^-23; tools/gpu_check_cert.py measures both the +screen and the exact pass against FP64 and against this bound. +""" + +import math + +import numpy as np + +K = 2304 +GROUP = 192 +NGROUPS = K // GROUP +TILE = 16 +QMAX = 31 +C_ACC = (K / 16 * 17 + 32) * 2.0 ** -23 +CN = 2.0 * C_ACC # exact path + screen +CAP = 30.0 # final_logit_softcapping +E_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_SOFTCAP +DMAX = 16.0 +INFL = 1.0 + 2.0 ** -16 +X_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) diff --git a/recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_cert/certwide.py b/recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_cert/certwide.py new file mode 100644 index 0000000000000000000000000000000000000000..00599667215428b9dab0bb8d60c7e760a3f23e7e --- /dev/null +++ b/recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_cert/certwide.py @@ -0,0 +1,140 @@ +"""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 = 17 +MAX_ROWS = 192 +MAX_TILES = 2048 +PARTS = 16 +# Give each path 2 * C_ACC to cover the compounded rounding model. +CN = 4 * cert_math.C_ACC +MAX_WEIGHT_NORM = 2.0**28 +ABS_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 = entry diff --git a/recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_cert/certwide_math.py b/recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_cert/certwide_math.py new file mode 100644 index 0000000000000000000000000000000000000000..12ab166a374a5e2b9a3d5533824a6582b81e7688 --- /dev/null +++ b/recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_cert/certwide_math.py @@ -0,0 +1,74 @@ +"""CPU model of the wide certificate's intervals and candidate selection.""" + +import numpy as np + +from . import cert_math as cm +from .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) diff --git a/recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_cert/certwide_reduce.py b/recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_cert/certwide_reduce.py new file mode 100644 index 0000000000000000000000000000000000000000..f79220af44802e3ac3eab8aed0d972111c12c079 --- /dev/null +++ b/recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_cert/certwide_reduce.py @@ -0,0 +1,68 @@ +"""Device-gated softcap and argmax over the compact or fallback wide head.""" + +import triton as tr +import triton.language as tl +from triton.language.extra import libdevice + + +@tr.jit +def _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.jit +def _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.jit +def _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) diff --git a/recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_cert/csrc/cert_ext.cu b/recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_cert/csrc/cert_ext.cu new file mode 100644 index 0000000000000000000000000000000000000000..6701ac91be1701d440c180a79257127de939b0d2 --- /dev/null +++ b/recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_cert/csrc/cert_ext.cu @@ -0,0 +1,549 @@ +// 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 + +#include +#include +#include +#include +#include + +#include +#include +#include + +#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 +__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(xr)) : make_uint4(0, 0, 0, 0); + xa[u][1] = live ? __ldg(reinterpret_cast(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(xr2)) : make_uint4(0, 0, 0, 0); + xb[u][1] = live2 ? __ldg(reinterpret_cast(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(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 +__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(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(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(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(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(x.data_ptr()); + const auto* scp = reinterpret_cast(sc.data_ptr()); + const auto* rtp = reinterpret_cast(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(); + bd = bdbg.data_ptr(); + } + if (M <= 8) + cert::k_screen<8><<>>(xp, (int)M, q.data_ptr(), scp, rtp, + nv.data_ptr(), (int)V, (int)v_real, (float)cn, + lt.data_ptr(), ht.data_ptr(), (int)ncta, + flags.data_ptr(), on.data_ptr(), sd, bd); + else + cert::k_screen<16><<>>(xp, (int)M, q.data_ptr(), scp, rtp, + nv.data_ptr(), (int)V, (int)v_real, (float)cn, + lt.data_ptr(), ht.data_ptr(), (int)ncta, + flags.data_ptr(), on.data_ptr(), sd, bd); + C10_CUDA_KERNEL_LAUNCH_CHECK(); + cert::k_rowmax<<>>(lt.data_ptr(), ht.data_ptr(), (int)ncta, tm.data_ptr(), + hm.data_ptr(), on.data_ptr()); + C10_CUDA_KERNEL_LAUNCH_CHECK(); + cert::k_select<<<(ncta + 255) / 256, 256, 0, st>>>(ht.data_ptr(), (int)ncta, (int)M, tm.data_ptr(), + hm.data_ptr(), on.data_ptr(), flags.data_ptr(), + mask.data_ptr(), reinterpret_cast(stats.data_ptr()), (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 elsewhere +void 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(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<<>>(mask.data_ptr(), xp, M, + packed.data_ptr(), (int)N, (int)K, + out.data_ptr(), (int)wk, flags.data_ptr()); + } else { + const size_t smem = (size_t)wk * dsk::kMaxRows * cert::kRowsCta * sizeof(float); + cert::k_exact16<<>>(mask.data_ptr(), xp, M, + packed.data_ptr(), (int)N, (int)K, + out.data_ptr(), (int)wk, flags.data_ptr()); + } + C10_CUDA_KERNEL_LAUNCH_CHECK(); +} + +template +void prepare_screen_wide() { + C10_CUDA_CHECK(cudaFuncSetAttribute(certwide::k_screen_wide, 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 +auto dispatch_screen_wide(int M, bool three_stages, Fn launch) { + using Three = std::integral_constant; + if (M <= 64) return launch(std::integral_constant{}, Three{}); + if (M <= 128) return launch(std::integral_constant{}, Three{}); + if (three_stages) return launch(std::integral_constant{}, Three{}); + return launch(std::integral_constant{}, std::integral_constant{}); +} + +std::tuple 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; + 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(); + k_threshold<<>>(lower.data_ptr(), upper.data_ptr(), ntiles, + threshold.data_ptr(), 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(), threshold.data_ptr(), M, + ntiles, sp, tiles.data_ptr(), groups.data_ptr(), 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(), 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(x.data_ptr()) % 16 == 0 && + reinterpret_cast(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(dbg_s.data_ptr()) % 8 == 0 && + reinterpret_cast(dbg_lo.data_ptr()) % 8 == 0 && + reinterpret_cast(dbg_hi.data_ptr()) % 8 == 0, + "inkling_certwide: misaligned float2 debug output"); + sd = dbg_s.data_ptr(); + ld = dbg_lo.data_ptr(); + hd = dbg_hi.data_ptr(); + } + const c10::cuda::CUDAGuard guard(x.device()); + const auto st = at::cuda::getCurrentCUDAStream(); + const auto* xp = reinterpret_cast(x.data_ptr()); + const auto* scp = reinterpret_cast(sc.data_ptr()); + auto* sp = state.data_ptr(); + C10_CUDA_CHECK(cudaMemsetAsync(sp, 0, 2 * sizeof(int), st)); + k_norm<<>>(xp, norms.data_ptr(), sp, on.data_ptr()); + 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<<<(V + kCols - 1) / kCols, kThreads, Stages * MR * 16 * kRowBytes, st>>>( + xp, q.data_ptr(), scp, radius.data_ptr(), norms.data_ptr(), M, (int)V, (int)v_real, + lower.data_ptr(), upper.data_ptr(), 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; +} diff --git a/recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_cert/csrc/certwide_screen.cuh b/recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_cert/csrc/certwide_screen.cuh new file mode 100644 index 0000000000000000000000000000000000000000..f5bdf9471ad96201bcb7823b43d94e8467c00ead --- /dev/null +++ b/recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_cert/csrc/certwide_screen.cuh @@ -0,0 +1,256 @@ +#pragma once + +namespace certwide { + +using namespace screen6; + +constexpr int kMaxM = 192; +constexpr int kWarps = 8; // eight n8 warps, or four candidate tiles per CTA +constexpr int kCols = 8 * kWarps; +constexpr int kThreads = 32 * kWarps; +constexpr int kRowBytes = 2 * kStep; +constexpr float kMaxX = 0x1p20f; +constexpr float kAbsSlop = 0x1p-78f; + +enum Reason { kCertified, kUnsafe, kTooMany, kOff }; + +// One block per activation row. Sum squares before screening so each vocab CTA +// can use the same upper bound on ||x||. Infl covers the serial and tree sums. +__global__ void k_norm(const __nv_bfloat16* x, float* norms, int* state, const int* on) { + if (!*on) { + if (threadIdx.x == 0 && blockIdx.x == 0) state[0] = kOff; + return; + } + __shared__ float warp_sums[8]; + const auto* row = x + (size_t)blockIdx.x * kK; + float sum = 0.f; + for (int k = threadIdx.x; k < kK; k += blockDim.x) { + const float a = __bfloat162float(row[k]); + sum = fmaf(a, a, sum); + } + for (int d = 16; d; d >>= 1) sum += __shfl_down_sync(0xffffffffu, sum, d); + if ((threadIdx.x & 31) == 0) warp_sums[threadIdx.x >> 5] = sum; + __syncthreads(); + if (threadIdx.x < 32) { + sum = threadIdx.x < 8 ? warp_sums[threadIdx.x] : 0.f; + for (int d = 4; d; d >>= 1) sum += __shfl_down_sync(0xffffffffu, sum, d); + if (threadIdx.x == 0) { + const float norm = sqrtf(sum) * kInfl + 4.f * kXAbs; + norms[blockIdx.x] = norm; + if (!(norm <= kMaxX)) atomicOr(state, kUnsafe); + } + } +} + +__device__ __forceinline__ void copy_x(void* dst, const void* src, bool valid) { + asm volatile("cp.async.cg.shared.global [%0], [%1], 16, %2;" :: + "r"((uint32_t)__cvta_generic_to_shared(dst)), "l"(src), "r"(valid ? 16 : 0) : "memory"); +} + +// Stream one 64-vocab CTA of Q. Each step is loaded by one warp per n8 +// tile, decoded once in that warp, and used for every m16 fragment before +// advancing K. Shared stages hold only activations. +template +__global__ void __launch_bounds__(kThreads) k_screen_wide( + const __nv_bfloat16* x, const uint8_t* q, const uint16_t* sc, const float* radius, + const float* norms, int M, int V, int v_real, float* lower, float* upper, const int* state, + float* debug_s, float* debug_lo, float* debug_hi) { + if (state[0] != kCertified) return; + constexpr int kStage = MR * 16 * kRowBytes; + extern __shared__ __align__(16) uint8_t work[]; + const int warp = threadIdx.x >> 5, lane = threadIdx.x & 31, g = lane >> 2, t = lane & 3; + const int nt = blockIdx.x * kWarps + warp, n = nt * 8 + 2 * t; + const int m16 = (M + 15) / 16; + const bool live_tile = nt < V / 8; + const uint8_t* qw = q + (size_t)(live_tile ? nt : 0) * kSteps * kTileBytes; + const float r0 = live_tile ? __ldg(radius + n) : 0.f; + const float r1 = live_tile ? __ldg(radius + n + 1) : 0.f; + + auto issue_x = [&](int step) { + auto* dst = work + (step % Stages) * kStage; + if (step < kSteps) { + for (int c = threadIdx.x; c < m16 * 16 * 8; c += kThreads) { + const int row = c / 8, ch = c % 8; + copy_x(dst + row * kRowBytes + (ch ^ ((row & 1) << 2)) * 16, + x + (size_t)(row < M ? row : 0) * kK + step * kStep + ch * 8, row < M); + } + } + asm volatile("cp.async.commit_group;" ::: "memory"); + }; + + float sum[MR][4] = {}; + issue_x(0); + if constexpr (Stages == 3) issue_x(1); + for (int group = 0; group < kGroups; ++group) { + const float s0 = live_tile ? half_to_float_u16(__ldg(sc + (size_t)group * V + n)) : 0.f; + const float s1 = live_tile ? half_to_float_u16(__ldg(sc + (size_t)group * V + n + 1)) : 0.f; + float partial[MR][4] = {}; + for (int u = 0; u < kStepsPerGroup; ++u) { + const int step = group * kStepsPerGroup + u; + const uint8_t* base = qw + step * kTileBytes; + const uint2 nib = live_tile ? dsk::ldg_stream64(base + 8 * lane) : make_uint2(0, 0); + const uint32_t high = live_tile ? dsk::ldg_stream32(base + 256 + 4 * lane) : 0; + asm volatile("cp.async.wait_group %0;" :: "n"(Stages - 2) : "memory"); + __syncthreads(); + // This stage was last read by the previous step, which has now + // finished in every warp of the CTA. + issue_x(step + Stages - 1); + if (live_tile) { + uint32_t b[8]; +#pragma unroll + for (int p = 0; p < 8; ++p) b[p] = six_pair(p < 4 ? nib.x : nib.y, high, p); + const uint8_t* xb = work + (step % Stages) * kStage; + const int off = ((2 * t) ^ ((g & 1) << 2)) * 16; +#pragma unroll + for (int j = 0; j < MR; ++j) { + if (j >= m16) break; + const auto* a = reinterpret_cast(xb + (j * 16 + g) * kRowBytes + off); + const auto* a2 = reinterpret_cast(xb + (j * 16 + g + 8) * kRowBytes + off); + const uint4 a0 = a[0], a1 = a[1], a20 = a2[0], a21 = a2[1]; + dsk::mma_bf16(partial[j], a0.x, a20.x, a0.y, a20.y, b[0], b[1]); + dsk::mma_bf16(partial[j], a0.z, a20.z, a0.w, a20.w, b[2], b[3]); + dsk::mma_bf16(partial[j], a1.x, a21.x, a1.y, a21.y, b[4], b[5]); + dsk::mma_bf16(partial[j], a1.z, a21.z, a1.w, a21.w, b[6], b[7]); + } + } + } +#pragma unroll + for (int j = 0; j < MR; ++j) { + sum[j][0] = fmaf(partial[j][0], s0, sum[j][0]); + sum[j][1] = fmaf(partial[j][1], s1, sum[j][1]); + sum[j][2] = fmaf(partial[j][2], s0, sum[j][2]); + sum[j][3] = fmaf(partial[j][3], s1, sum[j][3]); + } + } + asm volatile("cp.async.wait_group 0;" ::: "memory"); + __syncthreads(); + + // Reuse the activation storage for maxima. Four lanes handle an n8 row. + auto* lo8 = reinterpret_cast(work); + auto* hi8 = lo8 + kWarps * MR * 16; + auto epilogue = [&](int row, float s0, float s1) { + if (row >= M) return; + const float norm = __ldg(norms + row); + const float b0 = __fmul_ru(r0, norm), b1 = __fmul_ru(r1, norm); + const float e0 = (fabsf(s0) + b0) * 0x1p-20f + kAbsSlop; + const float e1 = (fabsf(s1) + b1) * 0x1p-20f + kAbsSlop; + const float lo0 = n < v_real ? s0 - b0 - e0 : -INFINITY; + const float lo1 = n + 1 < v_real ? s1 - b1 - e1 : -INFINITY; + const float hi0 = n < v_real ? s0 + b0 + e0 : -INFINITY; + const float hi1 = n + 1 < v_real ? s1 + b1 + e1 : -INFINITY; + if (debug_s && live_tile) { + reinterpret_cast(debug_s + (size_t)row * V + n)[0] = make_float2(s0, s1); + reinterpret_cast(debug_lo + (size_t)row * V + n)[0] = make_float2(lo0, lo1); + reinterpret_cast(debug_hi + (size_t)row * V + n)[0] = make_float2(hi0, hi1); + } + float lo = fmaxf(lo0, lo1), hi = fmaxf(hi0, hi1); + const unsigned lanes = 0xfu << (4 * g); + lo = fmaxf(lo, __shfl_xor_sync(lanes, lo, 1)); + lo = fmaxf(lo, __shfl_xor_sync(lanes, lo, 2)); + hi = fmaxf(hi, __shfl_xor_sync(lanes, hi, 1)); + hi = fmaxf(hi, __shfl_xor_sync(lanes, hi, 2)); + if (t == 0) { + lo8[warp * MR * 16 + row] = lo; + hi8[warp * MR * 16 + row] = hi; + } + }; +#pragma unroll + for (int j = 0; j < MR; ++j) { + epilogue(16 * j + g, sum[j][0], sum[j][1]); + epilogue(16 * j + g + 8, sum[j][2], sum[j][3]); + } + __syncthreads(); + for (int i = threadIdx.x; i < M * (kCols / 16); i += kThreads) { + const int row = i / (kCols / 16), pair = i % (kCols / 16); + const int tile = blockIdx.x * (kCols / 16) + pair; + if (tile >= V / 16) continue; + const int a = 2 * pair * MR * 16 + row, b = a + MR * 16; + const size_t addr = (size_t)row * (V / 16) + tile; + lower[addr] = fmaxf(lo8[a], lo8[b]); + upper[addr] = fmaxf(hi8[a], hi8[b]); + } +} + +// (1 - z / 2^20)^(2^20) <= exp(-z). Use downward rounding at each +// operation on this nonnegative base, including the final FP32 conversion. +__device__ float derivative_lower(float L, float cap) { + const double z = __ddiv_ru(2.0 * (double)L, (double)cap); + if (!(z <= 32.0)) return 0.f; + double lower = __dsub_rd(1.0, z * 0x1p-20); + for (int i = 0; i < 20; ++i) lower = __dmul_rd(lower, lower); + return __double2float_rd(lower); +} + +__global__ void k_threshold(const float* lower, const float* upper, int ntiles, + float* threshold, int* state, float cap, float two_e, float dmax) { + // An earlier range failure can also suppress this block. The candidate + // pass ignores every threshold whenever any row has forced fallback. + __shared__ int reason; + if (threadIdx.x == 0) reason = atomicAdd(state, 0); + __syncthreads(); + if (reason != kCertified) return; + __shared__ float los[8], his[8]; + const int row = blockIdx.x; + float lo = -INFINITY, hi = -INFINITY; + const size_t base = (size_t)row * ntiles; + for (int i = threadIdx.x; i < ntiles; i += blockDim.x) { + lo = fmaxf(lo, lower[base + i]); + hi = fmaxf(hi, upper[base + i]); + } + lo = dsk::warp_max(lo); + hi = dsk::warp_max(hi); + if ((threadIdx.x & 31) == 0) { + los[threadIdx.x >> 5] = lo; + his[threadIdx.x >> 5] = hi; + } + __syncthreads(); + if (threadIdx.x < 32) { + lo = dsk::warp_max(threadIdx.x < 8 ? los[threadIdx.x] : -INFINITY); + hi = dsk::warp_max(threadIdx.x < 8 ? his[threadIdx.x] : -INFINITY); + if (threadIdx.x == 0) { + const float L = fmaxf(__fadd_ru(fabsf(lo), dmax), fabsf(hi)); + const float slope = derivative_lower(L, cap); + const float delta = __fdiv_ru(2.f * two_e, slope); + if (!(isfinite(lo) && isfinite(hi) && delta <= dmax)) + atomicOr(state, kUnsafe); + threshold[row] = __fsub_rd(lo, delta); + } + } +} + +// Compact the union once. The mask retains the m16 groups in which at least +// one row selected the tile. One reservation per warp with live candidates. +__global__ void k_candidates(const float* upper, const float* threshold, int M, int ntiles, + int* state, int* tiles, int* groups, int capacity) { + if (state[0] != kCertified) return; + __shared__ float thr[kMaxM]; + if (threadIdx.x < M) thr[threadIdx.x] = threshold[threadIdx.x]; + __syncthreads(); + const int tile = blockIdx.x * blockDim.x + threadIdx.x; + unsigned group_mask = 0; + if (tile < ntiles) { + for (int m = 0; m < M; ++m) { + if (upper[(size_t)m * ntiles + tile] >= thr[m]) group_mask |= 1u << (m / 16); + } + } + const unsigned selected = __ballot_sync(0xffffffffu, group_mask != 0); + if (!selected) return; + int start = 0; + const int lane = threadIdx.x & 31; + if (lane == 0) start = atomicAdd(state + 1, __popc(selected)); + start = __shfl_sync(0xffffffffu, start, 0); + if (group_mask) { + const int slot = start + __popc(selected & ((1u << lane) - 1)); + if (slot < capacity) { + tiles[slot] = tile; + groups[slot] = group_mask; + } + } +} + +__global__ void k_finish(int* state, int capacity, int ntiles) { + if (state[0] == kCertified && (state[1] > capacity || state[1] == ntiles || state[1] == 0)) + state[0] = kTooMany; +} + +} // namespace certwide diff --git a/recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_cert/csrc/screen6.cuh b/recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_cert/csrc/screen6.cuh new file mode 100644 index 0000000000000000000000000000000000000000..4383778e28d4c59b4d9fad0f02e3af15d35255c8 --- /dev/null +++ b/recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_cert/csrc/screen6.cuh @@ -0,0 +1,33 @@ +#pragma once + +#include +#include +#include +#include + +namespace screen6 { + +constexpr int kK = 2304; +constexpr int kStep = 64; +constexpr int kSteps = kK / kStep; +constexpr int kGroup = 192; +constexpr int kGroups = kK / kGroup; +constexpr int kStepsPerGroup = kGroup / kStep; +constexpr int kTileBytes = 384; +constexpr int kRowsCta = 16; +constexpr float kInfl = 1.0f + 1.0f / 65536.0f; +constexpr float kXAbs = 0x1p-58f; + +// q + 32 in [1, 63]. Form BF16(128 + q + 32) and subtract 160 exactly. +__device__ __forceinline__ uint32_t six_pair(uint32_t nib, uint32_t hi, int p) { + const uint32_t lo = (nib >> (4 * (p & 3))) & 0x000F000Fu; + const uint32_t h2 = ((hi >> (2 * p)) & 0x00030003u) << 4; + uint32_t v = lo | h2 | 0x43004300u; + const __nv_bfloat162 off = __floats2bfloat162_rn(160.f, 160.f); + __nv_bfloat162 r = __hsub2(*reinterpret_cast<__nv_bfloat162*>(&v), off); + return *reinterpret_cast(&r); +} + +__device__ __forceinline__ float half_to_float_u16(uint16_t h) { return __half2float(__ushort_as_half(h)); } + +} // namespace screen6 diff --git a/recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_cert/dflash.py b/recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_cert/dflash.py new file mode 100644 index 0000000000000000000000000000000000000000..9dd292c94815a079f42b35be87f56104ca17b797 --- /dev/null +++ b/recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_cert/dflash.py @@ -0,0 +1,212 @@ +"""inkling_cert on the DFLASH worker (SPEC=dflash2): the certified head (<= 16 rows) on greedy verify steps. + +DSpark arms the certified head from its verify epilogue (patches.patch_verify). The DFLASH worker has no such +epilogue: its accept runs eagerly after the target verify graph, as `argmax(next_token_logits)` on all-greedy +batches whose logits nothing else reads (DFlashWorkerV2._can_skip_verify_logits: no grammar, no logprobs, no +logit adjustments, no selector sample). This module: + + DFlashWorkerV2.forward_batch_generation records (worker, batch) for the step (a context variable) + TpModelWorker.forward_batch_generation on that step's target verify (is_verify=True): cert.on = + batch_ok(...) and _can_skip_verify_logits(batch, sampling_info), written + on the stream before the replay, and reset to 0 right after it, so no + other graph replay (prefill, the next step) ever reads a stale 1 + +The narrow certified head (<= 16 rows: c1 / c2 with 8-row verify blocks) writes pico's exact logits on every +candidate tile and -inf elsewhere, so the stock softcap / mask / argmax over next_token_logits returns the same +token as the full head, bit for bit, also for ragged verify layouts. + +The wide head (17..INKLING_CERT_WIDE_MAX_ROWS rows) returns the certified IDs and writes the logits buffer only on a +fallback. Its IDs are handed to the accept instead of argmax(next_token_logits): + patches._wide_logits (capture) WIDE_IDS[(logits data_ptr, rows)] = that graph's ID buffer + DecodeCudaGraphRunner._process_output_after_replay (target verify, every replay) REPLAY["ids"] = the ID buffer + of the graph that just replayed, looked up by its (padded) output logits + DFlashWorkerV2._accept_block on an armed step whose replay produced IDs: target_predict = ids[:bs * block] + (the stock greedy branch; with the verify cap's cutoff, AcceptGreedy) +Not with SGLANG_RAGGED_VERIFY_MODE=compact (rows not request-major): refused at patch time. +""" + +import contextvars +import functools +import sys + +import torch + +WORKER = "sglang.srt.speculative.dflash_worker_v2" +TP_WORKER = "sglang.srt.managers.tp_worker" +_STEP = contextvars.ContextVar("inkling_cert_dflash_step", default=None) +COUNTS = {"steps": 0, "armed": 0, "live_gather": 0, "wide_injected": 0} +WIDE_IDS = {} # (data_ptr, rows) of a captured target-verify logits buffer -> [certified-ID buffers] +REPLAY = {"ids": None, "wide": False} # the replayed target-verify graph's IDs; wide: it contained the wide head +ACTIVE = {"dflash": False} # set when the DFLASH worker is patched (this process serves DFLASH) + + +def _state(): + from . import patches + + return patches + + +def note_wide_ids(out, ids): + """patches._wide_logits, at capture (the IDs also ride on the returned logits object as _inkling_certwide_ids).""" + WIDE_IDS.setdefault((out.data_ptr(), int(out.shape[0])), []).append(ids) + + +def _replayed_ids(logits): + """(ids, wide) for a target-verify replay's padded output logits. The graph's static output object carries the + attribute when the logits processor returned our view unchanged; otherwise the (buffer, rows) registry is used + if exactly one captured graph matches. A wide graph whose IDs cannot be identified is fatal (its logits buffer + is not written on certified steps).""" + if not isinstance(logits, torch.Tensor) or logits.dim() != 2: + return None, False + ids = getattr(logits, "_inkling_certwide_ids", None) + if ids is not None: + return ids, True + found = WIDE_IDS.get((logits.data_ptr(), int(logits.shape[0]))) + if not found: + return None, False + if len(found) == 1: + return found[0], True + return None, True + + +def patch_runner(mod): + """Record which captured wide-certified graph (if any) a target-verify replay ran.""" + p = _state() + cls = getattr(mod, "DecodeCudaGraphRunner", None) + p._need(cls, ["_process_output_after_replay"], "DecodeCudaGraphRunner") + orig = cls._process_output_after_replay + if getattr(orig, "_inkling_cert", False): + return + + @functools.wraps(orig) + def _process_output_after_replay(self, output, forward_batch): + output = orig(self, output, forward_batch) + if self.capture_forward_mode.is_target_verify() and not self.model_runner.is_draft_worker: + REPLAY["ids"], REPLAY["wide"] = _replayed_ids(getattr(output, "next_token_logits", None)) + return output + + _process_output_after_replay._inkling_cert = True + cls._process_output_after_replay = _process_output_after_replay + p.STATE["patched"].append("DecodeCudaGraphRunner._process_output_after_replay (DFLASH wide IDs)") + + +def dead_rows_to_anchor(x2, cert): + """Under the verify cap (inkling_vcap on DFLASH: STATE.src_index, live row r <=> src_index[r] == r, dead rows + -> their request's anchor row, identity on uncapped steps), give every dead row its anchor's hidden row before + the certified head, so dead rows (whose hidden states the cap's expert remap made meaningless) add no candidate + tiles of their own and cannot force a fallback. Captured into the verify graph; selected on the device: + with cert.on == 0 (the full head serves, e.g. sampled steps) the rows stay as they are, bit for bit. + Exact for every row an accept reads: live rows keep their own hidden rows, and the cap's cutoff never reads a + dead row's token (_accept_block's cutoff_verify_lens).""" + if not ACTIVE["dflash"]: + return x2 + vs = sys.modules.get("inkling_vcap.state") + st = getattr(vs, "STATE", None) + src = getattr(st, "src_index", None) + stride = int(getattr(st, "stride", 0) or 0) + m = x2.shape[0] + if (not isinstance(src, torch.Tensor) or not src.is_cuda or src.dtype != torch.int64 or src.numel() < m + or src.device != x2.device or stride <= 0 or m % stride): + return x2 + # src_index addresses the uniform request-major layout (stride rows per request); a compact ragged verify packs + # rows differently, so the gather is only used without it + try: + from sglang.srt.speculative.ragged_verify import ragged_verify_compact_enabled + + if ragged_verify_compact_enabled(): + return x2 + except ImportError: + return x2 + COUNTS["live_gather"] += 1 + gathered = x2.index_select(0, src[:m]) + return torch.where(cert.on.view(1, 1) != 0, gathered, x2) + + +def patch_worker(mod): + p = _state() + p._need(mod, ["DFlashWorkerV2"], WORKER) + cls = mod.DFlashWorkerV2 + p._need(cls, ["forward_batch_generation", "_can_skip_verify_logits"], f"{WORKER}.DFlashWorkerV2") + if getattr(cls.forward_batch_generation, "_inkling_cert", False): + return + p._need(cls, ["_accept_block"], f"{WORKER}.DFlashWorkerV2") + if p.STATE["cfg"].get("wide"): + from sglang.srt.speculative.ragged_verify import ragged_verify_compact_enabled + + if ragged_verify_compact_enabled(): + raise p.ops.CertFatal("inkling_cert: INKLING_CERT_WIDE with SGLANG_RAGGED_VERIFY_MODE=compact under DFLASH " + "(the certified IDs are request-major)") + fbg, accept = cls.forward_batch_generation, cls._accept_block + ACTIVE["dflash"] = True + + @functools.wraps(fbg) + def forward_batch_generation(self, batch, *args, **kwargs): + token = _STEP.set((self, batch, {"armed": False})) + try: + return fbg(self, batch, *args, **kwargs) + finally: + _STEP.reset(token) + + @functools.wraps(accept) + def _accept_block(self, *args, **kwargs): + ids = REPLAY["ids"] + step = _STEP.get() + armed = step is not None and step[2]["armed"] + if armed and REPLAY["wide"] and ids is None: + raise p.ops.CertFatal("inkling_cert: a wide-certified verify graph replayed but its IDs are ambiguous") + if (ids is not None and armed and kwargs.get("target_predict") is None + and kwargs.get("verify_shard") is None): + n = int(kwargs["bs"]) * int(self.block_size) + if ids.shape[0] < n: + raise p.ops.CertFatal("inkling_cert: certified IDs shorter than the verify block") + kwargs["target_predict"] = ids[:n] + COUNTS["wide_injected"] += 1 + return accept(self, *args, **kwargs) + + forward_batch_generation._inkling_cert = True + _accept_block._inkling_cert = True + cls.forward_batch_generation = forward_batch_generation + cls._accept_block = _accept_block + p.STATE["patched"].append("DFlashWorkerV2.forward_batch_generation/_accept_block") + + +def patch_tp_worker(mod): + p = _state() + p._need(mod, ["TpModelWorker"], TP_WORKER) + cls = mod.TpModelWorker + p._need(cls, ["forward_batch_generation"], f"{TP_WORKER}.TpModelWorker") + orig = cls.forward_batch_generation + if getattr(orig, "_inkling_cert_dflash", False): + return + + @functools.wraps(orig) + def forward_batch_generation(self, *args, **kwargs): + step = _STEP.get() + cert = p.STATE["cert"] + if step is None or cert is None or not kwargs.get("is_verify", False): + return orig(self, *args, **kwargs) + worker, batch, flags = step + si = getattr(batch, "sampling_info", None) + # mode "check" serves pico's full head and builds the certified result beside it (cert.run_check) + armed = bool(p.STATE["mode"] in ("1", "check") and p.STATE["disabled"] is None and p.batch_ok(batch, si) + and worker._can_skip_verify_logits(batch, si)) + COUNTS["steps"] += 1 + COUNTS["armed"] += armed + p.STATE["calls"] += 1 + every = p.STATE["cfg"]["log_every"] + if every and p.STATE["calls"] % every == 0: + p._report(cert) + flags["armed"] = armed + REPLAY["ids"], REPLAY["wide"] = None, False # set again only by a captured target-verify replay + cert.set_on(armed) + try: + out = orig(self, *args, **kwargs) + finally: + cert.set_on(0) # enqueued after the replay: no later replay reads a stale 1 + if not armed: + REPLAY["ids"], REPLAY["wide"] = None, False + return out + + forward_batch_generation._inkling_cert_dflash = True + cls.forward_batch_generation = forward_batch_generation + p.STATE["patched"].append("TpModelWorker.forward_batch_generation (DFLASH verify arming)") diff --git a/recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_cert/ops.py b/recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_cert/ops.py new file mode 100644 index 0000000000000000000000000000000000000000..8ba063556464d533fb82a712fdb9900aaa457e06 --- /dev/null +++ b/recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_cert/ops.py @@ -0,0 +1,84 @@ +"""Per-call device work of the certified head (graph-safe: fixed launches, no host sync, no allocation besides +torch.empty in the graph pool) and the start-up self-test. + +Cert.run(x2, out, on) launches screen (k_screen, k_rowmax, k_select) and exact (k_exact): out holds pico's FP32 +logits on the candidate tiles and -inf elsewhere when the device flag `on` is 1 and the step is certifiable, and +pico's logits everywhere otherwise (the masked kernel then runs every tile: the full head, the same bits). +""" + +import torch + +from . import cert_math + +K = cert_math.K +MAX_ROWS = 16 + + +class CertFatal(BaseException): + """A broken patch target or an impossible state (not caught by `except Exception`).""" + + +class Cert: + def __init__(self, ext, pack, tables, wk, device): + self.ext, self.pack, self.wk = ext, pack, int(wk) + self.V = int(pack.n) + if pack.k != K or self.V % 16: + raise CertFatal(f"inkling_cert: head [{pack.n}x{pack.k}] is not [16n x {K}]") + self.q, self.sc, self.rt, self.nv = tables["q"], tables["sc"], tables["rt"], tables["nv"] + self.eps = float(tables["eps"]) + self.ncta = self.V // 16 + f32, i32 = torch.float32, torch.int32 + self.lt = torch.empty((MAX_ROWS, self.ncta), dtype=f32, device=device) + self.ht = torch.empty((MAX_ROWS, self.ncta), dtype=f32, device=device) + self.tm = torch.empty((MAX_ROWS,), dtype=f32, device=device) + self.hm = torch.empty((MAX_ROWS,), dtype=f32, device=device) + self.on = torch.zeros((1,), dtype=i32, device=device) # host-written before each verify replay + self.off = torch.zeros((1,), dtype=i32, device=device) # eager calls: always the full head + self.force = torch.ones((1,), dtype=i32, device=device) # tests / self-test: certify if possible + self.flags = torch.zeros((4,), dtype=i32, device=device) + self.mask = torch.empty((self.ncta,), dtype=torch.uint8, device=device) + # stats: 0 candidate tiles on certified steps, 1 certified steps, 2 eligible but not certifiable, + # 3 (unused), 4 steps with on = 0, 5 rows checked, 6 token mismatches (check mode), 7 check steps + self.stats = torch.zeros((8,), dtype=torch.int64, device=device) + self.on_host = 0 + self._empty = torch.empty((0,), dtype=f32, device=device) + self.warm = set() + + @property + def screen_bytes(self): + return sum(t.numel() * t.element_size() for t in (self.q, self.sc, self.rt, self.nv)) + + def set_on(self, v): + v = 1 if v else 0 + if v != self.on_host: + self.on.fill_(v) + self.on_host = v + + def screen(self, x2, on, v_real, cap, sdbg=None, bdbg=None): + e = self._empty + self.ext.screen(x2, self.q, self.sc, self.rt, self.nv, self.V, int(v_real), cert_math.CN, self.lt, self.ht, + self.tm, self.hm, on, self.flags, self.mask, self.stats, float(cap), cert_math.TWO_E, + cert_math.DMAX, e if sdbg is None else sdbg, e if bdbg is None else bdbg) + + def run(self, x2, out, on, v_real, cap): + self.screen(x2, on, v_real, cap) + self.ext.exact(x2, self.pack.buf, self.V, K, self.mask, out, self.wk, self.flags) + return out + + def run_check(self, x2, out, on, v_real, cap, full_fn, softcap_fn, argmax_fn): + """Check mode: out gets pico's full head (what is served); the certified buffer is built beside it and both + go through the stock softcap, padding mask and argmax; mismatching rows of certified steps are counted.""" + c = torch.empty_like(out) + self.run(x2, c, on, v_real, cap) + full_fn(x2, out) + a = c.clone() + b = out.clone() + softcap_fn(a, cap) + softcap_fn(b, cap) + a[:, v_real:] = float("-inf") + b[:, v_real:] = float("-inf") + cert = self.flags[2:3].to(torch.int64) + self.stats[5:6].add_(cert * x2.shape[0]) + self.stats[6:7].add_((argmax_fn(a) != argmax_fn(b)).sum().view(1) * cert) + self.stats[7:8].add_(cert) + return out diff --git a/recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_cert/patches.py b/recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_cert/patches.py new file mode 100644 index 0000000000000000000000000000000000000000..44dfe932798702ed280635d74035d6d6de36eabc --- /dev/null +++ b/recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_cert/patches.py @@ -0,0 +1,566 @@ +"""SGLang patch points of inkling_cert (README.md has the table and the argument). + + inkling2 Inkling2LogitsProcessor._get_logits: marks target-verify calls (the only ones the certificate takes) + Inkling2ForConditionalGeneration.post_load_weights: builds the 6-bit copy and the bound tables after + inkling_pico12 coded the head, then runs the start-up self-test + unquant sm12x_fp32_lm_head: target-verify calls that pico's `lmhead` takes (1-16 rows) go through the + certified head; everything else to the wrapped function (pico's, which wraps the stock one) + dspark_verify DsparkVerifyEpilogue.begin_static_step / begin_step: remember whether the step arms the in-graph + greedy accept; TargetVerifyExecutor.run_non_compact: writes the device flag `on` before the replay +""" + +import functools +import os +import sys +import time + +import torch + +from . import build, cert_math, ops, quant + +K = cert_math.K +UNQUANT = "sglang.srt.layers.quantization.unquant" +MODEL = "sglang.srt.models.inkling2" +VERIFY = "sglang.srt.speculative.dspark_components.dspark_verify" + +# Debug observers that read the verify logits after a folded greedy accept (dspark_observability.py) +OBSERVER_ENVS = ("SGLANG_DSPARK_STS_COLLECT_PATH", "SGLANG_DSPARK_DEBUG_CONFIDENCE_METRICS", + "SGLANG_DSPARK_DEBUG_DUMP", "SGLANG_DSPARK_ENABLE_SPS_RECORD") + +STATE = {"mode": "1", "cfg": None, "log": None, "patched": [], "cert": None, "disabled": None, "calls": 0} +CTX = {"lp": None} # the Inkling2LogitsProcessor of the target-verify call in progress +EXIT = os._exit + + +def _log(msg): + (STATE["log"] or (lambda m: sys.stderr.write(m + "\n")))(msg) + + +def _need(owner, names, where): + missing = [n for n in names if getattr(owner, n, None) is None] + if missing: + raise ops.CertFatal(f"inkling_cert: patch target {where} lacks {missing}") + + +def _guarded(fn): + @functools.wraps(fn) + def run(*args, **kwargs): + try: + return fn(*args, **kwargs) + except (KeyboardInterrupt, SystemExit): + raise + except BaseException as exc: # noqa: BLE001 + _log(f"FATAL: {exc!r}") + EXIT(78) + + return run + + +def _disable(why): + if STATE["disabled"] is None: + STATE["disabled"] = why + _log(f"disabled: {why}; the head runs unchanged") + + +def _pico(): + """inkling_pico12's patches / ops modules, or None when its `lmhead` lever is not armed.""" + pp = sys.modules.get("inkling_pico12.patches") + po = sys.modules.get("inkling_pico12.ops") + if pp is None or po is None or "lmhead" not in tuple(pp.STATE.get("levers", ())): + return None, None + return pp, po + + +# ---- inkling2: verify context and table build ------------------------------------------------------------------ + + +def make_get_logits(inner): + def _get_logits(self, hidden_states, lm_head, logits_metadata, *args, **kwargs): + mode = getattr(logits_metadata, "forward_mode", None) + verify = mode is not None and mode.is_target_verify() + if verify: + result = _wide_logits(self, hidden_states, lm_head, logits_metadata, *args, **kwargs) + if result is not None: + return result + prev = CTX["lp"] + CTX["lp"] = self if verify else None + try: + return inner(self, hidden_states, lm_head, logits_metadata, *args, **kwargs) + finally: + CTX["lp"] = prev + + _get_logits.__wrapped__ = inner + _get_logits._inkling_cert = True + return _get_logits + + +def _wide_modules(): + return sys.modules.get("inkling_wide.patches"), sys.modules.get("inkling_wide.ops") + + +def _wide_logits(lp, x, head, meta, embedding_bias=None, use_logits_buffer=True): + cert = STATE["cert"] + wide = getattr(cert, "wide", None) + if (wide is None or STATE["disabled"] is not None or STATE["mode"] != "1" + or not x.is_cuda or not torch.cuda.is_current_stream_capturing()): + return None + from . import certwide + + wp, wo = _wide_modules() + weight = getattr(head, "weight", None) + entry = wide.entry + m = wo.rows_of(x) + if (not certwide.MIN_ROWS <= m <= min(certwide.MAX_ROWS, STATE["cfg"].get("wide_max_rows", certwide.MAX_ROWS)) + or x.dim() != 2 + or not isinstance(weight, torch.Tensor) or wp.HEADS.get(weight.data_ptr()) is not entry + or tuple(weight.shape) != (entry.n, entry.k) or not wo.eligible(x, entry) + or wo.choose_split(entry.n, entry.k, m, entry.kind) != 1): + return None + if (embedding_bias is not None or not getattr(lp, "use_fp32_lm_head", False) + or getattr(lp, "shard_softcap", None) != cert_math.CAP + or getattr(lp, "logit_scale", None) is not None + or getattr(lp, "final_logit_softcapping", None) is not None + or getattr(lp, "do_tensor_parallel_all_gather", False) + or getattr(lp, "do_tensor_parallel_all_gather_dp_attn", False) + or getattr(lp, "vocab_size", None) != entry.n + or getattr(meta, "extend_return_logprob", False) + or hasattr(head, "set_lora")): + return None + from sglang.srt.layers.logits_processor import should_apply_lm_head_quant_method + + if should_apply_lm_head_quant_method(head, getattr(head, "quant_method", None)): + return None + v_real = int(lp.config.vocab_size) + if not 0 < v_real <= entry.n: + return None + out = meta.next_token_logits_buffer if use_logits_buffer else None + # The stock implementation discards a buffer with a different shape. + if out is not None and tuple(out.shape) != (m, entry.n): + out = None + if out is None: + out = torch.empty((m, entry.n), dtype=torch.float32, device=x.device) + if (not wo.out_ok(out, m, entry, torch.float32, x.device) or out.data_ptr() % 32 + or not out.is_contiguous()): + return None + # The tensor is the graph's existing fallback buffer. Its attribute is + # consumed at capture by the folded accept, which records the ID pointer. + out = out.view_as(out) # keep the attribute off the graph's shared buffer object + out._inkling_certwide_ids = wide.run(wo.as_rows(x, entry.k), out, cert.on, v_real, wo.SET) + from . import dflash + + dflash.note_wide_ids(out, out._inkling_certwide_ids) # DFLASH: the eager accept looks them up after replay + return out + + +def _prepare_wide(cert, w, lp, tables): + from . import certwide + + wp, wo = _wide_modules() + entry = wp.HEADS.get(w.data_ptr()) if wp is not None else None + if entry is None or entry.fmt != wo.BF16X or entry.pack is not cert.pack: + raise ops.CertFatal("inkling_certwide: needs the wide head registered with pico's packed weights") + if wo.choose_split(entry.n, entry.k, certwide.MAX_ROWS, entry.kind) != 1: + raise ops.CertFatal("inkling_certwide: needs the unsplit packed wide head") + if getattr(cert, "wide", None) is None: + cert.wide = certwide.CertWide(cert.ext, wo.EXT, entry, tables) + else: + cert.wide.refresh(entry, tables) + + cert.wide.counting = False # the self-tests below are not served steps + with torch.inference_mode(): + # Warm the CUDA/Triton paths before capture. Use peaked BF16 rows so + # the sparse arithmetic and the forced full fallback are both checked. + for m in (17, 33, 64, 96, 128, 192): + x = (w[:m].float() * 60).to(torch.bfloat16) + out = torch.empty((m, entry.n), dtype=torch.float32, device=w.device) + ref = torch.empty_like(out) + wo.gemm(x, entry, ref, m) + v_real = int(lp.config.vocab_size) + expected = _softcap_argmax(ref, v_real) + for on in (cert.force, cert.off): + ids = cert.wide.run(x, out, on, v_real, wo.SET) + if not torch.equal(ids, expected): + raise ops.CertFatal(f"inkling_certwide: M={m} self-test token mismatch") + if on is cert.off and not torch.equal(out.view(torch.int32), ref.view(torch.int32)): + raise ops.CertFatal(f"inkling_certwide: M={m} fallback logit mismatch") + cert.wide.counting = True + if STATE["cfg"].get("wide_stats") and cert.wide.stats is None: # once: graphs capture the counter address + cert.wide.enable_stats() + _log(f"wide certified packed head armed (17–{STATE['cfg'].get('wide_max_rows', certwide.MAX_ROWS)} rows, " + f"compact capacity {cert.wide.capacity} tiles{', outcome stats on' if cert.wide.stats is not None else ''})") + + +def prepare(model): + if STATE["mode"] == "0": + return + for env in OBSERVER_ENVS: + if os.environ.get(env, "").strip() not in ("", "0", "false", "False"): + _disable(f"{env} is set (that observer reads the verify logits)") + return + pp, po = _pico() + if pp is None: + raise ops.CertFatal("inkling_cert: needs INKLING_PICO12 with `lmhead` (pico's GEMV is the exact pass)") + lm_head = getattr(getattr(model, "llm", None), "lm_head", None) + w = getattr(lm_head, "weight", None) + pack = pp.HEADS.get(w.data_ptr()) if isinstance(w, torch.Tensor) else None + if pack is None: + raise ops.CertFatal("inkling_cert: inkling_pico12 has not coded the head (hook order: pico12 must come first)") + try: + from sglang.srt.distributed import get_tensor_model_parallel_world_size + + tp = get_tensor_model_parallel_world_size() + except Exception: # noqa: BLE001 + tp = 1 + if tp != 1: + _disable(f"tensor parallel size {tp} (TP1 only)") + return + unq = sys.modules.get(UNQUANT) + if unq is None or not getattr(unq.sm12x_fp32_lm_head, "_inkling_cert", False): + raise ops.CertFatal("inkling_cert: unquant.sm12x_fp32_lm_head is not ours (another overlay wrapped it after us)") + t0 = time.monotonic() + ext = build.load(STATE["cfg"]["cache_dir"]) + t_ext = time.monotonic() - t0 + old = STATE["cert"] + _require_wide_replay_stream() + tables = quant.build_tables(w.data) + if old is not None: # a reload: refresh in place (captured graphs hold these pointers) + for name in ("q", "sc", "rt", "nv"): + getattr(old, name).copy_(tables[name]) + old.pack = pack + cert = old + else: + cert = ops.Cert(ext, pack, tables, po.SET.wk, w.device) + lp = getattr(getattr(model, "llm", None), "logits_processor", None) + if STATE["cfg"].get("wide"): + _prepare_wide(cert, w, lp, tables) + del tables + if torch.cuda.is_available(): + torch.cuda.empty_cache() + selftest(cert, po, v_real=int(getattr(getattr(lp, "config", None), "vocab_size", 0) or 0) or None) + STATE["cert"] = cert + info = build.INFO + _log(f"active (mode {STATE['mode']}): 6-bit screen of the [{cert.V}x{K}] head, {cert.screen_bytes / 1e6:.1f} MB " + f"read per certified step (pico's coded head: {pack.nbytes / 1e6:.1f} MB), eps {cert.eps * 100:.2f} %; " + f"patched {', '.join(STATE['patched'])}; ext {'reused' if info.get('cached') else 'built'} in {t_ext:.1f} s; " + f"tables {time.monotonic() - t0 - t_ext:.1f} s; wk={cert.wk}") + + +@torch.inference_mode() +def selftest(cert, po, v_real=None, n=4): + """Start-up check on random rows (M = 8 and 16): the not-certified path equals pico's full head bit for bit, + the certified path gives the full head's softcapped argmax. Also loads every kernel before graph capture.""" + dev = cert.q.device + g = torch.Generator(device=dev) + g.manual_seed(1234) + v_real = v_real or cert.V + for m in (8, 16): + for i in range(n): + x = (torch.randn((m, K), generator=g, device=dev) * (1.0 + i)).to(torch.bfloat16) + ref = torch.empty((m, cert.V), dtype=torch.float32, device=dev) + po.gemv(x, cert.pack, ref) + a = torch.empty_like(ref) + cert.run(x, a, cert.off, v_real, cert_math.CAP) + if not torch.equal(a.view(torch.int32), ref.view(torch.int32)): + raise ops.CertFatal(f"inkling_cert: self-test M={m}: the full fallback differs from pico's head") + b = torch.empty_like(ref) + cert.run(x, b, cert.force, v_real, cert_math.CAP) + ta = _softcap_argmax(b, v_real) + tb = _softcap_argmax(ref.clone(), v_real) + if not torch.equal(ta, tb): + raise ops.CertFatal(f"inkling_cert: self-test M={m}: certified argmax differs from the full head") + cert.stats.zero_() + torch.cuda.synchronize() + + +def _softcap_argmax(logits, v_real, cap=cert_math.CAP): + sc, am = _stock_fns() + sc(logits, cap) + logits[:, v_real:] = float("-inf") + return am(logits) + + +_FNS = [] + + +def _stock_fns(): + if not _FNS: + from sglang.kernels.ops.activation.softcap import softcap_inplace_logits + from sglang.kernels.ops.sampling import argmax as sampling_argmax + + _FNS.extend([softcap_inplace_logits, sampling_argmax]) + return _FNS[0], _FNS[1] + + +def patch_model(mod): + _need(mod, ["Inkling2LogitsProcessor", "Inkling2ForConditionalGeneration"], MODEL) + lp_cls = mod.Inkling2LogitsProcessor + _need(lp_cls, ["_get_logits", "_compute_lm_head"], f"{MODEL}.Inkling2LogitsProcessor") + if not getattr(lp_cls._get_logits, "_inkling_cert", False): + lp_cls._get_logits = make_get_logits(lp_cls._get_logits) + STATE["patched"].append("Inkling2LogitsProcessor._get_logits") + cls = mod.Inkling2ForConditionalGeneration + _need(cls, ["post_load_weights"], f"{MODEL}.Inkling2ForConditionalGeneration") + orig = cls.post_load_weights + if getattr(orig, "_inkling_cert", False): + return + + @functools.wraps(orig) + def post_load_weights(self, *args, **kwargs): + result = orig(self, *args, **kwargs) # inkling_pico12 (if armed before us) codes the head in here + _guarded(prepare)(self) + return result + + post_load_weights._inkling_cert = True + cls.post_load_weights = post_load_weights + STATE["patched"].append("Inkling2ForConditionalGeneration.post_load_weights") + + +# ---- unquant: the head --------------------------------------------------------------------------------------- + + +def _eligible(lp, x, weight, out, cert): + """Our call iff pico's `lmhead` would take it (the reference bits are pico's) and the processor is as assumed.""" + pp, po = _pico() + if pp is None or cert is None: + return None + pack = pp.HEADS.get(weight.data_ptr()) if isinstance(weight, torch.Tensor) else None + if pack is None or pack is not cert.pack or tuple(weight.shape) != (pack.n, pack.k): + return None + m = po.rows_of(x) + if not (1 <= m <= ops.MAX_ROWS) or not po.eligible(x, pack): + return None + if out is not None and not po.out_ok(out, m, pack, torch.float32, x.device): + return None + cap = getattr(lp, "shard_softcap", None) + if cap is None or float(cap) != cert_math.CAP or getattr(lp, "logit_scale", None) is not None: + _disable(f"logits processor softcap {cap!r} / logit_scale {getattr(lp, 'logit_scale', None)!r} not as assumed") + return None + if getattr(lp, "do_tensor_parallel_all_gather", False) or getattr(lp, "do_tensor_parallel_all_gather_dp_attn", False): + _disable("logits gather across ranks") + return None + v_real = int(getattr(getattr(lp, "config", None), "vocab_size", 0) or 0) + if not 0 < v_real <= pack.n: + _disable(f"vocab_size {v_real} not in (0, {pack.n}]") + return None + return po, pack, m, v_real + + +def make_lm_head(inner): + def sm12x_fp32_lm_head(x, weight, out): + lp = CTX["lp"] + cert = STATE["cert"] + if lp is None or cert is None or STATE["disabled"] is not None or STATE["mode"] == "0": + return inner(x, weight, out) + got = _eligible(lp, x, weight, out, cert) + if got is None: + return inner(x, weight, out) + po, pack, m, v_real = got + capturing = x.is_cuda and torch.cuda.is_current_stream_capturing() + if not capturing: + # eager target verify (warm-up, or a batch without a graph): pico's full head; the first call per row + # bucket goes through the kernels (full fallback, the same bits) so every launch is loaded before capture + bucket = 8 if m <= 8 else 16 + if bucket in cert.warm: + return inner(x, weight, out) + cert.warm.add(bucket) + lead = x.shape[:-1] + x2 = po.as_rows(x, K) + if out is None: + out = torch.empty((m, pack.n), dtype=torch.float32, device=x.device) + on = cert.on if capturing else cert.off + if capturing: + from . import dflash + + x2 = dflash.dead_rows_to_anchor(x2, cert) # DFLASH + verify cap only; identity otherwise + if STATE["mode"] == "check": + sc, am = _stock_fns() + cert.run_check(x2, out, on, v_real, cert_math.CAP, lambda xx, oo: po.gemv(xx, pack, oo), sc, am) + else: + cert.run(x2, out, on, v_real, cert_math.CAP) + return out.view(*lead, pack.n) + + sm12x_fp32_lm_head.__wrapped__ = inner + sm12x_fp32_lm_head._inkling_cert = True + # keep pico's marker visible so that its own hook (if it runs again) does not wrap a second time + sm12x_fp32_lm_head._pico12 = getattr(inner, "_pico12", False) or _over_pico(inner) + sm12x_fp32_lm_head._wide = getattr(inner, "_wide", False) # inkling_wide's hook must not wrap again + return sm12x_fp32_lm_head + + +def _over_pico(fn): + """True if fn is pico12's head function, or inkling_wide's wrapper directly over it (wide takes only + 17..256 rows; every call cert serves or falls back on has <= 16 rows and reaches pico's function).""" + if getattr(fn, "_pico12", False): + return True + return bool(getattr(fn, "_wide", False)) and getattr(getattr(fn, "__wrapped__", None), "_pico12", False) + + +def patch_unquant(mod): + _need(mod, ["sm12x_fp32_lm_head", "sm12x_fp32_lm_head_applies"], UNQUANT) + if getattr(mod.sm12x_fp32_lm_head, "_inkling_cert", False): + return + if not _over_pico(mod.sm12x_fp32_lm_head): + raise ops.CertFatal("inkling_cert: unquant.sm12x_fp32_lm_head is not inkling_pico12's (arm INKLING_PICO12 with " + "lmhead, before INKLING_CERT_HEAD)") + mod.sm12x_fp32_lm_head = make_lm_head(mod.sm12x_fp32_lm_head) + STATE["patched"].append("unquant.sm12x_fp32_lm_head (outside inkling_pico12)") + + +# ---- dspark_verify: the per-step device flag ------------------------------------------------------------------- + + +def _sampling_ok(si): + if si is None: + return True + return (bool(getattr(si, "is_all_greedy", False)) and not getattr(si, "has_watermark_candidates", False) + and getattr(si, "sampling_mask_batch_indices", None) is None) + + +def batch_ok(batch, sampling_info): + """Host-side conditions beyond the epilogue's own arming (fold_eligible: all greedy, no logit adjustments, no + grammar): nothing after the folded accept may read the verify logits. Both the sampling info the worker passes + and the batch's own are checked (simulated acceptance can pass None while the batch samples).""" + if getattr(batch, "return_logprob", False) or getattr(batch, "has_grammar", False): + return False + return _sampling_ok(sampling_info) and _sampling_ok(getattr(batch, "sampling_info", None)) + + +def _patch_wide_accept(mod): + _need(mod, ["AcceptGreedy", "sampling_argmax"], VERIFY) + original_argmax = mod.sampling_argmax + original_accept = mod.AcceptGreedy + + def sampling_argmax(logits): + ids = getattr(logits, "_inkling_certwide_ids", None) + return original_argmax(logits) if ids is None else ids + + class AcceptGreedy(original_accept): + @classmethod + def execute(cls, *args, **kwargs): + logits = kwargs.get("target_logits") + ids = getattr(logits, "_inkling_certwide_ids", None) + if ids is not None and kwargs.get("target_predict") is None: + kwargs["target_predict"] = ids + return original_accept.execute(*args, **kwargs) + + # Both the fused static tail and the ordinary accept (also used by vcap) + # get their predictions from the same capture output tensor. + mod.sampling_argmax = sampling_argmax + mod.AcceptGreedy = AcceptGreedy + + +def _require_wide_replay_stream(): + wide = getattr(STATE["cert"], "wide", None) + if wide is not None: + wide.require_replay_stream() + + +def patch_graph_runner(mod): + cls = mod.DecodeCudaGraphRunner + orig = cls.execute + if getattr(orig, "_inkling_certwide", False): + return + + @functools.wraps(orig) + def execute(self, *args, **kwargs): + if self.capture_forward_mode.is_target_verify() and not self.model_runner.is_draft_worker: + _require_wide_replay_stream() + return orig(self, *args, **kwargs) + + execute._inkling_certwide = True + cls.execute = execute + STATE["patched"].append("DecodeCudaGraphRunner.execute") + from . import dflash + + dflash.patch_runner(mod) + + +def patch_verify(mod): + _need(mod, ["DsparkVerifyEpilogue", "TargetVerifyExecutor"], VERIFY) + ep = mod.DsparkVerifyEpilogue + ex = mod.TargetVerifyExecutor + _need(ep, ["begin_static_step", "begin_step"], f"{VERIFY}.DsparkVerifyEpilogue") + _need(ex, ["run_non_compact"], f"{VERIFY}.TargetVerifyExecutor") + if getattr(ex.run_non_compact, "_inkling_cert", False): + return + if STATE["cfg"].get("wide"): + _patch_wide_accept(mod) + b_static, b_step, run = ep.begin_static_step, ep.begin_step, ex.run_non_compact + + @functools.wraps(b_static) + def begin_static_step(self, bs, armed): + _require_wide_replay_stream() + self.__dict__["_inkling_cert_armed"] = bool(armed) + return b_static(self, bs, armed) + + @functools.wraps(b_step) + def begin_step(self, verify_lens, armed): + _require_wide_replay_stream() + self.__dict__["_inkling_cert_armed"] = False + cert = STATE["cert"] + if cert is not None: + cert.set_on(0) + return b_step(self, verify_lens, armed) + + @functools.wraps(run) + def run_non_compact(self, *, batch, sampling_info, **kwargs): + cert = STATE["cert"] + if cert is not None: + epi = getattr(self, "verify_epilogue", None) + armed = epi is not None and bool(epi.__dict__.get("_inkling_cert_armed", False)) + # SGLANG_SIMULATE_ACC_LEN (a benchmark mode; its folded bonus may be sampled): never certify + simulated = getattr(self, "_simulated_correct_len", None) is not None or bool(getattr(epi, "simulate_fold", False)) + _require_wide_replay_stream() + cert.set_on(armed and not simulated and STATE["disabled"] is None and batch_ok(batch, sampling_info)) + STATE["calls"] += 1 + every = STATE["cfg"]["log_every"] + if every and STATE["calls"] % every == 0: + _report(cert) + return run(self, batch=batch, sampling_info=sampling_info, **kwargs) + + for f in (begin_static_step, begin_step, run_non_compact): + f._inkling_cert = True + ep.begin_static_step, ep.begin_step, ex.run_non_compact = begin_static_step, begin_step, run_non_compact + STATE["patched"].append("DsparkVerifyEpilogue.begin_static_step/begin_step, TargetVerifyExecutor.run_non_compact") + + +_PINNED = {} + + +def _report(cert): + """Print the counters copied at the previous report (no sync), then start the next copy.""" + prev = _PINNED.get("buf") + if prev is not None and _PINNED.get("ev") is not None and _PINNED["ev"].query(): + s = prev.tolist() + cert_steps = max(s[1], 1) + line = (f"steps certified {s[1]} (tiles/step {s[0] / cert_steps:.1f}), not certifiable {s[2]}, " + f"not eligible {s[4]}") + if STATE["mode"] == "check": + line += f"; check: {s[7]} steps, {s[5]} rows, mismatches {s[6]}" + _log(line) + wprev = _PINNED.get("wbuf") + if wprev is not None: + _log("wide outcomes " + getattr(cert, "wide").describe_stats(wprev)) + if prev is None: + _PINNED["buf"] = torch.zeros((8,), dtype=torch.int64, pin_memory=True) + wide = getattr(cert, "wide", None) + if wide is not None and wide.stats is not None: + _PINNED["wbuf"] = torch.zeros(wide.stats.shape, dtype=torch.int64, pin_memory=True) + _PINNED["buf"].copy_(cert.stats, non_blocking=True) + if _PINNED.get("wbuf") is not None: + _PINNED["wbuf"].copy_(cert.wide.stats, non_blocking=True) + ev = torch.cuda.Event() + ev.record() + _PINNED["ev"] = ev + + +def patch_dflash_worker(mod): + from . import dflash + + dflash.patch_worker(mod) + + +def patch_dflash_tp_worker(mod): + from . import dflash + + dflash.patch_tp_worker(mod) diff --git a/recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_cert/quant.py b/recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_cert/quant.py new file mode 100644 index 0000000000000000000000000000000000000000..dd9ae9a362906425a78d2657eeca3fa81353d6d0 --- /dev/null +++ b/recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_cert/quant.py @@ -0,0 +1,124 @@ +"""The screening copy of the LM head and its bound tables (load time; torch, on the weight's device). + +Format (cert_ext.cu reads exactly this): + q int in [-31, 31], one FP16 scale per (row, 192-value group): D[v, k] = sc[g, v] * q[v, k] (real numbers) + Q uint8 [V/8 tiles][36 steps][384 B]: per (8-row tile, 64-value step), lane l = 4 * row + t (t = 0..3) holds the + row's values 16t .. 16t + 15 as u = q + 32 (0..63): bytes [8l, 8l + 8) the low nibbles, bytes [256 + 4l, + 4) + the high two bits. Nibble word h (h = 0, 1; bytes 8l + 4h ..): nibble slot j (bits 4j) = value 2(4h + j), slot + j + 4 = value 2(4h + j) + 1. High word: slot p (bits 2p) = value 2p, slot p + 8 = value 2p + 1 (p = 0..7). + sc fp16 [12][V] scales, rounded up so that 31 * sc >= the group's max |w| + rt fp16 [12][V] ||W_vg - D_vg||_2, computed in float64, rounded up + nv fp32 [V] max(||W_v||, ||D_v||), float64, rounded up +""" + +import torch + +K = 2304 +GROUP = 192 +NGROUPS = K // GROUP +STEP = 64 +STEPS = K // STEP +QMAX = 31 + + +def round_up_f32(x64): + """float64 (>= 0 or inf) -> the smallest fp32 >= x.""" + f = x64.float() + bump = f.double() < x64 + return torch.where(bump, (f.view(torch.int32) + 1).view(torch.float32), f) + + +def round_up_f16(x64): + """float64 (>= 0) -> the smallest fp16 >= x (inf above the fp16 range).""" + h = x64.half() + bump = h.double() < x64 + return torch.where(bump, (h.view(torch.int16) + 1).view(torch.float16), h) + + +def quantize_rows(w): + """w [r, K] (bf16 / fp32) -> (q int8 [r, K], sc fp16 [r, NGROUPS], D float64 [r, K]).""" + r = w.shape[0] + w64 = w.double().view(r, NGROUPS, GROUP) + amax = w64.abs().amax(-1) + sc = round_up_f16(amax / QMAX) + s64 = sc.double() + safe = torch.where(s64 > 0, s64, torch.ones_like(s64)) + q = torch.round(w64 / safe[..., None]).clamp(-QMAX, QMAX) + q = torch.where(s64[..., None] > 0, q, torch.zeros_like(q)) + d = q * s64[..., None] + return q.view(r, K).to(torch.int8), sc, d.view(r, K) + + +def pack6(q): + """q int8 [V, K] (V % 8 == 0) -> uint8 [V/8 * STEPS * 384] in the layout above.""" + V = q.shape[0] + u = (q.to(torch.int32) + 32).view(V // 8, 8, STEPS, 4, 16) # tile, row g, step, t, value j + u = u.permute(0, 2, 1, 3, 4).reshape(V // 8, STEPS, 32, 16) # tile, step, lane = 4g + t, j + lo = u & 0xF + hi = (u >> 4) & 0x3 + nib = torch.zeros((V // 8, STEPS, 32, 2), dtype=torch.int64, device=q.device) + for h in range(2): + for j in range(4): + p = 4 * h + j + nib[..., h] |= lo[..., 2 * p].long() << (4 * j) + nib[..., h] |= lo[..., 2 * p + 1].long() << (16 + 4 * j) + hw = torch.zeros((V // 8, STEPS, 32), dtype=torch.int64, device=q.device) + for p in range(8): + hw |= hi[..., 2 * p].long() << (2 * p) + hw |= hi[..., 2 * p + 1].long() << (16 + 2 * p) + nib_b = torch.stack([(nib >> (8 * b)) & 0xFF for b in range(4)], -1).view(V // 8, STEPS, 256) + hw_b = torch.stack([(hw >> (8 * b)) & 0xFF for b in range(4)], -1).view(V // 8, STEPS, 128) + return torch.cat([nib_b, hw_b], -1).to(torch.uint8).reshape(-1) + + +def unpack6(packed, V): + """Inverse of pack6 by the kernel's own extraction rule (tests): -> q int8 [V, K].""" + b = packed.view(V // 8, STEPS, 384).long() + nib = b[..., :256].view(V // 8, STEPS, 32, 2, 4) + nibw = (nib << (8 * torch.arange(4, device=b.device))).sum(-1) # [.., 32, 2] u32 words + hiw = (b[..., 256:].view(V // 8, STEPS, 32, 4) << (8 * torch.arange(4, device=b.device))).sum(-1) + vals = torch.empty((V // 8, STEPS, 32, 16), dtype=torch.int64, device=b.device) + for p in range(8): + w = nibw[..., p // 4] + lo = (w >> (4 * (p % 4))) & 0x000F000F + h2 = ((hiw >> (2 * p)) & 0x00030003) << 4 + v = lo | h2 + vals[..., 2 * p] = v & 0xFFFF + vals[..., 2 * p + 1] = v >> 16 + q = vals - 32 + return q.view(V // 8, STEPS, 8, 4, 16).permute(0, 2, 1, 3, 4).reshape(V, K).to(torch.int8) + + +@torch.inference_mode() +def build_tables(weight, chunk=4096): + """weight bf16 [V, K] -> dict(q=packed uint8, sc, rt, nv, eps). Runs on weight.device, chunk rows at a time.""" + if chunk % 8: + raise ValueError("inkling_cert: chunk must be a multiple of 8") + return _build(weight, chunk) + + +def _build(weight, chunk): + V, k = weight.shape + if k != K or V % 16: + raise ValueError(f"inkling_cert: head [{V}, {k}] is not [16n, {K}]") + dev = weight.device + packed = torch.empty((V // 8 * STEPS * 384,), dtype=torch.uint8, device=dev) + sc = torch.empty((NGROUPS, V), dtype=torch.float16, device=dev) + rt = torch.empty((NGROUPS, V), dtype=torch.float16, device=dev) + nv = torch.empty((V,), dtype=torch.float32, device=dev) + err = 0.0 + for r0 in range(0, V, chunk): + r1 = min(V, r0 + chunk) + w64 = weight[r0:r1].double() + q, s, d = quantize_rows(weight[r0:r1]) + packed[r0 // 8 * STEPS * 384 : r1 // 8 * STEPS * 384] = pack6(q) + sc[:, r0:r1] = s.t() + res = (w64 - d).view(r1 - r0, NGROUPS, GROUP) + rg = res.pow(2).sum(-1).sqrt() * (1.0 + 2.0 ** -40) + rt[:, r0:r1] = round_up_f16(rg).t() + n = torch.maximum(w64.norm(dim=1), d.norm(dim=1)) * (1.0 + 2.0 ** -40) + nv[r0:r1] = round_up_f32(n) + err += float((res.reshape(r1 - r0, K).norm(dim=1) / w64.norm(dim=1).clamp_min(1e-30)).sum()) + if not (torch.isfinite(rt.float()).all() and torch.isfinite(nv).all() and torch.isfinite(sc.float()).all()): + raise ValueError("inkling_cert: non-finite bound table (head weights out of the fp16 range?)") + return dict(q=packed, sc=sc.contiguous(), rt=rt.contiguous(), nv=nv, eps=err / V) diff --git a/recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_cert/tests/test_cert.py b/recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_cert/tests/test_cert.py new file mode 100644 index 0000000000000000000000000000000000000000..6779a74e54ab21f82b963ddecd41a2113a832c25 --- /dev/null +++ b/recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_cert/tests/test_cert.py @@ -0,0 +1,231 @@ +"""CPU tests of inkling_cert (numpy + torch, no GPU, no sglang). From overlay/: + python3 -m unittest discover -s inkling_cert/tests -v +""" + +import math +import os +import sys +import unittest + +import numpy as np +import torch + +sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))) +from inkling_cert import cert_math as cm # noqa: E402 +from inkling_cert import quant # noqa: E402 + +K = cm.K + + +def head(V, seed=0, scale_rows=True): + """A head shaped like Inkling's: rows of norm ~1, a few heavy-tailed entries.""" + rng = np.random.default_rng(seed) + W = rng.standard_normal((V, K)) * (1 + 0.5 * rng.standard_normal((V, 1)) ** 2) + W[rng.random((V, K)) < 0.002] *= 6 + if scale_rows: + W /= np.linalg.norm(W, axis=1, keepdims=True) + return cm.bf16_round(W.astype(np.float32)) + + +def rows_like(W, M, seed=0, peak=0.25): + """Hidden rows with ||x|| ~ 220 and a peaked logit distribution (cos ~ peak with one or two rows).""" + rng = np.random.default_rng(seed) + V = W.shape[0] + X = rng.standard_normal((M, K)) + X /= np.linalg.norm(X, axis=1, keepdims=True) + for m in range(M): + tgt = rng.integers(0, V, size=2) + X[m] = X[m] * math.sqrt(1 - 2 * peak ** 2) + peak * W[tgt[0]] + peak * rng.random() * W[tgt[1]] + X *= 220.0 / np.linalg.norm(X, axis=1, keepdims=True) + return cm.bf16_round(X.astype(np.float32)) + + +def exact_logits(x, W): + return (x.astype(np.float64) @ W.astype(np.float64).T).astype(np.float32) + + +class PackTest(unittest.TestCase): + def test_roundtrip(self): + g = torch.Generator().manual_seed(0) + q = torch.randint(-31, 32, (48, K), generator=g, dtype=torch.int32).to(torch.int8) + p = quant.pack6(q) + self.assertEqual(p.numel(), 48 // 8 * quant.STEPS * 384) + self.assertTrue(torch.equal(quant.unpack6(p, 48), q)) + + def test_kernel_lane_mapping(self): + """The k index each lane / mma uses for B (decoded by the kernel's rule) equals the one it uses for A.""" + g = torch.Generator().manual_seed(1) + q = torch.randint(-31, 32, (16, K), generator=g, dtype=torch.int32).to(torch.int8) + b = quant.pack6(q).view(2, quant.STEPS, 384).long() + seen = np.zeros((16, K), int) + for i in range(2): # the CTA's two 8-row tiles + for s in range(quant.STEPS): + for lane in range(32): + gg, t = lane >> 2, lane & 3 + nib = [int(sum(int(b[i, s, 8 * lane + 4 * h + j]) << (8 * j) for j in range(4))) for h in range(2)] + hi = int(sum(int(b[i, s, 256 + 4 * lane + j]) << (8 * j) for j in range(4))) + for j4 in range(4): + for half, p in ((0, 2 * j4), (1, 2 * j4 + 1)): + w = nib[0] if j4 < 2 else nib[1] + v = ((w >> (4 * (p & 3))) & 0x000F000F) | (((hi >> (2 * p)) & 0x00030003) << 4) + # A operand of this register: x row, values 16t + 4 j4 + 2 half + {0, 1} of step s + ks = [64 * s + 16 * t + 4 * j4 + 2 * half, 64 * s + 16 * t + 4 * j4 + 2 * half + 1] + vals = [(v & 0xFFFF) - 32, (v >> 16) - 32] + for k, val in zip(ks, vals): + self.assertEqual(val, int(q[8 * i + gg, k])) + seen[8 * i + gg, k] += 1 + self.assertTrue((seen == 1).all()) + + def test_six_pair_exact_in_bf16(self): + u = np.arange(64, dtype=np.uint32) + bits = (0x4300 | u).astype(np.uint32) << 16 + vals = bits.view(np.float32) - np.float32(160.0) + self.assertTrue(np.array_equal(vals, u.astype(np.float32) - 32)) + + +class TablesTest(unittest.TestCase): + def test_torch_matches_numpy(self): + W = head(64, seed=3) + t = quant.build_tables(torch.from_numpy(W).to(torch.bfloat16), chunk=32) + q, sc, D = cm.quantize(W) + rt, nv = cm.tables(W, D) + self.assertTrue(torch.equal(quant.unpack6(t["q"], 64), torch.from_numpy(q))) + self.assertTrue(np.array_equal(t["sc"].numpy().T, sc)) + self.assertTrue(np.array_equal(t["rt"].numpy().T, rt)) + self.assertTrue(np.array_equal(t["nv"].numpy(), nv)) + self.assertLessEqual(np.abs(q).max(), 31) + + def test_bound_covers_exact(self): + W = head(4096, seed=4) + q, sc, D = cm.quantize(W) + rt, nv = cm.tables(W, D) + x = rows_like(W, 8, seed=5) + lo, hi = cm.screen(x, D, rt, nv, 4096) + l = x.astype(np.float64) @ W.astype(np.float64).T + self.assertTrue((lo <= l).all() and (l <= hi).all()) + + +class CertifyTest(unittest.TestCase): + V = 8192 + V_REAL = 8000 + + def setUp(self): + self.W = head(self.V, seed=7) + self.q, self.sc, self.D = cm.quantize(self.W) + self.rt, self.nv = cm.tables(self.W, self.D) + + def _check(self, x, l=None, s_err=None): + lo, hi = cm.screen(x, self.D, self.rt, self.nv, self.V_REAL, s_err=s_err) + mask, certified = cm.select(lo, hi) + l = exact_logits(x, self.W) if l is None else l + self.assertTrue(np.array_equal(cm.certified_token(l, mask, self.V_REAL), cm.stock_token(l, self.V_REAL))) + return mask, certified + + def test_peaked_rows(self): + x = rows_like(self.W, 16, seed=11) + mask, certified = self._check(x) + self.assertTrue(certified) + self.assertLess(mask.sum(), self.V // 16 // 4) + + def test_adversarial_screen_error(self): + """Screen errors pushed to the bound's accumulation term in the worst direction for each id.""" + x = rows_like(self.W, 8, seed=12) + l = exact_logits(x, self.W) + w = cm.stock_token(l, self.V_REAL) + xn = np.linalg.norm(x.astype(np.float64), axis=1) + err = cm.C_ACC * self.nv[None, :].astype(np.float64) * xn[:, None] * 0.999 + sign = -np.ones_like(err) + sign[np.arange(8), w] = -1.0 # the winner looks lower, every other id higher + sign[:, :] = np.where(np.arange(self.V)[None, :] == w[:, None], -1.0, 1.0) + self._check(x, s_err=sign * err) + + def test_exact_ties_lowest_id(self): + W = self.W.copy() + W[5000] = W[300] # identical rows: identical logits + W[6000] = W[300] + self.W = W + self.q, self.sc, self.D = cm.quantize(W) + self.rt, self.nv = cm.tables(W, self.D) + x = np.repeat(cm.bf16_round((W[300] * 220.0).astype(np.float32))[None], 4, 0) + mask, certified = self._check(x) + self.assertEqual(int(cm.certified_token(exact_logits(x, W), mask, self.V_REAL)[0]), 300) + + def test_softcap_ties(self): + """Distinct raw logits that the softcap maps to the same FP32 value: the lowest id must still win.""" + x = rows_like(self.W, 1, seed=13) + l = exact_logits(x, self.W) + w = int(cm.stock_token(l, self.V_REAL)[0]) + lw = l[0, w] + # put a lower-id token just below w in raw logit but equal after softcap (large logits saturate) + tested = 0 + for big in (45.0, 60.0, 90.0, 120.0): + l2 = l.copy() + l2[0, w] = big + other = 7 if w != 7 else 9 + cand = np.float32(big) + while cm.softcap(np.array([cand]))[0] == cm.softcap(np.array([np.float32(big)]))[0]: + cand = np.nextafter(cand, np.float32(-np.inf)) + cand = np.nextafter(cand, np.float32(np.inf)) + if cand == np.float32(big): + continue # no softcap tie below this value in FP32 + tested += 1 + l2[0, other] = cand + self.assertLess(l2[0, other], l2[0, w]) + self.assertEqual(int(cm.stock_token(l2, self.V_REAL)[0]), min(other, w)) + # bounds as tight as possible around the true values: the screen interval from l2 itself + lo = l2 - 1e-3 + hi = l2 + 1e-3 + lo[:, self.V_REAL:] = -np.inf + hi[:, self.V_REAL:] = -np.inf + mask, certified = cm.select(lo.astype(np.float32), hi.astype(np.float32)) + self.assertTrue(certified) + self.assertEqual(int(cm.certified_token(l2, mask, self.V_REAL)[0]), min(other, w)) + self.assertGreater(tested, 0) + del lw + + def test_padded_ids_never_raise_threshold(self): + x = rows_like(self.W, 2, seed=14) + l = exact_logits(x, self.W) + l[:, self.V_REAL:] = 1e4 # padded ids with huge logits must not matter + s_err = np.zeros_like(l, dtype=np.float64) + s_err[:, self.V_REAL:] = 1e4 + self._check(x, l=l, s_err=s_err) + + def test_out_of_range_falls_back(self): + x = rows_like(self.W, 2, seed=15) * np.float32(40.0) # logits in the thousands: not certifiable + lo, hi = cm.screen(x, self.D, self.rt, self.nv, self.V_REAL) + mask, certified = cm.select(lo, hi) + self.assertFalse(certified) + self.assertTrue(mask.all()) + + def test_not_on_is_full(self): + x = rows_like(self.W, 2, seed=16) + lo, hi = cm.screen(x, self.D, self.rt, self.nv, self.V_REAL) + mask, certified = cm.select(lo, hi, on=False) + self.assertFalse(certified) + self.assertTrue(mask.all()) + + def test_fill_below_any_winner(self): + """f(-inf) = -30 stays strictly below f(T) for every T the range test admits.""" + for T in (-150.0, -100.0, -30.0, 0.0): + lo = np.full((1, 32), -np.inf, np.float32) + hi = np.full((1, 32), -np.inf, np.float32) + lo[0, 0], hi[0, 0] = T, T + 1 + mask, certified = cm.select(lo, hi) + if certified: + self.assertGreater(cm.softcap(np.array([T], np.float32))[0], cm.softcap(np.array([-np.inf], np.float32))[0]) + + +class ModeTest(unittest.TestCase): + def test_parse(self): + import inkling_cert as ic + + self.assertEqual(ic.parse_mode(""), "0") + self.assertEqual(ic.parse_mode("1"), "1") + self.assertEqual(ic.parse_mode("check"), "check") + with self.assertRaises(RuntimeError): + ic.parse_mode("maybe") + + +if __name__ == "__main__": + unittest.main() diff --git a/recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_cert/tests/test_certwide.py b/recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_cert/tests/test_certwide.py new file mode 100644 index 0000000000000000000000000000000000000000..f3142476b5003536708d5852a4d962cb08862136 --- /dev/null +++ b/recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_cert/tests/test_certwide.py @@ -0,0 +1,195 @@ +"""Batched bound, serving handoff and fallback tests (CPU).""" + +import threading +import types +import unittest +from unittest import mock + +import numpy as np +import torch + +from inkling_cert import cert_math as cm, certwide, certwide_math as wm, patches + + +class WideBoundTest(unittest.TestCase): + def test_weight_radius_covers_both_paths_and_matches_torch(self): + rng = np.random.default_rng(45) + w = cm.bf16_round(rng.normal(0, 0.021, (80, cm.K))) + _, _, d = cm.quantize(w) + rt, nv = cm.tables(w, d) + r = wm.weight_radius(rt, nv) + torch_r = certwide.weight_radius({"rt": torch.from_numpy(rt.T.copy()), "nv": torch.from_numpy(nv)}) + np.testing.assert_array_equal(r, torch_r.numpy()) + self.assertTrue(np.all(r.astype(np.float64) >= np.linalg.norm(w - d, axis=1) + certwide.CN * nv)) + x = cm.bf16_round(rng.normal(0, 5, (192, cm.K))) + norm = wm.activation_norm(x) + for sign in (-1, 1): + err = sign * 2 * cm.C_ACC * norm[:, None] * nv[None, :] + lo, hi = wm.intervals(x.astype(np.float64) @ d.T + err, norm, r) + exact = x.astype(np.float64) @ w.T - err + self.assertTrue(np.all((lo <= exact) & (exact <= hi))) + + def test_disjoint_rows_union_capped_ties_and_pad(self): + # Distinct m16 groups need distinct vocab tiles. The lower index lies + # in a different tile and has a slightly smaller *raw* logit. + def plateau(x): + return np.round(cm.softcap(x) * 2.0**15) * 2.0**-15 + + for m in (17, 24, 64, 128, 192): + with self.subTest(m=m): + logits = np.full((m, 512), -9, np.float32) + shift = 32 * (np.arange(m) // 16) + logits[np.arange(m), 4 + shift] = 100 + logits[np.arange(m), 19 + shift] = np.nextafter(np.float32(100), np.float32(np.inf)) + logits[:, -1] = 500 + lo, hi = wm.intervals(logits, np.ones(m, np.float32), np.full(512, 0.02, np.float32)) + rows, union, groups, safe = wm.select(lo, hi, 511, 2048, np.ones(m)) + self.assertTrue(safe) + self.assertTrue(np.all(rows.sum(1) == 2)) + self.assertEqual(union.sum(), 2 * ((m + 15) // 16)) + self.assertFalse(union[-1]) + np.testing.assert_array_equal(wm.compact_token(logits, 511, groups, plateau), 4 + shift) + np.testing.assert_array_equal(wm.compact_token(logits, 511, groups, plateau), + cm.stock_token(logits, 511, plateau)) + + def test_inclusive_threshold_and_overcapacity_fallback(self): + logit = np.zeros((24, 128), np.float32) + logit[:, 2] = 50 + cut, ok = wm.thresholds(logit.max(1), logit.max(1)) + self.assertTrue(ok.all()) + hi = logit.copy() + hi[:, 17] = cut + norm = np.ones(24) + rows, union, _, safe = wm.select(logit, hi, 128, 2, norm) + self.assertEqual(union.sum(), 2) + self.assertTrue(rows[:, 1].all()) + self.assertTrue(safe) + self.assertFalse(wm.select(logit, hi, 128, 1, norm)[-1]) + self.assertFalse(wm.select(logit, hi, 128, 2, norm, on=False)[-1]) + flat = np.zeros_like(logit) + self.assertFalse(wm.select(flat, flat, 128, 8, norm)[-1]) + + def test_derivative_and_cutoff_round_conservatively(self): + L = np.linspace(0, 500, 2049, dtype=np.float32) + self.assertTrue(np.all(wm.derivative_lower(L) <= np.exp(-2 * L.astype(np.float64) / cm.CAP))) + T = np.array([-150.4, -150.3, -100, -1, 0, 1, 100, 150.3, 150.4], np.float32) + H = np.maximum(T, 1) + cutoff, ok = wm.thresholds(T, H) + np.testing.assert_array_equal(ok, [False, True, True, True, True, True, True, True, False]) + ideal_slope = np.exp(-2 * np.maximum(np.abs(T.astype(np.float64)) + cm.DMAX, H) / cm.CAP) + self.assertTrue(np.all((T.astype(np.float64) - cutoff)[ok] * ideal_slope[ok] >= 2 * cm.TWO_E)) + + def test_one_unsafe_row_forces_full_head(self): + logits = np.zeros((192, 64), np.float32) + logits[:, 1] = 50 + norm = np.ones(192) + self.assertTrue(wm.select(logits, logits, 64, 4, norm)[-1]) + for bad in (200, np.inf, np.nan): + altered = logits.copy() + altered[-1, 1] = bad + self.assertFalse(wm.select(altered, altered, 64, 4, norm)[-1]) + norm[-1] = 2.0**21 + self.assertFalse(wm.select(logits, logits, 64, 4, norm)[-1]) + + def test_softcap_reversal_proof_uses_margin(self): + # The bounded softcap error can cause a slightly smaller raw logit + # to win outright. Its lower index and separate tile are incidental. + logits = np.full((17, 64), -np.inf, np.float32) + logits[:, 0], logits[:, 19] = 99.9999, 100 + def adversarial_softcap(x): + return cm.softcap(x) + np.where(x < 100, cm.E_SOFTCAP, -cm.E_SOFTCAP) + + rows, _, groups, safe = wm.select(logits, logits, 64, 4, np.ones(17)) + self.assertTrue(safe) + self.assertTrue(rows[:, 0].all()) + np.testing.assert_array_equal(wm.compact_token(logits, 64, groups, adversarial_softcap), 0) + + +class WideHookTest(unittest.TestCase): + def test_both_graph_accept_paths_consume_the_ids(self): + class AcceptGreedy: + @classmethod + def execute(cls, *, target_logits, target_predict=None): + return target_predict + + stock_ids = torch.tensor([3, 4]) + direct_ids = torch.tensor([8, 9]) + mod = types.SimpleNamespace(AcceptGreedy=AcceptGreedy, sampling_argmax=lambda logits: stock_ids) + patches._patch_wide_accept(mod) + shared = torch.empty(2, 32) + captured = shared.view_as(shared) + captured._inkling_certwide_ids = direct_ids + self.assertIs(mod.sampling_argmax(captured), direct_ids) + self.assertIs(mod.AcceptGreedy.execute(target_logits=captured), direct_ids) + self.assertIs(mod.AcceptGreedy.execute(target_logits=captured, target_predict=stock_ids), stock_ids) + self.assertIs(mod.sampling_argmax(shared), stock_ids) + self.assertIsNone(mod.AcceptGreedy.execute(target_logits=shared)) + + def test_head_handoff_is_target_verify_only(self): + mode = mock.Mock() + metadata = types.SimpleNamespace(forward_mode=mode) + stock = object() + direct = object() + wrapped = patches.make_get_logits(lambda *args: stock) + with mock.patch.object(patches, "_wide_logits", return_value=direct) as wide: + mode.is_target_verify.return_value = True + self.assertIs(wrapped(None, None, None, metadata), direct) + mode.is_target_verify.return_value = False + self.assertIs(wrapped(None, None, None, metadata), stock) + self.assertEqual(wide.call_count, 1) + + def test_grammar_and_logprobs_never_arm(self): + for blocked in ("has_grammar", "return_logprob"): + batch = types.SimpleNamespace(**{blocked: True}) + self.assertFalse(patches.batch_ok(batch, sampling_info=None)) + + def test_replay_workspace_rejects_other_streams_and_threads(self): + stack = certwide.CertWide.__new__(certwide.CertWide) + stack.q = types.SimpleNamespace(device="cuda:0") + stack._replay_owner = None + stack._owner_lock = threading.Lock() + with mock.patch.object(torch.cuda, "current_stream", return_value=1) as current: + stack.require_replay_stream() + stack.require_replay_stream() + with mock.patch.object(threading, "current_thread", return_value=object()): + with self.assertRaisesRegex(RuntimeError, "owning thread and CUDA stream"): + stack.require_replay_stream() + current.return_value = 2 + with self.assertRaisesRegex(RuntimeError, "owning thread and CUDA stream"): + stack.require_replay_stream() + + def test_target_graph_checks_owner_before_replay(self): + class Runner: + model_runner = types.SimpleNamespace(is_draft_worker=False) + capture_forward_mode = types.SimpleNamespace(is_target_verify=lambda: True) + replay = mock.Mock(return_value="output") + + def execute(self): + return self.replay() + + def _process_output_after_replay(self, output, forward_batch): + return output + + wide = mock.Mock() + with mock.patch.dict(patches.STATE, cert=types.SimpleNamespace(wide=wide), patched=[]): + patches.patch_graph_runner(types.SimpleNamespace(DecodeCudaGraphRunner=Runner)) + wide.require_replay_stream.side_effect = RuntimeError("wrong stream") + with self.assertRaisesRegex(RuntimeError, "wrong stream"): + Runner().execute() + Runner.replay.assert_not_called() + wide.require_replay_stream.side_effect = None + self.assertEqual(Runner().execute(), "output") + + def test_exact_passes_registered_width_to_binding(self): + stack = certwide.CertWide.__new__(certwide.CertWide) + stack.wide_ext = mock.Mock() + stack.entry = types.SimpleNamespace(n=128, buf=object()) + stack.sparse = torch.empty((24, 32)) + stack.state, stack.tiles, stack.groups = object(), object(), object() + x, wrong_width = torch.empty((24, cm.K)), torch.empty((24, 112)) + stack.exact(x, wrong_width, 120, types.SimpleNamespace(mt=0, mg=2, pfd=1)) + self.assertEqual(stack.wide_ext.certwide_exact.call_args.args[7:], (128, 120, 0, 2, 1)) + + +if __name__ == "__main__": + unittest.main() diff --git a/recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_cert/tests/test_dflash.py b/recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_cert/tests/test_dflash.py new file mode 100644 index 0000000000000000000000000000000000000000..1d3afd91053462c91dbf2cf13cbf15679896fbae --- /dev/null +++ b/recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_cert/tests/test_dflash.py @@ -0,0 +1,183 @@ +"""CPU tests of inkling_cert's DFLASH arming (fake worker classes).""" +import os +import sys +import types +import unittest + +sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))) + +from inkling_cert import dflash, patches # noqa: E402 + + +class FakeCert: + def __init__(self): + self.log = [] + + def set_on(self, v): + self.log.append(1 if v else 0) + + +class Arming(unittest.TestCase): + def setUp(self): + self.saved = dict(patches.STATE) + patches.STATE.update(mode="1", disabled=None, cert=FakeCert(), cfg={"wide": False, "log_every": 0}, + patched=[], calls=0) + + def tearDown(self): + patches.STATE.clear() + patches.STATE.update(self.saved) + + def build(self, skip): + seen = [] + + class TpModelWorker: + def forward_batch_generation(self, *a, **k): + seen.append(patches.STATE["cert"].log[-1] if patches.STATE["cert"].log else None) + return "out" + + class DFlashWorkerV2: + def __init__(self): + self.target_worker = TpModelWorker() + + def _can_skip_verify_logits(self, batch, si): + return skip + + block_size = 8 + + def forward_batch_generation(self, batch, *a, **k): + self.target_worker.forward_batch_generation(batch=None, forward_batch=None, is_verify=False) + out = self.target_worker.forward_batch_generation(batch=None, forward_batch=None, is_verify=True) + self.accepted = self._accept_block(bs=2, next_token_logits=None, target_predict=None) + return out + + def _accept_block(self, **kw): + return kw["target_predict"] + + dflash.patch_worker(types.SimpleNamespace(DFlashWorkerV2=DFlashWorkerV2)) + dflash.patch_tp_worker(types.SimpleNamespace(TpModelWorker=TpModelWorker)) + return DFlashWorkerV2, seen + + def batch(self, greedy=True, logprob=False): + si = types.SimpleNamespace(is_all_greedy=greedy, has_watermark_candidates=False, + sampling_mask_batch_indices=None) + return types.SimpleNamespace(sampling_info=si, return_logprob=logprob, has_grammar=False) + + def test_greedy_armed_then_reset(self): + W, seen = self.build(True) + self.assertEqual(W().forward_batch_generation(self.batch()), "out") + log = patches.STATE["cert"].log + self.assertEqual(seen[-1], 1) # the verify forward saw on = 1 + self.assertEqual(log[-1], 0) # reset right after + self.assertIsNone(seen[0]) # the non-verify forward was not armed + + def test_not_armed(self): + for skip, batch in ((False, self.batch()), (True, self.batch(greedy=False)), (True, self.batch(logprob=True))): + patches.STATE["cert"] = FakeCert() + W, seen = self.build(skip) + W().forward_batch_generation(batch) + self.assertEqual(seen[-1], 0) + + def test_wide_ids_injected_only_when_armed(self): + import torch + + for skip, expect in ((True, True), (False, False)): + patches.STATE["cert"] = FakeCert() + W, seen = self.build(skip) + ids = torch.arange(24) + orig_tp = W().target_worker.forward_batch_generation + + w = W() + + def verify_then_replay(*a, _o=w.target_worker.forward_batch_generation, **k): + out = _o(*a, **k) + if k.get("is_verify"): + dflash.REPLAY.update(ids=ids, wide=True) # what the runner hook records on a wide replay + return out + + w.target_worker.forward_batch_generation = verify_then_replay + w.forward_batch_generation(self.batch()) + if expect: + self.assertTrue(torch.equal(w.accepted, ids[:16])) + else: + self.assertIsNone(w.accepted) + del orig_tp + + def test_ambiguous_wide_replay_is_fatal(self): + W, seen = self.build(True) + w = W() + + def verify(*a, _o=w.target_worker.forward_batch_generation, **k): + out = _o(*a, **k) + if k.get("is_verify"): + dflash.REPLAY.update(ids=None, wide=True) + return out + + w.target_worker.forward_batch_generation = verify + with self.assertRaises(BaseException): + w.forward_batch_generation(self.batch()) + + def test_outside_dflash_untouched(self): + W, seen = self.build(True) + W().target_worker.forward_batch_generation(is_verify=True) # no DFLASH step context + self.assertEqual(patches.STATE["cert"].log, []) + + def _wide_worker(self, compact): + patches.STATE["cfg"] = {"wide": True, "log_every": 0} + rv = types.ModuleType("sglang.srt.speculative.ragged_verify") + rv.ragged_verify_compact_enabled = lambda: compact + names = ["sglang", "sglang.srt", "sglang.srt.speculative", "sglang.srt.speculative.ragged_verify"] + saved = {n: sys.modules.get(n) for n in names} + for n in names[:-1]: + sys.modules.setdefault(n, types.ModuleType(n)) + sys.modules[names[-1]] = rv + + class DFlashWorkerV2: + def forward_batch_generation(self, batch): + pass + + def _accept_block(self, **kw): + pass + + def _can_skip_verify_logits(self, b, s): + return True + + try: + dflash.patch_worker(types.SimpleNamespace(DFlashWorkerV2=DFlashWorkerV2)) + finally: + for n, m in saved.items(): + if m is None: + sys.modules.pop(n, None) + else: + sys.modules[n] = m + return DFlashWorkerV2 + + def test_wide_refused_under_compact(self): + # the certified IDs are request-major: the wide head is refused with compact ragged verify + with self.assertRaises(BaseException): + self._wide_worker(compact=True) + + def test_wide_armed_static(self): + W = self._wide_worker(compact=False) + self.assertTrue(getattr(W.forward_batch_generation, "_inkling_cert", False)) + +@unittest.skipIf(__import__("importlib").util.find_spec("torch") is None, "needs torch") +class DeadRows(unittest.TestCase): + def test_gather_selected_by_on(self): + import torch + + vs = types.ModuleType("inkling_vcap.state") + vs.STATE = types.SimpleNamespace(src_index=None, stride=8) + sys.modules["inkling_vcap.state"] = vs + try: + dflash.ACTIVE["dflash"] = True + x = torch.arange(16 * 4, dtype=torch.float32).view(16, 4) + cert = types.SimpleNamespace(on=torch.ones(1, dtype=torch.int32)) + self.assertIs(dflash.dead_rows_to_anchor(x, cert), x) # no src_index: untouched (CPU / not CUDA) + finally: + dflash.ACTIVE["dflash"] = False + sys.modules.pop("inkling_vcap.state", None) + self.assertIs(dflash.dead_rows_to_anchor(x, cert), x) # not DFLASH: untouched + + +if __name__ == "__main__": + unittest.main() diff --git a/recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_cert/tests/test_patches.py b/recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_cert/tests/test_patches.py new file mode 100644 index 0000000000000000000000000000000000000000..f785a0d85d6a324ab940d9b6a15a77ea069fe84f --- /dev/null +++ b/recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_cert/tests/test_patches.py @@ -0,0 +1,196 @@ +"""CPU tests of inkling_cert's SGLang hooks with stand-in objects (no sglang, no GPU).""" + +import os +import sys +import types +import unittest + +import torch + +sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))) +from inkling_cert import patches # noqa: E402 + + +class FakeCert: + def __init__(self, pack): + self.pack = pack + self.on_values = [] + self.runs = [] + self.warm = set() + self.on, self.off = "ON", "OFF" + + def set_on(self, v): + self.on_values.append(1 if v else 0) + + def run(self, x2, out, on, v_real, cap): + self.runs.append((x2.shape[0], on, v_real, cap)) + out.fill_(1.0) + return out + + +class Pack: + def __init__(self, n, k): + self.n, self.k = n, k + + +def install_fake_pico(weight, pack): + pp = types.ModuleType("inkling_pico12.patches") + pp.STATE = {"levers": ("lmhead",)} + pp.HEADS = {weight.data_ptr(): pack} + po = types.ModuleType("inkling_pico12.ops") + po.rows_of = lambda x: x.numel() // x.shape[-1] + po.eligible = lambda x, p: 0 < po.rows_of(x) <= 16 + po.out_ok = lambda out, m, p, dt, dev: tuple(out.shape) == (m, p.n) + po.as_rows = lambda x, k: x.reshape(-1, k) + sys.modules["inkling_pico12.patches"] = pp + sys.modules["inkling_pico12.ops"] = po + + +class Mode: + def __init__(self, verify): + self.verify = verify + + def is_target_verify(self): + return self.verify + + +class LP: + shard_softcap = 30.0 + logit_scale = None + do_tensor_parallel_all_gather = False + do_tensor_parallel_all_gather_dp_attn = False + + def __init__(self, vocab): + self.config = types.SimpleNamespace(vocab_size=vocab) + + +class HookTest(unittest.TestCase): + def setUp(self): + self.V, self.K = 64, 2304 + self.w = torch.zeros((self.V, self.K), dtype=torch.bfloat16) + self.pack = Pack(self.V, self.K) + install_fake_pico(self.w, self.pack) + self.cert = FakeCert(self.pack) + patches.STATE.update(mode="1", cfg={"log_every": 0, "cache_dir": "/tmp"}, cert=self.cert, disabled=None, + log=lambda m: None) + self.inner_calls = [] + + def inner(x, weight, out): + self.inner_calls.append(x.shape[0]) + return torch.zeros((x.shape[0], self.V)) + + inner._pico12 = True + self.head = patches.make_lm_head(inner) + self.lp = LP(60) + + def get_logits(lp, hidden, lm_head, meta): + return self.head(hidden, self.w, None) + + self.get_logits = patches.make_get_logits(get_logits) + + def x(self, m): + return torch.zeros((m, self.K), dtype=torch.bfloat16) + + def test_only_target_verify(self): + self.get_logits(self.lp, self.x(8), None, types.SimpleNamespace(forward_mode=Mode(False))) + self.assertEqual(self.inner_calls, [8]) + self.assertEqual(self.cert.runs, []) + self.assertIsNone(patches.CTX["lp"]) + + def test_eager_verify_first_call_warms_then_pico(self): + meta = types.SimpleNamespace(forward_mode=Mode(True)) + self.get_logits(self.lp, self.x(8), None, meta) # first eager M <= 8: kernels, full fallback + self.get_logits(self.lp, self.x(8), None, meta) # then pico directly + self.get_logits(self.lp, self.x(16), None, meta) # first eager M 9..16 + self.assertEqual([r[1] for r in self.cert.runs], ["OFF", "OFF"]) + self.assertEqual(self.inner_calls, [8]) + self.assertEqual(self.cert.runs[0][2:], (60, 30.0)) + + def test_rows_above_16_and_bad_processor(self): + meta = types.SimpleNamespace(forward_mode=Mode(True)) + self.get_logits(self.lp, self.x(24), None, meta) + self.assertEqual(self.inner_calls, [24]) + lp = LP(60) + lp.logit_scale = 2.0 + self.get_logits(lp, self.x(8), None, meta) + self.assertIsNotNone(patches.STATE["disabled"]) + self.get_logits(self.lp, self.x(8), None, meta) # disabled for good + self.assertEqual(self.cert.runs, []) + + def test_mode_off(self): + patches.STATE["mode"] = "0" + self.get_logits(self.lp, self.x(8), None, types.SimpleNamespace(forward_mode=Mode(True))) + self.assertEqual(self.cert.runs, []) + + +class VerifyFlagTest(unittest.TestCase): + def setUp(self): + self.cert = FakeCert(None) + patches.STATE.update(mode="1", cfg={"log_every": 0, "cache_dir": "/tmp"}, cert=self.cert, disabled=None, + log=lambda m: None) + calls = [] + + class Epi: + simulate_fold = False + + def begin_static_step(self, bs, armed): + calls.append(("static", armed)) + + def begin_step(self, verify_lens, armed): + calls.append(("step", armed)) + + class Exec: + _simulated_correct_len = None + + def __init__(self): + self.verify_epilogue = Epi() + + def run_non_compact(self, *, batch, draft_input, verify_ids_2d, verify_window, sampling_info): + calls.append(("run",)) + return "result" + + mod = types.ModuleType("dspark_verify") + mod.DsparkVerifyEpilogue, mod.TargetVerifyExecutor = Epi, Exec + patches.patch_verify(mod) + self.ex, self.calls = Exec(), calls + + def run_step(self, armed, batch=None, si=None): + self.ex.verify_epilogue.begin_static_step(1, armed) + batch = batch or types.SimpleNamespace(return_logprob=False, has_grammar=False, sampling_info=si) + r = self.ex.run_non_compact(batch=batch, draft_input=None, verify_ids_2d=None, verify_window=None, + sampling_info=si) + self.assertEqual(r, "result") + return self.cert.on_values[-1] + + def greedy(self, **kw): + d = dict(is_all_greedy=True, has_watermark_candidates=False, sampling_mask_batch_indices=None) + d.update(kw) + return types.SimpleNamespace(**d) + + def test_flag(self): + self.assertEqual(self.run_step(True, si=self.greedy()), 1) + self.assertEqual(self.run_step(False, si=self.greedy()), 0) + self.assertEqual(self.run_step(True, si=self.greedy(is_all_greedy=False)), 0) + self.assertEqual(self.run_step(True, si=self.greedy(has_watermark_candidates=True)), 0) + self.assertEqual(self.run_step(True, si=self.greedy(sampling_mask_batch_indices=torch.zeros(1))), 0) + b = types.SimpleNamespace(return_logprob=True, has_grammar=False, sampling_info=None) + self.assertEqual(self.run_step(True, batch=b, si=None), 0) + b = types.SimpleNamespace(return_logprob=False, has_grammar=False, sampling_info=self.greedy(is_all_greedy=False)) + self.assertEqual(self.run_step(True, batch=b, si=None), 0) # the batch samples although si is None + self.assertEqual(self.run_step(True, si=None), 1) + + def test_begin_step_clears(self): + self.assertEqual(self.run_step(True, si=self.greedy()), 1) + self.ex.verify_epilogue.begin_step(None, armed=True) + self.assertEqual(self.cert.on_values[-1], 0) + b = types.SimpleNamespace(return_logprob=False, has_grammar=False, sampling_info=None) + self.ex.run_non_compact(batch=b, draft_input=None, verify_ids_2d=None, verify_window=None, sampling_info=None) + self.assertEqual(self.cert.on_values[-1], 0) # not re-armed without begin_static_step + + def test_simulated_never(self): + self.ex._simulated_correct_len = torch.zeros(1) + self.assertEqual(self.run_step(True, si=self.greedy()), 0) + + +if __name__ == "__main__": + unittest.main() diff --git a/recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_cert/tools/gpu_check_cert.py b/recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_cert/tools/gpu_check_cert.py new file mode 100644 index 0000000000000000000000000000000000000000..8a8c65b3a408bd87ac21f65befc8ec8b59c03906 --- /dev/null +++ b/recipe/stack/cands/n292-v2-v297-pk3c/recipe/overlay/inkling_cert/tools/gpu_check_cert.py @@ -0,0 +1,307 @@ +#!/usr/bin/env python3 +"""GPU check + microbench of inkling_cert on the real Inkling-2-Mini head (run in the SGLang image, server stopped). + + python3 inkling_cert/tools/gpu_check_cert.py --model /model --hidden DIR [--quick] + +DIR holds *.npz with `hidden` (uint16 BF16 bits [T, 2304]): real LM-head input rows (inkling_cert/tools or the +CPU-oracle dump). Gates (any failure -> FAIL): + 1 packing: the 6-bit copy decodes (by the kernel's rule) to the quantised head; tables finite + 2 screen accuracy: |s - | and |pico - | within the accumulation model; lo <= pico <= hi everywhere + 3 exactness: certified token == full-head token (stock softcap + padding mask + stock argmax) on every real row, + at M = 8 and M = 16, plus near-tie rows (two ids within 1e-3, softcap saturation, exact duplicates if any); + computed tiles bit-identical to pico's full head, the rest -inf; on = 0 gives pico's full head bit for bit + 4 CUDA graph: replay with changing rows and on flag == eager +Bench (L2 flushed by reading 256 MiB before every rep, CUDA events, median of N): pico full head, cert path +(screen + exact), screen alone, at M = 8 and 16 with real candidate masks. Last line: `cert gpu_check result PASS|FAIL`. +""" + +import argparse +import glob +import json +import os +import struct +import sys +import time + +import numpy as np +import torch + +HERE = os.path.dirname(os.path.abspath(__file__)) +OVERLAY = os.path.dirname(os.path.dirname(HERE)) +sys.path.insert(0, OVERLAY) + +from inkling_cert import build as cbuild, cert_math as cm, ops as cops, quant # noqa: E402 +from inkling_pico12 import build as pbuild, ops as pops # noqa: E402 + +FAIL = [] + + +def gate(ok, msg): + print((" ok " if ok else " FAIL ") + msg, flush=True) + if not ok: + FAIL.append(msg) + + +def load_head(model_dir): + path = os.path.join(model_dir, "model-00001-of-00001.safetensors") + if not os.path.exists(path): + idx = json.load(open(os.path.join(model_dir, "model.safetensors.index.json")))["weight_map"] + path = os.path.join(model_dir, idx["model.llm.unembed.weight"]) + with open(path, "rb") as f: + n = struct.unpack("