dhndhn commited on
Commit
4eb9d14
·
verified ·
1 Parent(s): 1e0bb40

Fresh loom-next port

Browse files
Files changed (9) hide show
  1. README.md +3 -2
  2. REPORT.md +1 -1
  3. info.json +104 -102
  4. llm_config.json +198 -202
  5. model.json +112 -112
  6. model.json.lock +33 -33
  7. program/vision_control.loom +165 -165
  8. program/vision_prepare.loom +33 -33
  9. program/vision_stages.loom +18 -18
README.md CHANGED
@@ -1,6 +1,6 @@
1
  ---
2
  base_model: bartowski/t-tech_T-Search-GGUF
3
- license: apache-2.0
4
  tags:
5
  - loom
6
  - loom-serve
@@ -11,6 +11,7 @@ tags:
11
  - mtp
12
  - vision
13
  - image-text-to-text
 
14
  ---
15
 
16
  # t-tech_T-Search (Q4_K_M) for AMD Loom
@@ -116,7 +117,7 @@ AMD Radeon AI PRO R9700 (gfx1201, 32 GB): the results for this package are not y
116
  - `info.json`: the measurements, gate evidence and versions this card shows; everything else comes from the files above.
117
  - `REPORT.md`: how the values above were measured: setup, commands and the value of every run.
118
 
119
- Versions: card schema `loom-card/3`; loom-skills unknown; hrx-loom `0.2.0` (install fingerprint `20d79282b0f3d72a`); card generator `fdd785e`.
120
 
121
  Source files, fetched by `loom-fetch` from their own repositories:
122
 
 
1
  ---
2
  base_model: bartowski/t-tech_T-Search-GGUF
3
+ license: mit
4
  tags:
5
  - loom
6
  - loom-serve
 
11
  - mtp
12
  - vision
13
  - image-text-to-text
14
+ - loom-target-set
15
  ---
16
 
17
  # t-tech_T-Search (Q4_K_M) for AMD Loom
 
117
  - `info.json`: the measurements, gate evidence and versions this card shows; everything else comes from the files above.
118
  - `REPORT.md`: how the values above were measured: setup, commands and the value of every run.
119
 
120
+ Versions: card schema `loom-card/3`; loom-skills unknown; hrx-loom unknown; card generator `6facf9a`.
121
 
122
  Source files, fetched by `loom-fetch` from their own repositories:
123
 
REPORT.md CHANGED
@@ -4,7 +4,7 @@ How the values on this repository's model card were measured. Generated from `in
4
 
5
  ## Setup
6
 
