bong-water-water-bong commited on
Commit
5fdc468
·
verified ·
1 Parent(s): 1675d97

Inkling-2-Mini Loom card for unsloth mainline GGUF (r8 programs + binding glue, Apache-2.0, 3158 gated)

Browse files
.gitattributes CHANGED
@@ -33,3 +33,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
 
 
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
36
+ tokenizer.json filter=lfs diff=lfs merge=lfs -text
LICENSE ADDED
@@ -0,0 +1,202 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright 2026 bong-water-water-bong
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
202
+
NOTICE ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Inkling-2-Mini Loom card (1bit-MONSTER/Inkling-2-Mini-loom)
2
+
3
+ This card is derived from loom-fun/unsloth-Inkling-2-Mini-loom, release r8
4
+ (revision 4e018e88a3aa9826286c71dfe2f6c905a491659b), Apache License 2.0. Its programs were
5
+ generated with the loom-skills workflow (https://github.com/loom-fun/loom-skills) by the loom-fun
6
+ authors (Jeremy Fowers, Daniel Holanda). README.loom-fun-r8.md is their original card text.
7
+
8
+ Changes by 1bit-MONSTER: binding changes only, so the card reads the mainline-layout GGUF that
9
+ unsloth/Inkling-2-Mini-GGUF ships under its root name since 23 Nov 2026. They are listed in
10
+ PROVENANCE.json ("changes_from_base"), with the sha256 of every file and whether it is
11
+ identical to or modified from r8.
12
+
13
+ Model weights: Inkling-2-Mini by Thinking Machines Lab, GGUF conversion by Unsloth
14
+ (unsloth/Inkling-2-Mini-GGUF). Weights are not included in this repository; loom-fetch
15
+ downloads them from unsloth by revision and sha256.
PROVENANCE.json ADDED
@@ -0,0 +1,120 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "card": "1bit-MONSTER/Inkling-2-Mini-loom",
3
+ "base_card": {
4
+ "repository": "loom-fun/unsloth-Inkling-2-Mini-loom",
5
+ "revision": "4e018e88a3aa9826286c71dfe2f6c905a491659b",
6
+ "release": "r8",
7
+ "license": "apache-2.0"
8
+ },
9
+ "weights": {
10
+ "repository": "unsloth/Inkling-2-Mini-GGUF",
11
+ "revision": "8078d149286eec7193795413b9e0643da6d11fa1",
12
+ "files": [
13
+ {
14
+ "name": "Inkling-2-Mini-UD-Q4_K_XL.gguf",
15
+ "bytes": 17629760736,
16
+ "sha256": "e64276656f072e9b2197a61723667cbdb71da66a716ffd966e572c21088f3cd3"
17
+ },
18
+ {
19
+ "name": "dspark-Inkling-2-Mini-Q8_0_Old.gguf",
20
+ "bytes": 402278560,
21
+ "sha256": "2ec78510da837e8fc3be54a14757a0c5fbd2d8d9e85a0d92853fafdf674f3773"
22
+ }
23
+ ]
24
+ },
25
+ "changes_from_base": [
26
+ "weights.loom + program/llm.loom: 48 loop-control tensors renamed loop_{attn,k,v,mlp}_* -> loop_{q,k,v,ffn}_ctrl_* (byte-identical tensors in the mainline file)",
27
+ "program/llm.loom: the global loop_res_query/loop_kv_res_query parameters replaced by the 12 per-block blk.N.loop_msg_query tensors; two kernels g_ink_mix2_q4_mq / g_ink_mix2_q4_lv_mq read the same four rows (0,3,1,2) of that tensor; 72 launches moved to them; no other kernel changed",
28
+ "model.json + model.json.lock: unsloth revision 8078d149, main file = the mainline-layout root GGUF, drafter = dspark-Inkling-2-Mini-Q8_0_Old.gguf"
29
+ ],
30
+ "files": {
31
+ "LICENSE": {
32
+ "sha256": "3f69585535b3a5bb688326e39a844f22552f9d92cb6f98f9b0361ab2a17f31a1",
33
+ "bytes": 11352,
34
+ "source": "Apache-2.0 licence text"
35
+ },
36
+ "NOTICE": {
37
+ "sha256": "26a16e1e60ba0d458373ee5e0554a4bf4cc0bab427055c9688af15c1ed2ed39d",
38
+ "bytes": 949,
39
+ "source": "1bit-MONSTER (card text)"
40
+ },
41
+ "README.loom-fun-r8.md": {
42
+ "sha256": "3ab7cee720fefafc5bbec76a7f9a48b152b13b3f6f658c67c2f350925aad3584",
43
+ "bytes": 11481,
44
+ "source": "loom-fun r8 README.md, verbatim"
45
+ },
46
+ "README.md": {
47
+ "sha256": "ecd5ee52de8a8fb6462e6813faa1138ed83ec64ca32845b248c4fd97e0a07d5f",
48
+ "bytes": 3011,
49
+ "source": "1bit-MONSTER (card text)"
50
+ },
51
+ "head_weights.loom": {
52
+ "sha256": "746132fc59c158cd5d6b43a57275b023280675d97c1c477e1ec3b41ed7f66ded",
53
+ "bytes": 3846,
54
+ "source": "identical to loom-fun r8"
55
+ },
56
+ "info.json": {
57
+ "sha256": "88238cab82ff00f28fe2663858e930bfb63ce981a6bf0533db06563f718c340c",
58
+ "bytes": 31866,
59
+ "source": "modified from loom-fun r8 (binding glue, see changes_from_base)"
60
+ },
61
+ "llm_config.json": {
62
+ "sha256": "1f26dc55da0bb31d8ac1ae02b5ddaa686192e1a68d41ae7d41983ec68febaf52",
63
+ "bytes": 4459,
64
+ "source": "identical to loom-fun r8"
65
+ },
66
+ "model.json": {
67
+ "sha256": "25c31a7030b0bb744ccfb031596d7bc627858554f56f761d596cd457268d5281",
68
+ "bytes": 1716,
69
+ "source": "modified from loom-fun r8 (binding glue, see changes_from_base)"
70
+ },
71
+ "model.json.lock": {
72
+ "sha256": "08a8b3a3a5a010edb25afdd0191826e1fa41d84dd3d1620c75a7333de4d36cef",
73
+ "bytes": 895,
74
+ "source": "modified from loom-fun r8 (binding glue, see changes_from_base)"
75
+ },
76
+ "program/control.loom": {
77
+ "sha256": "aea2fa34d530ed7254228cde4ed067f4c9a4df7ecb90661a59b04de868654c5c",
78
+ "bytes": 232520,
79
+ "source": "identical to loom-fun r8"
80
+ },
81
+ "program/llm.loom": {
82
+ "sha256": "70d69cf54f28d6860f247089544d6d8b421a6de7bb865dfd17e23d9cab70e319",
83
+ "bytes": 8039799,
84
+ "source": "modified from loom-fun r8 (binding glue, see changes_from_base)"
85
+ },
86
+ "program/prepare.loom": {
87
+ "sha256": "3450779e6f3517edbaa01927edea53a9581d3ac2c75e68adfa48dd6f08dc1cfb",
88
+ "bytes": 19508,
89
+ "source": "identical to loom-fun r8"
90
+ },
91
+ "program/service.loom": {
92
+ "sha256": "5dcd083b26d98f39b3215f9f47b9acfaa08e62df406718cdb92aa0684323f7db",
93
+ "bytes": 26042,
94
+ "source": "identical to loom-fun r8"
95
+ },
96
+ "program/storage.loom": {
97
+ "sha256": "d1b75d6420b892c6b297ed3f73331faa349f0f0f4f514e7a450d8f9327ebc666",
98
+ "bytes": 12748,
99
+ "source": "identical to loom-fun r8"
100
+ },
101
+ "tokenizer.json": {
102
+ "sha256": "a45fdc4e7e66a035de236d2694742fed5645327051caace5f8312013a879f9b1",
103
+ "bytes": 12242935,
104
+ "source": "identical to loom-fun r8"
105
+ },
106
+ "weights.loom": {
107
+ "sha256": "62f2116541a94eedb194f7a0b028699b2daa83f305ec3764f368d68947d68130",
108
+ "bytes": 103772,
109
+ "source": "modified from loom-fun r8 (binding glue, see changes_from_base)"
110
+ }
111
+ },
112
+ "license": "Apache-2.0",
113
+ "gate": {
114
+ "engine_issue": "1bit-MONSTER/engine#3158",
115
+ "row": "rc2-acc-1",
116
+ "date": "2026-11-24",
117
+ "near_tie_rule": "8/8",
118
+ "precondition_thinking_on": "29=29"
119
+ }
120
+ }
README.loom-fun-r8.md ADDED
@@ -0,0 +1,141 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ base_model: unsloth/Inkling-2-Mini-GGUF
3
+ license: apache-2.0
4
+ tags:
5
+ - loom
6
+ - loom-serve
7
+ - gguf
8
+ - strix-halo
9
+ - speculative-decoding
10
+ - dflash
11
+ ---
12
+
13
+ # Inkling-2-Mini (UD-Q4_K_XL) for AMD Loom
14
+
15
+ A [Loom](https://github.com/ROCm/hrx-system) package (`.loom` programs and a `model.json` card) for the unmodified GGUF checkpoint [unsloth/Inkling-2-Mini-GGUF](https://huggingface.co/unsloth/Inkling-2-Mini-GGUF) (`Inkling-2-Mini-UD-Q4_K_XL.gguf`), generated on an AMD Ryzen AI Max+ 395 "Strix Halo" with the [loom-skills](https://github.com/loom-fun/loom-skills) workflow. Learn more on the [Loom ecosystem website](https://loom-fun.github.io/loom-dev/).
16
+
17
+ ## Quick start
18
+
19
+ ```bash
20
+ pipx install "hrx-loom[hf]==0.2.0"
21
+ loom-fetch huggingface:loom-fun/unsloth-Inkling-2-Mini-loom:chat --materialize=copy --output=./inkling-2-mini
22
+ loom-serve --model=./inkling-2-mini/model.json '--device=amdgpu://?completion_spin_ns=4294967295' --pool_backing=fixed --parameter_mode=preload
23
+ ```
24
+
25
+ - `--materialize=copy` puts copies of the fetched package files in the output directory.
26
+ - `completion_spin_ns=4294967295` enables active waiting for GPU completions (uses CPU while GPU work is in flight); the card's performance measurements use this setting.
27
+ - `--pool_backing=fixed` commits the preset's memory pool up front instead of growing elastic backing.
28
+ - `--parameter_mode=preload` loads weights eagerly on startup rather than on the first request.
29
+
30
+ ## Sampling defaults, loop mitigation & manual DSpark / context overrides
31
+
32
+ - **Default sampling (matches checkpoint `general.sampling.*`):** `temperature: 1.0`, `top_p: 1.0`, `top_k: 0` (device sampler keeps up to 64 top candidates; exact 2-stage chunk-pruned top-k adds `< 0.2 ms/tok`, zero throughput penalty vs greedy). Clients that omit `temperature` automatically get the checkpoint's recommended `T = 1.0`.
33
+ - **Loop mitigation (Thinking Machines documented limitation):** Greedy decoding (`temperature: 0`) on long reasoning traces can trigger repetitive verification loops. Keep the default `temperature: 1.0, top_p: 1.0` and cap `max_tokens` and agent turns in client harnesses.
34
+ - **Per-request DSpark depth control (on a drafting-enabled server):** Pass `"draft_depth"` in `/v1/chat/completions` JSON:
35
+ - omitted or `-1` (default): **adaptive** DSpark (`d1 ↔ d3`, EMA thresholds `62.5% / 54.7%` short context, `83.0%` at `>= 16k` context; occupancy gate disables drafting at `>= 2` concurrent streams).
36
+ - `"draft_depth": 1`: **fixed depth 1**.
37
+ - `"draft_depth": 3` (or `>= 2`): **fixed full depth** (the server's configured `draft_depth`).
38
+ - *(To completely disable DSpark with zero proposals and zero drafter warm overhead, use the serve-time deployment override `"draft_depth": 0` below — `loom-serve`'s scheduler plans speculative slots at the deployment level.)*
39
+ - **Serve-time context & DSpark deployment override:** Create a tiny deployment JSON pointing to the fetched `model.json` to override `context_capacity` (e.g. `131072` for 64 GB Strix Halo, up to `262144` default) or truly disable/cap `draft_depth` globally (`0` = off, `1`, `2`, `3`):
40
+
41
+ ```json
42
+ {"name": "Inkling-2-Mini", "model": {"path": "./inkling-2-mini/model.json"}, "definition": {"kind": "text", "context_capacity": 131072, "draft_depth": 1}}
43
+ ```
44
+
45
+ ## Send a request
46
+
47
+ In another terminal (uses the package default `temperature: 1.0, top_p: 1.0`; optional thinking is turned off):
48
+
49
+ ```bash
50
+ curl http://127.0.0.1:8080/v1/chat/completions \
51
+ -H 'Content-Type: application/json' \
52
+ -d '{"model": "Inkling-2-Mini", "messages": [{"role": "user", "content": "Hello"}], "chat_template_kwargs": {"enable_thinking": false}}'
53
+ ```
54
+
55
+ ## Performance vs llama.cpp
56
+
57
+ All runs below were measured cool (`47–60 °C` start, `< 70 °C` end) on the same Strix Halo (`AMD Ryzen AI Max+ PRO 395 / Radeon 8060S`, `gfx1151`, 128 GB shared RAM, 85 W sustained laptop envelope, Ubuntu 24.04) with FP16 KV and unmodified weights (`Inkling-2-Mini-UD-Q4_K_XL.gguf`, `dspark-Inkling-2-Mini-Q8_0.gguf`).
58
+
59
+ ### Headline: Recommended Sampling (`temperature = 1.0, top_p = 1.0, top_k = 0, min_p = 0.0`)
60
+
61
+ | metric | llama.cpp ROCm `b1383` (`-np 1`) | llama.cpp Vulkan `b12602` (`-np 1`) | Loom undrafted (`draft_depth=0`) | Loom drafted (adaptive DSpark `d1↔d3`) | Loom undrafted vs best llama.cpp | Loom drafted vs best llama.cpp | true 48-pass roofline |
62
+ |---|---:|---:|---:|---:|---:|---:|---:|
63
+ | decode tok/s, short prose | 15.7 | 15.2 | **44.0** | **44.2–45.4** *(acc 0.16–0.18)* | **2.80×** | **2.82–2.89×** | 56.0 *(79–81%)* |
64
+ | decode tok/s, code (LRU class) | — | — | **43.0** | **58.5** *(acc 0.44)* | — | — | 56.0 *(1-pass)* |
65
+ | decode tok/s, math/reasoning | — | — | **42.0** | **64.0** *(acc 0.54)* | — | — | 56.0 *(1-pass)* |
66
+ | decode tok/s, 2k context | 14.9 | 14.5 | **40.5** | **50.2** *(acc 0.40)* | **2.72×** | **3.37×** | ~54.8 |
67
+ | decode tok/s, 32k context | 10.7 | 12.7 | **32.6** | **38.5** *(acc 0.22)* | **2.57×** | **3.03×** | ~44 |
68
+ | prefill tok/s, 1k document | 292.8 | 249.3 | **1,589.4** | **1,589.4** | **5.43×** | **5.43×** | ~4,300 *(37%)* |
69
+ | prefill tok/s, 2k document | 278.6 | 268.6 | **1,747.6** | **1,747.6** | **6.27×** | **6.27×** | ~4,200 *(42%)* |
70
+ | prefill tok/s, 8k document | 241.5 | 257.2 | **1,856.5** | **1,856.5** | **7.22×** | **7.22×** | ~4,000 *(46%)* |
71
+ | prefill tok/s, 16k document | 203.9 | 239.2 | **1,819.7** | **1,819.7** | **7.61×** | **7.61×** | ~3,800 *(48%)* |
72
+ | prefill tok/s, 32k document | 158.1 | 207.3 | **1,689.6** | **1,689.6** | **8.15×** | **8.15×** | ~3,600 *(47%)* |
73
+ | 4 streams, aggregate decode (`-np 4`) | 34.9 | 31.9 | **86.3** *(95.8 steady)* | **87.0** *(95.8 steady, gate off)* | **2.47×** | **2.49×** | — |
74
+ | speculative decoding, drafted tokens accepted | n/a | n/a | n/a | **50%** (`spec` gate) / **16–54%** (`T=1.0`) | n/a | n/a | n/a |
75
+
76
+ ### Separate Row: Greedy (`temperature = 0`, used by correctness gates)
77
+
78
+ | metric (`T = 0`) | llama.cpp ROCm `b1383` (`-np 1`) | llama.cpp Vulkan `b12602` (`-np 1`) | Loom undrafted (`draft_depth=0`) | Loom drafted (adaptive DSpark `d1↔d3`) | Loom drafted vs best llama.cpp |
79
+ |---|---:|---:|---:|---:|---:|
80
+ | decode tok/s, short prose | 15.2 | 17.2 | **43.8** | **48.5** *(acc 0.24)* | **2.82×** |
81
+ | decode tok/s, 2k context | 14.6 | 17.1 | **39.5** | **45.2** *(acc 0.23)* | **2.64×** |
82
+ | decode tok/s, 32k context | 10.7 | 12.7 | **33.2** | **39.1** *(acc 0.21)* | **3.08×** |
83
+ | 4 streams, steady aggregate (`-np 4`) | 39.4 | 37.7 | **87.6** | **95.8** *(gate off)* | **2.43×** |
84
+
85
+ **Methodology**
86
+
87
+ - **True 48-pass roofline:** Inkling-2-Mini is a looped transformer (24 physical blocks executed across 48 logical passes, touching `4.01 GB/token` active weights + KV and `9.77 GFLOP/token`). On Strix Halo (`228 GB/s` practical LPDDR5X, `43.8 TFLOP/s` sustained FP16 WMMA at 85 W), the true single-pass hardware ceilings are **`56.0 tok/s` decode** and **`4.3k → 3.6k tok/s` prefill** (1k → 32k). Automated `roofline.py` counts physical GGUF tensors once (`98.5 tok/s` / `9.6k tok/s`) and overstates ceilings by ~1.8× on looped architectures.
88
+ - **Fair engine comparison:** Both undrafted (`draft_depth=0`) and drafted (adaptive DSpark `d1↔d3`) Loom rows are shown alongside undrafted `llama.cpp` ROCm (`lemonade-sdk/llamacpp-rocm` `b1383`) and `llama.cpp` Vulkan (`ggml-org/llama.cpp` `b12602`) run with `-ngl 99 -cram 0 -c 38000 -kvu -np 1 --temp 1.0 --top-p 1.0 --top-k 0 --min-p 0.0` (`-c 35024 -np 4` for 4 streams) on the local `inkling2_loop` compatibility GGUF.
89
+ - **4 streams:** Loom's occupancy gate automatically turns off drafting at `>= 2` concurrent streams, so drafted and undrafted 4-stream runs execute identical single-token decode epochs (`86–87 tok/s` wall including prompt, `95.8 tok/s` steady decode window).
90
+ - Measured 2026-11-22 on `hrx-loom 0.2.0` (`AMD RYZEN AI MAX+ PRO 395 w/ Radeon 8060S`, Ubuntu 24.04). — not measured; n/a not applicable.
91
+
92
+ ## Features
93
+
94
+ | feature | status | detail |
95
+ |---|---|---|
96
+ | API | ✅ | OpenAI-style `/v1/chat/completions` |
97
+ | tool calling | ✅ | OpenAI-style `tools` and `tool_calls` |
98
+ | reasoning / thinking | ✅ | on by default; `chat_template_kwargs: {"enable_thinking": false}` turns it off |
99
+ | reasoning effort | ✅ | `reasoning_effort`: none, minimal, low, medium, high, xhigh, max (default high) |
100
+ | speculative decoding | ✅ | DFlash, depth 3, on by default; drafter [unsloth/Inkling-2-Mini-GGUF](https://huggingface.co/unsloth/Inkling-2-Mini-GGUF) |
101
+ | image input | ❌ | not supported by Loom (the upstream model has it) |
102
+ | audio input / output | — | not applicable |
103
+ | sampling | ✅ | `temperature`, `top_p`, `top_k`, `seed` |
104
+ | context size | ✅ | 262,144 tokens per request |
105
+ | concurrency | ✅ | 4 concurrent requests |
106
+ | max output tokens | ✅ | 4,096 (preset `max_tokens`) |
107
+
108
+ ## Correctness
109
+
110
+ | gate | description | result |
111
+ |---|---|---|
112
+ | `kernel_tests` | Unit tests of the generated kernels against reference implementations | ❌ no evidence |
113
+ | `golden` | llama.cpp reference recorded on the same GGUF: greedy tokens and top-5 log-probs, short prompts and 1k-32k documents | ✅ pass ¹ |
114
+ | `compare` | Greedy output vs the llama.cpp reference, token by token; every divergence is a near-tie | ✅ pass ¹ |
115
+ | `vision` | Image input vs llama.cpp with the same projector: identical prompt tokens, replies equal up to near-ties | — not applicable |
116
+ | `consistency` | Concurrent requests give the same output as the same requests run alone | ✅ pass ¹ |
117
+ | `spec` | Speculative decoding on gives exactly the output of speculative decoding off | ✅ pass ¹ |
118
+ | `agent` | Multi-turn tool-calling loop: exact prompt rendering, history reuse, valid tool calls, output vs llama.cpp | ✅ pass ¹ |
119
+ | `agent_think_off` | The tool-calling loop with thinking off | ✅ pass ¹ |
120
+ | `sampling` | temperature, top_k and seed behave as specified; first-token distribution matches llama.cpp | ✅ pass ¹ |
121
+ | `logits` | Host logits readback (llm.logits on): at T=0 every returned row's argmax is the device's token, the top-k matches llama.cpp, greedy text is unchanged | ❌ no evidence |
122
+ | `decision` | Decision answers (choice, score, noul probabilities) vs llama.cpp on the same prompts | — not applicable |
123
+
124
+ - ¹ local run, LEVEL=full, 2026-11-22; device AMD RYZEN AI MAX+ PRO 395 w/ Radeon 8060S, AMD Radeon 8060S Graphics, Ubuntu 24.04; hrx-loom unknown.
125
+ - Gates are the loom-benchmark correctness gates (`gates.sh`); a gate without a recorded run shows no evidence.
126
+
127
+ ## Files
128
+
129
+ - `model.json` / `model.json.lock`: the card and the pinned source files (sha256 checked by `loom-fetch`).
130
+ - `program/*.loom`, `weights.loom`: the generated Loom programs.
131
+ - `tokenizer.json`: the tokenizer.
132
+ - `llm_config.json`: the configuration the programs were generated from.
133
+ - `info.json`: the measurements, gate evidence and versions this card shows; everything else comes from the files above.
134
+ - `REPORT.md`: how the values above were measured: setup, commands and the value of every run.
135
+
136
+ Versions: card schema `loom-card/3`; loom-skills unknown; hrx-loom unknown; card generator unknown.
137
+
138
+ Source files, fetched by `loom-fetch` from their own repositories:
139
+
140
+ - checkpoint: [unsloth/Inkling-2-Mini-GGUF](https://huggingface.co/unsloth/Inkling-2-Mini-GGUF) @ `ea0c79b`, `Inkling-2-Mini-UD-Q4_K_XL.gguf`
141
+ - drafter: [unsloth/Inkling-2-Mini-GGUF](https://huggingface.co/unsloth/Inkling-2-Mini-GGUF) @ `ea0c79b`, `dspark-Inkling-2-Mini-Q8_0.gguf`
README.md ADDED
@@ -0,0 +1,52 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ base_model: unsloth/Inkling-2-Mini-GGUF
3
+ license: apache-2.0
4
+ tags:
5
+ - loom
6
+ - loom-serve
7
+ - gguf
8
+ - strix-halo
9
+ - speculative-decoding
10
+ ---
11
+
12
+ # Inkling-2-Mini (UD-Q4_K_XL, mainline layout) for AMD Loom
13
+
14
+ A [Loom](https://github.com/ROCm/hrx-system) card for [unsloth/Inkling-2-Mini-GGUF](https://huggingface.co/unsloth/Inkling-2-Mini-GGUF)
15
+ at revision `8078d149`. It reads the root `Inkling-2-Mini-UD-Q4_K_XL.gguf`, which is the mainline (`inkling2_loop`) layout
16
+ since 23 Nov 2026, with the DSpark drafter `dspark-Inkling-2-Mini-Q8_0_Old.gguf`.
17
+
18
+ It is [loom-fun/unsloth-Inkling-2-Mini-loom](https://huggingface.co/loom-fun/unsloth-Inkling-2-Mini-loom) release **r8**
19
+ (`4e018e88`, Apache-2.0, by the loom-fun authors) with **binding changes only**. The mainline file holds the same tensors
20
+ as the file r8 reads, renamed and regrouped:
21
+ - 48 loop-control tensors are renamed (`loop_{attn,k,v,mlp}_*` → `loop_{q,k,v,ffn}_ctrl_*`). Their bytes are identical.
22
+ - The two global loop-query tensors are split into 12 per-block `loop_msg_query` tensors. The one kernel that reads them
23
+ has a twin that reads the same four rows from the per-block tensor.
24
+
25
+ No other program, kernel or data file changed. `PROVENANCE.json` lists every file's sha256 and whether it is identical
26
+ to r8. r8's own card text is in `README.loom-fun-r8.md`.
27
+
28
+ ## Quick start
29
+
30
+ ```bash
31
+ pipx install "hrx-loom[hf]==0.3.0"
32
+ loom-fetch huggingface:1bit-MONSTER/Inkling-2-Mini-loom:chat --materialize=copy --output=./inkling-2-mini
33
+ loom-serve --model=./inkling-2-mini/model.json '--device=amdgpu://?completion_spin_ns=4294967295' --pool_backing=fixed
34
+ ```
35
+
36
+ ## Measured (AMD Ryzen AI Max+ 395, Radeon 8060S, gfx1151, hrx-loom 0.3.0)
37
+
38
+ - **Same output as r8:** greedy chat, 8 prompts × 256 tokens, rows 1, 32k, draft depth 3. This card on the mainline file
39
+ matched r8 on its original file 8/8, in both interleaved runs. Warm decode was 63.3 / 63.2 vs 63.0 / 64.0 tok/s.
40
+ - **#3158 accuracy row** (1bit-MONSTER engine gate, 24 Nov, strixhalo; Loom vs a CPU llama.cpp arbiter on the same mainline
41
+ GGUF, 8 prompts, thinking on, 768 tokens, reasoning compared): prompt-rendering precondition thinking-on 29 = 29.
42
+ Near-tie rule: **8/8** (4 identical, 4 splits, every one inside the reasoning at the CPU's 2nd choice, 0.031-0.263 nat).
43
+ - **Known answers + speed** (same run): 17*23 3/3 at ~91.6 tok/s decode; a 16.8K-token needle 3/3 at ~2,072 tok/s prefill
44
+ and ~54 tok/s decode.
45
+ - **Known, from r8:** with thinking OFF the card's prompt is 27 tokens where the model's template renders 29 (the template's
46
+ "Thinking effort level: 0" system line is not rendered). With thinking on both are 29. Unchanged from r8's chat program.
47
+
48
+ ## Licence and credit
49
+
50
+ Apache-2.0 (LICENSE), as r8. Programs by the loom-fun authors (Jeremy Fowers, Daniel Holanda), generated with
51
+ [loom-skills](https://github.com/loom-fun/loom-skills); binding changes by 1bit-MONSTER (see NOTICE). Model:
52
+ Inkling-2-Mini by Thinking Machines Lab; GGUF by Unsloth. No weights in this repository.
head_weights.loom ADDED
@@ -0,0 +1,94 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // Weight policy (the proposal head; draft/prep_weights.py): the listed tensors of the published checkpoint are staged and
2
+ // converted at load by llm_prep_<src>_<dst> (llm.loom); every other tensor keeps its file bytes. No converted
3
+ // checkpoint is written or published.
4
+
5
+ func.decl import("weights") @input(%source: i32, %key: buffer, %key_offset: i64, %key_length: i64, %offset: i64, %length: i64, %alignment: i64) -> (i64)
6
+
7
+ func.decl import("prepare") @stage(%root: buffer, %tag: i64) -> (i32)
8
+
9
+ func.decl import("prepare") @config_i64(%stage: i32, %key: buffer, %value: i64)
10
+
11
+ global.rodata.def @root0 = bytes("6c6c6d5f707265705f71385f30675f71345f3073")
12
+
13
+ global.rodata.def @split_key = bytes("6c6c6d2e707265705f73706c6974")
14
+
15
+ global.rodata.def @skip_key = bytes("6c6c6d2e707265705f736b6970")
16
+
17
+ global.rodata.def @blocks_key = bytes("6c6c6d2e707265705f626c6f636b73")
18
+
19
+ global.rodata.def @input_key = bytes("6c6c6d2e707265705f696e707574")
20
+
21
+ // "output.weight"
22
+ global.rodata.def @k0 = bytes("6f75747075742e776569676874")
23
+
24
+ func.def @same(%key: buffer, %name: buffer) -> (i1) {
25
+ %a = buffer.length %key
26
+ %b = buffer.length %name
27
+ %sized = index.cmp eq, %a, %b : offset
28
+ %result = scf.if %sized -> (i1) {
29
+ %o = index.constant 0 : offset
30
+ %order = buffer.compare %key[%o], %name[%o], %b
31
+ %z = scalar.constant 0 : i32
32
+ %same = scalar.cmpi eq, %order, %z : i32
33
+ scf.yield %same : i1
34
+ } else {
35
+ %no = scalar.constant false : i1
36
+ scf.yield %no : i1
37
+ }
38
+ func.return %result : i1
39
+ }
40
+
41
+ func.def public @prepare_weight(%key: buffer) -> (i64) {
42
+ %zero = scalar.constant 0 : i64
43
+ %blocks_0 = scalar.constant 0 : i64
44
+ %kind_0 = scalar.constant 0 : i64
45
+ %inb_0 = scalar.constant 0 : i64
46
+ %outb_0 = scalar.constant 0 : i64
47
+ %len_0 = scalar.constant 0 : i64
48
+ %split_0 = scalar.constant 0 : i64
49
+ %skip_0 = scalar.constant 0 : i64
50
+ %name0 = global.load @k0 : buffer
51
+ %is0 = func.call @same(%key, %name0) : (buffer, buffer) -> (i1)
52
+ %nb0 = scalar.constant 4718592 : i64
53
+ %nk0 = scalar.constant 0 : i64
54
+ %ni0 = scalar.constant 272 : i64
55
+ %no0 = scalar.constant 18 : i64
56
+ %blocks_1 = scf.select %is0, %nb0, %blocks_0 : i64
57
+ %kind_1 = scf.select %is0, %nk0, %kind_0 : i64
58
+ %inb_1 = scf.select %is0, %ni0, %inb_0 : i64
59
+ %outb_1 = scf.select %is0, %no0, %outb_0 : i64
60
+ %nl0 = scalar.constant 489741984 : i64
61
+ %nsp0 = scalar.constant 65536 : i64
62
+ %nsk0 = scalar.constant 72 : i64
63
+ %len_1 = scf.select %is0, %nl0, %len_0 : i64
64
+ %split_1 = scf.select %is0, %nsp0, %split_0 : i64
65
+ %skip_1 = scf.select %is0, %nsk0, %skip_0 : i64
66
+ %found = scalar.cmpi ne, %blocks_1, %zero : i64
67
+ %bytes = scf.if %found -> (i64) {
68
+ %source = scalar.constant 0 : i32
69
+ %align = scalar.constant 256 : i64
70
+ %length = scalar.addi %len_1, %zero : i64
71
+ %key_bytes = buffer.length %key
72
+ %key_length = index.cast %key_bytes : offset to i64
73
+ %first = func.call @input(%source, %key, %zero, %key_length, %zero, %length, %align) : (i32, buffer, i64, i64, i64, i64, i64) -> (i64)
74
+ %want0 = scalar.constant 0 : i64
75
+ %this0 = scalar.cmpi eq, %kind_1, %want0 : i64
76
+ scf.if %this0 {
77
+ %root0 = global.load @root0 : buffer
78
+ %stage0 = func.call @stage(%root0, %zero) : (buffer, i64) -> (i32)
79
+ %bk0 = global.load @blocks_key : buffer
80
+ %ik0 = global.load @input_key : buffer
81
+ func.call @config_i64(%stage0, %bk0, %blocks_1) : (i32, buffer, i64)
82
+ func.call @config_i64(%stage0, %ik0, %first) : (i32, buffer, i64)
83
+ %spk0 = global.load @split_key : buffer
84
+ %skk0 = global.load @skip_key : buffer
85
+ func.call @config_i64(%stage0, %spk0, %split_1) : (i32, buffer, i64)
86
+ func.call @config_i64(%stage0, %skk0, %skip_1) : (i32, buffer, i64)
87
+ }
88
+ %prepared = scalar.muli %blocks_1, %outb_1 : i64
89
+ scf.yield %prepared : i64
90
+ } else {
91
+ scf.yield %zero : i64
92
+ }
93
+ func.return %bytes : i64
94
+ }
info.json ADDED
@@ -0,0 +1,1196 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "card": {
3
+ "features": {
4
+ "api": {
5
+ "status": "yes",
6
+ "value": {
7
+ "endpoint": "/v1/chat/completions",
8
+ "style": "openai"
9
+ }
10
+ },
11
+ "audio": {
12
+ "status": "n/a",
13
+ "value": null
14
+ },
15
+ "concurrency": {
16
+ "status": "yes",
17
+ "value": {
18
+ "pending_requests": null,
19
+ "rows": 4
20
+ }
21
+ },
22
+ "context": {
23
+ "status": "yes",
24
+ "value": {
25
+ "native": 1048576,
26
+ "tokens": 262144
27
+ }
28
+ },
29
+ "image_input": {
30
+ "status": "no",
31
+ "value": null
32
+ },
33
+ "max_output_tokens": {
34
+ "status": "yes",
35
+ "value": {
36
+ "max_tokens": 4096
37
+ }
38
+ },
39
+ "reasoning_effort": {
40
+ "status": "yes",
41
+ "value": {
42
+ "default": "high",
43
+ "levels": [
44
+ "none",
45
+ "minimal",
46
+ "low",
47
+ "medium",
48
+ "high",
49
+ "xhigh",
50
+ "max"
51
+ ]
52
+ }
53
+ },
54
+ "sampling": {
55
+ "status": "yes",
56
+ "value": null
57
+ },
58
+ "speculative_decoding": {
59
+ "status": "yes",
60
+ "value": {
61
+ "depth": 3,
62
+ "drafter": "unsloth/Inkling-2-Mini-GGUF",
63
+ "method": "dflash"
64
+ }
65
+ },
66
+ "thinking": {
67
+ "status": "yes",
68
+ "value": {
69
+ "default": true,
70
+ "mode": "toggle"
71
+ }
72
+ },
73
+ "tool_calling": {
74
+ "status": "yes",
75
+ "value": null
76
+ }
77
+ },
78
+ "license": "apache-2.0",
79
+ "memory_bytes": 33000000000,
80
+ "output": "/home/sawsriva/Projects/loom/work/inkling2/pub/info.json"
81
+ },
82
+ "devices": {
83
+ "strix-halo": {
84
+ "gates": {},
85
+ "performance": {
86
+ "baseline": {
87
+ "args": "-ngl 99 -cram 0 -c 38000 -kvu -np 1 --temp 1.0 --top-p 1.0 --top-k 0 --min-p 0.0 (c4: -c 35024 -np 4)",
88
+ "name": "llama.cpp",
89
+ "version": "llamacpp-rocm/b1383"
90
+ },
91
+ "sessions": [
92
+ {
93
+ "aggregate": "median",
94
+ "commands": [],
95
+ "date": "2026-11-21",
96
+ "metrics": {
97
+ "decode": {
98
+ "acceptance": 0.577,
99
+ "baseline": 15.3,
100
+ "baseline_runs": [
101
+ 14.89,
102
+ 15.67
103
+ ],
104
+ "loom": 45.4,
105
+ "loom_runs": [
106
+ 45.4,
107
+ 45.38
108
+ ]
109
+ },
110
+ "decode_2k": {
111
+ "acceptance": 0.644,
112
+ "baseline": 14.4,
113
+ "baseline_runs": [
114
+ 13.87,
115
+ 14.97
116
+ ],
117
+ "loom": 43.5,
118
+ "loom_runs": [
119
+ 43.47,
120
+ 43.52
121
+ ]
122
+ },
123
+ "decode_32k": {
124
+ "acceptance": 0.636,
125
+ "baseline": 10.8,
126
+ "baseline_runs": [
127
+ 10.8
128
+ ],
129
+ "loom": 31.6,
130
+ "loom_runs": [
131
+ 31.61
132
+ ]
133
+ },
134
+ "prefill_16k": {
135
+ "baseline": 206.1,
136
+ "baseline_runs": [
137
+ 206.1
138
+ ],
139
+ "loom": 1641.5,
140
+ "loom_runs": [
141
+ 1641.5
142
+ ]
143
+ },
144
+ "prefill_1k": {
145
+ "baseline": 288.9,
146
+ "baseline_runs": [
147
+ 289.0,
148
+ 288.9
149
+ ],
150
+ "loom": 1488.6,
151
+ "loom_runs": [
152
+ 1490.0,
153
+ 1487.2
154
+ ]
155
+ },
156
+ "prefill_2k": {
157
+ "baseline": 273.1,
158
+ "baseline_runs": [
159
+ 273.3,
160
+ 273.0
161
+ ],
162
+ "loom": 1699.0,
163
+ "loom_runs": [
164
+ 1700.1,
165
+ 1697.9
166
+ ]
167
+ },
168
+ "prefill_32k": {
169
+ "baseline": 159.7,
170
+ "baseline_runs": [
171
+ 159.7
172
+ ],
173
+ "loom": 1264.7,
174
+ "loom_runs": [
175
+ 1264.7
176
+ ]
177
+ },
178
+ "prefill_8k": {
179
+ "baseline": 241.3,
180
+ "baseline_runs": [
181
+ 241.3
182
+ ],
183
+ "loom": 1735.0,
184
+ "loom_runs": [
185
+ 1735.0
186
+ ]
187
+ },
188
+ "streams4": {
189
+ "acceptance": 0.0,
190
+ "baseline": 39.7,
191
+ "baseline_runs": [
192
+ 39.7
193
+ ],
194
+ "loom": 88.7,
195
+ "loom_runs": [
196
+ 88.7
197
+ ]
198
+ }
199
+ },
200
+ "programs_sha256": "1170a90da0bc7dbcbf7188466f74a88b8699d9069214f9aa8e05cf941e3e1c8b",
201
+ "runs": {
202
+ "decode_prefill": 2,
203
+ "streams4": 1
204
+ },
205
+ "source": "machine"
206
+ },
207
+ {
208
+ "aggregate": "median",
209
+ "commands": [],
210
+ "date": "2026-11-21",
211
+ "metrics": {
212
+ "decode": {
213
+ "acceptance": 0.577,
214
+ "baseline": 15.3,
215
+ "baseline_runs": [
216
+ 14.89,
217
+ 15.67
218
+ ],
219
+ "loom": 46.4,
220
+ "loom_runs": [
221
+ 46.61,
222
+ 46.21
223
+ ]
224
+ },
225
+ "decode_2k": {
226
+ "acceptance": 0.635,
227
+ "baseline": 14.4,
228
+ "baseline_runs": [
229
+ 13.87,
230
+ 14.97
231
+ ],
232
+ "loom": 44.7,
233
+ "loom_runs": [
234
+ 44.23,
235
+ 45.23
236
+ ]
237
+ },
238
+ "decode_32k": {
239
+ "acceptance": 0.703,
240
+ "baseline": 10.8,
241
+ "baseline_runs": [
242
+ 10.8
243
+ ],
244
+ "loom": 32.9,
245
+ "loom_runs": [
246
+ 32.87
247
+ ]
248
+ },
249
+ "prefill_16k": {
250
+ "baseline": 206.1,
251
+ "baseline_runs": [
252
+ 206.1
253
+ ],
254
+ "loom": 1607.8,
255
+ "loom_runs": [
256
+ 1607.8
257
+ ]
258
+ },
259
+ "prefill_1k": {
260
+ "baseline": 288.9,
261
+ "baseline_runs": [
262
+ 289.0,
263
+ 288.9
264
+ ],
265
+ "loom": 1448.2,
266
+ "loom_runs": [
267
+ 1451.1,
268
+ 1445.3
269
+ ]
270
+ },
271
+ "prefill_2k": {
272
+ "baseline": 273.1,
273
+ "baseline_runs": [
274
+ 273.3,
275
+ 273.0
276
+ ],
277
+ "loom": 1648.8,
278
+ "loom_runs": [
279
+ 1646.3,
280
+ 1651.4
281
+ ]
282
+ },
283
+ "prefill_32k": {
284
+ "baseline": 159.7,
285
+ "baseline_runs": [
286
+ 159.7
287
+ ],
288
+ "loom": 1243.5,
289
+ "loom_runs": [
290
+ 1243.5
291
+ ]
292
+ },
293
+ "prefill_8k": {
294
+ "baseline": 241.3,
295
+ "baseline_runs": [
296
+ 241.3
297
+ ],
298
+ "loom": 1687.6,
299
+ "loom_runs": [
300
+ 1687.6
301
+ ]
302
+ }
303
+ },
304
+ "programs_sha256": "251afe746679d8d46b97eb077afef2083f679f84d428a92d6ce838c071c1d136",
305
+ "runs": {
306
+ "decode_prefill": 2,
307
+ "streams4": null
308
+ },
309
+ "source": "devlab"
310
+ },
311
+ {
312
+ "aggregate": "median",
313
+ "commands": [],
314
+ "date": "2026-11-21",
315
+ "metrics": {
316
+ "decode": {
317
+ "acceptance": 0.577,
318
+ "baseline": 15.3,
319
+ "baseline_runs": [
320
+ 14.89,
321
+ 15.67
322
+ ],
323
+ "loom": 46.4,
324
+ "loom_runs": [
325
+ 46.61,
326
+ 46.21
327
+ ]
328
+ },
329
+ "decode_2k": {
330
+ "acceptance": 0.635,
331
+ "baseline": 14.4,
332
+ "baseline_runs": [
333
+ 13.87,
334
+ 14.97
335
+ ],
336
+ "loom": 44.7,
337
+ "loom_runs": [
338
+ 44.23,
339
+ 45.23
340
+ ]
341
+ },
342
+ "decode_32k": {
343
+ "acceptance": 0.703,
344
+ "baseline": 10.8,
345
+ "baseline_runs": [
346
+ 10.8
347
+ ],
348
+ "loom": 32.9,
349
+ "loom_runs": [
350
+ 32.87
351
+ ]
352
+ },
353
+ "prefill_16k": {
354
+ "baseline": 206.1,
355
+ "baseline_runs": [
356
+ 206.1
357
+ ],
358
+ "loom": 1607.8,
359
+ "loom_runs": [
360
+ 1607.8
361
+ ]
362
+ },
363
+ "prefill_1k": {
364
+ "baseline": 288.9,
365
+ "baseline_runs": [
366
+ 289.0,
367
+ 288.9
368
+ ],
369
+ "loom": 1448.2,
370
+ "loom_runs": [
371
+ 1451.1,
372
+ 1445.3
373
+ ]
374
+ },
375
+ "prefill_2k": {
376
+ "baseline": 273.1,
377
+ "baseline_runs": [
378
+ 273.3,
379
+ 273.0
380
+ ],
381
+ "loom": 1648.8,
382
+ "loom_runs": [
383
+ 1646.3,
384
+ 1651.4
385
+ ]
386
+ },
387
+ "prefill_32k": {
388
+ "baseline": 159.7,
389
+ "baseline_runs": [
390
+ 159.7
391
+ ],
392
+ "loom": 1243.5,
393
+ "loom_runs": [
394
+ 1243.5
395
+ ]
396
+ },
397
+ "prefill_8k": {
398
+ "baseline": 241.3,
399
+ "baseline_runs": [
400
+ 241.3
401
+ ],
402
+ "loom": 1687.6,
403
+ "loom_runs": [
404
+ 1687.6
405
+ ]
406
+ },
407
+ "streams4": {
408
+ "baseline": 39.7,
409
+ "baseline_runs": [
410
+ 39.7
411
+ ],
412
+ "loom": 98.8,
413
+ "loom_runs": [
414
+ 98.8
415
+ ]
416
+ }
417
+ },
418
+ "programs_sha256": "251afe746679d8d46b97eb077afef2083f679f84d428a92d6ce838c071c1d136",
419
+ "runs": {
420
+ "decode_prefill": 2,
421
+ "streams4": 1
422
+ },
423
+ "source": "devlab"
424
+ },
425
+ {
426
+ "aggregate": "median",
427
+ "commands": [],
428
+ "date": "2026-11-21",
429
+ "metrics": {
430
+ "decode": {
431
+ "acceptance": 0.585,
432
+ "baseline": 15.3,
433
+ "baseline_runs": [
434
+ 14.89,
435
+ 15.67
436
+ ],
437
+ "loom": 46.5,
438
+ "loom_runs": [
439
+ 46.52
440
+ ]
441
+ },
442
+ "decode_2k": {
443
+ "acceptance": 0.635,
444
+ "baseline": 14.4,
445
+ "baseline_runs": [
446
+ 13.87,
447
+ 14.97
448
+ ],
449
+ "loom": 44.4,
450
+ "loom_runs": [
451
+ 44.41
452
+ ]
453
+ },
454
+ "decode_32k": {
455
+ "acceptance": 0.658,
456
+ "baseline": 10.8,
457
+ "baseline_runs": [
458
+ 10.8
459
+ ],
460
+ "loom": 37.7,
461
+ "loom_runs": [
462
+ 37.7
463
+ ]
464
+ },
465
+ "prefill_16k": {
466
+ "baseline": 206.1,
467
+ "baseline_runs": [
468
+ 206.1
469
+ ],
470
+ "loom": 1692.8,
471
+ "loom_runs": [
472
+ 1692.8
473
+ ]
474
+ },
475
+ "prefill_1k": {
476
+ "baseline": 288.9,
477
+ "baseline_runs": [
478
+ 289.0,
479
+ 288.9
480
+ ],
481
+ "loom": 1420.4,
482
+ "loom_runs": [
483
+ 1420.4
484
+ ]
485
+ },
486
+ "prefill_2k": {
487
+ "baseline": 273.1,
488
+ "baseline_runs": [
489
+ 273.3,
490
+ 273.0
491
+ ],
492
+ "loom": 1666.8,
493
+ "loom_runs": [
494
+ 1666.8
495
+ ]
496
+ },
497
+ "prefill_32k": {
498
+ "baseline": 159.7,
499
+ "baseline_runs": [
500
+ 159.7
501
+ ],
502
+ "loom": 1604.6,
503
+ "loom_runs": [
504
+ 1604.6
505
+ ]
506
+ },
507
+ "prefill_8k": {
508
+ "baseline": 241.3,
509
+ "baseline_runs": [
510
+ 241.3
511
+ ],
512
+ "loom": 1713.0,
513
+ "loom_runs": [
514
+ 1713.0
515
+ ]
516
+ },
517
+ "streams4": {
518
+ "baseline": 39.7,
519
+ "baseline_runs": [
520
+ 39.7
521
+ ],
522
+ "loom": 89.8,
523
+ "loom_runs": [
524
+ 89.8
525
+ ]
526
+ }
527
+ },
528
+ "programs_sha256": "8cb36d5ba16ce31a158c0d7fb84f33760f0d746e806369668b8b0290439598ff",
529
+ "runs": {
530
+ "decode_prefill": 1,
531
+ "streams4": 1
532
+ },
533
+ "source": "devlab"
534
+ },
535
+ {
536
+ "aggregate": "median",
537
+ "commands": [],
538
+ "date": "2026-11-22",
539
+ "metrics": {
540
+ "decode": {
541
+ "acceptance": 0.209,
542
+ "baseline": 15.3,
543
+ "baseline_runs": [
544
+ 14.89,
545
+ 15.67
546
+ ],
547
+ "loom": 46.0,
548
+ "loom_runs": [
549
+ 46.0
550
+ ]
551
+ },
552
+ "decode_2k": {
553
+ "acceptance": 0.215,
554
+ "baseline": 14.4,
555
+ "baseline_runs": [
556
+ 13.87,
557
+ 14.97
558
+ ],
559
+ "loom": 43.1,
560
+ "loom_runs": [
561
+ 43.06
562
+ ]
563
+ },
564
+ "decode_32k": {
565
+ "acceptance": 0.227,
566
+ "baseline": 10.8,
567
+ "baseline_runs": [
568
+ 10.8
569
+ ],
570
+ "loom": 14.8,
571
+ "loom_runs": [
572
+ 14.78
573
+ ]
574
+ },
575
+ "prefill_16k": {
576
+ "baseline": 206.1,
577
+ "baseline_runs": [
578
+ 206.1
579
+ ],
580
+ "loom": 1529.2,
581
+ "loom_runs": [
582
+ 1529.2
583
+ ]
584
+ },
585
+ "prefill_1k": {
586
+ "baseline": 288.9,
587
+ "baseline_runs": [
588
+ 289.0,
589
+ 288.9
590
+ ],
591
+ "loom": 1456.3,
592
+ "loom_runs": [
593
+ 1456.3
594
+ ]
595
+ },
596
+ "prefill_2k": {
597
+ "baseline": 273.1,
598
+ "baseline_runs": [
599
+ 273.3,
600
+ 273.0
601
+ ],
602
+ "loom": 1639.3,
603
+ "loom_runs": [
604
+ 1639.3
605
+ ]
606
+ },
607
+ "prefill_32k": {
608
+ "baseline": 159.7,
609
+ "baseline_runs": [
610
+ 159.7
611
+ ],
612
+ "loom": 1252.9,
613
+ "loom_runs": [
614
+ 1252.9
615
+ ]
616
+ },
617
+ "prefill_8k": {
618
+ "baseline": 241.3,
619
+ "baseline_runs": [
620
+ 241.3
621
+ ],
622
+ "loom": 1580.3,
623
+ "loom_runs": [
624
+ 1580.3
625
+ ]
626
+ },
627
+ "streams4": {
628
+ "baseline": 39.7,
629
+ "baseline_runs": [
630
+ 39.7
631
+ ],
632
+ "loom": 89.8,
633
+ "loom_runs": [
634
+ 89.8
635
+ ]
636
+ }
637
+ },
638
+ "programs_sha256": "91e3bbda29f45cde8e3a6caec38364de9a34262be172d48b0184f87aac1c07dd",
639
+ "runs": {
640
+ "decode_prefill": 1,
641
+ "streams4": 1
642
+ },
643
+ "source": "devlab"
644
+ },
645
+ {
646
+ "aggregate": "median",
647
+ "commands": [],
648
+ "date": "2026-11-22",
649
+ "metrics": {
650
+ "decode": {
651
+ "acceptance": 0.209,
652
+ "baseline": 15.3,
653
+ "baseline_runs": [
654
+ 14.89,
655
+ 15.67
656
+ ],
657
+ "loom": 46.0,
658
+ "loom_runs": [
659
+ 46.0
660
+ ]
661
+ },
662
+ "decode_2k": {
663
+ "acceptance": 0.215,
664
+ "baseline": 14.4,
665
+ "baseline_runs": [
666
+ 13.87,
667
+ 14.97
668
+ ],
669
+ "loom": 43.1,
670
+ "loom_runs": [
671
+ 43.06
672
+ ]
673
+ },
674
+ "decode_32k": {
675
+ "acceptance": 0.227,
676
+ "baseline": 10.8,
677
+ "baseline_runs": [
678
+ 10.8
679
+ ],
680
+ "loom": 14.8,
681
+ "loom_runs": [
682
+ 14.78
683
+ ]
684
+ },
685
+ "prefill_16k": {
686
+ "baseline": 206.1,
687
+ "baseline_runs": [
688
+ 206.1
689
+ ],
690
+ "loom": 1529.2,
691
+ "loom_runs": [
692
+ 1529.2
693
+ ]
694
+ },
695
+ "prefill_1k": {
696
+ "baseline": 288.9,
697
+ "baseline_runs": [
698
+ 289.0,
699
+ 288.9
700
+ ],
701
+ "loom": 1456.3,
702
+ "loom_runs": [
703
+ 1456.3
704
+ ]
705
+ },
706
+ "prefill_2k": {
707
+ "baseline": 273.1,
708
+ "baseline_runs": [
709
+ 273.3,
710
+ 273.0
711
+ ],
712
+ "loom": 1639.3,
713
+ "loom_runs": [
714
+ 1639.3
715
+ ]
716
+ },
717
+ "prefill_32k": {
718
+ "baseline": 159.7,
719
+ "baseline_runs": [
720
+ 159.7
721
+ ],
722
+ "loom": 1252.9,
723
+ "loom_runs": [
724
+ 1252.9
725
+ ]
726
+ },
727
+ "prefill_8k": {
728
+ "baseline": 241.3,
729
+ "baseline_runs": [
730
+ 241.3
731
+ ],
732
+ "loom": 1580.3,
733
+ "loom_runs": [
734
+ 1580.3
735
+ ]
736
+ },
737
+ "streams4": {
738
+ "baseline": 39.7,
739
+ "baseline_runs": [
740
+ 39.7
741
+ ],
742
+ "loom": 89.8,
743
+ "loom_runs": [
744
+ 89.8
745
+ ]
746
+ }
747
+ },
748
+ "programs_sha256": "91e3bbda29f45cde8e3a6caec38364de9a34262be172d48b0184f87aac1c07dd",
749
+ "runs": {
750
+ "decode_prefill": 1,
751
+ "streams4": 1
752
+ },
753
+ "source": "devlab"
754
+ },
755
+ {
756
+ "aggregate": "median",
757
+ "commands": [],
758
+ "date": "2026-11-22",
759
+ "metrics": {
760
+ "decode": {
761
+ "acceptance": 0.209,
762
+ "baseline": 15.3,
763
+ "baseline_runs": [
764
+ 14.89,
765
+ 15.67
766
+ ],
767
+ "loom": 48.6,
768
+ "loom_runs": [
769
+ 48.57
770
+ ]
771
+ },
772
+ "decode_2k": {
773
+ "acceptance": 0.255,
774
+ "baseline": 14.4,
775
+ "baseline_runs": [
776
+ 13.87,
777
+ 14.97
778
+ ],
779
+ "loom": 47.0,
780
+ "loom_runs": [
781
+ 47.02
782
+ ]
783
+ },
784
+ "decode_32k": {
785
+ "acceptance": 0.198,
786
+ "baseline": 10.8,
787
+ "baseline_runs": [
788
+ 10.8
789
+ ],
790
+ "loom": 37.7,
791
+ "loom_runs": [
792
+ 37.72
793
+ ]
794
+ },
795
+ "prefill_16k": {
796
+ "baseline": 206.1,
797
+ "baseline_runs": [
798
+ 206.1
799
+ ],
800
+ "loom": 1826.9,
801
+ "loom_runs": [
802
+ 1826.9
803
+ ]
804
+ },
805
+ "prefill_1k": {
806
+ "baseline": 288.9,
807
+ "baseline_runs": [
808
+ 289.0,
809
+ 288.9
810
+ ],
811
+ "loom": 1604.6,
812
+ "loom_runs": [
813
+ 1604.6
814
+ ]
815
+ },
816
+ "prefill_2k": {
817
+ "baseline": 273.1,
818
+ "baseline_runs": [
819
+ 273.3,
820
+ 273.0
821
+ ],
822
+ "loom": 1790.1,
823
+ "loom_runs": [
824
+ 1790.1
825
+ ]
826
+ },
827
+ "prefill_32k": {
828
+ "baseline": 159.7,
829
+ "baseline_runs": [
830
+ 159.7
831
+ ],
832
+ "loom": 1696.8,
833
+ "loom_runs": [
834
+ 1696.8
835
+ ]
836
+ },
837
+ "prefill_8k": {
838
+ "baseline": 241.3,
839
+ "baseline_runs": [
840
+ 241.3
841
+ ],
842
+ "loom": 1870.8,
843
+ "loom_runs": [
844
+ 1870.8
845
+ ]
846
+ },
847
+ "streams4": {
848
+ "baseline": 39.7,
849
+ "baseline_runs": [
850
+ 39.7
851
+ ],
852
+ "loom": 93.4,
853
+ "loom_runs": [
854
+ 93.4
855
+ ]
856
+ }
857
+ },
858
+ "programs_sha256": "219789284ccdcf69f1c4fbb4cb95b68840c49c9e9373ac2bab73a00dc2431a84",
859
+ "runs": {
860
+ "decode_prefill": 1,
861
+ "streams4": 1
862
+ },
863
+ "source": "devlab"
864
+ },
865
+ {
866
+ "aggregate": "median",
867
+ "commands": [],
868
+ "date": "2026-11-22",
869
+ "metrics": {
870
+ "decode": {
871
+ "acceptance": 0.241,
872
+ "baseline": 15.7,
873
+ "baseline_runs": [
874
+ 15.74
875
+ ],
876
+ "loom": 48.5,
877
+ "loom_runs": [
878
+ 48.5
879
+ ]
880
+ },
881
+ "decode_2k": {
882
+ "acceptance": 0.231,
883
+ "baseline": 14.9,
884
+ "baseline_runs": [
885
+ 14.87
886
+ ],
887
+ "loom": 45.2,
888
+ "loom_runs": [
889
+ 45.2
890
+ ]
891
+ },
892
+ "decode_32k": {
893
+ "acceptance": 0.212,
894
+ "baseline": 10.7,
895
+ "baseline_runs": [
896
+ 10.71
897
+ ],
898
+ "loom": 39.1,
899
+ "loom_runs": [
900
+ 39.1
901
+ ]
902
+ },
903
+ "prefill_16k": {
904
+ "baseline": 203.9,
905
+ "baseline_runs": [
906
+ 203.9
907
+ ],
908
+ "loom": 1819.7,
909
+ "loom_runs": [
910
+ 1819.7
911
+ ]
912
+ },
913
+ "prefill_1k": {
914
+ "baseline": 292.8,
915
+ "baseline_runs": [
916
+ 292.8
917
+ ],
918
+ "loom": 1589.4,
919
+ "loom_runs": [
920
+ 1589.4
921
+ ]
922
+ },
923
+ "prefill_2k": {
924
+ "baseline": 278.6,
925
+ "baseline_runs": [
926
+ 278.6
927
+ ],
928
+ "loom": 1747.6,
929
+ "loom_runs": [
930
+ 1747.6
931
+ ]
932
+ },
933
+ "prefill_32k": {
934
+ "baseline": 158.1,
935
+ "baseline_runs": [
936
+ 158.1
937
+ ],
938
+ "loom": 1689.6,
939
+ "loom_runs": [
940
+ 1689.6
941
+ ]
942
+ },
943
+ "prefill_8k": {
944
+ "baseline": 241.5,
945
+ "baseline_runs": [
946
+ 241.5
947
+ ],
948
+ "loom": 1856.5,
949
+ "loom_runs": [
950
+ 1856.5
951
+ ]
952
+ },
953
+ "streams4": {
954
+ "baseline": 39.4,
955
+ "baseline_runs": [
956
+ 39.4
957
+ ],
958
+ "loom": 95.8,
959
+ "loom_runs": [
960
+ 95.8
961
+ ]
962
+ }
963
+ },
964
+ "programs_sha256": "f3d1518c4cdb64e0c997b14f89c884878aad3e7d83a3f6c0fe01bdd4a3783041",
965
+ "runs": {
966
+ "decode_prefill": 1,
967
+ "streams4": 1
968
+ },
969
+ "source": "devlab"
970
+ },
971
+ {
972
+ "aggregate": "median",
973
+ "commands": [],
974
+ "date": "2026-11-22",
975
+ "metrics": {
976
+ "decode": {
977
+ "acceptance": 0.241,
978
+ "baseline": 15.7,
979
+ "baseline_runs": [
980
+ 15.74
981
+ ],
982
+ "loom": 48.5,
983
+ "loom_runs": [
984
+ 48.5
985
+ ]
986
+ },
987
+ "decode_2k": {
988
+ "acceptance": 0.231,
989
+ "baseline": 14.9,
990
+ "baseline_runs": [
991
+ 14.87
992
+ ],
993
+ "loom": 45.2,
994
+ "loom_runs": [
995
+ 45.2
996
+ ]
997
+ },
998
+ "decode_32k": {
999
+ "acceptance": 0.212,
1000
+ "baseline": 10.7,
1001
+ "baseline_runs": [
1002
+ 10.71
1003
+ ],
1004
+ "loom": 39.1,
1005
+ "loom_runs": [
1006
+ 39.1
1007
+ ]
1008
+ },
1009
+ "prefill_16k": {
1010
+ "baseline": 203.9,
1011
+ "baseline_runs": [
1012
+ 203.9
1013
+ ],
1014
+ "loom": 1819.7,
1015
+ "loom_runs": [
1016
+ 1819.7
1017
+ ]
1018
+ },
1019
+ "prefill_1k": {
1020
+ "baseline": 292.8,
1021
+ "baseline_runs": [
1022
+ 292.8
1023
+ ],
1024
+ "loom": 1589.4,
1025
+ "loom_runs": [
1026
+ 1589.4
1027
+ ]
1028
+ },
1029
+ "prefill_2k": {
1030
+ "baseline": 278.6,
1031
+ "baseline_runs": [
1032
+ 278.6
1033
+ ],
1034
+ "loom": 1747.6,
1035
+ "loom_runs": [
1036
+ 1747.6
1037
+ ]
1038
+ },
1039
+ "prefill_32k": {
1040
+ "baseline": 158.1,
1041
+ "baseline_runs": [
1042
+ 158.1
1043
+ ],
1044
+ "loom": 1689.6,
1045
+ "loom_runs": [
1046
+ 1689.6
1047
+ ]
1048
+ },
1049
+ "prefill_8k": {
1050
+ "baseline": 241.5,
1051
+ "baseline_runs": [
1052
+ 241.5
1053
+ ],
1054
+ "loom": 1856.5,
1055
+ "loom_runs": [
1056
+ 1856.5
1057
+ ]
1058
+ },
1059
+ "streams4": {
1060
+ "baseline": 39.4,
1061
+ "baseline_runs": [
1062
+ 39.4
1063
+ ],
1064
+ "loom": 95.8,
1065
+ "loom_runs": [
1066
+ 95.8
1067
+ ]
1068
+ }
1069
+ },
1070
+ "programs_sha256": "f3d1518c4cdb64e0c997b14f89c884878aad3e7d83a3f6c0fe01bdd4a3783041",
1071
+ "runs": {
1072
+ "decode_prefill": 1,
1073
+ "streams4": 1
1074
+ },
1075
+ "source": "devlab"
1076
+ }
1077
+ ]
1078
+ },
1079
+ "quick_start": {
1080
+ "args": [
1081
+ "--pool_backing=fixed",
1082
+ "--parameter_mode=preload"
1083
+ ],
1084
+ "device": "amdgpu://?completion_spin_ns=4294967295",
1085
+ "preset": "chat"
1086
+ },
1087
+ "roofline": {
1088
+ "checkpoint": "Inkling-2-Mini-UD-Q4_K_XL.gguf",
1089
+ "device": {
1090
+ "bandwidth_bytes_per_s": 228000000000.0,
1091
+ "name": "AMD Ryzen AI Max+ 395 \"Strix Halo\" (gfx1151)",
1092
+ "peak_flops": 43800000000000.0,
1093
+ "power_mode": "85 W",
1094
+ "spec_peak_flops": 59000000000000.0
1095
+ },
1096
+ "drafting": {
1097
+ "acceptance": null,
1098
+ "depth": 1,
1099
+ "method": "dflash",
1100
+ "tokens_per_pass": null
1101
+ },
1102
+ "metrics": {
1103
+ "decode": {
1104
+ "ceiling": 98.5,
1105
+ "efficiency": 0.78
1106
+ },
1107
+ "decode_2k": {
1108
+ "ceiling": 93.8,
1109
+ "efficiency": 0.787
1110
+ },
1111
+ "decode_32k": {
1112
+ "ceiling": 78.0,
1113
+ "efficiency": 0.813
1114
+ },
1115
+ "prefill_16k": {
1116
+ "ceiling": 8642.8,
1117
+ "efficiency": 0.445
1118
+ },
1119
+ "prefill_1k": {
1120
+ "ceiling": 9583.4,
1121
+ "efficiency": 0.445
1122
+ },
1123
+ "prefill_2k": {
1124
+ "ceiling": 9283.9,
1125
+ "efficiency": 0.445
1126
+ },
1127
+ "prefill_32k": {
1128
+ "ceiling": 8020.5,
1129
+ "efficiency": 0.445
1130
+ },
1131
+ "prefill_8k": {
1132
+ "ceiling": 8991.6,
1133
+ "efficiency": 0.445
1134
+ },
1135
+ "streams4": {
1136
+ "basis": "shared-experts",
1137
+ "ceiling": 379.1,
1138
+ "efficiency": 0.85
1139
+ }
1140
+ },
1141
+ "tool": {
1142
+ "script": "skills/loom-roofline/roofline.py",
1143
+ "sha256": "89f99027ab117da473420a6c3484067dd4130efc90fa2eaf431f9070036e0e71",
1144
+ "skills_commit": "unknown"
1145
+ }
1146
+ }
1147
+ }
1148
+ },
1149
+ "repo": "1bit-MONSTER/Inkling-2-Mini-loom",
1150
+ "report": "generated",
1151
+ "schema": "loom-card/3",
1152
+ "sources": {
1153
+ "devlab": {
1154
+ "device": {
1155
+ "cpu": "AMD RYZEN AI MAX+ PRO 395 w/ Radeon 8060S",
1156
+ "gpu": "AMD Radeon 8060S Graphics",
1157
+ "os": "Ubuntu 24.04"
1158
+ },
1159
+ "hrx_loom": null,
1160
+ "kind": "devlab",
1161
+ "run": null,
1162
+ "url": null
1163
+ },
1164
+ "local": {
1165
+ "device": {
1166
+ "cpu": "AMD RYZEN AI MAX+ PRO 395 w/ Radeon 8060S",
1167
+ "gpu": "AMD Radeon 8060S Graphics",
1168
+ "os": "Ubuntu 24.04"
1169
+ },
1170
+ "hrx_loom": null,
1171
+ "kind": "local",
1172
+ "run": null,
1173
+ "url": null
1174
+ },
1175
+ "machine": {
1176
+ "device": {
1177
+ "cpu": "AMD RYZEN AI MAX+ PRO 395 w/ Radeon 8060S",
1178
+ "gpu": "AMD Radeon 8060S Graphics",
1179
+ "os": "Ubuntu 24.04"
1180
+ },
1181
+ "hrx_loom": null,
1182
+ "kind": "machine",
1183
+ "run": null,
1184
+ "url": null
1185
+ }
1186
+ },
1187
+ "versions": {
1188
+ "card_generator": "unknown"
1189
+ },
1190
+ "derived_from": {
1191
+ "repo": "loom-fun/unsloth-Inkling-2-Mini-loom",
1192
+ "revision": "4e018e88a3aa9826286c71dfe2f6c905a491659b",
1193
+ "release": "r8",
1194
+ "note": "binding changes only for the mainline GGUF layout (PROVENANCE.json); the base card gate records were made for its own programs and file and are not carried over"
1195
+ }
1196
+ }
llm_config.json ADDED
@@ -0,0 +1,244 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "name": "Inkling-2-Mini",
3
+ "arch": "inkling2",
4
+ "gguf": "Inkling-2-Mini-UD-Q4_K_XL.gguf",
5
+ "hidden": 2304,
6
+ "layers": 48,
7
+ "heads": 24,
8
+ "kv_heads": 8,
9
+ "head_dim": 128,
10
+ "ffn": 1152,
11
+ "vocab": 200058,
12
+ "context_length": 1048576,
13
+ "rms_eps": 9.999999974752427e-07,
14
+ "rope_theta": 10000.0,
15
+ "rope_type": "neox",
16
+ "qk_norm": false,
17
+ "attn_gate": true,
18
+ "post_norms": false,
19
+ "embed_norm": false,
20
+ "embed_scale": null,
21
+ "sliding_window": 1024,
22
+ "sliding_layers": [
23
+ 0,
24
+ 1,
25
+ 2,
26
+ 3,
27
+ 4,
28
+ 6,
29
+ 7,
30
+ 8,
31
+ 9,
32
+ 10,
33
+ 12,
34
+ 13,
35
+ 14,
36
+ 15,
37
+ 16,
38
+ 18,
39
+ 19,
40
+ 20,
41
+ 21,
42
+ 22
43
+ ],
44
+ "nope_layers": [
45
+ 0,
46
+ 1,
47
+ 2,
48
+ 3,
49
+ 4,
50
+ 5,
51
+ 6,
52
+ 7,
53
+ 8,
54
+ 9,
55
+ 10,
56
+ 11,
57
+ 12,
58
+ 13,
59
+ 14,
60
+ 15,
61
+ 16,
62
+ 17,
63
+ 18,
64
+ 19,
65
+ 20,
66
+ 21,
67
+ 22,
68
+ 23,
69
+ 24,
70
+ 25,
71
+ 26,
72
+ 27,
73
+ 28,
74
+ 29,
75
+ 30,
76
+ 31,
77
+ 32,
78
+ 33,
79
+ 34,
80
+ 35,
81
+ 36,
82
+ 37,
83
+ 38,
84
+ 39,
85
+ 40,
86
+ 41,
87
+ 42,
88
+ 43,
89
+ 44,
90
+ 45,
91
+ 46,
92
+ 47
93
+ ],
94
+ "tied_embeddings": false,
95
+ "eos_id": 200006,
96
+ "extra_eos_ids": [
97
+ 199999
98
+ ],
99
+ "bos_id": null,
100
+ "chat": {
101
+ "bos": "",
102
+ "system_prefix": "<|message_system|><|content_text|>",
103
+ "suffix": "<|end_message|>",
104
+ "user_prefix": "<|message_user|><|content_text|>",
105
+ "assistant_prefix": "<|message_model|><|content_text|>",
106
+ "default_system": "",
107
+ "trim_content": false,
108
+ "think_open": "<|message_model|><|content_thinking|>",
109
+ "think_close": "<|end_message|>",
110
+ "history_think": "nonempty",
111
+ "history_think_scope": "all",
112
+ "generation_prompt": "",
113
+ "generation_prompt_plain": "",
114
+ "thinking": "toggle",
115
+ "thinking_default": true,
116
+ "starts_in_reasoning": false,
117
+ "think_end": "<|end_message|>",
118
+ "reasoning_instructions": {
119
+ "none": "0",
120
+ "minimal": "0.1",
121
+ "low": "0.2",
122
+ "medium": "0.7",
123
+ "high": "0.9",
124
+ "xhigh": "0.99",
125
+ "max": "0.99"
126
+ },
127
+ "reasoning_effort_default": "high",
128
+ "reasoning_separator": "",
129
+ "terminal": "<|content_model_end_sampling|>",
130
+ "nonspecial_tokens": [
131
+ "<|message_model|>",
132
+ "<|content_thinking|>",
133
+ "<|content_text|>",
134
+ "<|content_invoke_tool_json|>",
135
+ "<|end_message|>"
136
+ ],
137
+ "tools_function_only": false,
138
+ "tools_prefix": "<|message_system|>tool_declare<|content_xml|>",
139
+ "tools_suffix": "<|end_message|>",
140
+ "tools_after_system": false,
141
+ "tools_system_separator": "",
142
+ "tool_line_prefix": "",
143
+ "call_format": "inkling2",
144
+ "base_call_format": "hermes",
145
+ "tool_turn_prefix": "",
146
+ "tool_item_prefix": "<|message_tool|>",
147
+ "tool_item_suffix": "<|end_message|>",
148
+ "tool_turn_suffix": "",
149
+ "content_call_separator": "",
150
+ "call_separator": "",
151
+ "call_marker": "<|content_invoke_tool_json|>",
152
+ "_note": "Inkling-2-Mini chat format: control.loom renders the whole conversation in chat_begin (chat/inkling2.loom); generic fields are informational and configure chat_reasoning, nonspecial_tokens, and terminal."
153
+ },
154
+ "attn_sinks": false,
155
+ "kv_layers": 48,
156
+ "logit_softcap": 30.0,
157
+ "inkling2": {
158
+ "n_phys": 24,
159
+ "core_start": 6,
160
+ "core_end": 18,
161
+ "n_passes": 3,
162
+ "gate_rank": 64,
163
+ "l_cache": 4,
164
+ "attn_res_block_size": 6,
165
+ "d_rel": 16,
166
+ "rel_extent": 1024,
167
+ "qk_clip": 22.627416610717773,
168
+ "rel_clip": 8.0,
169
+ "log_scale_floor": 8192,
170
+ "log_scale_alpha": 0.10000000149011612
171
+ },
172
+ "moe": {
173
+ "experts": 128,
174
+ "used": 8,
175
+ "ffn": 1152,
176
+ "leading_dense": 0,
177
+ "gating": 2,
178
+ "norm_weights": true,
179
+ "scale": 8.0,
180
+ "probs_bias": true,
181
+ "act": "situ",
182
+ "norm_eps": 1e-20,
183
+ "situ_beta": 4.0,
184
+ "situ_linear_beta": 25.0,
185
+ "gate_up_fused": true,
186
+ "down_scale": true
187
+ },
188
+ "sampling": {
189
+ "temperature": 1.0,
190
+ "top_p": 1.0,
191
+ "top_k": 0,
192
+ "min_p": 0.0
193
+ },
194
+ "model_id": "Inkling-2-Mini",
195
+ "draft": {
196
+ "kind": "dflash",
197
+ "depth": 3,
198
+ "gguf": "dspark-Inkling-2-Mini-Q8_0.gguf",
199
+ "layers": 3,
200
+ "kv_heads": 8,
201
+ "head_dim": 128,
202
+ "taps": 4,
203
+ "block_size": 8,
204
+ "dspark_inkling2": true,
205
+ "kv_layers": 1,
206
+ "carry_stride": 8404992,
207
+ "head_policy": "head_weights.loom"
208
+ },
209
+ "generator": {
210
+ "skills_commit": "unknown",
211
+ "dirty": null,
212
+ "kit": {
213
+ "example": null,
214
+ "modified": true
215
+ },
216
+ "hrx_loom": "unknown"
217
+ },
218
+ "sdk": {
219
+ "hrx_loom": "0.2.0",
220
+ "source": "pypi",
221
+ "wheel_sha256": "5148f9e3a264af400ec4bae38bd7b06bf551d28cc33b7a61d67f7bcefa590438",
222
+ "hrx_system_sha": "0cd370f2baaa0cfef47cc23007f1a109906f8a52"
223
+ },
224
+ "resolved": {
225
+ "scopes": [
226
+ "facet/drafted",
227
+ "facet/moe",
228
+ "facet/sliding-window"
229
+ ],
230
+ "choices": {},
231
+ "devices": [
232
+ "rdna3",
233
+ "rdna4"
234
+ ],
235
+ "facets": [
236
+ "draft-dflash",
237
+ "drafted",
238
+ "gated-attn",
239
+ "moe",
240
+ "sliding-window"
241
+ ],
242
+ "env": {}
243
+ }
244
+ }
model.json ADDED
@@ -0,0 +1,92 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "schema_version": 1,
3
+ "model": {
4
+ "id": "Inkling-2-Mini",
5
+ "name": "Inkling-2-Mini (Loom port of loom-fun r8, re-carded for unsloth's mainline GGUF layout)"
6
+ },
7
+ "programs": {
8
+ "source": {
9
+ "inputs": [
10
+ {
11
+ "path": "program/prepare.loom",
12
+ "data": [
13
+ "weights.loom",
14
+ "head_weights.loom",
15
+ "llm_config.json"
16
+ ]
17
+ },
18
+ "program/control.loom",
19
+ "program/storage.loom",
20
+ "program/service.loom"
21
+ ],
22
+ "libraries": [
23
+ "program/llm.loom"
24
+ ]
25
+ }
26
+ },
27
+ "services": {
28
+ "chat": {
29
+ "kind": "text",
30
+ "version": 1
31
+ }
32
+ },
33
+ "variants": {
34
+ "gguf": {
35
+ "services": {
36
+ "chat": {
37
+ "programs": [
38
+ "source"
39
+ ],
40
+ "config": {
41
+ "llm.card": true,
42
+ "llm.logits": false
43
+ },
44
+ "parameters": {
45
+ "model": {
46
+ "files": [
47
+ {
48
+ "path": "parameter/Inkling-2-Mini-UD-Q4_K_XL.gguf",
49
+ "format": "gguf",
50
+ "origin": "@checkpoint/Inkling-2-Mini-UD-Q4_K_XL.gguf"
51
+ }
52
+ ]
53
+ },
54
+ "draft": {
55
+ "files": [
56
+ {
57
+ "path": "parameter/dspark-Inkling-2-Mini-Q8_0.gguf",
58
+ "format": "gguf",
59
+ "origin": "@checkpoint/dspark-Inkling-2-Mini-Q8_0_Old.gguf"
60
+ }
61
+ ]
62
+ }
63
+ },
64
+ "tokenizers": {
65
+ "text": "tokenizer.json"
66
+ }
67
+ }
68
+ }
69
+ }
70
+ },
71
+ "presets": {
72
+ "chat": {
73
+ "service": "chat",
74
+ "variant": "gguf",
75
+ "programs": "source",
76
+ "execution": {
77
+ "rows": 4,
78
+ "context_capacity": 262144,
79
+ "prefill_capacity": 4096,
80
+ "max_tokens": 4096,
81
+ "draft_depth": 3
82
+ }
83
+ }
84
+ },
85
+ "origins": {
86
+ "checkpoint": {
87
+ "kind": "hf",
88
+ "repository": "unsloth/Inkling-2-Mini-GGUF",
89
+ "revision": "8078d149286eec7193795413b9e0643da6d11fa1"
90
+ }
91
+ }
92
+ }
model.json.lock ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "schema_version": 2,
3
+ "scope": "assets",
4
+ "origins": {
5
+ "checkpoint": {
6
+ "requested": {
7
+ "kind": "hf",
8
+ "repository": "unsloth/Inkling-2-Mini-GGUF",
9
+ "revision": "8078d149286eec7193795413b9e0643da6d11fa1"
10
+ },
11
+ "resolved": {
12
+ "revision": "8078d149286eec7193795413b9e0643da6d11fa1"
13
+ }
14
+ }
15
+ },
16
+ "files": [
17
+ {
18
+ "origin": "tokenizer.json",
19
+ "size": 12242935,
20
+ "sha256": "a45fdc4e7e66a035de236d2694742fed5645327051caace5f8312013a879f9b1"
21
+ },
22
+ {
23
+ "origin": "@checkpoint/Inkling-2-Mini-UD-Q4_K_XL.gguf",
24
+ "size": 17629760736,
25
+ "sha256": "e64276656f072e9b2197a61723667cbdb71da66a716ffd966e572c21088f3cd3"
26
+ },
27
+ {
28
+ "origin": "@checkpoint/dspark-Inkling-2-Mini-Q8_0_Old.gguf",
29
+ "size": 402278560,
30
+ "sha256": "2ec78510da837e8fc3be54a14757a0c5fbd2d8d9e85a0d92853fafdf674f3773"
31
+ }
32
+ ]
33
+ }
program/control.loom ADDED
The diff for this file is too large to render. See raw diff
 
program/llm.loom ADDED
The diff for this file is too large to render. See raw diff
 
program/prepare.loom ADDED
@@ -0,0 +1,343 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ config.def @llm.card = false : i1
2
+
3
+ // logits:begin
4
+ // A declaration: the one definition (default false) is in llm.loom; a second config.def of the key links ambiguously (LINK/MATERIALIZE).
5
+ config.decl @llm.logits : i1
6
+ // logits:end
7
+
8
+ func.decl import("input") @require(%condition: i32, %diagnostic: buffer)
9
+
10
+ func.decl import("json") @members(%json: buffer) -> (buffer, i32, i64)
11
+
12
+ func.decl import("prepare") @stage(%root: buffer, %tag: i64) -> (i32)
13
+
14
+ func.decl import("prepare") @config_i64(%stage: i32, %key: buffer, %value: i64)
15
+
16
+ func.decl import("prepare") @source(%directory: buffer, %path: buffer) -> (i32)
17
+
18
+ func.decl import("prepare") @parameter(%stage: i32, %binding: i32, %input: i32, %source: i32, %policy: buffer)
19
+
20
+ func.decl import("prepare") @source_scope(%scope: buffer) -> (i32)
21
+
22
+ // "model"
23
+ global.rodata.def @model_scope = bytes("6d6f64656c")
24
+
25
+ // "llm_advance"
26
+ global.rodata.def @root = bytes("6c6c6d5f616476616e6365")
27
+
28
+ // "llm.context", "llm.spans", "llm.tokens", "llm.pool"
29
+ global.rodata.def @context_key = bytes("6c6c6d2e636f6e74657874")
30
+
31
+ global.rodata.def @spans_key = bytes("6c6c6d2e7370616e73")
32
+
33
+ global.rodata.def @tokens_key = bytes("6c6c6d2e746f6b656e73")
34
+
35
+ global.rodata.def @pool_key = bytes("6c6c6d2e706f6f6c")
36
+
37
+ // logits:begin
38
+ // "llm.logit_slots": the rows of the logits region a stage may write (min(spans, rows)), set only with the capability.
39
+ global.rodata.def @logit_slots_key = bytes("6c6c6d2e6c6f6769745f736c6f7473")
40
+ // logits:end
41
+
42
+ // "llm_verify", "llm_dflash_warm", "llm_dflash_propose", "llm.width", "llm.gated", "llm.epoch_spans", "llm.epoch_tokens"
43
+ global.rodata.def @verify_root = bytes("6c6c6d5f766572696679")
44
+
45
+ global.rodata.def @warm_root = bytes("6c6c6d5f64666c6173685f7761726d")
46
+
47
+ global.rodata.def @propose_root = bytes("6c6c6d5f64666c6173685f70726f706f7365")
48
+
49
+ global.rodata.def @width_key = bytes("6c6c6d2e7769647468")
50
+
51
+ global.rodata.def @gated_key = bytes("6c6c6d2e6761746564")
52
+
53
+ global.rodata.def @epoch_spans_key = bytes("6c6c6d2e65706f63685f7370616e73")
54
+
55
+ global.rodata.def @epoch_tokens_key = bytes("6c6c6d2e65706f63685f746f6b656e73")
56
+
57
+ // "draft"
58
+ global.rodata.def @draft_scope = bytes("6472616674")
59
+
60
+ // "head_weights.loom"
61
+ global.rodata.def @head_policy_name = bytes("686561645f776569676874732e6c6f6f6d")
62
+
63
+ // "weights.loom"
64
+ global.rodata.def @policy = bytes("776569676874732e6c6f6f6d")
65
+
66
+ // "<|content_model_end_sampling|>" is the service terminal marker.
67
+ global.rodata.def @terminal = bytes("3c7c636f6e74656e745f6d6f64656c5f656e645f73616d706c696e677c3e")
68
+
69
+ global.rodata.def @empty = bytes("")
70
+
71
+ // "llm requires pooled epochs without MTP, at most 128 shapes and a context of at most 1048576"
72
+ global.rodata.def @unsupported = bytes("6c6c6d20726571756972657320706f6f6c65642065706f63687320776974686f7574204d54502c206174206d6f7374203132382073686170657320616e64206120636f6e74657874206f66206174206d6f73742031303438353736")
73
+
74
+ func.decl @llm_storage(%maximum: i64, %span_capacity: i64, %context: i64, %pool: i64, %rows: i64, %pins: i64, %drafting: i64) -> (buffer, buffer, buffer, buffer, buffer)
75
+
76
+ // Control state layout: [0, 8) unused, [8, 88) two transfer records,
77
+ // [88, 128) layout recipe, [128, 640) stage per packing shape, then a 16-byte
78
+ // sampling record per resident row.
79
+ func.def public @prepare(%prefill: i64, %context: i64, %pool: i64, %rows: i64, %pins: i64, %draft_depth: i32, %shapes: buffer, %shape_count: i64, %weights: buffer, %options: buffer) -> (i64, i32, buffer, buffer, buffer, buffer, buffer, buffer, buffer) {
80
+ %c0_source = scalar.constant 0 : i32
81
+ %origin = index.constant 0 : offset
82
+ %c0 = index.constant 0 : index
83
+ %c1 = index.constant 1 : index
84
+ %c0_i32 = scalar.constant 0 : i32
85
+ %c0_i64 = scalar.constant 0 : i64
86
+ %c64_i64 = scalar.constant 128 : i64
87
+ %c4096_i64 = scalar.constant 1048576 : i64
88
+ %pooled = scalar.cmpi ne, %pool, %c0_i64 : i64
89
+ %packed = scalar.cmpi ne, %shape_count, %c0_i64 : i64
90
+ %few_shapes = scalar.cmpi ule, %shape_count, %c64_i64 : i64
91
+ %short_context = scalar.cmpi ule, %context, %c4096_i64 : i64
92
+ %no_draft = scalar.cmpi eq, %draft_depth, %c0_i32 : i32
93
+ %has_epochs = scalar.andi %pooled, %packed : i1
94
+ %c7_i32 = scalar.constant 7 : i32
95
+ %depth_ok = scalar.cmpi ule, %draft_depth, %c7_i32 : i32
96
+ %mode_ok = scalar.andi %has_epochs, %depth_ok : i1
97
+ %limits_ok = scalar.andi %few_shapes, %short_context : i1
98
+ %supported = scalar.andi %mode_ok, %limits_ok : i1
99
+ %supported32 = scalar.extui %supported : i1 to i32
100
+ %error = global.load @unsupported : buffer
101
+ func.call @require(%supported32, %error) : (i32, buffer)
102
+ %empty = global.load @empty : buffer
103
+ %policy = global.load @policy : buffer
104
+ %card = config.get @llm.card : i1
105
+ %checkpoint = scf.if %card -> (i32) {
106
+ %scope = global.load @model_scope : buffer
107
+ %scoped = func.call @source_scope(%scope) : (buffer) -> (i32)
108
+ scf.yield %scoped : i32
109
+ } else {
110
+ %direct = func.call @source(%empty, %weights) : (buffer, buffer) -> (i32)
111
+ scf.yield %direct : i32
112
+ }
113
+ %bounded_count = scalar.assume %shape_count [range(%shape_count, 1, 128)] : i64
114
+ %count = index.cast %bounded_count : i64 to index
115
+ %c4_off = index.constant 4 : offset
116
+ %stage_slots = index.constant 128 : index
117
+ %stage_bytes = index.scale %stage_slots, %c4_off : index, offset -> offset
118
+ %header_bytes = index.constant 128 : offset
119
+ %control_bytes = index.constant 2048 : offset
120
+ // Then one 20-byte sampling + per-request draft_depth record per resident row (control.loom @bind_request).
121
+ %bounded_rows = scalar.assume %rows [range(%rows, 1, 1048576)] : i64
122
+ %row_count = index.cast %bounded_rows : i64 to index
123
+ %record_bytes = index.constant 20 : offset
124
+ %sampling_bytes = index.scale %row_count, %record_bytes : index, offset -> offset
125
+ %state_bytes = index.add %control_bytes, %sampling_bytes : offset
126
+ %state = buffer.alloca<private> align(8) %state_bytes : buffer
127
+ buffer.fill %c0_i32, %state[%origin], %state_bytes : i32
128
+ %stage_view = buffer.view %state[%header_bytes] : buffer -> view<[%count]xi32>
129
+ %verify_at = index.constant 640 : offset
130
+ %warm_at = index.constant 1152 : offset
131
+ %verify_view = buffer.view %state[%verify_at] : buffer -> view<[%count]xi32>
132
+ %warm_view = buffer.view %state[%warm_at] : buffer -> view<[%count]xi32>
133
+ %drafting = scalar.cmpi ne, %draft_depth, %c0_i32 : i32
134
+ %depth64 = scalar.extui %draft_depth : i32 to i64
135
+ %c1_w = scalar.constant 1 : i64
136
+ %width = scalar.addi %depth64, %c1_w : i64
137
+ %verify_root = global.load @verify_root : buffer
138
+ %warm_root = global.load @warm_root : buffer
139
+ %width_key = global.load @width_key : buffer
140
+ %gated_key = global.load @gated_key : buffer
141
+ %gated_off = scalar.constant 0 : i64
142
+ %gated_on = scalar.constant 1 : i64
143
+ %root = global.load @root : buffer
144
+ %context_key = global.load @context_key : buffer
145
+ %spans_key = global.load @spans_key : buffer
146
+ %tokens_key = global.load @tokens_key : buffer
147
+ %pool_key = global.load @pool_key : buffer
148
+ // logits:begin
149
+ %logits_cfg = config.get @llm.logits : i1
150
+ %logit_slots_key = global.load @logit_slots_key : buffer
151
+ // logits:end
152
+ %shape_view = buffer.view %shapes[%origin] : buffer -> view<[%count]x2xi64>
153
+ %maximum, %span_capacity = scf.for %i = [%c0 to %count step %c1](%previous = %c0_i64 : i64, %previous_spans = %c0_i64 : i64) -> (i64, i64) {
154
+ %tokens = view.load %shape_view[%i, 0] : view<[%count]x2xi64> -> i64
155
+ %spans = view.load %shape_view[%i, 1] : view<[%count]x2xi64> -> i64
156
+ %tag = index.cast %i : index to i64
157
+ %stage = func.call @stage(%root, %tag) : (buffer, i64) -> (i32)
158
+ func.call @config_i64(%stage, %context_key, %context) : (i32, buffer, i64)
159
+ func.call @config_i64(%stage, %pool_key, %pool) : (i32, buffer, i64)
160
+ func.call @config_i64(%stage, %tokens_key, %tokens) : (i32, buffer, i64)
161
+ func.call @config_i64(%stage, %spans_key, %spans) : (i32, buffer, i64)
162
+ // logits:begin
163
+ scf.if %logits_cfg {
164
+ %logit_slots = scalar.minsi %spans, %rows : i64
165
+ func.call @config_i64(%stage, %logit_slots_key, %logit_slots) : (i32, buffer, i64)
166
+ }
167
+ // logits:end
168
+ func.call @parameter(%stage, %c0_i32, %c0_source, %checkpoint, %policy) : (i32, i32, i32, i32, buffer)
169
+ view.store %stage, %stage_view[%i] : i32, view<[%count]xi32>
170
+ %larger = scalar.cmpi ugt, %tokens, %previous : i64
171
+ %next = scf.select %larger, %tokens, %previous : i64
172
+ %more_spans = scalar.cmpi ugt, %spans, %previous_spans : i64
173
+ %next_spans = scf.select %more_spans, %spans, %previous_spans : i64
174
+ scf.yield %next, %next_spans : i64, i64
175
+ }
176
+ // Verify and catch-up stages per shape, declared after every advance stage (the first shape_count
177
+ // stages are the shared target stages), then proposal stages for cohorts of 1, 2, 4, ... spans.
178
+ // the drafter checkpoint (card parameter scope "draft")
179
+ %draft_scope = global.load @draft_scope : buffer
180
+ %draft_source = func.call @source_scope(%draft_scope) : (buffer) -> (i32)
181
+ %head_policy = global.load @head_policy_name : buffer
182
+ scf.if %drafting {
183
+ %propose_root = global.load @propose_root : buffer
184
+ %epoch_spans_key = global.load @epoch_spans_key : buffer
185
+ %epoch_tokens_key = global.load @epoch_tokens_key : buffer
186
+ %span32 = scalar.trunci %span_capacity : i64 to i32
187
+ %one32 = scalar.constant 1 : i32
188
+ %bits32 = scalar.constant 32 : i32
189
+ %below = scalar.subi %span32, %one32 : i32
190
+ %leading = scalar.ctlzi %below : i32
191
+ %last_level = scalar.subi %bits32, %leading : i32
192
+ %levels_all = scalar.addi %last_level, %one32 : i32
193
+ %level_cap = scalar.constant 5 : i32
194
+ %levels32 = scalar.minui %levels_all, %level_cap : i32
195
+ %levels_b = scalar.assume %levels32 [range(%levels32, 1, 14)] : i32
196
+ %levels = index.cast %levels_b : i32 to index
197
+ %c1_64 = scalar.constant 1 : i64
198
+ %first_propose = scf.for %level = [%c0 to %levels step %c1](%first = %c0_i32 : i32) -> (i32) {
199
+ %shift = index.cast %level : index to i64
200
+ %cap = scalar.shli %c1_64, %shift : i64
201
+ %pstage = func.call @stage(%propose_root, %shift) : (buffer, i64) -> (i32)
202
+ func.call @config_i64(%pstage, %context_key, %context) : (i32, buffer, i64)
203
+ func.call @config_i64(%pstage, %pool_key, %pool) : (i32, buffer, i64)
204
+ // A DFlash block is [anchor, <mask> x depth] (llama.cpp's n_max + 1 tokens), capped at the trained block size:
205
+ // 4 streams at depth 3 propose 16 tokens (one int8 matvec pass per drafter weight) instead of 64 (GEMM).
206
+ %block_full = scalar.constant 8 : i64
207
+ %block_tokens = scalar.constant 8 : i64
208
+ %cap_tokens = scalar.muli %cap, %block_tokens : i64
209
+ func.call @config_i64(%pstage, %tokens_key, %cap_tokens) : (i32, buffer, i64)
210
+ func.call @config_i64(%pstage, %spans_key, %cap) : (i32, buffer, i64)
211
+ func.call @config_i64(%pstage, %width_key, %width) : (i32, buffer, i64)
212
+ func.call @config_i64(%pstage, %epoch_spans_key, %span_capacity) : (i32, buffer, i64)
213
+ func.call @config_i64(%pstage, %epoch_tokens_key, %maximum) : (i32, buffer, i64)
214
+ %pstage_b0 = scalar.constant 0 : i32
215
+ func.call @parameter(%pstage, %pstage_b0, %c0_source, %checkpoint, %policy) : (i32, i32, i32, i32, buffer)
216
+ %pstage_b1 = scalar.constant 1 : i32
217
+ func.call @parameter(%pstage, %pstage_b1, %c0_source, %draft_source, %policy) : (i32, i32, i32, i32, buffer)
218
+ %pstage_b2 = scalar.constant 2 : i32
219
+ func.call @parameter(%pstage, %pstage_b2, %c0_source, %checkpoint, %head_policy) : (i32, i32, i32, i32, buffer)
220
+
221
+ %initial = index.cmp eq, %level, %c0 : index
222
+ %next_first = scf.select %initial, %pstage, %first : i32
223
+ scf.yield %next_first : i32
224
+ }
225
+ scf.for %i = [%c0 to %count step %c1] {
226
+ %tokens = view.load %shape_view[%i, 0] : view<[%count]x2xi64> -> i64
227
+ %spans = view.load %shape_view[%i, 1] : view<[%count]x2xi64> -> i64
228
+ %tag = index.cast %i : index to i64
229
+ %vstage = func.call @stage(%verify_root, %tag) : (buffer, i64) -> (i32)
230
+ func.call @config_i64(%vstage, %context_key, %context) : (i32, buffer, i64)
231
+ func.call @config_i64(%vstage, %pool_key, %pool) : (i32, buffer, i64)
232
+ func.call @config_i64(%vstage, %tokens_key, %tokens) : (i32, buffer, i64)
233
+ func.call @config_i64(%vstage, %spans_key, %spans) : (i32, buffer, i64)
234
+ func.call @config_i64(%vstage, %width_key, %width) : (i32, buffer, i64)
235
+ func.call @config_i64(%vstage, %gated_key, %gated_off) : (i32, buffer, i64)
236
+ func.call @parameter(%vstage, %c0_i32, %c0_source, %checkpoint, %policy) : (i32, i32, i32, i32, buffer)
237
+ view.store %vstage, %verify_view[%i] : i32, view<[%count]xi32>
238
+ %wstage = func.call @stage(%warm_root, %tag) : (buffer, i64) -> (i32)
239
+ func.call @config_i64(%wstage, %context_key, %context) : (i32, buffer, i64)
240
+ func.call @config_i64(%wstage, %pool_key, %pool) : (i32, buffer, i64)
241
+ func.call @config_i64(%wstage, %tokens_key, %tokens) : (i32, buffer, i64)
242
+ func.call @config_i64(%wstage, %spans_key, %spans) : (i32, buffer, i64)
243
+ %wstage_b0 = scalar.constant 0 : i32
244
+ func.call @parameter(%wstage, %wstage_b0, %c0_source, %draft_source, %policy) : (i32, i32, i32, i32, buffer)
245
+
246
+ view.store %wstage, %warm_view[%i] : i32, view<[%count]xi32>
247
+ %same_shape = scalar.cmpi eq, %tokens, %spans : i64
248
+ %gate_slots = scalar.constant 32 : i64
249
+ %few_spans = scalar.cmpi ult, %spans, %gate_slots : i64
250
+ %gate_ok = scalar.andi %same_shape, %few_spans : i1
251
+ scf.if %gate_ok {
252
+ %gate_at = index.constant 1700 : offset
253
+ %gate_view = buffer.view %state[%gate_at] : buffer -> view<32xi32>
254
+ %gate_slot = index.cast %spans : i64 to index
255
+ %gate_i32 = index.cast %i : index to i32
256
+ %gate_one = scalar.constant 1 : i32
257
+ %gate_idx1 = scalar.addi %gate_i32, %gate_one : i32
258
+ %gtag_base = scalar.constant 256 : i64
259
+ %gtag = scalar.addi %tag, %gtag_base : i64
260
+ %gvstage = func.call @stage(%verify_root, %gtag) : (buffer, i64) -> (i32)
261
+ func.call @config_i64(%gvstage, %context_key, %context) : (i32, buffer, i64)
262
+ func.call @config_i64(%gvstage, %pool_key, %pool) : (i32, buffer, i64)
263
+ func.call @config_i64(%gvstage, %tokens_key, %tokens) : (i32, buffer, i64)
264
+ func.call @config_i64(%gvstage, %spans_key, %spans) : (i32, buffer, i64)
265
+ func.call @config_i64(%gvstage, %width_key, %width) : (i32, buffer, i64)
266
+ func.call @config_i64(%gvstage, %gated_key, %gated_on) : (i32, buffer, i64)
267
+ func.call @parameter(%gvstage, %c0_i32, %c0_source, %checkpoint, %policy) : (i32, i32, i32, i32, buffer)
268
+ %gate_shift = scalar.constant 8 : i32
269
+ %gv_high = scalar.shli %gvstage, %gate_shift : i32
270
+ %gate_tag = scalar.ori %gate_idx1, %gv_high : i32
271
+ view.store %gate_tag, %gate_view[%gate_slot] : i32, view<32xi32>
272
+ }
273
+ }
274
+ %draft_at = index.constant 1664 : offset
275
+ %draft_view = buffer.view %state[%draft_at] : buffer -> view<3xi32>
276
+ view.store %first_propose, %draft_view[0] : i32, view<3xi32>
277
+ view.store %levels32, %draft_view[1] : i32, view<3xi32>
278
+ %kind32 = scalar.constant 2 : i32
279
+ view.store %kind32, %draft_view[2] : i32, view<3xi32>
280
+ // Adaptive depth=1 fast-path stages (when draft_depth >= 2): 1-step propose + t=2 verify + t=2 warm
281
+ %c1_ad = scalar.constant 1 : i32
282
+ %adapt_ok = scalar.cmpi ugt, %draft_depth, %c1_ad : i32
283
+ scf.if %adapt_ok {
284
+ %c1_a64 = scalar.constant 1 : i64
285
+ %c2_a64 = scalar.constant 2 : i64
286
+ %ptag_d1 = scalar.constant 16 : i64
287
+ %pstage_d1 = func.call @stage(%propose_root, %ptag_d1) : (buffer, i64) -> (i32)
288
+ func.call @config_i64(%pstage_d1, %context_key, %context) : (i32, buffer, i64)
289
+ func.call @config_i64(%pstage_d1, %pool_key, %pool) : (i32, buffer, i64)
290
+ %block_d1 = scalar.constant 8 : i64
291
+ func.call @config_i64(%pstage_d1, %tokens_key, %block_d1) : (i32, buffer, i64)
292
+ func.call @config_i64(%pstage_d1, %spans_key, %c1_a64) : (i32, buffer, i64)
293
+ func.call @config_i64(%pstage_d1, %width_key, %c2_a64) : (i32, buffer, i64)
294
+ func.call @config_i64(%pstage_d1, %epoch_spans_key, %span_capacity) : (i32, buffer, i64)
295
+ func.call @config_i64(%pstage_d1, %epoch_tokens_key, %maximum) : (i32, buffer, i64)
296
+ %pstage_d1_b0 = scalar.constant 0 : i32
297
+ func.call @parameter(%pstage_d1, %pstage_d1_b0, %c0_source, %checkpoint, %policy) : (i32, i32, i32, i32, buffer)
298
+ %pstage_d1_b1 = scalar.constant 1 : i32
299
+ func.call @parameter(%pstage_d1, %pstage_d1_b1, %c0_source, %draft_source, %policy) : (i32, i32, i32, i32, buffer)
300
+ %pstage_d1_b2 = scalar.constant 2 : i32
301
+ func.call @parameter(%pstage_d1, %pstage_d1_b2, %c0_source, %checkpoint, %head_policy) : (i32, i32, i32, i32, buffer)
302
+
303
+ %vtag_d1 = scalar.constant 512 : i64
304
+ %vstage_d1 = func.call @stage(%verify_root, %vtag_d1) : (buffer, i64) -> (i32)
305
+ func.call @config_i64(%vstage_d1, %context_key, %context) : (i32, buffer, i64)
306
+ func.call @config_i64(%vstage_d1, %pool_key, %pool) : (i32, buffer, i64)
307
+ func.call @config_i64(%vstage_d1, %tokens_key, %c2_a64) : (i32, buffer, i64)
308
+ func.call @config_i64(%vstage_d1, %spans_key, %c1_a64) : (i32, buffer, i64)
309
+ func.call @config_i64(%vstage_d1, %width_key, %c2_a64) : (i32, buffer, i64)
310
+ func.call @config_i64(%vstage_d1, %gated_key, %gated_off) : (i32, buffer, i64)
311
+ func.call @parameter(%vstage_d1, %c0_i32, %c0_source, %checkpoint, %policy) : (i32, i32, i32, i32, buffer)
312
+ %wstage_d1 = func.call @stage(%warm_root, %vtag_d1) : (buffer, i64) -> (i32)
313
+ func.call @config_i64(%wstage_d1, %context_key, %context) : (i32, buffer, i64)
314
+ func.call @config_i64(%wstage_d1, %pool_key, %pool) : (i32, buffer, i64)
315
+ func.call @config_i64(%wstage_d1, %tokens_key, %c2_a64) : (i32, buffer, i64)
316
+ func.call @config_i64(%wstage_d1, %spans_key, %c1_a64) : (i32, buffer, i64)
317
+ %wstage_d1_b0 = scalar.constant 0 : i32
318
+ func.call @parameter(%wstage_d1, %wstage_d1_b0, %c0_source, %draft_source, %policy) : (i32, i32, i32, i32, buffer)
319
+
320
+ %adapt_at = index.constant 1828 : offset
321
+ %adapt_view = buffer.view %state[%adapt_at] : buffer -> view<5xi32>
322
+ view.store %c1_ad, %adapt_view[0] : i32, view<5xi32>
323
+ view.store %pstage_d1, %adapt_view[1] : i32, view<5xi32>
324
+ view.store %vstage_d1, %adapt_view[2] : i32, view<5xi32>
325
+ view.store %wstage_d1, %adapt_view[3] : i32, view<5xi32>
326
+ view.store %c0_i32, %adapt_view[4] : i32, view<5xi32>
327
+ }
328
+ }
329
+ %smaller = scalar.cmpi ult, %maximum, %prefill : i64
330
+ %effective = scf.select %smaller, %maximum, %prefill : i64
331
+ %layout_origin = index.constant 88 : offset
332
+ %layout = buffer.view %state[%layout_origin] : buffer -> view<5xi64>
333
+ view.store %maximum, %layout[0] : i64, view<5xi64>
334
+ view.store %span_capacity, %layout[1] : i64, view<5xi64>
335
+ view.store %context, %layout[2] : i64, view<5xi64>
336
+ view.store %pool, %layout[3] : i64, view<5xi64>
337
+ view.store %pins, %layout[4] : i64, view<5xi64>
338
+ %stage_count32 = index.cast %count : index to i32
339
+ %drafting64 = scalar.extui %drafting : i1 to i64
340
+ %allocations, %views, %origins, %draft, %geometry = func.call @llm_storage(%maximum, %span_capacity, %context, %pool, %rows, %pins, %drafting64) : (i64, i64, i64, i64, i64, i64, i64) -> (buffer, buffer, buffer, buffer, buffer)
341
+ %terminal = global.load @terminal : buffer
342
+ func.return %effective, %stage_count32, %state, %terminal, %allocations, %views, %origins, %draft, %geometry : i64, i32, buffer, buffer, buffer, buffer, buffer, buffer, buffer
343
+ }
program/service.loom ADDED
@@ -0,0 +1,316 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // Text service contracts share one fixture implementation. Each ABI has
2
+ // explicit exported roles, including the unversioned development contract.
3
+
4
+ func.decl @prepare(%prefill: i64, %context: i64, %pool: i64, %rows: i64, %pins: i64, %draft_depth: i32, %shapes: buffer, %shape_count: i64, %weights: buffer, %options: buffer) -> (i64, i32, buffer, buffer, buffer, buffer, buffer, buffer, buffer)
5
+
6
+ func.def public @text_prepare(%prefill: i64, %context: i64, %pool: i64, %rows: i64, %pins: i64, %draft_depth: i32, %shapes: buffer, %shape_count: i64, %weights: buffer, %options: buffer) -> (i64, i32, buffer, buffer, buffer, buffer, buffer, buffer, buffer) {
7
+ %result_0, %result_1, %result_2, %result_3, %result_4, %result_5, %result_6, %result_7, %result_8 = func.call @prepare(%prefill, %context, %pool, %rows, %pins, %draft_depth, %shapes, %shape_count, %weights, %options) : (i64, i64, i64, i64, i64, i32, buffer, i64, buffer, buffer) -> (i64, i32, buffer, buffer, buffer, buffer, buffer, buffer, buffer)
8
+ func.return %result_0, %result_1, %result_2, %result_3, %result_4, %result_5, %result_6, %result_7, %result_8 : i64, i32, buffer, buffer, buffer, buffer, buffer, buffer, buffer
9
+ }
10
+
11
+ func.def public @text_prepare_v1(%prefill: i64, %context: i64, %pool: i64, %rows: i64, %pins: i64, %draft_depth: i32, %shapes: buffer, %shape_count: i64, %weights: buffer, %options: buffer) -> (i64, i32, buffer, buffer, buffer, buffer, buffer, buffer, buffer) {
12
+ %result_0, %result_1, %result_2, %result_3, %result_4, %result_5, %result_6, %result_7, %result_8 = func.call @prepare(%prefill, %context, %pool, %rows, %pins, %draft_depth, %shapes, %shape_count, %weights, %options) : (i64, i64, i64, i64, i64, i32, buffer, i64, buffer, buffer) -> (i64, i32, buffer, buffer, buffer, buffer, buffer, buffer, buffer)
13
+ func.return %result_0, %result_1, %result_2, %result_3, %result_4, %result_5, %result_6, %result_7, %result_8 : i64, i32, buffer, buffer, buffer, buffer, buffer, buffer, buffer
14
+ }
15
+
16
+ func.decl @resize_state(%state: buffer, %rows: i64) -> (buffer, buffer, buffer, buffer, buffer, buffer)
17
+
18
+ func.def public @text_resize_state(%state: buffer, %rows: i64) -> (buffer, buffer, buffer, buffer, buffer, buffer) {
19
+ %control, %allocations, %views, %origins, %draft, %geometry = func.call @resize_state(%state, %rows) : (buffer, i64) -> (buffer, buffer, buffer, buffer, buffer, buffer)
20
+ func.return %control, %allocations, %views, %origins, %draft, %geometry : buffer, buffer, buffer, buffer, buffer, buffer
21
+ }
22
+
23
+ func.def public @text_resize_state_v1(%state: buffer, %rows: i64) -> (buffer, buffer, buffer, buffer, buffer, buffer) {
24
+ %control, %allocations, %views, %origins, %draft, %geometry = func.call @resize_state(%state, %rows) : (buffer, i64) -> (buffer, buffer, buffer, buffer, buffer, buffer)
25
+ func.return %control, %allocations, %views, %origins, %draft, %geometry : buffer, buffer, buffer, buffer, buffer, buffer
26
+ }
27
+
28
+ func.def public @sequence_resize_state_v1(%state: buffer, %rows: i64) -> (buffer, buffer, buffer, buffer, buffer, buffer) {
29
+ %control, %allocations, %views, %origins, %draft, %geometry = func.call @resize_state(%state, %rows) : (buffer, i64) -> (buffer, buffer, buffer, buffer, buffer, buffer)
30
+ func.return %control, %allocations, %views, %origins, %draft, %geometry : buffer, buffer, buffer, buffer, buffer, buffer
31
+ }
32
+
33
+ func.decl @model_name() -> (buffer)
34
+
35
+ func.def public @text_model_name() -> (buffer) {
36
+ %result_0 = func.call @model_name() : () -> (buffer)
37
+ func.return %result_0 : buffer
38
+ }
39
+
40
+ func.def public @text_model_name_v1() -> (buffer) {
41
+ %result_0 = func.call @model_name() : () -> (buffer)
42
+ func.return %result_0 : buffer
43
+ }
44
+
45
+ func.decl @request_defaults(%options: buffer) -> (buffer)
46
+
47
+ func.def public @text_request_defaults(%options: buffer) -> (buffer) {
48
+ %result_0 = func.call @request_defaults(%options) : (buffer) -> (buffer)
49
+ func.return %result_0 : buffer
50
+ }
51
+
52
+ func.def public @text_request_defaults_v1(%options: buffer) -> (buffer) {
53
+ %result_0 = func.call @request_defaults(%options) : (buffer) -> (buffer)
54
+ func.return %result_0 : buffer
55
+ }
56
+
57
+ func.decl @request_options(%defaults: buffer, %request: buffer, %nonce: i64) -> (buffer)
58
+
59
+ func.def public @text_request_options(%defaults: buffer, %request: buffer, %nonce: i64) -> (buffer) {
60
+ %result_0 = func.call @request_options(%defaults, %request, %nonce) : (buffer, buffer, i64) -> (buffer)
61
+ func.return %result_0 : buffer
62
+ }
63
+
64
+ func.def public @text_request_options_v1(%defaults: buffer, %request: buffer, %nonce: i64) -> (buffer) {
65
+ %result_0 = func.call @request_options(%defaults, %request, %nonce) : (buffer, buffer, i64) -> (buffer)
66
+ func.return %result_0 : buffer
67
+ }
68
+
69
+ func.decl @bind_request(%state: buffer, %row: i32, %options: buffer)
70
+
71
+ func.def public @text_bind_request(%state: buffer, %row: i32, %options: buffer) {
72
+ func.call @bind_request(%state, %row, %options) : (buffer, i32, buffer)
73
+ func.return
74
+ }
75
+
76
+ func.def public @text_bind_request_v1(%state: buffer, %row: i32, %options: buffer) {
77
+ func.call @bind_request(%state, %row, %options) : (buffer, i32, buffer)
78
+ func.return
79
+ }
80
+
81
+ func.decl @chat_reasoning() -> (i32, i32, i32)
82
+
83
+ func.def public @text_chat_reasoning() -> (i32, i32, i32) {
84
+ %enabled, %efforts, %default = func.call @chat_reasoning() : () -> (i32, i32, i32)
85
+ func.return %enabled, %efforts, %default : i32, i32, i32
86
+ }
87
+
88
+ func.def public @text_chat_reasoning_v1() -> (i32, i32, i32) {
89
+ %enabled, %efforts, %default = func.call @chat_reasoning() : () -> (i32, i32, i32)
90
+ func.return %enabled, %efforts, %default : i32, i32, i32
91
+ }
92
+
93
+ func.decl @chat_image_limits() -> (i64, i64, i64, i64, i64)
94
+
95
+ func.def public @text_chat_image_limits() -> (i64, i64, i64, i64, i64) {
96
+ %result_0, %result_1, %result_2, %result_3, %result_4 = func.call @chat_image_limits() : () -> (i64, i64, i64, i64, i64)
97
+ func.return %result_0, %result_1, %result_2, %result_3, %result_4 : i64, i64, i64, i64, i64
98
+ }
99
+
100
+ func.def public @text_chat_image_limits_v1() -> (i64, i64, i64, i64, i64) {
101
+ %result_0, %result_1, %result_2, %result_3, %result_4 = func.call @chat_image_limits() : () -> (i64, i64, i64, i64, i64)
102
+ func.return %result_0, %result_1, %result_2, %result_3, %result_4 : i64, i64, i64, i64, i64
103
+ }
104
+
105
+ func.decl @chat_begin(%request: buffer, %tools: buffer) -> (buffer, i64)
106
+
107
+ func.def public @text_chat_begin(%request: buffer, %tools: buffer) -> (buffer, i64) {
108
+ %result_0, %result_1 = func.call @chat_begin(%request, %tools) : (buffer, buffer) -> (buffer, i64)
109
+ func.return %result_0, %result_1 : buffer, i64
110
+ }
111
+
112
+ func.def public @text_chat_begin_v1(%request: buffer, %tools: buffer) -> (buffer, i64) {
113
+ %result_0, %result_1 = func.call @chat_begin(%request, %tools) : (buffer, buffer) -> (buffer, i64)
114
+ func.return %result_0, %result_1 : buffer, i64
115
+ }
116
+
117
+ func.decl @chat_message(%raw: buffer, %role: buffer, %content: buffer, %parts: buffer, %frames: buffer, %reasoning: buffer, %calls: buffer, %state: i64, %ordinal: i64, %fields: i64, %part_count: i64) -> (buffer, i64, buffer, i64)
118
+
119
+ func.def public @text_chat_message(%raw: buffer, %role: buffer, %content: buffer, %parts: buffer, %frames: buffer, %reasoning: buffer, %calls: buffer, %state: i64, %ordinal: i64, %fields: i64, %part_count: i64) -> (buffer, i64, buffer, i64) {
120
+ %result_0, %result_1, %result_2, %result_3 = func.call @chat_message(%raw, %role, %content, %parts, %frames, %reasoning, %calls, %state, %ordinal, %fields, %part_count) : (buffer, buffer, buffer, buffer, buffer, buffer, buffer, i64, i64, i64, i64) -> (buffer, i64, buffer, i64)
121
+ func.return %result_0, %result_1, %result_2, %result_3 : buffer, i64, buffer, i64
122
+ }
123
+
124
+ func.def public @text_chat_message_v1(%raw: buffer, %role: buffer, %content: buffer, %parts: buffer, %frames: buffer, %reasoning: buffer, %calls: buffer, %state: i64, %ordinal: i64, %fields: i64, %part_count: i64) -> (buffer, i64, buffer, i64) {
125
+ %result_0, %result_1, %result_2, %result_3 = func.call @chat_message(%raw, %role, %content, %parts, %frames, %reasoning, %calls, %state, %ordinal, %fields, %part_count) : (buffer, buffer, buffer, buffer, buffer, buffer, buffer, i64, i64, i64, i64) -> (buffer, i64, buffer, i64)
126
+ func.return %result_0, %result_1, %result_2, %result_3 : buffer, i64, buffer, i64
127
+ }
128
+
129
+ func.decl @chat_end(%state: i64) -> (buffer, i64)
130
+
131
+ func.def public @text_chat_end(%state: i64) -> (buffer, i64) {
132
+ %result_0, %result_1 = func.call @chat_end(%state) : (i64) -> (buffer, i64)
133
+ func.return %result_0, %result_1 : buffer, i64
134
+ }
135
+
136
+ func.def public @text_chat_end_v1(%state: i64) -> (buffer, i64) {
137
+ %result_0, %result_1 = func.call @chat_end(%state) : (i64) -> (buffer, i64)
138
+ func.return %result_0, %result_1 : buffer, i64
139
+ }
140
+
141
+ func.decl @render_tool(%name: buffer, %arguments: buffer, %ordinal: i64) -> (buffer, i64)
142
+
143
+ func.def public @text_render_tool(%name: buffer, %arguments: buffer, %ordinal: i64) -> (buffer, i64) {
144
+ %result_0, %result_1 = func.call @render_tool(%name, %arguments, %ordinal) : (buffer, buffer, i64) -> (buffer, i64)
145
+ func.return %result_0, %result_1 : buffer, i64
146
+ }
147
+
148
+ func.def public @text_render_tool_v1(%name: buffer, %arguments: buffer, %ordinal: i64) -> (buffer, i64) {
149
+ %result_0, %result_1 = func.call @render_tool(%name, %arguments, %ordinal) : (buffer, buffer, i64) -> (buffer, i64)
150
+ func.return %result_0, %result_1 : buffer, i64
151
+ }
152
+
153
+ func.decl @parse_tools(%schemas: buffer, %response: buffer, %truncated: i64) -> (buffer)
154
+
155
+ func.def public @text_parse_tools(%schemas: buffer, %response: buffer, %truncated: i64) -> (buffer) {
156
+ %result_0 = func.call @parse_tools(%schemas, %response, %truncated) : (buffer, buffer, i64) -> (buffer)
157
+ func.return %result_0 : buffer
158
+ }
159
+
160
+ func.def public @text_parse_tools_v1(%schemas: buffer, %response: buffer, %truncated: i64) -> (buffer) {
161
+ %result_0 = func.call @parse_tools(%schemas, %response, %truncated) : (buffer, buffer, i64) -> (buffer)
162
+ func.return %result_0 : buffer
163
+ }
164
+
165
+ func.decl @prepare_input(%text: buffer, %markers: buffer, %marker_count: i64, %format: i32, %boundary: i32, %capacity: i64) -> (buffer, i64, buffer)
166
+
167
+ func.def public @text_prepare_input(%text: buffer, %markers: buffer, %marker_count: i64, %format: i32, %boundary: i32, %capacity: i64) -> (buffer, i64, buffer) {
168
+ %result_0, %result_1, %result_2 = func.call @prepare_input(%text, %markers, %marker_count, %format, %boundary, %capacity) : (buffer, buffer, i64, i32, i32, i64) -> (buffer, i64, buffer)
169
+ func.return %result_0, %result_1, %result_2 : buffer, i64, buffer
170
+ }
171
+
172
+ func.def public @text_prepare_input_v1(%text: buffer, %markers: buffer, %marker_count: i64, %format: i32, %boundary: i32, %capacity: i64) -> (buffer, i64, buffer) {
173
+ %result_0, %result_1, %result_2 = func.call @prepare_input(%text, %markers, %marker_count, %format, %boundary, %capacity) : (buffer, buffer, i64, i32, i32, i64) -> (buffer, i64, buffer)
174
+ func.return %result_0, %result_1, %result_2 : buffer, i64, buffer
175
+ }
176
+
177
+ func.decl @output_next(%response: buffer, %previous: i64, %state: i64, %phase: i32) -> (i64, i64, i64, i64)
178
+
179
+ func.def public @text_output_next(%response: buffer, %previous: i64, %state: i64, %phase: i32) -> (i64, i64, i64, i64) {
180
+ %result_0, %result_1, %result_2, %result_3 = func.call @output_next(%response, %previous, %state, %phase) : (buffer, i64, i64, i32) -> (i64, i64, i64, i64)
181
+ func.return %result_0, %result_1, %result_2, %result_3 : i64, i64, i64, i64
182
+ }
183
+
184
+ func.def public @text_output_next_v1(%response: buffer, %previous: i64, %state: i64, %phase: i32) -> (i64, i64, i64, i64) {
185
+ %result_0, %result_1, %result_2, %result_3 = func.call @output_next(%response, %previous, %state, %phase) : (buffer, i64, i64, i32) -> (i64, i64, i64, i64)
186
+ func.return %result_0, %result_1, %result_2, %result_3 : i64, i64, i64, i64
187
+ }
188
+
189
+ func.decl @complete_text(%prompt: buffer, %response: buffer, %content: buffer, %reasoning: buffer, %tools: buffer, %initial_state: i64, %final_state: i64) -> (buffer, i32)
190
+
191
+ func.def public @text_complete_text(%prompt: buffer, %response: buffer, %content: buffer, %reasoning: buffer, %tools: buffer, %initial_state: i64, %final_state: i64) -> (buffer, i32) {
192
+ %result_0, %result_1 = func.call @complete_text(%prompt, %response, %content, %reasoning, %tools, %initial_state, %final_state) : (buffer, buffer, buffer, buffer, buffer, i64, i64) -> (buffer, i32)
193
+ func.return %result_0, %result_1 : buffer, i32
194
+ }
195
+
196
+ func.def public @text_complete_text_v1(%prompt: buffer, %response: buffer, %content: buffer, %reasoning: buffer, %tools: buffer, %initial_state: i64, %final_state: i64) -> (buffer, i32) {
197
+ %result_0, %result_1 = func.call @complete_text(%prompt, %response, %content, %reasoning, %tools, %initial_state, %final_state) : (buffer, buffer, buffer, buffer, buffer, i64, i64) -> (buffer, i32)
198
+ func.return %result_0, %result_1 : buffer, i32
199
+ }
200
+
201
+ func.decl @encode_state(%bindings: buffer, %count: i32, %origins: buffer)
202
+
203
+ func.def public @text_encode_state(%bindings: buffer, %count: i32, %origins: buffer) {
204
+ func.call @encode_state(%bindings, %count, %origins) : (buffer, i32, buffer)
205
+ func.return
206
+ }
207
+
208
+ func.def public @text_encode_state_v1(%bindings: buffer, %count: i32, %origins: buffer) {
209
+ func.call @encode_state(%bindings, %count, %origins) : (buffer, i32, buffer)
210
+ func.return
211
+ }
212
+
213
+ func.decl @capture_epoch(%state: buffer, %shape: i32, %count: i32, %plan: buffer) -> (buffer)
214
+
215
+ func.def public @text_capture_epoch(%state: buffer, %shape: i32, %count: i32, %plan: buffer) -> (buffer) {
216
+ %result_0 = func.call @capture_epoch(%state, %shape, %count, %plan) : (buffer, i32, i32, buffer) -> (buffer)
217
+ func.return %result_0 : buffer
218
+ }
219
+
220
+ func.def public @text_capture_epoch_v1(%state: buffer, %shape: i32, %count: i32, %plan: buffer) -> (buffer) {
221
+ %result_0 = func.call @capture_epoch(%state, %shape, %count, %plan) : (buffer, i32, i32, buffer) -> (buffer)
222
+ func.return %result_0 : buffer
223
+ }
224
+
225
+ func.decl @encode_epoch(%control_state: buffer, %plan: buffer, %inputs: buffer, %media_plan: buffer, %first_count: i32, %next_count: i32, %input_count: i32, %first_media_count: i32, %next_media_count: i32, %first_packet_capacity: i32, %next_packet_capacity: i32, %eos: i32, %metadata: buffer, %tokens: buffer) -> (i32, buffer, i64, i64)
226
+
227
+ func.def public @text_encode_epoch(%control_state: buffer, %plan: buffer, %inputs: buffer, %media_plan: buffer, %first_count: i32, %next_count: i32, %input_count: i32, %first_media_count: i32, %next_media_count: i32, %first_packet_capacity: i32, %next_packet_capacity: i32, %eos: i32, %metadata: buffer, %tokens: buffer) -> (i32, buffer, i64, i64) {
228
+ %count, %transfers, %transfer_begin, %transfer_length = func.call @encode_epoch(%control_state, %plan, %inputs, %media_plan, %first_count, %next_count, %input_count, %first_media_count, %next_media_count, %first_packet_capacity, %next_packet_capacity, %eos, %metadata, %tokens) : (buffer, buffer, buffer, buffer, i32, i32, i32, i32, i32, i32, i32, i32, buffer, buffer) -> (i32, buffer, i64, i64)
229
+ func.return %count, %transfers, %transfer_begin, %transfer_length : i32, buffer, i64, i64
230
+ }
231
+
232
+ func.def public @text_encode_epoch_v1(%control_state: buffer, %plan: buffer, %inputs: buffer, %media_plan: buffer, %first_count: i32, %next_count: i32, %input_count: i32, %first_media_count: i32, %next_media_count: i32, %first_packet_capacity: i32, %next_packet_capacity: i32, %eos: i32, %metadata: buffer, %tokens: buffer) -> (i32, buffer, i64, i64) {
233
+ %count, %transfers, %transfer_begin, %transfer_length = func.call @encode_epoch(%control_state, %plan, %inputs, %media_plan, %first_count, %next_count, %input_count, %first_media_count, %next_media_count, %first_packet_capacity, %next_packet_capacity, %eos, %metadata, %tokens) : (buffer, buffer, buffer, buffer, i32, i32, i32, i32, i32, i32, i32, i32, buffer, buffer) -> (i32, buffer, i64, i64)
234
+ func.return %count, %transfers, %transfer_begin, %transfer_length : i32, buffer, i64, i64
235
+ }
236
+
237
+ func.decl @publish_epoch(%control_state: buffer, %plan: buffer, %media_plan: buffer, %count: i32, %first_media_count: i32, %next_media_count: i32, %verified: i32, %continues: i32, %next_speculative: buffer, %ordinary: buffer, %first_results: buffer, %next_results: buffer, %progress: buffer)
238
+
239
+ func.def public @text_publish_epoch(%control_state: buffer, %plan: buffer, %media_plan: buffer, %count: i32, %first_media_count: i32, %next_media_count: i32, %verified: i32, %continues: i32, %next_speculative: buffer, %ordinary: buffer, %first_results: buffer, %next_results: buffer, %progress: buffer) {
240
+ func.call @publish_epoch(%control_state, %plan, %media_plan, %count, %first_media_count, %next_media_count, %verified, %continues, %next_speculative, %ordinary, %first_results, %next_results, %progress) : (buffer, buffer, buffer, i32, i32, i32, i32, i32, buffer, buffer, buffer, buffer, buffer)
241
+ func.return
242
+ }
243
+
244
+ func.def public @text_publish_epoch_v1(%control_state: buffer, %plan: buffer, %media_plan: buffer, %count: i32, %first_media_count: i32, %next_media_count: i32, %verified: i32, %continues: i32, %next_speculative: buffer, %ordinary: buffer, %first_results: buffer, %next_results: buffer, %progress: buffer) {
245
+ func.call @publish_epoch(%control_state, %plan, %media_plan, %count, %first_media_count, %next_media_count, %verified, %continues, %next_speculative, %ordinary, %first_results, %next_results, %progress) : (buffer, buffer, buffer, i32, i32, i32, i32, i32, buffer, buffer, buffer, buffer, buffer)
246
+ func.return
247
+ }
248
+
249
+ func.decl @step(%state: buffer, %initialize: i32, %source_position: i32, %input_count: i32, %residual: hal.buffer, %control: hal.buffer, %recurrent: hal.buffer, %attention: hal.buffer, %tokens: hal.buffer, %progress: hal.buffer) -> (i64, i32)
250
+
251
+ func.def public @text_step(%state: buffer, %initialize: i32, %source_position: i32, %input_count: i32, %residual: hal.buffer, %control: hal.buffer, %recurrent: hal.buffer, %attention: hal.buffer, %tokens: hal.buffer, %progress: hal.buffer) -> (i64, i32) {
252
+ %result_0, %result_1 = func.call @step(%state, %initialize, %source_position, %input_count, %residual, %control, %recurrent, %attention, %tokens, %progress) : (buffer, i32, i32, i32, hal.buffer, hal.buffer, hal.buffer, hal.buffer, hal.buffer, hal.buffer) -> (i64, i32)
253
+ func.return %result_0, %result_1 : i64, i32
254
+ }
255
+
256
+ func.def public @text_step_v1(%state: buffer, %initialize: i32, %source_position: i32, %input_count: i32, %residual: hal.buffer, %control: hal.buffer, %recurrent: hal.buffer, %attention: hal.buffer, %tokens: hal.buffer, %progress: hal.buffer) -> (i64, i32) {
257
+ %result_0, %result_1 = func.call @step(%state, %initialize, %source_position, %input_count, %residual, %control, %recurrent, %attention, %tokens, %progress) : (buffer, i32, i32, i32, hal.buffer, hal.buffer, hal.buffer, hal.buffer, hal.buffer, hal.buffer) -> (i64, i32)
258
+ func.return %result_0, %result_1 : i64, i32
259
+ }
260
+
261
+ func.decl @epoch(%control_state: buffer, %shape: i32, %proposes: i32, %verifies: i32, %span_count: i32, %output_count: i32, %epoch_count: i32, %continuation_shape: i32, %continuation_proposes: i32, %first_media_count: i32, %next_media_count: i32, %residual: hal.buffer, %metadata: hal.buffer, %origins: hal.buffer, %state: hal.buffer, %tokens: hal.buffer, %outputs: hal.buffer, %carry: hal.buffer, %committed: hal.buffer, %results: hal.buffer, %draft_cache: hal.buffer, %draft_origins: hal.buffer, %next_results: hal.buffer) -> (i64)
262
+
263
+ func.def public @text_epoch(%control_state: buffer, %shape: i32, %proposes: i32, %verifies: i32, %span_count: i32, %output_count: i32, %epoch_count: i32, %continuation_shape: i32, %continuation_proposes: i32, %first_media_count: i32, %next_media_count: i32, %residual: hal.buffer, %metadata: hal.buffer, %origins: hal.buffer, %state: hal.buffer, %tokens: hal.buffer, %outputs: hal.buffer, %carry: hal.buffer, %committed: hal.buffer, %results: hal.buffer, %draft_cache: hal.buffer, %draft_origins: hal.buffer, %next_results: hal.buffer) -> (i64) {
264
+ %result_0 = func.call @epoch(%control_state, %shape, %proposes, %verifies, %span_count, %output_count, %epoch_count, %continuation_shape, %continuation_proposes, %first_media_count, %next_media_count, %residual, %metadata, %origins, %state, %tokens, %outputs, %carry, %committed, %results, %draft_cache, %draft_origins, %next_results) : (buffer, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, hal.buffer, hal.buffer, hal.buffer, hal.buffer, hal.buffer, hal.buffer, hal.buffer, hal.buffer, hal.buffer, hal.buffer, hal.buffer, hal.buffer) -> (i64)
265
+ func.return %result_0 : i64
266
+ }
267
+
268
+ func.def public @text_epoch_v1(%control_state: buffer, %shape: i32, %proposes: i32, %verifies: i32, %span_count: i32, %output_count: i32, %epoch_count: i32, %continuation_shape: i32, %continuation_proposes: i32, %first_media_count: i32, %next_media_count: i32, %residual: hal.buffer, %metadata: hal.buffer, %origins: hal.buffer, %state: hal.buffer, %tokens: hal.buffer, %outputs: hal.buffer, %carry: hal.buffer, %committed: hal.buffer, %results: hal.buffer, %draft_cache: hal.buffer, %draft_origins: hal.buffer, %next_results: hal.buffer) -> (i64) {
269
+ %result_0 = func.call @epoch(%control_state, %shape, %proposes, %verifies, %span_count, %output_count, %epoch_count, %continuation_shape, %continuation_proposes, %first_media_count, %next_media_count, %residual, %metadata, %origins, %state, %tokens, %outputs, %carry, %committed, %results, %draft_cache, %draft_origins, %next_results) : (buffer, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, hal.buffer, hal.buffer, hal.buffer, hal.buffer, hal.buffer, hal.buffer, hal.buffer, hal.buffer, hal.buffer, hal.buffer, hal.buffer, hal.buffer) -> (i64)
270
+ func.return %result_0 : i64
271
+ }
272
+
273
+ func.def public @sequence_prepare_v1(%prefill: i64, %context: i64, %pool: i64, %rows: i64, %pins: i64, %draft_depth: i32, %shapes: buffer, %shape_count: i64, %weights: buffer, %options: buffer) -> (i64, i32, buffer, buffer, buffer, buffer, buffer, buffer, buffer) {
274
+ %result_0, %result_1, %result_2, %result_3, %result_4, %result_5, %result_6, %result_7, %result_8 = func.call @prepare(%prefill, %context, %pool, %rows, %pins, %draft_depth, %shapes, %shape_count, %weights, %options) : (i64, i64, i64, i64, i64, i32, buffer, i64, buffer, buffer) -> (i64, i32, buffer, buffer, buffer, buffer, buffer, buffer, buffer)
275
+ func.return %result_0, %result_1, %result_2, %result_3, %result_4, %result_5, %result_6, %result_7, %result_8 : i64, i32, buffer, buffer, buffer, buffer, buffer, buffer, buffer
276
+ }
277
+
278
+ func.def public @sequence_epoch_v1(%control_state: buffer, %shape: i32, %proposes: i32, %verifies: i32, %span_count: i32, %output_count: i32, %epoch_count: i32, %continuation_shape: i32, %continuation_proposes: i32, %first_media_count: i32, %next_media_count: i32, %residual: hal.buffer, %metadata: hal.buffer, %origins: hal.buffer, %state: hal.buffer, %tokens: hal.buffer, %outputs: hal.buffer, %carry: hal.buffer, %committed: hal.buffer, %results: hal.buffer, %draft_cache: hal.buffer, %draft_origins: hal.buffer, %next_results: hal.buffer) -> (i64) {
279
+ %result_0 = func.call @epoch(%control_state, %shape, %proposes, %verifies, %span_count, %output_count, %epoch_count, %continuation_shape, %continuation_proposes, %first_media_count, %next_media_count, %residual, %metadata, %origins, %state, %tokens, %outputs, %carry, %committed, %results, %draft_cache, %draft_origins, %next_results) : (buffer, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, hal.buffer, hal.buffer, hal.buffer, hal.buffer, hal.buffer, hal.buffer, hal.buffer, hal.buffer, hal.buffer, hal.buffer, hal.buffer, hal.buffer) -> (i64)
280
+ func.return %result_0 : i64
281
+ }
282
+
283
+ func.def public @sequence_encode_epoch_v1(%control_state: buffer, %plan: buffer, %inputs: buffer, %media_plan: buffer, %first_count: i32, %next_count: i32, %input_count: i32, %first_media_count: i32, %next_media_count: i32, %first_packet_capacity: i32, %next_packet_capacity: i32, %eos: i32, %metadata: buffer, %tokens: buffer) -> (i32, buffer, i64, i64) {
284
+ %count, %transfers, %transfer_begin, %transfer_length = func.call @encode_epoch(%control_state, %plan, %inputs, %media_plan, %first_count, %next_count, %input_count, %first_media_count, %next_media_count, %first_packet_capacity, %next_packet_capacity, %eos, %metadata, %tokens) : (buffer, buffer, buffer, buffer, i32, i32, i32, i32, i32, i32, i32, i32, buffer, buffer) -> (i32, buffer, i64, i64)
285
+ func.return %count, %transfers, %transfer_begin, %transfer_length : i32, buffer, i64, i64
286
+ }
287
+
288
+ func.def public @sequence_publish_epoch_v1(%control_state: buffer, %plan: buffer, %media_plan: buffer, %count: i32, %first_media_count: i32, %next_media_count: i32, %verified: i32, %continues: i32, %next_speculative: buffer, %ordinary: buffer, %first_results: buffer, %next_results: buffer, %progress: buffer) {
289
+ func.call @publish_epoch(%control_state, %plan, %media_plan, %count, %first_media_count, %next_media_count, %verified, %continues, %next_speculative, %ordinary, %first_results, %next_results, %progress) : (buffer, buffer, buffer, i32, i32, i32, i32, i32, buffer, buffer, buffer, buffer, buffer)
290
+ func.return
291
+ }
292
+
293
+ func.def public @sequence_encode_state_v1(%bindings: buffer, %count: i32, %origins: buffer) {
294
+ func.call @encode_state(%bindings, %count, %origins) : (buffer, i32, buffer)
295
+ func.return
296
+ }
297
+
298
+ func.def public @sequence_bind_request_v1(%state: buffer, %row: i32, %options: buffer) {
299
+ func.call @bind_request(%state, %row, %options) : (buffer, i32, buffer)
300
+ func.return
301
+ }
302
+
303
+ func.def public @sequence_capture_epoch_v1(%state: buffer, %shape: i32, %count: i32, %plan: buffer) -> (buffer) {
304
+ %result_0 = func.call @capture_epoch(%state, %shape, %count, %plan) : (buffer, i32, i32, buffer) -> (buffer)
305
+ func.return %result_0 : buffer
306
+ }
307
+
308
+ func.def public @sequence_request_defaults_v1(%options: buffer) -> (buffer) {
309
+ %result_0 = func.call @request_defaults(%options) : (buffer) -> (buffer)
310
+ func.return %result_0 : buffer
311
+ }
312
+
313
+ func.def public @sequence_request_options_v1(%defaults: buffer, %request: buffer, %nonce: i64) -> (buffer) {
314
+ %result_0 = func.call @request_options(%defaults, %request, %nonce) : (buffer, buffer, i64) -> (buffer)
315
+ func.return %result_0 : buffer
316
+ }
program/storage.loom ADDED
@@ -0,0 +1,216 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // KV geometry: 16 planes (K and V per attention layer) of pool x 2048 bytes (F16 KV heads x head_dim).
2
+ // Recurrent slots: 174227456 bytes each (gated delta-net state of every recurrent layer; 4 = none).
3
+ // logits:begin
4
+ // A declaration: the one definition (default false) is in llm.loom; a second config.def of the key links ambiguously (LINK/MATERIALIZE).
5
+ config.decl @llm.logits : i1
6
+ // logits:end
7
+
8
+ func.def @allocation(%records: buffer, %slot: index, %bytes: i64, %clear: i64) {
9
+ %origin = index.constant 0 : offset
10
+ %bounded = index.assume %slot [range(%slot, 0, 10)] : index
11
+ %view = buffer.view %records[%origin] : buffer -> view<11x3xi64>
12
+ %alignment = scalar.constant 256 : i64
13
+ view.store %bytes, %view[%bounded, 0] : i64, view<11x3xi64>
14
+ view.store %alignment, %view[%bounded, 1] : i64, view<11x3xi64>
15
+ view.store %clear, %view[%bounded, 2] : i64, view<11x3xi64>
16
+ func.return
17
+ }
18
+
19
+ // KV is a stable prefix; private views and recurrent slots grow by appending.
20
+ func.def public @llm_storage(%maximum: i64, %span_capacity: i64, %context: i64, %pool: i64, %rows: i64, %pins: i64, %drafting: i64) -> (buffer, buffer, buffer, buffer, buffer) {
21
+ // drafting = 0 (draft_depth 0 at serve time): no drafter allocations, one cache region, no draft table.
22
+ %zero_flag = scalar.constant 0 : i64
23
+ %on = scalar.cmpi ne, %drafting, %zero_flag : i64
24
+ %origin = index.constant 0 : offset
25
+ %c0 = index.constant 0 : index
26
+ %c1 = index.constant 1 : index
27
+ %c0_i32 = scalar.constant 0 : i32
28
+ %c0_i64 = scalar.constant 0 : i64
29
+ %c1_i64 = scalar.constant 1 : i64
30
+ %c4_i64 = scalar.constant 4 : i64
31
+ %bounded_rows = scalar.assume %rows [range(%rows, 1, 2147483647)] : i64
32
+ %row_count = index.cast %bounded_rows : i64 to index
33
+ %slot_stride = scalar.constant 256 : i64
34
+ %token_bytes = scalar.muli %maximum, %c4_i64 : i64
35
+ %alignment_bias = scalar.constant 255 : i64
36
+ %biased_token_bytes = scalar.addi %token_bytes, %alignment_bias : i64
37
+ %token_slots = scalar.divui %biased_token_bytes, %slot_stride : i64
38
+ %padded_token_bytes = scalar.muli %token_slots, %slot_stride : i64
39
+ %progress_offset = scalar.addi %slot_stride, %padded_token_bytes : i64
40
+ %recurrent_offset = scalar.addi %progress_offset, %slot_stride : i64
41
+ %recurrent_bytes = scalar.constant 174227456 : i64
42
+ %recurrent_padded = scalar.addi %recurrent_bytes, %alignment_bias : i64
43
+ %recurrent_pages = scalar.divui %recurrent_padded, %slot_stride : i64
44
+ %recurrent_region = scalar.muli %recurrent_pages, %slot_stride : i64
45
+ %row_stride = scalar.addi %recurrent_offset, %recurrent_region : i64
46
+ %pinned = scalar.cmpi ne, %pins, %c0_i64 : i64
47
+ %twice_rows = scalar.addi %rows, %rows : i64
48
+ %fork_slots = scalar.addi %twice_rows, %pins : i64
49
+ %slots = scf.select %pinned, %fork_slots, %rows : i64
50
+ %private_bytes = scalar.muli %slots, %row_stride : i64
51
+ %kv_position_bytes = scalar.constant 2048 : i64
52
+ %plane_count = scalar.constant 16 : i64
53
+ %plane_bytes = scalar.muli %pool, %kv_position_bytes : i64
54
+ %pool_bytes = scalar.muli %plane_bytes, %plane_count : i64
55
+ %biased_pool = scalar.addi %pool_bytes, %alignment_bias : i64
56
+ %pool_slots = scalar.divui %biased_pool, %slot_stride : i64
57
+ %private_origin = scalar.muli %pool_slots, %slot_stride : i64
58
+ %recurrent_origin = scalar.addi %private_origin, %recurrent_offset : i64
59
+ %arena_bytes = scalar.addi %private_origin, %private_bytes : i64
60
+ %c3_i64 = scalar.constant 3 : i64
61
+ %c15_i64 = scalar.constant 15 : i64
62
+ %c16_i64 = scalar.constant 16 : i64
63
+ %padded = scalar.addi %context, %c15_i64 : i64
64
+ %blocks = scalar.divui %padded, %c16_i64 : i64
65
+ %map_entries = scalar.muli %rows, %blocks : i64
66
+ %map_bytes = scalar.muli %map_entries, %c4_i64 : i64
67
+ %origin_stride = scalar.constant 40 : i64
68
+ %map_origin = scalar.muli %bounded_rows, %origin_stride : i64
69
+ %table_bytes = scalar.addi %map_origin, %map_bytes : i64
70
+ %allocation_bytes = index.constant 264 : offset
71
+ %allocations = buffer.alloca<private> align(8) %allocation_bytes : buffer
72
+ %allocation_count = index.constant 11 : index
73
+ scf.for %i = [%c0 to %allocation_count step %c1] {
74
+ func.call @allocation(%allocations, %i, %c0_i64, %c0_i64) : (buffer, index, i64, i64)
75
+ }
76
+ // Final normalized hidden rows (the drafter's catch-up input) live in the residual allocation.
77
+ %hidden_row = scalar.constant 36864 : i64
78
+ %carry_stride = scalar.constant 8404992 : i64
79
+ %residual_bytes = scalar.muli %maximum, %hidden_row : i64
80
+ %span_floor = scalar.muli %span_capacity, %c4_i64 : i64
81
+ %feedback_bytes = scalar.maxui %residual_bytes, %span_floor : i64
82
+ %header_bytes = scalar.constant 16 : i64
83
+ %record_bytes = scalar.constant 36 : i64
84
+ %plan_bytes = scalar.muli %span_capacity, %record_bytes : i64
85
+ %metadata_bytes = scalar.addi %header_bytes, %plan_bytes : i64
86
+ %c2 = index.constant 2 : index
87
+ %c3 = index.constant 3 : index
88
+ %c4 = index.constant 4 : index
89
+ %c5 = index.constant 5 : index
90
+ func.call @allocation(%allocations, %c0, %feedback_bytes, %c0_i64) : (buffer, index, i64, i64)
91
+ func.call @allocation(%allocations, %c1, %arena_bytes, %c0_i64) : (buffer, index, i64, i64)
92
+ func.call @allocation(%allocations, %c2, %metadata_bytes, %c0_i64) : (buffer, index, i64, i64)
93
+ func.call @allocation(%allocations, %c3, %table_bytes, %c0_i64) : (buffer, index, i64, i64)
94
+ func.call @allocation(%allocations, %c4, %token_bytes, %c0_i64) : (buffer, index, i64, i64)
95
+ func.call @allocation(%allocations, %c5, %span_floor, %c0_i64) : (buffer, index, i64, i64)
96
+ // Drafter: carry (one hidden row per resident row and checkpoint), committed packet, verification
97
+ // results (first bank 40 B/span, second bank 44 B/span), draft K/V (2 planes over the pool's
98
+ // page ids), and the draft page table (same layout as the target table).
99
+ %c6 = index.constant 6 : index
100
+ %c7 = index.constant 7 : index
101
+ %c8 = index.constant 8 : index
102
+ %c9 = index.constant 9 : index
103
+ %c10 = index.constant 10 : index
104
+ %owners = scalar.addi %rows, %pins : i64
105
+ %carry_bytes = scalar.muli %owners, %carry_stride : i64
106
+ %committed_stride = scalar.constant 40 : i64
107
+ %committed_records = scalar.muli %span_capacity, %committed_stride : i64
108
+ %committed_bytes = scalar.addi %committed_records, %header_bytes : i64
109
+ %result_stride = scalar.constant 84 : i64
110
+ %results_bytes = scalar.muli %span_capacity, %result_stride : i64
111
+ %first_bank_stride = scalar.constant 40 : i64
112
+ %feedback_split = scalar.muli %span_capacity, %first_bank_stride : i64
113
+ %draft_planes = scalar.constant 2 : i64
114
+ %draft_pos_bytes = scalar.constant 2048 : i64
115
+ %draft_plane_bytes = scalar.muli %pool, %draft_pos_bytes : i64
116
+ %draft_bytes = scalar.muli %draft_plane_bytes, %draft_planes : i64
117
+ %carry_on = scf.select %on, %carry_bytes, %c0_i64 : i64
118
+ %committed_on = scf.select %on, %committed_bytes, %c0_i64 : i64
119
+ %results_on = scf.select %on, %results_bytes, %c0_i64 : i64
120
+ %draft_on = scf.select %on, %draft_bytes, %c0_i64 : i64
121
+ %table_on = scf.select %on, %table_bytes, %c0_i64 : i64
122
+ %carry_stride_on = scf.select %on, %carry_stride, %c0_i64 : i64
123
+ %split_on = scf.select %on, %feedback_split, %c4_i64 : i64
124
+ func.call @allocation(%allocations, %c6, %carry_on, %carry_on) : (buffer, index, i64, i64)
125
+ func.call @allocation(%allocations, %c7, %committed_on, %c0_i64) : (buffer, index, i64, i64)
126
+ func.call @allocation(%allocations, %c8, %results_on, %c0_i64) : (buffer, index, i64, i64)
127
+ func.call @allocation(%allocations, %c9, %draft_on, %c0_i64) : (buffer, index, i64, i64)
128
+ func.call @allocation(%allocations, %c10, %table_on, %c0_i64) : (buffer, index, i64, i64)
129
+
130
+ // logits:begin
131
+ // Opt-in logits readback (card config llm.logits, default off; gen_llm.py g_logits_export): the outputs allocation also holds
132
+ // one full-vocabulary f32 row per slot (min(span_capacity, rows)) after the 8192-span token region. Spans hold at most 8192 tokens (4 B each).
133
+ %logits_on = config.get @llm.logits : i1
134
+ scf.if %logits_on {
135
+ %logit_region = scalar.constant 32768 : i64
136
+ %logit_row = scalar.constant 800256 : i64
137
+ %logit_slots = scalar.minsi %span_capacity, %rows : i64
138
+ %logit_rows = scalar.muli %logit_slots, %logit_row : i64
139
+ %logit_total = scalar.addi %logit_region, %logit_rows : i64
140
+ func.call @allocation(%allocations, %c5, %logit_total, %c0_i64) : (buffer, index, i64, i64)
141
+ }
142
+ // logits:end
143
+
144
+ %view_stride = index.constant 64 : offset
145
+ %view_bytes = index.scale %row_count, %view_stride : index, offset -> offset
146
+ %views = buffer.alloca<private> align(8) %view_bytes : buffer
147
+ %view_records = buffer.view %views[%origin] : buffer -> view<[%row_count]x4x2xi64>
148
+ %origin_bytes = index.cast %map_origin : i64 to offset
149
+ %origins = buffer.alloca<private> align(8) %origin_bytes : buffer
150
+ buffer.fill %c0_i32, %origins[%origin], %origin_bytes : i32
151
+ %origin_records = buffer.view %origins[%origin] : buffer -> view<[%row_count]x5xi64>
152
+ %control_bytes = scalar.constant 12 : i64
153
+ %progress_bytes = scalar.constant 32 : i64
154
+ scf.for %row = [%c0 to %row_count step %c1] {
155
+ %row64 = index.cast %row : index to i64
156
+ %relative = scalar.muli %row64, %row_stride : i64
157
+ %base = scalar.addi %private_origin, %relative : i64
158
+ %tokens = scalar.addi %base, %slot_stride : i64
159
+ %progress = scalar.addi %base, %progress_offset : i64
160
+ view.store %base, %view_records[%row, 0, 0] : i64, view<[%row_count]x4x2xi64>
161
+ view.store %control_bytes, %view_records[%row, 0, 1] : i64, view<[%row_count]x4x2xi64>
162
+ view.store %c0_i64, %view_records[%row, 1, 0] : i64, view<[%row_count]x4x2xi64>
163
+ view.store %c0_i64, %view_records[%row, 1, 1] : i64, view<[%row_count]x4x2xi64>
164
+ view.store %tokens, %view_records[%row, 2, 0] : i64, view<[%row_count]x4x2xi64>
165
+ view.store %token_bytes, %view_records[%row, 2, 1] : i64, view<[%row_count]x4x2xi64>
166
+ view.store %progress, %view_records[%row, 3, 0] : i64, view<[%row_count]x4x2xi64>
167
+ view.store %progress_bytes, %view_records[%row, 3, 1] : i64, view<[%row_count]x4x2xi64>
168
+ view.store %c0_i64, %origin_records[%row, 2] : i64, view<[%row_count]x5xi64>
169
+ %map_stride = scalar.muli %blocks, %c4_i64 : i64
170
+ %map_offset = scalar.muli %row64, %map_stride : i64
171
+ %map_base = scalar.addi %map_origin, %map_offset : i64
172
+ view.store %map_base, %origin_records[%row, 4] : i64, view<[%row_count]x5xi64>
173
+ }
174
+ %geometry_one = index.constant 104 : offset
175
+ %geometry_two = index.constant 144 : offset
176
+ %geometry_bytes = scf.select %on, %geometry_two, %geometry_one : offset
177
+ %geometry = buffer.alloca<private> align(8) %geometry_bytes : buffer
178
+ %geometry_view = buffer.view %geometry[%origin] : buffer -> view<13xi64>
179
+ view.store %c16_i64, %geometry_view[0] : i64, view<13xi64>
180
+ view.store %map_origin, %geometry_view[1] : i64, view<13xi64>
181
+ view.store %carry_stride_on, %geometry_view[2] : i64, view<13xi64>
182
+ view.store %split_on, %geometry_view[3] : i64, view<13xi64>
183
+ view.store %recurrent_origin, %geometry_view[4] : i64, view<13xi64>
184
+ view.store %row_stride, %geometry_view[5] : i64, view<13xi64>
185
+ view.store %recurrent_bytes, %geometry_view[6] : i64, view<13xi64>
186
+ view.store %slots, %geometry_view[7] : i64, view<13xi64>
187
+ view.store %c1_i64, %geometry_view[8] : i64, view<13xi64>
188
+ view.store %c0_i64, %geometry_view[9] : i64, view<13xi64>
189
+ view.store %plane_count, %geometry_view[10] : i64, view<13xi64>
190
+ view.store %plane_bytes, %geometry_view[11] : i64, view<13xi64>
191
+ %block_bytes = scalar.constant 32768 : i64
192
+ view.store %block_bytes, %geometry_view[12] : i64, view<13xi64>
193
+ // second cache region: the drafter's K/V planes (allocation 9), same page geometry
194
+ %draft_origins = scf.if %on -> (buffer) {
195
+ %region_at = index.constant 104 : offset
196
+ %region = buffer.view %geometry[%region_at] : buffer -> view<5xi64>
197
+ %c9_i64 = scalar.constant 9 : i64
198
+ %draft_block_bytes = scalar.constant 32768 : i64
199
+ view.store %c9_i64, %region[0] : i64, view<5xi64>
200
+ view.store %c0_i64, %region[1] : i64, view<5xi64>
201
+ view.store %draft_planes, %region[2] : i64, view<5xi64>
202
+ view.store %draft_plane_bytes, %region[3] : i64, view<5xi64>
203
+ view.store %draft_block_bytes, %region[4] : i64, view<5xi64>
204
+ // the draft page table starts as a copy of the target's (page maps at the same offsets)
205
+ %copy = buffer.alloca<private> align(8) %origin_bytes : buffer
206
+ buffer.copy %origins[%origin], %copy[%origin], %origin_bytes
207
+ scf.yield %copy : buffer
208
+ } else {
209
+ %none_bytes = index.constant 0 : offset
210
+ %none = buffer.alloca<private> align(1) %none_bytes : buffer
211
+ scf.yield %none : buffer
212
+ }
213
+ %empty_bytes = index.constant 0 : offset
214
+ %empty = buffer.alloca<private> align(1) %empty_bytes : buffer
215
+ func.return %allocations, %views, %origins, %draft_origins, %geometry : buffer, buffer, buffer, buffer, buffer
216
+ }
tokenizer.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a45fdc4e7e66a035de236d2694742fed5645327051caace5f8312013a879f9b1
3
+ size 12242935
weights.loom ADDED
The diff for this file is too large to render. See raw diff