7
- - Package: this repository. Programs generated by loom-skills unknown with hrx-loom `0.2.0` (install fingerprint `20d79282b0f3d72a`).
8
  - Checkpoint: [bartowski/t-tech_T-Search-GGUF](https://huggingface.co/bartowski/t-tech_T-Search-GGUF) @ `c9b3588081973d33635efbc2b14931551a8e5216`, `t-tech_T-Search-Q4_K_M.gguf`, sha256 `d4f7ead76404f94a28e91be4afb519097f819e6be34d298c1ecbe55bbd1d7962`.
9
  - Programs measured: the sha256 below is card_lib.programs_sha256, over `program/*.loom` without each file's first-line generator comment.
10
 
 
4
 
5
  ## Setup
6
 
7
+ - Package: this repository. Programs generated by loom-skills unknown with hrx-loom unknown.
8
  - Checkpoint: [bartowski/t-tech_T-Search-GGUF](https://huggingface.co/bartowski/t-tech_T-Search-GGUF) @ `c9b3588081973d33635efbc2b14931551a8e5216`, `t-tech_T-Search-Q4_K_M.gguf`, sha256 `d4f7ead76404f94a28e91be4afb519097f819e6be34d298c1ecbe55bbd1d7962`.
9
  - Programs measured: the sha256 below is card_lib.programs_sha256, over `program/*.loom` without each file's first-line generator comment.
10
 
info.json CHANGED
@@ -1,102 +1,104 @@
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": 262144,
26
- "tokens": 262144
27
- }
28
- },
29
- "image_input": {
30
- "status": "yes",
31
- "value": {
32
- "projector": "mmproj-t-tech_T-Search-bf16.gguf"
33
- }
34
- },
35
- "max_output_tokens": {
36
- "status": "yes",
37
- "value": {
38
- "max_tokens": 4096
39
- }
40
- },
41
- "reasoning_effort": {
42
- "status": "n/a",
43
- "value": null
44
- },
45
- "sampling": {
46
- "status": "unknown",
47
- "value": null
48
- },
49
- "speculative_decoding": {
50
- "status": "yes",
51
- "value": {
52
- "depth": 3,
53
- "drafter": null,
54
- "method": "mtp"
55
- }
56
- },
57
- "thinking": {
58
- "status": "yes",
59
- "value": {
60
- "default": true,
61
- "mode": "toggle"
62
- }
63
- },
64
- "tool_calling": {
65
- "status": "yes",
66
- "value": null
67
- }
68
- },
69
- "license": "apache-2.0"
70
- },
71
- "devices": {
72
- "radeon-r9700": {
73
- "quick_start": {
74
- "args": [
75
- "--pool_backing=fixed",
76
- "--parameter_mode=preload"
77
- ],
78
- "device": "amdgpu://?completion_spin_ns=4294967295",
79
- "preset": "chat-r9700"
80
- },
81
- "state": "not_measured"
82
- },
83
- "strix-halo": {
84
- "quick_start": {
85
- "args": [
86
- "--pool_backing=fixed",
87
- "--parameter_mode=preload"
88
- ],
89
- "device": "amdgpu://?completion_spin_ns=4294967295",
90
- "preset": "chat"
91
- },
92
- "state": "not_measured"
93
- }
94
- },
95
- "repo": "loom-draft/bartowski-t-tech_T-Search-loom",
96
- "report": "generated",
97
- "schema": "loom-card/3",
98
- "sources": {},
99
- "versions": {
100
- "card_generator": "fdd785e5"
101
- }
102
- }
 
 
 
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": 262144,
26
+ "tokens": 262144
27
+ }
28
+ },
29
+ "image_input": {
30
+ "status": "yes",
31
+ "value": {
32
+ "projector": "mmproj-t-tech_T-Search-bf16.gguf"
33
+ }
34
+ },
35
+ "max_output_tokens": {
36
+ "status": "yes",
37
+ "value": {
38
+ "max_tokens": 4096
39
+ }
40
+ },
41
+ "reasoning_effort": {
42
+ "status": "n/a",
43
+ "value": null
44
+ },
45
+ "sampling": {
46
+ "status": "unknown",
47
+ "value": null
48
+ },
49
+ "speculative_decoding": {
50
+ "status": "yes",
51
+ "value": {
52
+ "depth": 3,
53
+ "drafter": null,
54
+ "method": "mtp"
55
+ }
56
+ },
57
+ "thinking": {
58
+ "status": "yes",
59
+ "value": {
60
+ "default": true,
61
+ "mode": "toggle"
62
+ }
63
+ },
64
+ "tool_calling": {
65
+ "status": "yes",
66
+ "value": null
67
+ }
68
+ },
69
+ "tags": [
70
+ "loom-target-set"
71
+ ]
72
+ },
73
+ "devices": {
74
+ "radeon-r9700": {
75
+ "quick_start": {
76
+ "args": [
77
+ "--pool_backing=fixed",
78
+ "--parameter_mode=preload"
79
+ ],
80
+ "device": "amdgpu://?completion_spin_ns=4294967295",
81
+ "preset": "chat-r9700"
82
+ },
83
+ "state": "not_measured"
84
+ },
85
+ "strix-halo": {
86
+ "quick_start": {
87
+ "args": [
88
+ "--pool_backing=fixed",
89
+ "--parameter_mode=preload"
90
+ ],
91
+ "device": "amdgpu://?completion_spin_ns=4294967295",
92
+ "preset": "chat"
93
+ },
94
+ "state": "not_measured"
95
+ }
96
+ },
97
+ "repo": "loom-draft/bartowski-t-tech_T-Search-loom",
98
+ "report": "generated",
99
+ "schema": "loom-card/3",
100
+ "sources": {},
101
+ "versions": {
102
+ "card_generator": "6facf9ad6acd3252746ab941da73dd4da7543710"
103
+ }
104
+ }
llm_config.json CHANGED
@@ -1,203 +1,199 @@
1
- {
2
- "name": "T Search",
3
- "arch": "qwen35moe",
4
- "gguf": "t-tech_T-Search-Q4_K_M.gguf",
5
- "hidden": 2048,
6
- "layers": 40,
7
- "heads": 16,
8
- "kv_heads": 2,
9
- "head_dim": 256,
10
- "ffn": 512,
11
- "vocab": 248320,
12
- "context_length": 262144,
13
- "rms_eps": 9.999999974752427e-07,
14
- "rope_theta": 10000000.0,
15
- "rope_type": "neox",
16
- "qk_norm": true,
17
- "attn_gate": "fused_q",
18
- "post_norms": false,
19
- "embed_norm": false,
20
- "embed_scale": null,
21
- "sliding_window": 0,
22
- "sliding_layers": [],
23
- "nope_layers": [],
24
- "tied_embeddings": false,
25
- "eos_id": 248046,
26
- "extra_eos_ids": [
27
- 248044
28
- ],
29
- "bos_id": null,
30
- "chat": {
31
- "bos": "",
32
- "system_prefix": "<|im_start|>system\n",
33
- "suffix": "<|im_end|>\n",
34
- "user_prefix": "<|im_start|>user\n",
35
- "assistant_prefix": "<|im_start|>assistant\n",
36
- "default_system": "",
37
- "trim_content": true,
38
- "think_open": "<think>\n",
39
- "think_close": "\n</think>\n\n",
40
- "history_think": "always",
41
- "history_think_scope": "after_last_query",
42
- "generation_prompt": "<|im_start|>assistant\n<think>\n",
43
- "generation_prompt_plain": "<|im_start|>assistant\n<think>\n\n</think>\n\n",
44
- "thinking": "toggle",
45
- "thinking_default": true,
46
- "starts_in_reasoning": true,
47
- "think_end": "</think>",
48
- "tools_function_only": false,
49
- "tool_line_prefix": "\n",
50
- "tool_separator": "",
51
- "tools_after_system": false,
52
- "tools_prefix": "# Tools\n\nYou have access to the following functions:\n\n<tools>",
53
- "tools_system_separator": "\n\n",
54
- "tools_suffix": "\n</tools>\n\nIf you choose to call a function ONLY reply in the following format with NO suffix:\n\n<tool_call>\n<function=example_function_name>\n<parameter=example_parameter_1>\nvalue_1\n</parameter>\n<parameter=example_parameter_2>\nThis is the value for the second parameter\nthat can span\nmultiple lines\n</parameter>\n</function>\n</tool_call>\n\n<IMPORTANT>\nReminder:\n- Function calls MUST follow the specified format: an inner <function=...></function> block must be nested within <tool_call></tool_call> XML tags\n- Required parameters MUST be specified\n- You may provide optional reasoning for your function call in natural language BEFORE the function call, but NOT after\n- If there is no function call available, answer the question like normal with your current knowledge and do not tell the user about function calls\n</IMPORTANT>",
55
- "call_format": "qwen_xml",
56
- "calls_open": "",
57
- "calls_close": "",
58
- "call_end": "",
59
- "call_marker": "<tool_call>",
60
- "content_call_separator": "\n\n",
61
- "call_separator": "\n",
62
- "tool_turn_prefix": "<|im_start|>user",
63
- "tool_item_prefix": "\n<tool_response>\n",
64
- "tool_item_suffix": "\n</tool_response>",
65
- "tool_turn_suffix": "<|im_end|>\n",
66
- "terminal": "<|im_end|>"
67
- },
68
- "rope_dims": 64,
69
- "mrope": {
70
- "sections": [
71
- 11,
72
- 11,
73
- 10,
74
- 0
75
- ],
76
- "interleaved": true
77
- },
78
- "recurrent_layers": [
79
- 0,
80
- 1,
81
- 2,
82
- 4,
83
- 5,
84
- 6,
85
- 8,
86
- 9,
87
- 10,
88
- 12,
89
- 13,
90
- 14,
91
- 16,
92
- 17,
93
- 18,
94
- 20,
95
- 21,
96
- 22,
97
- 24,
98
- 25,
99
- 26,
100
- 28,
101
- 29,
102
- 30,
103
- 32,
104
- 33,
105
- 34,
106
- 36,
107
- 37,
108
- 38
109
- ],
110
- "gdn": {
111
- "conv_kernel": 4,
112
- "k_heads": 16,
113
- "v_heads": 32,
114
- "head_k": 128,
115
- "inner": 4096,
116
- "head_v": 128
117
- },
118
- "kv_layers": 10,
119
- "ffn_norm_tensor": "post_attention_norm",
120
- "mtp": {
121
- "layers": [
122
- 40
123
- ]
124
- },
125
- "attn_sinks": false,
126
- "moe": {
127
- "experts": 256,
128
- "used": 8,
129
- "ffn": 512,
130
- "leading_dense": 0,
131
- "gating": 1,
132
- "norm_weights": true,
133
- "scale": 1.0,
134
- "probs_bias": false,
135
- "shared_ffn": 512,
136
- "shared_gate": true
137
- },
138
- "vision": {
139
- "mmproj": "mmproj-t-tech_T-Search-bf16.gguf",
140
- "family": "qwen3vl_merger",
141
- "img_begin": "<|vision_start|>",
142
- "img_end": "<|vision_end|>",
143
- "mrope": true
144
- },
145
- "model_id": "t-tech_t-search",
146
- "draft": {
147
- "kind": "mtp",
148
- "depth": 3
149
- },
150
- "generator": {
151
- "commit": "f74d5f3aadeadf06a26463c2cef97e211411274a",
152
- "dirty": false,
153
- "overlay": null,
154
- "modified": false,
155
- "hrx_loom": {
156
- "hrx_loom": "0.2.0",
157
- "fingerprint": "20d79282b0f3d72a",
158
- "verified": false
159
- }
160
- },
161
- "sdk": {
162
- "hrx_loom": "0.2.0",
163
- "source": "pypi",
164
- "wheel_sha256": "5148f9e3a264af400ec4bae38bd7b06bf551d28cc33b7a61d67f7bcefa590438",
165
- "hrx_system_sha": "0cd370f2baaa0cfef47cc23007f1a109906f8a52"
166
- },
167
- "resolved": {
168
- "scopes": [
169
- "arch/llm/moe/qwen35moe",
170
- "facet/drafted",
171
- "facet/hybrid-gdn",
172
- "facet/kv-le2",
173
- "facet/moe",
174
- "facet/vision",
175
- "facet/wide-head"
176
- ],
177
- "choices": {
178
- "decode.attn.kv_once.d256": {
179
- "value": false,
180
- "from": "arch/llm/moe/qwen35moe",
181
- "evidence": "Drafted qwen35moe (head_dim 256, 2 KV heads): the K/V-once decode body (#451) cost decode_32k 0.74-0.78x on Strix (runs 43603564334, 43608671297, 43611547482). Rule off: Strix decode_32k vs loom-fun 1.00/1.04/0.98/1.04, R9700 vs staging main 1.22-1.41 (run 43631671557, PR #715)."
182
- }
183
- },
184
- "devices": [
185
- "rdna3",
186
- "rdna4"
187
- ],
188
- "facets": [
189
- "draft-mtp",
190
- "drafted",
191
- "gated-attn",
192
- "hybrid-gdn",
193
- "kv-le2",
194
- "moe",
195
- "mtp",
196
- "vision",
197
- "wide-head"
198
- ],
199
- "env": {
200
- "ATTN_GQA_D256": "0"
201
- }
202
- }
203
  }
 
1
+ {
2
+ "name": "T Search",
3
+ "arch": "qwen35moe",
4
+ "gguf": "t-tech_T-Search-Q4_K_M.gguf",
5
+ "hidden": 2048,
6
+ "layers": 40,
7
+ "heads": 16,
8
+ "kv_heads": 2,
9
+ "head_dim": 256,
10
+ "ffn": 512,
11
+ "vocab": 248320,
12
+ "context_length": 262144,
13
+ "rms_eps": 9.999999974752427e-07,
14
+ "rope_theta": 10000000.0,
15
+ "rope_type": "neox",
16
+ "qk_norm": true,
17
+ "attn_gate": "fused_q",
18
+ "post_norms": false,
19
+ "embed_norm": false,
20
+ "embed_scale": null,
21
+ "sliding_window": 0,
22
+ "sliding_layers": [],
23
+ "nope_layers": [],
24
+ "tied_embeddings": false,
25
+ "eos_id": 248046,
26
+ "extra_eos_ids": [
27
+ 248044
28
+ ],
29
+ "bos_id": null,
30
+ "chat": {
31
+ "bos": "",
32
+ "system_prefix": "<|im_start|>system\n",
33
+ "suffix": "<|im_end|>\n",
34
+ "user_prefix": "<|im_start|>user\n",
35
+ "assistant_prefix": "<|im_start|>assistant\n",
36
+ "default_system": "",
37
+ "trim_content": true,
38
+ "think_open": "<think>\n",
39
+ "think_close": "\n</think>\n\n",
40
+ "history_think": "always",
41
+ "history_think_scope": "after_last_query",
42
+ "generation_prompt": "<|im_start|>assistant\n<think>\n",
43
+ "generation_prompt_plain": "<|im_start|>assistant\n<think>\n\n</think>\n\n",
44
+ "thinking": "toggle",
45
+ "thinking_default": true,
46
+ "starts_in_reasoning": true,
47
+ "think_end": "</think>",
48
+ "tools_function_only": false,
49
+ "tool_line_prefix": "\n",
50
+ "tool_separator": "",
51
+ "tools_after_system": false,
52
+ "tools_prefix": "# Tools\n\nYou have access to the following functions:\n\n<tools>",
53
+ "tools_system_separator": "\n\n",
54
+ "tools_suffix": "\n</tools>\n\nIf you choose to call a function ONLY reply in the following format with NO suffix:\n\n<tool_call>\n<function=example_function_name>\n<parameter=example_parameter_1>\nvalue_1\n</parameter>\n<parameter=example_parameter_2>\nThis is the value for the second parameter\nthat can span\nmultiple lines\n</parameter>\n</function>\n</tool_call>\n\n<IMPORTANT>\nReminder:\n- Function calls MUST follow the specified format: an inner <function=...></function> block must be nested within <tool_call></tool_call> XML tags\n- Required parameters MUST be specified\n- You may provide optional reasoning for your function call in natural language BEFORE the function call, but NOT after\n- If there is no function call available, answer the question like normal with your current knowledge and do not tell the user about function calls\n</IMPORTANT>",
55
+ "call_format": "qwen_xml",
56
+ "calls_open": "",
57
+ "calls_close": "",
58
+ "call_end": "",
59
+ "call_marker": "<tool_call>",
60
+ "content_call_separator": "\n\n",
61
+ "call_separator": "\n",
62
+ "tool_turn_prefix": "<|im_start|>user",
63
+ "tool_item_prefix": "\n<tool_response>\n",
64
+ "tool_item_suffix": "\n</tool_response>",
65
+ "tool_turn_suffix": "<|im_end|>\n",
66
+ "terminal": "<|im_end|>"
67
+ },
68
+ "rope_dims": 64,
69
+ "mrope": {
70
+ "sections": [
71
+ 11,
72
+ 11,
73
+ 10,
74
+ 0
75
+ ],
76
+ "interleaved": true
77
+ },
78
+ "recurrent_layers": [
79
+ 0,
80
+ 1,
81
+ 2,
82
+ 4,
83
+ 5,
84
+ 6,
85
+ 8,
86
+ 9,
87
+ 10,
88
+ 12,
89
+ 13,
90
+ 14,
91
+ 16,
92
+ 17,
93
+ 18,
94
+ 20,
95
+ 21,
96
+ 22,
97
+ 24,
98
+ 25,
99
+ 26,
100
+ 28,
101
+ 29,
102
+ 30,
103
+ 32,
104
+ 33,
105
+ 34,
106
+ 36,
107
+ 37,
108
+ 38
109
+ ],
110
+ "gdn": {
111
+ "conv_kernel": 4,
112
+ "k_heads": 16,
113
+ "v_heads": 32,
114
+ "head_k": 128,
115
+ "inner": 4096,
116
+ "head_v": 128
117
+ },
118
+ "kv_layers": 10,
119
+ "ffn_norm_tensor": "post_attention_norm",
120
+ "mtp": {
121
+ "layers": [
122
+ 40
123
+ ]
124
+ },
125
+ "attn_sinks": false,
126
+ "moe": {
127
+ "experts": 256,
128
+ "used": 8,
129
+ "ffn": 512,
130
+ "leading_dense": 0,
131
+ "gating": 1,
132
+ "norm_weights": true,
133
+ "scale": 1.0,
134
+ "probs_bias": false,
135
+ "shared_ffn": 512,
136
+ "shared_gate": true
137
+ },
138
+ "vision": {
139
+ "mmproj": "mmproj-t-tech_T-Search-bf16.gguf",
140
+ "family": "qwen3vl_merger",
141
+ "img_begin": "<|vision_start|>",
142
+ "img_end": "<|vision_end|>",
143
+ "mrope": true
144
+ },
145
+ "model_id": "t-tech_t-search",
146
+ "draft": {
147
+ "kind": "mtp",
148
+ "depth": 3
149
+ },
150
+ "generator": {
151
+ "commit": "0bba6583c76a28925d9d26f7cc8272efe75cdc7d",
152
+ "dirty": false,
153
+ "overlay": null,
154
+ "modified": false,
155
+ "hrx_loom": "unknown"
156
+ },
157
+ "sdk": {
158
+ "hrx_loom": "0.2.0",
159
+ "source": "pypi",
160
+ "wheel_sha256": "5148f9e3a264af400ec4bae38bd7b06bf551d28cc33b7a61d67f7bcefa590438",
161
+ "hrx_system_sha": "0cd370f2baaa0cfef47cc23007f1a109906f8a52"
162
+ },
163
+ "resolved": {
164
+ "scopes": [
165
+ "arch/llm/moe/qwen35moe",
166
+ "facet/drafted",
167
+ "facet/hybrid-gdn",
168
+ "facet/kv-le2",
169
+ "facet/moe",
170
+ "facet/vision",
171
+ "facet/wide-head"
172
+ ],
173
+ "choices": {
174
+ "decode.attn.kv_once.d256": {
175
+ "value": false,
176
+ "from": "arch/llm/moe/qwen35moe",
177
+ "evidence": "Drafted qwen35moe (head_dim 256, 2 KV heads): the K/V-once decode body (#451) cost decode_32k 0.74-0.78x on Strix (runs 43603564334, 43608671297, 43611547482). Rule off: Strix decode_32k vs loom-fun 1.00/1.04/0.98/1.04, R9700 vs staging main 1.22-1.41 (run 43631671557, PR #715)."
178
+ }
179
+ },
180
+ "devices": [
181
+ "rdna3",
182
+ "rdna4"
183
+ ],
184
+ "facets": [
185
+ "draft-mtp",
186
+ "drafted",
187
+ "gated-attn",
188
+ "hybrid-gdn",
189
+ "kv-le2",
190
+ "moe",
191
+ "mtp",
192
+ "vision",
193
+ "wide-head"
194
+ ],
195
+ "env": {
196
+ "ATTN_GQA_D256": "0"
197
+ }
198
+ }
 
 
 
 
199
  }
model.json CHANGED
@@ -1,112 +1,112 @@
1
- {
2
- "schema_version": 1,
3
- "model": {
4
- "id": "t-tech_t-search",
5
- "name": "T Search (Loom port, GGUF)"
6
- },
7
- "programs": {
8
- "source": {
9
- "inputs": [
10
- {
11
- "path": "program/prepare.loom",
12
- "data": [
13
- "weights.loom",
14
- "llm_config.json"
15
- ]
16
- },
17
- "program/control.loom",
18
- "program/storage.loom",
19
- "program/service.loom",
20
- "program/vision_prepare.loom",
21
- "program/vision_control.loom"
22
- ],
23
- "libraries": [
24
- "program/llm.loom",
25
- "program/vision_stages.loom",
26
- "program/vision_encoder.loom"
27
- ]
28
- }
29
- },
30
- "services": {
31
- "chat": {
32
- "kind": "text",
33
- "version": 1,
34
- "components": {
35
- "image": {
36
- "version": 1
37
- }
38
- }
39
- }
40
- },
41
- "variants": {
42
- "gguf": {
43
- "services": {
44
- "chat": {
45
- "programs": [
46
- "source"
47
- ],
48
- "config": {
49
- "llm.card": true,
50
- "llm.logits": false
51
- },
52
- "parameters": {
53
- "model": {
54
- "files": [
55
- {
56
- "path": "parameter/t-tech_T-Search-Q4_K_M.gguf",
57
- "format": "gguf",
58
- "origin": "@checkpoint/t-tech_T-Search-Q4_K_M.gguf"
59
- }
60
- ]
61
- },
62
- "vision": {
63
- "files": [
64
- {
65
- "path": "parameter/mmproj-t-tech_T-Search-bf16.gguf",
66
- "format": "gguf",
67
- "origin": "@checkpoint/mmproj-t-tech_T-Search-bf16.gguf"
68
- }
69
- ]
70
- }
71
- },
72
- "tokenizers": {
73
- "text": "tokenizer.json"
74
- }
75
- }
76
- }
77
- }
78
- },
79
- "presets": {
80
- "chat": {
81
- "service": "chat",
82
- "variant": "gguf",
83
- "programs": "source",
84
- "execution": {
85
- "rows": 4,
86
- "context_capacity": 262144,
87
- "prefill_capacity": 4096,
88
- "max_tokens": 4096,
89
- "draft_depth": 3
90
- }
91
- },
92
- "chat-r9700": {
93
- "service": "chat",
94
- "variant": "gguf",
95
- "programs": "source",
96
- "execution": {
97
- "rows": 4,
98
- "context_capacity": 45056,
99
- "prefill_capacity": 4096,
100
- "max_tokens": 4096,
101
- "draft_depth": 3
102
- }
103
- }
104
- },
105
- "origins": {
106
- "checkpoint": {
107
- "kind": "hf",
108
- "repository": "bartowski/t-tech_T-Search-GGUF",
109
- "revision": "c9b3588081973d33635efbc2b14931551a8e5216"
110
- }
111
- }
112
- }
 
1
+ {
2
+ "schema_version": 1,
3
+ "model": {
4
+ "id": "t-tech_t-search",
5
+ "name": "T Search (Loom port, GGUF)"
6
+ },
7
+ "programs": {
8
+ "source": {
9
+ "inputs": [
10
+ {
11
+ "path": "program/prepare.loom",
12
+ "data": [
13
+ "weights.loom",
14
+ "llm_config.json"
15
+ ]
16
+ },
17
+ "program/control.loom",
18
+ "program/storage.loom",
19
+ "program/service.loom",
20
+ "program/vision_prepare.loom",
21
+ "program/vision_control.loom"
22
+ ],
23
+ "libraries": [
24
+ "program/llm.loom",
25
+ "program/vision_stages.loom",
26
+ "program/vision_encoder.loom"
27
+ ]
28
+ }
29
+ },
30
+ "services": {
31
+ "chat": {
32
+ "kind": "text",
33
+ "version": 1,
34
+ "components": {
35
+ "image": {
36
+ "version": 1
37
+ }
38
+ }
39
+ }
40
+ },
41
+ "variants": {
42
+ "gguf": {
43
+ "services": {
44
+ "chat": {
45
+ "programs": [
46
+ "source"
47
+ ],
48
+ "config": {
49
+ "llm.card": true,
50
+ "llm.logits": false
51
+ },
52
+ "parameters": {
53
+ "model": {
54
+ "files": [
55
+ {
56
+ "path": "parameter/t-tech_T-Search-Q4_K_M.gguf",
57
+ "format": "gguf",
58
+ "origin": "@checkpoint/t-tech_T-Search-Q4_K_M.gguf"
59
+ }
60
+ ]
61
+ },
62
+ "vision": {
63
+ "files": [
64
+ {
65
+ "path": "parameter/mmproj-t-tech_T-Search-bf16.gguf",
66
+ "format": "gguf",
67
+ "origin": "@checkpoint/mmproj-t-tech_T-Search-bf16.gguf"
68
+ }
69
+ ]
70
+ }
71
+ },
72
+ "tokenizers": {
73
+ "text": "tokenizer.json"
74
+ }
75
+ }
76
+ }
77
+ }
78
+ },
79
+ "presets": {
80
+ "chat": {
81
+ "service": "chat",
82
+ "variant": "gguf",
83
+ "programs": "source",
84
+ "execution": {
85
+ "rows": 4,
86
+ "context_capacity": 262144,
87
+ "prefill_capacity": 4096,
88
+ "max_tokens": 4096,
89
+ "draft_depth": 3
90
+ }
91
+ },
92
+ "chat-r9700": {
93
+ "service": "chat",
94
+ "variant": "gguf",
95
+ "programs": "source",
96
+ "execution": {
97
+ "rows": 4,
98
+ "context_capacity": 45056,
99
+ "prefill_capacity": 4096,
100
+ "max_tokens": 4096,
101
+ "draft_depth": 3
102
+ }
103
+ }
104
+ },
105
+ "origins": {
106
+ "checkpoint": {
107
+ "kind": "hf",
108
+ "repository": "bartowski/t-tech_T-Search-GGUF",
109
+ "revision": "c9b3588081973d33635efbc2b14931551a8e5216"
110
+ }
111
+ }
112
+ }
model.json.lock CHANGED
@@ -1,33 +1,33 @@
1
- {
2
- "schema_version": 2,
3
- "scope": "assets",
4
- "origins": {
5
- "checkpoint": {
6
- "requested": {
7
- "kind": "hf",
8
- "repository": "bartowski/t-tech_T-Search-GGUF",
9
- "revision": "c9b3588081973d33635efbc2b14931551a8e5216"
10
- },
11
- "resolved": {
12
- "revision": "c9b3588081973d33635efbc2b14931551a8e5216"
13
- }
14
- }
15
- },
16
- "files": [
17
- {
18
- "origin": "@checkpoint/t-tech_T-Search-Q4_K_M.gguf",
19
- "size": 21864081248,
20
- "sha256": "d4f7ead76404f94a28e91be4afb519097f819e6be34d298c1ecbe55bbd1d7962"
21
- },
22
- {
23
- "origin": "@checkpoint/mmproj-t-tech_T-Search-bf16.gguf",
24
- "size": 902822528,
25
- "sha256": "eda292241425f2bf859533586b88561bd834365b132d2d0077421c1989265696"
26
- },
27
- {
28
- "origin": "tokenizer.json",
29
- "size": 11071477,
30
- "sha256": "f913b92a26abaa0ef27571382c9c3cffdea931cc27f2acb3fcb964a182ed628a"
31
- }
32
- ]
33
- }
 
1
+ {
2
+ "schema_version": 2,
3
+ "scope": "assets",
4
+ "origins": {
5
+ "checkpoint": {
6
+ "requested": {
7
+ "kind": "hf",
8
+ "repository": "bartowski/t-tech_T-Search-GGUF",
9
+ "revision": "c9b3588081973d33635efbc2b14931551a8e5216"
10
+ },
11
+ "resolved": {
12
+ "revision": "c9b3588081973d33635efbc2b14931551a8e5216"
13
+ }
14
+ }
15
+ },
16
+ "files": [
17
+ {
18
+ "origin": "@checkpoint/t-tech_T-Search-Q4_K_M.gguf",
19
+ "size": 21864081248,
20
+ "sha256": "d4f7ead76404f94a28e91be4afb519097f819e6be34d298c1ecbe55bbd1d7962"
21
+ },
22
+ {
23
+ "origin": "@checkpoint/mmproj-t-tech_T-Search-bf16.gguf",
24
+ "size": 902822528,
25
+ "sha256": "eda292241425f2bf859533586b88561bd834365b132d2d0077421c1989265696"
26
+ },
27
+ {
28
+ "origin": "tokenizer.json",
29
+ "size": 11071477,
30
+ "sha256": "f913b92a26abaa0ef27571382c9c3cffdea931cc27f2acb3fcb964a182ed628a"
31
+ }
32
+ ]
33
+ }
program/vision_control.loom CHANGED
@@ -1,165 +1,165 @@
1
- // Image component control (generated by gen_component.py).
2
- type.decl import("finite", "batch") @FiniteBatch
3
- func.decl import("finite", "batch_pack") @finite_batch_pack(%batch: ptr<@FiniteBatch>) -> (buffer, buffer)
4
- func.decl import("finite", "batch_finish") @finite_batch_finish(%batch: ptr<@FiniteBatch>)
5
- func.decl import("input") @require(%condition: i32, %diagnostic: buffer)
6
- func.decl import("runner") @execute_2(%stage: i32, %input: hal.buffer, %output: hal.buffer) -> (i64)
7
- func.decl @vision_stage(%height: i64, %width: i64) -> (i32)
8
- global.rodata.def @vision_bad_rows = bytes("696d61676520726f7720636f756e7420646f6573206e6f74206d61746368207468652070726f6365737365642073697a65")
9
-
10
- // Memory: private = largest packet + encoder scratch at the largest size; retained = output rows.
11
- func.def public @vision_forecast_memory(%state: buffer, %ranges: buffer, %descriptors: buffer) -> (i64, i64, i64) {
12
- %origin = index.constant 0 : offset
13
- %c0 = index.constant 0 : index
14
- %c1 = index.constant 1 : index
15
- %c0_i64 = scalar.constant 0 : i64
16
- %c16 = scalar.constant 16 : i64
17
- %range_bytes = buffer.length %ranges
18
- %range_length = index.cast %range_bytes : offset to i64
19
- %count_value = scalar.divui %range_length, %c16 : i64
20
- %bounded = scalar.assume %count_value [range(%count_value, 1, 2147483647)] : i64
21
- %count = index.cast %bounded : i64 to index
22
- %records = buffer.view %ranges[%origin] : buffer -> view<[%count]x2xi64>
23
- %peak, %rows = scf.for %i = [%c0 to %count step %c1](%p = %c0_i64 : i64, %r = %c0_i64 : i64) -> (i64, i64) {
24
- %off = view.load %records[%i, 0] : view<[%count]x2xi64> -> i64
25
- %ob = scalar.assume %off [range(%off, 0, 9223372036854775807)] : i64
26
- %o = index.cast %ob : i64 to offset
27
- %header = buffer.view %descriptors[%o] : buffer -> view<8xi32>
28
- %len32 = view.load %header[7] : view<8xi32> -> i32
29
- %rows32 = view.load %header[2] : view<8xi32> -> i32
30
- %len = scalar.extui %len32 : i32 to i64
31
- %rr = scalar.extui %rows32 : i32 to i64
32
- %bigger = scalar.cmpi ugt, %len, %p : i64
33
- %np = scf.select %bigger, %len, %p : i64
34
- %nr = scalar.addi %r, %rr : i64
35
- scf.yield %np, %nr : i64, i64
36
- }
37
- %scratch = scalar.constant 2235170816 : i64
38
- %private = scalar.addi %peak, %scratch : i64
39
- %row_bytes = scalar.constant 8192 : i64
40
- %retained = scalar.muli %rows, %row_bytes : i64
41
- func.return %private, %retained, %retained : i64, i64, i64
42
- }
43
-
44
- // One image per run: the tag is the processed size (metadata [width, height]).
45
- func.def public @text_image_prepare_request_v1(%state: buffer, %request: buffer) -> (buffer, i64, i64) {
46
- %origin = index.constant 0 : offset
47
- %header = buffer.view %request[%origin] : buffer -> view<8xi32>
48
- %meta32 = view.load %header[3] : view<8xi32> -> i32
49
- %meta64 = scalar.extui %meta32 : i32 to i64
50
- %mb = scalar.assume %meta64 [range(%meta64, 0, 4294967295)] : i64
51
- %mo = index.cast %mb : i64 to offset
52
- %meta = buffer.view %request[%mo] : buffer -> view<2xi32>
53
- %w = view.load %meta[0] : view<2xi32> -> i32
54
- %h = view.load %meta[1] : view<2xi32> -> i32
55
- %w64 = scalar.extui %w : i32 to i64
56
- %h64 = scalar.extui %h : i32 to i64
57
- %shift = scalar.constant 32 : i64
58
- %wbits = scalar.shli %w64, %shift : i64
59
- %tag = scalar.ori %wbits, %h64 : i64
60
- %units = scalar.constant 1 : i64
61
- func.return %request, %units, %tag : buffer, i64, i64
62
- }
63
-
64
- func.def public @text_image_prepare_batch_v1(%state: buffer, %tags: buffer, %batch: ptr<@FiniteBatch>) -> (i32, buffer, buffer) {
65
- %ranges, %packed = func.call @finite_batch_pack(%batch) : (ptr<@FiniteBatch>) -> (buffer, buffer)
66
- %origin = index.constant 0 : offset
67
- %range = buffer.view %ranges[%origin] : buffer -> view<1x2xi64>
68
- %source64 = view.load %range[0, 0] : view<1x2xi64> -> i64
69
- %sb = scalar.assume %source64 [range(%source64, 0, 4294967295)] : i64
70
- %source = index.cast %sb : i64 to offset
71
- %header = buffer.view %packed[%source] : buffer -> view<8xi32>
72
- %rows32 = view.load %header[2] : view<8xi32> -> i32
73
- %meta32 = view.load %header[3] : view<8xi32> -> i32
74
- %planes32 = view.load %header[5] : view<8xi32> -> i32
75
- %meta64 = scalar.extui %meta32 : i32 to i64
76
- %planes64 = scalar.extui %planes32 : i32 to i64
77
- %mb = scalar.assume %meta64 [range(%meta64, 0, 4294967295)] : i64
78
- %pb = scalar.assume %planes64 [range(%planes64, 0, 4294967295)] : i64
79
- %mo0 = index.cast %mb : i64 to offset
80
- %po0 = index.cast %pb : i64 to offset
81
- %mo = index.add %source, %mo0 : offset
82
- %po = index.add %source, %po0 : offset
83
- %meta = buffer.view %packed[%mo] : buffer -> view<2xi32>
84
- %dst_w = view.load %meta[0] : view<2xi32> -> i32
85
- %dst_h = view.load %meta[1] : view<2xi32> -> i32
86
- %plane = buffer.view %packed[%po] : buffer -> view<12xi32>
87
- %src_w = view.load %plane[1] : view<12xi32> -> i32
88
- %src_h = view.load %plane[2] : view<12xi32> -> i32
89
- %pix_rel = view.load %plane[6] : view<12xi32> -> i32
90
- %channels = view.load %plane[8] : view<12xi32> -> i32
91
- // rows check: the chat program declared rows from the same size rule
92
- %pf = scalar.constant 32 : i32
93
- %gw = scalar.divui %dst_w, %pf : i32
94
- %gh = scalar.divui %dst_h, %pf : i32
95
- %expect = scalar.muli %gw, %gh : i32
96
- %ok = scalar.cmpi eq, %expect, %rows32 : i32
97
- %ok32 = scalar.extui %ok : i1 to i32
98
- %bad = global.load @vision_bad_rows : buffer
99
- func.call @require(%ok32, %bad) : (i32, buffer)
100
- // payload: 64-byte device header + the packed cohort
101
- %hdr_bytes = index.constant 64 : offset
102
- %packed_bytes = buffer.length %packed
103
- %payload_bytes = index.add %hdr_bytes, %packed_bytes : offset
104
- %payload = buffer.alloca<private> align(16) %payload_bytes : buffer
105
- buffer.copy %packed[%origin], %payload[%hdr_bytes], %packed_bytes
106
- %hdr = buffer.view %payload[%origin] : buffer -> view<16xi32>
107
- %source64b = index.cast %source : offset to i64
108
- %source32 = scalar.trunci %source64b : i64 to i32
109
- %sixty4 = scalar.constant 64 : i32
110
- %pix0 = scalar.addi %pix_rel, %source32 : i32
111
- %pix_abs = scalar.addi %pix0, %sixty4 : i32
112
- %zero32 = scalar.constant 0 : i32
113
- view.store %src_w, %hdr[0] : i32, view<16xi32>
114
- view.store %src_h, %hdr[1] : i32, view<16xi32>
115
- view.store %channels, %hdr[2] : i32, view<16xi32>
116
- view.store %pix_abs, %hdr[3] : i32, view<16xi32>
117
- view.store %dst_w, %hdr[4] : i32, view<16xi32>
118
- view.store %dst_h, %hdr[5] : i32, view<16xi32>
119
- // plan: [output bytes, result bytes, 1 request, rows] [first row, rows, 0] then [byte offset, width] per row
120
- %rows64 = scalar.extui %rows32 : i32 to i64
121
- %rb = scalar.assume %rows64 [range(%rows64, 1, 4096)] : i64
122
- %rows = index.cast %rb : i64 to index
123
- %c16 = index.constant 16 : offset
124
- %c56 = index.constant 56 : offset
125
- %row_bytes_total = index.scale %rows, %c16 : index, offset -> offset
126
- %plan_bytes = index.add %c56, %row_bytes_total : offset
127
- %plan = buffer.alloca<private> align(8) %plan_bytes : buffer
128
- %ph = buffer.view %plan[%origin] : buffer -> view<7xi64>
129
- %width = scalar.constant 2048 : i64
130
- %row_bytes = scalar.constant 8192 : i64
131
- %out_bytes = scalar.muli %rb, %row_bytes : i64
132
- %one = scalar.constant 1 : i64
133
- %zero = scalar.constant 0 : i64
134
- view.store %out_bytes, %ph[0] : i64, view<7xi64>
135
- view.store %out_bytes, %ph[1] : i64, view<7xi64>
136
- view.store %one, %ph[2] : i64, view<7xi64>
137
- view.store %rb, %ph[3] : i64, view<7xi64>
138
- view.store %zero, %ph[4] : i64, view<7xi64>
139
- view.store %rb, %ph[5] : i64, view<7xi64>
140
- view.store %zero, %ph[6] : i64, view<7xi64>
141
- %records = buffer.view %plan[%c56] : buffer -> view<[%rows]x2xi64>
142
- %c0 = index.constant 0 : index
143
- %c1 = index.constant 1 : index
144
- scf.for %i = [%c0 to %rows step %c1] {
145
- %i64 = index.cast %i : index to i64
146
- %offset = scalar.muli %i64, %row_bytes : i64
147
- view.store %offset, %records[%i, 0] : i64, view<[%rows]x2xi64>
148
- view.store %width, %records[%i, 1] : i64, view<[%rows]x2xi64>
149
- }
150
- %h64 = scalar.extui %dst_h : i32 to i64
151
- %w64 = scalar.extui %dst_w : i32 to i64
152
- %stage = func.call @vision_stage(%h64, %w64) : (i64, i64) -> (i32)
153
- func.return %stage, %payload, %plan : i32, buffer, buffer
154
- }
155
-
156
- func.def public @text_image_run_v1(%state: buffer, %stage: i32, %input: hal.buffer, %output: hal.buffer, %batch: ptr<@FiniteBatch>) {
157
- %work = func.call @execute_2(%stage, %input, %output) : (i32, hal.buffer, hal.buffer) -> (i64)
158
- func.return
159
- }
160
-
161
- // One run encodes the whole cohort (one image per run): every member is done when the run is collected.
162
- func.def public @text_image_collect_batch_v1(%state: buffer, %batch: ptr<@FiniteBatch>) {
163
- func.call @finite_batch_finish(%batch) : (ptr<@FiniteBatch>)
164
- func.return
165
- }
 
1
+ // Image component control (generated by gen_component.py).
2
+ type.decl import("finite", "batch") @FiniteBatch
3
+ func.decl import("finite", "batch_pack") @finite_batch_pack(%batch: ptr<@FiniteBatch>) -> (buffer, buffer)
4
+ func.decl import("finite", "batch_finish") @finite_batch_finish(%batch: ptr<@FiniteBatch>)
5
+ func.decl import("input") @require(%condition: i32, %diagnostic: buffer)
6
+ func.decl import("runner") @execute_2(%stage: i32, %input: hal.buffer, %output: hal.buffer) -> (i64)
7
+ func.decl @vision_stage(%height: i64, %width: i64) -> (i32)
8
+ global.rodata.def @vision_bad_rows = bytes("696d61676520726f7720636f756e7420646f6573206e6f74206d61746368207468652070726f6365737365642073697a65")
9
+
10
+ // Memory: private = largest packet + encoder scratch at the largest size; retained = output rows.
11
+ func.def public @vision_forecast_memory(%state: buffer, %ranges: buffer, %descriptors: buffer) -> (i64, i64, i64) {
12
+ %origin = index.constant 0 : offset
13
+ %c0 = index.constant 0 : index
14
+ %c1 = index.constant 1 : index
15
+ %c0_i64 = scalar.constant 0 : i64
16
+ %c16 = scalar.constant 16 : i64
17
+ %range_bytes = buffer.length %ranges
18
+ %range_length = index.cast %range_bytes : offset to i64
19
+ %count_value = scalar.divui %range_length, %c16 : i64
20
+ %bounded = scalar.assume %count_value [range(%count_value, 1, 2147483647)] : i64
21
+ %count = index.cast %bounded : i64 to index
22
+ %records = buffer.view %ranges[%origin] : buffer -> view<[%count]x2xi64>
23
+ %peak, %rows = scf.for %i = [%c0 to %count step %c1](%p = %c0_i64 : i64, %r = %c0_i64 : i64) -> (i64, i64) {
24
+ %off = view.load %records[%i, 0] : view<[%count]x2xi64> -> i64
25
+ %ob = scalar.assume %off [range(%off, 0, 9223372036854775807)] : i64
26
+ %o = index.cast %ob : i64 to offset
27
+ %header = buffer.view %descriptors[%o] : buffer -> view<8xi32>
28
+ %len32 = view.load %header[7] : view<8xi32> -> i32
29
+ %rows32 = view.load %header[2] : view<8xi32> -> i32
30
+ %len = scalar.extui %len32 : i32 to i64
31
+ %rr = scalar.extui %rows32 : i32 to i64
32
+ %bigger = scalar.cmpi ugt, %len, %p : i64
33
+ %np = scf.select %bigger, %len, %p : i64
34
+ %nr = scalar.addi %r, %rr : i64
35
+ scf.yield %np, %nr : i64, i64
36
+ }
37
+ %scratch = scalar.constant 2235170816 : i64
38
+ %private = scalar.addi %peak, %scratch : i64
39
+ %row_bytes = scalar.constant 8192 : i64
40
+ %retained = scalar.muli %rows, %row_bytes : i64
41
+ func.return %private, %retained, %retained : i64, i64, i64
42
+ }
43
+
44
+ // One image per run: the tag is the processed size (metadata [width, height]).
45
+ func.def public @text_image_prepare_request_v1(%state: buffer, %request: buffer) -> (buffer, i64, i64) {
46
+ %origin = index.constant 0 : offset
47
+ %header = buffer.view %request[%origin] : buffer -> view<8xi32>
48
+ %meta32 = view.load %header[3] : view<8xi32> -> i32
49
+ %meta64 = scalar.extui %meta32 : i32 to i64
50
+ %mb = scalar.assume %meta64 [range(%meta64, 0, 4294967295)] : i64
51
+ %mo = index.cast %mb : i64 to offset
52
+ %meta = buffer.view %request[%mo] : buffer -> view<2xi32>
53
+ %w = view.load %meta[0] : view<2xi32> -> i32
54
+ %h = view.load %meta[1] : view<2xi32> -> i32
55
+ %w64 = scalar.extui %w : i32 to i64
56
+ %h64 = scalar.extui %h : i32 to i64
57
+ %shift = scalar.constant 32 : i64
58
+ %wbits = scalar.shli %w64, %shift : i64
59
+ %tag = scalar.ori %wbits, %h64 : i64
60
+ %units = scalar.constant 1 : i64
61
+ func.return %request, %units, %tag : buffer, i64, i64
62
+ }
63
+
64
+ func.def public @text_image_prepare_batch_v1(%state: buffer, %tags: buffer, %batch: ptr<@FiniteBatch>) -> (i32, buffer, buffer) {
65
+ %ranges, %packed = func.call @finite_batch_pack(%batch) : (ptr<@FiniteBatch>) -> (buffer, buffer)
66
+ %origin = index.constant 0 : offset
67
+ %range = buffer.view %ranges[%origin] : buffer -> view<1x2xi64>
68
+ %source64 = view.load %range[0, 0] : view<1x2xi64> -> i64
69
+ %sb = scalar.assume %source64 [range(%source64, 0, 4294967295)] : i64
70
+ %source = index.cast %sb : i64 to offset
71
+ %header = buffer.view %packed[%source] : buffer -> view<8xi32>
72
+ %rows32 = view.load %header[2] : view<8xi32> -> i32
73
+ %meta32 = view.load %header[3] : view<8xi32> -> i32
74
+ %planes32 = view.load %header[5] : view<8xi32> -> i32
75
+ %meta64 = scalar.extui %meta32 : i32 to i64
76
+ %planes64 = scalar.extui %planes32 : i32 to i64
77
+ %mb = scalar.assume %meta64 [range(%meta64, 0, 4294967295)] : i64
78
+ %pb = scalar.assume %planes64 [range(%planes64, 0, 4294967295)] : i64
79
+ %mo0 = index.cast %mb : i64 to offset
80
+ %po0 = index.cast %pb : i64 to offset
81
+ %mo = index.add %source, %mo0 : offset
82
+ %po = index.add %source, %po0 : offset
83
+ %meta = buffer.view %packed[%mo] : buffer -> view<2xi32>
84
+ %dst_w = view.load %meta[0] : view<2xi32> -> i32
85
+ %dst_h = view.load %meta[1] : view<2xi32> -> i32
86
+ %plane = buffer.view %packed[%po] : buffer -> view<12xi32>
87
+ %src_w = view.load %plane[1] : view<12xi32> -> i32
88
+ %src_h = view.load %plane[2] : view<12xi32> -> i32
89
+ %pix_rel = view.load %plane[6] : view<12xi32> -> i32
90
+ %channels = view.load %plane[8] : view<12xi32> -> i32
91
+ // rows check: the chat program declared rows from the same size rule
92
+ %pf = scalar.constant 32 : i32
93
+ %gw = scalar.divui %dst_w, %pf : i32
94
+ %gh = scalar.divui %dst_h, %pf : i32
95
+ %expect = scalar.muli %gw, %gh : i32
96
+ %ok = scalar.cmpi eq, %expect, %rows32 : i32
97
+ %ok32 = scalar.extui %ok : i1 to i32
98
+ %bad = global.load @vision_bad_rows : buffer
99
+ func.call @require(%ok32, %bad) : (i32, buffer)
100
+ // payload: 64-byte device header + the packed cohort
101
+ %hdr_bytes = index.constant 64 : offset
102
+ %packed_bytes = buffer.length %packed
103
+ %payload_bytes = index.add %hdr_bytes, %packed_bytes : offset
104
+ %payload = buffer.alloca<private> align(16) %payload_bytes : buffer
105
+ buffer.copy %packed[%origin], %payload[%hdr_bytes], %packed_bytes
106
+ %hdr = buffer.view %payload[%origin] : buffer -> view<16xi32>
107
+ %source64b = index.cast %source : offset to i64
108
+ %source32 = scalar.trunci %source64b : i64 to i32
109
+ %sixty4 = scalar.constant 64 : i32
110
+ %pix0 = scalar.addi %pix_rel, %source32 : i32
111
+ %pix_abs = scalar.addi %pix0, %sixty4 : i32
112
+ %zero32 = scalar.constant 0 : i32
113
+ view.store %src_w, %hdr[0] : i32, view<16xi32>
114
+ view.store %src_h, %hdr[1] : i32, view<16xi32>
115
+ view.store %channels, %hdr[2] : i32, view<16xi32>
116
+ view.store %pix_abs, %hdr[3] : i32, view<16xi32>
117
+ view.store %dst_w, %hdr[4] : i32, view<16xi32>
118
+ view.store %dst_h, %hdr[5] : i32, view<16xi32>
119
+ // plan: [output bytes, result bytes, 1 request, rows] [first row, rows, 0] then [byte offset, width] per row
120
+ %rows64 = scalar.extui %rows32 : i32 to i64
121
+ %rb = scalar.assume %rows64 [range(%rows64, 1, 4096)] : i64
122
+ %rows = index.cast %rb : i64 to index
123
+ %c16 = index.constant 16 : offset
124
+ %c56 = index.constant 56 : offset
125
+ %row_bytes_total = index.scale %rows, %c16 : index, offset -> offset
126
+ %plan_bytes = index.add %c56, %row_bytes_total : offset
127
+ %plan = buffer.alloca<private> align(8) %plan_bytes : buffer
128
+ %ph = buffer.view %plan[%origin] : buffer -> view<7xi64>
129
+ %width = scalar.constant 2048 : i64
130
+ %row_bytes = scalar.constant 8192 : i64
131
+ %out_bytes = scalar.muli %rb, %row_bytes : i64
132
+ %one = scalar.constant 1 : i64
133
+ %zero = scalar.constant 0 : i64
134
+ view.store %out_bytes, %ph[0] : i64, view<7xi64>
135
+ view.store %out_bytes, %ph[1] : i64, view<7xi64>
136
+ view.store %one, %ph[2] : i64, view<7xi64>
137
+ view.store %rb, %ph[3] : i64, view<7xi64>
138
+ view.store %zero, %ph[4] : i64, view<7xi64>
139
+ view.store %rb, %ph[5] : i64, view<7xi64>
140
+ view.store %zero, %ph[6] : i64, view<7xi64>
141
+ %records = buffer.view %plan[%c56] : buffer -> view<[%rows]x2xi64>
142
+ %c0 = index.constant 0 : index
143
+ %c1 = index.constant 1 : index
144
+ scf.for %i = [%c0 to %rows step %c1] {
145
+ %i64 = index.cast %i : index to i64
146
+ %offset = scalar.muli %i64, %row_bytes : i64
147
+ view.store %offset, %records[%i, 0] : i64, view<[%rows]x2xi64>
148
+ view.store %width, %records[%i, 1] : i64, view<[%rows]x2xi64>
149
+ }
150
+ %h64 = scalar.extui %dst_h : i32 to i64
151
+ %w64 = scalar.extui %dst_w : i32 to i64
152
+ %stage = func.call @vision_stage(%h64, %w64) : (i64, i64) -> (i32)
153
+ func.return %stage, %payload, %plan : i32, buffer, buffer
154
+ }
155
+
156
+ func.def public @text_image_run_v1(%state: buffer, %stage: i32, %input: hal.buffer, %output: hal.buffer, %batch: ptr<@FiniteBatch>) {
157
+ %work = func.call @execute_2(%stage, %input, %output) : (i32, hal.buffer, hal.buffer) -> (i64)
158
+ func.return
159
+ }
160
+
161
+ // One run encodes the whole cohort (one image per run): every member is done when the run is collected.
162
+ func.def public @text_image_collect_batch_v1(%state: buffer, %batch: ptr<@FiniteBatch>) {
163
+ func.call @finite_batch_finish(%batch) : (ptr<@FiniteBatch>)
164
+ func.return
165
+ }
program/vision_prepare.loom CHANGED
@@ -1,33 +1,33 @@
1
- // Image component preparation (generated by gen_component.py).
2
- func.decl import("prepare") @source_scope(%scope: buffer) -> (i32)
3
- func.decl import("prepare") @parameter(%stage: i32, %binding: i32, %input: i32, %source: i32, %policy: buffer)
4
- func.decl import("prepare") @memory_forecast(%root: buffer)
5
-
6
- global.rodata.def @vision_forecast_root = bytes("766973696f6e5f666f7265636173745f6d656d6f7279")
7
- global.rodata.def @vision_scope = bytes("766973696f6e")
8
- global.rodata.def @vision_policy = bytes("776569676874732e6c6f6f6d")
9
- global.rodata.def @vision_name = bytes("7177656e33766c5f6d65726765722d70726f6a6563746f72")
10
- global.rodata.def @vision_empty = bytes("")
11
-
12
- func.decl @vision_stage(%height: i64, %width: i64) -> (i32)
13
-
14
- func.def public @text_image_prepare_v1(%directory: buffer, %options: buffer) -> (i64, i64, i64, i64, buffer, buffer, buffer) {
15
- %forecast = global.load @vision_forecast_root : buffer
16
- func.call @memory_forecast(%forecast) : (buffer)
17
- %h = scalar.constant 1024 : i64
18
- %w = scalar.constant 1024 : i64
19
- %stage = func.call @vision_stage(%h, %w) : (i64, i64) -> (i32)
20
- %scope = global.load @vision_scope : buffer
21
- %checkpoint = func.call @source_scope(%scope) : (buffer) -> (i32)
22
- %policy = global.load @vision_policy : buffer
23
- %c0 = scalar.constant 0 : i32
24
- func.call @parameter(%stage, %c0, %c0, %checkpoint, %policy) : (i32, i32, i32, i32, buffer)
25
- %units = scalar.constant 1 : i64
26
- %upload = scalar.constant 67174400 : i64
27
- %output = scalar.constant 33554432 : i64
28
- %state_bytes = index.constant 1 : offset
29
- %state = buffer.alloca<private> align(1) %state_bytes : buffer
30
- %empty = global.load @vision_empty : buffer
31
- %name = global.load @vision_name : buffer
32
- func.return %units, %upload, %output, %output, %empty, %name, %state : i64, i64, i64, i64, buffer, buffer, buffer
33
- }
 
1
+ // Image component preparation (generated by gen_component.py).
2
+ func.decl import("prepare") @source_scope(%scope: buffer) -> (i32)
3
+ func.decl import("prepare") @parameter(%stage: i32, %binding: i32, %input: i32, %source: i32, %policy: buffer)
4
+ func.decl import("prepare") @memory_forecast(%root: buffer)
5
+
6
+ global.rodata.def @vision_forecast_root = bytes("766973696f6e5f666f7265636173745f6d656d6f7279")
7
+ global.rodata.def @vision_scope = bytes("766973696f6e")
8
+ global.rodata.def @vision_policy = bytes("776569676874732e6c6f6f6d")
9
+ global.rodata.def @vision_name = bytes("7177656e33766c5f6d65726765722d70726f6a6563746f72")
10
+ global.rodata.def @vision_empty = bytes("")
11
+
12
+ func.decl @vision_stage(%height: i64, %width: i64) -> (i32)
13
+
14
+ func.def public @text_image_prepare_v1(%directory: buffer, %options: buffer) -> (i64, i64, i64, i64, buffer, buffer, buffer) {
15
+ %forecast = global.load @vision_forecast_root : buffer
16
+ func.call @memory_forecast(%forecast) : (buffer)
17
+ %h = scalar.constant 1024 : i64
18
+ %w = scalar.constant 1024 : i64
19
+ %stage = func.call @vision_stage(%h, %w) : (i64, i64) -> (i32)
20
+ %scope = global.load @vision_scope : buffer
21
+ %checkpoint = func.call @source_scope(%scope) : (buffer) -> (i32)
22
+ %policy = global.load @vision_policy : buffer
23
+ %c0 = scalar.constant 0 : i32
24
+ func.call @parameter(%stage, %c0, %c0, %checkpoint, %policy) : (i32, i32, i32, i32, buffer)
25
+ %units = scalar.constant 1 : i64
26
+ %upload = scalar.constant 67174400 : i64
27
+ %output = scalar.constant 33554432 : i64
28
+ %state_bytes = index.constant 1 : offset
29
+ %state = buffer.alloca<private> align(1) %state_bytes : buffer
30
+ %empty = global.load @vision_empty : buffer
31
+ %name = global.load @vision_name : buffer
32
+ func.return %units, %upload, %output, %output, %empty, %name, %state : i64, i64, i64, i64, buffer, buffer, buffer
33
+ }
program/vision_stages.loom CHANGED
@@ -1,18 +1,18 @@
1
- // Encoder stage per processed image size (shared by preparation and batching).
2
- func.decl import("prepare") @stage(%root: buffer, %tag: i64) -> (i32)
3
- func.decl import("prepare") @config_i64(%stage: i32, %key: buffer, %value: i64)
4
- global.rodata.def @vision_root = bytes("766973696f6e5f656e636f6465")
5
- global.rodata.def @vision_height_key = bytes("766973696f6e2e686569676874")
6
- global.rodata.def @vision_width_key = bytes("766973696f6e2e7769647468")
7
-
8
- func.def public @vision_stage(%height: i64, %width: i64) -> (i32) {
9
- %root = global.load @vision_root : buffer
10
- %one = scalar.constant 1 : i64
11
- %stage = func.call @stage(%root, %one) : (buffer, i64) -> (i32)
12
- %hk = global.load @vision_height_key : buffer
13
- %wk = global.load @vision_width_key : buffer
14
- func.call @config_i64(%stage, %hk, %height) : (i32, buffer, i64)
15
- func.call @config_i64(%stage, %wk, %width) : (i32, buffer, i64)
16
- func.return %stage : i32
17
- }
18
-
 
1
+ // Encoder stage per processed image size (shared by preparation and batching).
2
+ func.decl import("prepare") @stage(%root: buffer, %tag: i64) -> (i32)
3
+ func.decl import("prepare") @config_i64(%stage: i32, %key: buffer, %value: i64)
4
+ global.rodata.def @vision_root = bytes("766973696f6e5f656e636f6465")
5
+ global.rodata.def @vision_height_key = bytes("766973696f6e2e686569676874")
6
+ global.rodata.def @vision_width_key = bytes("766973696f6e2e7769647468")
7
+
8
+ func.def public @vision_stage(%height: i64, %width: i64) -> (i32) {
9
+ %root = global.load @vision_root : buffer
10
+ %one = scalar.constant 1 : i64
11
+ %stage = func.call @stage(%root, %one) : (buffer, i64) -> (i32)
12
+ %hk = global.load @vision_height_key : buffer
13
+ %wk = global.load @vision_width_key : buffer
14
+ func.call @config_i64(%stage, %hk, %height) : (i32, buffer, i64)
15
+ func.call @config_i64(%stage, %wk, %width) : (i32, buffer, i64)
16
+ func.return %stage : i32
17
+ }
18
+