Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/aien-sovereign-core-mv/patches/1ae18ed1bcd8c174 # aien-sovereign-core-mv AienOS host runtime: inference scheduling, paged KV state, the aien CLI and Spark verification tooling. Its inference engine is in alpha testing (DGX Spark GB10); Omega is the implementation destination. Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers ## GitHub aien-dev/aien-sovereign-core-mv#790 (code only) closed derived `1ae18ed1bcd8c174` #790 Imported from GitHub aien-dev/aien-sovereign-core-mv#790 (code only) GitHub's metadata for this pull request is unavailable: its state is DERIVED from the commits (merged: the head is reachable from this project's main; open: GitHub kept a merge ref; else closed). Base `aa84ab18c2a47031be754f79a173503b5644a149` · Head `42464fe2acc9bd7287f9e0c23aca9ae58b8ce141` cursor[bot] commented on `crates/aien-omega-q38/src/lib.rs` line 468 on 2026-11-02 00:38 UTC The `omega_gpu_q38_graph_set_layer_bf16` import and `Q38Graph::set_layer_bf16` are removed, so Rust no longer references that symbol. A 27B native build does not need it to link. It remains the archive witness for the 3-arg gather, which kept the name `omega_q38_gather_table`. A q38 archive without the witness fails in build.rs instead of linking the 1-arg symbol. The witness is still only on open omega-mv#905, so the lock is unchanged. cursor[bot] commented on `crates/aien-omega-q38/src/lib.rs` line 590 on 2026-11-02 00:38 UTC omega.lock stays `a647b6a9821fffcf52ba9ce813f75afa4b84be62`. omega-mv main (`ba5559d9`) still declares `void omega_q38_gather_table(uint32_t *tab)`. The 3-arg form is only on open omega-mv#905 (`d7f1bff9`). That branch is not pinned. build.rs now refuses a native q38 omega with the old gather before the call can link. A header must declare `int omega_q38_gather_table(uint32_t q_heads, uint32_t kv_heads, uint32_t *tab)`. An archive must define `T omega_gpu_q38_graph_set_layer_bf16`, the symbol that shipped with that signature, because nm cannot see C argument counts and the gather symbol kept its name. Receipt: `cargo build -p aien-omega-q38` with `AIEN_OMEGA_GPU_LIB` defining `omega_gpu_q38_graph_create` and `omega_q38_gather_table` but not the witness exits 101 and names the pin and omega-mv#905. The real header at `a647b6a9` fails the same declaration check. The #905 header passes it. cursor[bot] commented on `crates/aien-inference-abi/src/qwen38_omega.rs` line 872 on 2026-11-02 00:38 UTC Removed. `Proj::Bf16`, the decode `set_layer_bf16` arm, and the prefill bf16 matmul arms are gone. `fuse_fp8` refuses a bf16 projection with "BF16 projections are not supported". The description matches the code. The 2026-10-31 receipt stays the FP8 b128 run. No BF16 chip run was added. drakestapleton reviewed (COMMENTED) on 2026-10-30 11:28 UTC Triage: BLOCKED. On hold, not closed. This PR is blocked on two things: - aien-dev/omega-mv#905, which is still open. - Missing GB10 run logs. The claim of FP8 9B serving on GB10 (16 coherent prompts) has no committed run output. Also: - It is stacked on `ship/motor-l387`. - AIEN Verification fails on `a18645d8`. It will be rechecked after omega-mv#905 merges. Hardware evidence: missing. Triage only; no approval or merge implied. cursor[bot] reviewed (APPROVED) on 2026-11-02 00:47 UTC Risk: medium. Approved. Cursor Bugbot and Cursor Security Agent both completed successfully with no findings that need human review.
Open in Web View Automation
Sent by Cursor Approval Agent: Pull Request Router and Approver ### Fetch it A git bundle of the pull request's head, 81751 bytes. ``` curl -fsSL https://interplane.io/drakestapleton/aien-sovereign-core-mv/patches/1ae18ed1bcd8c174.bundle -o 1ae18ed1bcd8c174.bundle git fetch 1ae18ed1bcd8c174.bundle refs/pull/790/head ``` Raw bundle · Diff ### Provenance This proposal is imported from GitHub; it is not signed by its author. Its import statement and source record: ``` github-import 1 aien-dev/aien-sovereign-core-mv 790 42464fe2acc9bd7287f9e0c23aca9ae58b8ce141 ``` ``` {"kind":"github-import","owner":"aien-dev","repo":"aien-sovereign-core-mv","number":790,"url":"https://github.com/aien-dev/aien-sovereign-core-mv/pull/790","export_sha256":"967c79e26a893657b5cdaa45efd442be5dbd2ecfe68e25f9a8c1b5da4d60d452","imported_utc":"2026-11-18T16:38:01Z","metadata":"unavailable","state_derived":true} ``` ### Changes ``` diff --git a/crates/aien-inference-abi/fixtures/chat-templates/qwen3.5-9b/LICENSE b/crates/aien-inference-abi/fixtures/chat-templates/qwen3.5-9b/LICENSE new file mode 100644 index 00000000..f938136e --- /dev/null +++ b/crates/aien-inference-abi/fixtures/chat-templates/qwen3.5-9b/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2026 Alibaba Cloud + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. \ No newline at end of file diff --git a/crates/aien-inference-abi/fixtures/chat-templates/qwen3.5-9b/PROVENANCE.md b/crates/aien-inference-abi/fixtures/chat-templates/qwen3.5-9b/PROVENANCE.md new file mode 100644 index 00000000..b001d0a7 --- /dev/null +++ b/crates/aien-inference-abi/fixtures/chat-templates/qwen3.5-9b/PROVENANCE.md @@ -0,0 +1,20 @@ +# Qwen3.5-9B chat template (pinned) + +- Source: Hugging Face `Qwen/Qwen3.5-9B` revision c202236235762e1c871ad0ccb60c8ee5ba337b9a (the download + `~/models/qwen3.5-9b-c2022362`, sha256 list `~/models/qwen3.5-9b-c2022362.sha256`, 2026-10-27), + `chat_template.jinja` copied byte for byte. The `chat_template` field of that revision's `tokenizer_config.json` + is the same text; the loader trims before matching, so either copy selects this layout. +- Licence: Apache-2.0, upstream `LICENSE` copied unchanged. Not relicensed. +- sha256 chat_template.jinja: a4aee8afcf2e0711 (first 16 hex digits; full hash in `sha256sum` of this directory) +- sha256 upstream tokenizer_config.json: 316230d6a809701f (first 16 hex digits) +- Differences from the Qwen3.6-35B-A3B template (`../qwen3.6-35b-a3b`): no `preserve_thinking` switch (an + assistant turn carries its think block only when it follows the last user query), and tool-call arguments are + rendered with `tojson` for mappings and sequences, `string` otherwise. The engine refuses tools, so only the first + difference reaches a rendering; `ChatTemplate::Qwen35` is the Qwen3.6 renderer with `preserve_thinking` ignored. +- `render_oracle.json`: the template rendered by the reference engine, jinja2 3.1.2 + `ImmutableSandboxedEnvironment(trim_blocks=True, lstrip_blocks=True)` with `raise_exception` and `tojson` as + transformers provides them, `tools=None`, `add_generation_prompt=True`, for the same 48 conversation x option + cases and 5 refusals as the Qwen3.6 oracle. 45 cases render identically to the Qwen3.6 oracle; the 3 that set + `preserve_thinking: true` with an earlier assistant turn differ. Produced once with a scratch script outside this + repository (`~/handoffs/H2H9B/ours-evidence/template/make_oracle.py`; no Python in the repository); the Rust test + `tests/qwen36_chat_template.rs` (`qwen35_*`) compares the engine's rendering to it. diff --git a/crates/aien-inference-abi/fixtures/chat-templates/qwen3.5-9b/chat_template.jinja b/crates/aien-inference-abi/fixtures/chat-templates/qwen3.5-9b/chat_template.jinja new file mode 100644 index 00000000..a585dec8 --- /dev/null +++ b/crates/aien-inference-abi/fixtures/chat-templates/qwen3.5-9b/chat_template.jinja @@ -0,0 +1,154 @@ +{%- set image_count = namespace(value=0) %} +{%- set video_count = namespace(value=0) %} +{%- macro render_content(content, do_vision_count, is_system_content=false) %} + {%- if content is string %} + {{- content }} + {%- elif content is iterable and content is not mapping %} + {%- for item in content %} + {%- if 'image' in item or 'image_url' in item or item.type == 'image' %} + {%- if is_system_content %} + {{- raise_exception('System message cannot contain images.') }} + {%- endif %} + {%- if do_vision_count %} + {%- set image_count.value = image_count.value + 1 %} + {%- endif %} + {%- if add_vision_id %} + {{- 'Picture ' ~ image_count.value ~ ': ' }} + {%- endif %} + {{- '<|vision_start|><|image_pad|><|vision_end|>' }} + {%- elif 'video' in item or item.type == 'video' %} + {%- if is_system_content %} + {{- raise_exception('System message cannot contain videos.') }} + {%- endif %} + {%- if do_vision_count %} + {%- set video_count.value = video_count.value + 1 %} + {%- endif %} + {%- if add_vision_id %} + {{- 'Video ' ~ video_count.value ~ ': ' }} + {%- endif %} + {{- '<|vision_start|><|video_pad|><|vision_end|>' }} + {%- elif 'text' in item %} + {{- item.text }} + {%- else %} + {{- raise_exception('Unexpected item type in content.') }} + {%- endif %} + {%- endfor %} + {%- elif content is none or content is undefined %} + {{- '' }} + {%- else %} + {{- raise_exception('Unexpected content type.') }} + {%- endif %} +{%- endmacro %} +{%- if not messages %} + {{- raise_exception('No messages provided.') }} +{%- endif %} +{%- if tools and tools is iterable and tools is not mapping %} + {{- '<|im_start|>system\n' }} + {{- "# Tools\n\nYou have access to the following functions:\n\n" }} + {%- for tool in tools %} + {{- "\n" }} + {{- tool | tojson }} + {%- endfor %} + {{- "\n" }} + {{- '\n\nIf you choose to call a function ONLY reply in the following format with NO suffix:\n\n\n\n\nvalue_1\n\n\nThis is the value for the second parameter\nthat can span\nmultiple lines\n\n\n\n\n\nReminder:\n- Function calls MUST follow the specified format: an inner block must be nested within 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' }} + {%- if messages[0].role == 'system' %} + {%- set content = render_content(messages[0].content, false, true)|trim %} + {%- if content %} + {{- '\n\n' + content }} + {%- endif %} + {%- endif %} + {{- '<|im_end|>\n' }} +{%- else %} + {%- if messages[0].role == 'system' %} + {%- set content = render_content(messages[0].content, false, true)|trim %} + {{- '<|im_start|>system\n' + content + '<|im_end|>\n' }} + {%- endif %} +{%- endif %} +{%- set ns = namespace(multi_step_tool=true, last_query_index=messages|length - 1) %} +{%- for message in messages[::-1] %} + {%- set index = (messages|length - 1) - loop.index0 %} + {%- if ns.multi_step_tool and message.role == "user" %} + {%- set content = render_content(message.content, false)|trim %} + {%- if not(content.startswith('') and content.endswith('')) %} + {%- set ns.multi_step_tool = false %} + {%- set ns.last_query_index = index %} + {%- endif %} + {%- endif %} +{%- endfor %} +{%- if ns.multi_step_tool %} + {{- raise_exception('No user query found in messages.') }} +{%- endif %} +{%- for message in messages %} + {%- set content = render_content(message.content, true)|trim %} + {%- if message.role == "system" %} + {%- if not loop.first %} + {{- raise_exception('System message must be at the beginning.') }} + {%- endif %} + {%- elif message.role == "user" %} + {{- '<|im_start|>' + message.role + '\n' + content + '<|im_end|>' + '\n' }} + {%- elif message.role == "assistant" %} + {%- set reasoning_content = '' %} + {%- if message.reasoning_content is string %} + {%- set reasoning_content = message.reasoning_content %} + {%- else %} + {%- if '' in content %} + {%- set reasoning_content = content.split('')[0].rstrip('\n').split('')[-1].lstrip('\n') %} + {%- set content = content.split('')[-1].lstrip('\n') %} + {%- endif %} + {%- endif %} + {%- set reasoning_content = reasoning_content|trim %} + {%- if loop.index0 > ns.last_query_index %} + {{- '<|im_start|>' + message.role + '\n\n' + reasoning_content + '\n\n\n' + content }} + {%- else %} + {{- '<|im_start|>' + message.role + '\n' + content }} + {%- endif %} + {%- if message.tool_calls and message.tool_calls is iterable and message.tool_calls is not mapping %} + {%- for tool_call in message.tool_calls %} + {%- if tool_call.function is defined %} + {%- set tool_call = tool_call.function %} + {%- endif %} + {%- if loop.first %} + {%- if content|trim %} + {{- '\n\n\n\n' }} + {%- else %} + {{- '\n\n' }} + {%- endif %} + {%- else %} + {{- '\n\n\n' }} + {%- endif %} + {%- if tool_call.arguments is defined %} + {%- for args_name, args_value in tool_call.arguments|items %} + {{- '\n' }} + {%- set args_value = args_value | tojson | safe if args_value is mapping or (args_value is sequence and args_value is not string) else args_value | string %} + {{- args_value }} + {{- '\n\n' }} + {%- endfor %} + {%- endif %} + {{- '\n' }} + {%- endfor %} + {%- endif %} + {{- '<|im_end|>\n' }} + {%- elif message.role == "tool" %} + {%- if loop.previtem and loop.previtem.role != "tool" %} + {{- '<|im_start|>user' }} + {%- endif %} + {{- '\n\n' }} + {{- content }} + {{- '\n' }} + {%- if not loop.last and loop.nextitem.role != "tool" %} + {{- '<|im_end|>\n' }} + {%- elif loop.last %} + {{- '<|im_end|>\n' }} + {%- endif %} + {%- else %} + {{- raise_exception('Unexpected message role.') }} + {%- endif %} +{%- endfor %} +{%- if add_generation_prompt %} + {{- '<|im_start|>assistant\n' }} + {%- if enable_thinking is defined and enable_thinking is false %} + {{- '\n\n\n\n' }} + {%- else %} + {{- '\n' }} + {%- endif %} +{%- endif %} \ No newline at end of file diff --git a/crates/aien-inference-abi/fixtures/chat-templates/qwen3.5-9b/render_oracle.json b/crates/aien-inference-abi/fixtures/chat-templates/qwen3.5-9b/render_oracle.json new file mode 100644 index 00000000..2479ba0a --- /dev/null +++ b/crates/aien-inference-abi/fixtures/chat-templates/qwen3.5-9b/render_oracle.json @@ -0,0 +1,922 @@ +{ + "template": "Qwen/Qwen3.5-9B c2022362 chat_template.jinja sha256 a4aee8af", + "jinja2": "3.1.2", + "cases": [ + { + "turns": [ + [ + "user", + "Hi" + ] + ], + "options": {}, + "text": "<|im_start|>user\nHi<|im_end|>\n<|im_start|>assistant\n\n" + }, + { + "turns": [ + [ + "user", + "Hi" + ] + ], + "options": { + "enable_thinking": true + }, + "text": "<|im_start|>user\nHi<|im_end|>\n<|im_start|>assistant\n\n" + }, + { + "turns": [ + [ + "user", + "Hi" + ] + ], + "options": { + "enable_thinking": false + }, + "text": "<|im_start|>user\nHi<|im_end|>\n<|im_start|>assistant\n\n\n\n\n" + }, + { + "turns": [ + [ + "user", + "Hi" + ] + ], + "options": { + "preserve_thinking": true + }, + "text": "<|im_start|>user\nHi<|im_end|>\n<|im_start|>assistant\n\n" + }, + { + "turns": [ + [ + "user", + "Hi" + ] + ], + "options": { + "preserve_thinking": false, + "enable_thinking": false + }, + "text": "<|im_start|>user\nHi<|im_end|>\n<|im_start|>assistant\n\n\n\n\n" + }, + { + "turns": [ + [ + "user", + "Hi" + ] + ], + "options": { + "reasoning_effort": "low" + }, + "text": "<|im_start|>user\nHi<|im_end|>\n<|im_start|>assistant\n\n" + }, + { + "turns": [ + [ + "system", + "You are terse." + ], + [ + "user", + "Hi" + ] + ], + "options": {}, + "text": "<|im_start|>system\nYou are terse.<|im_end|>\n<|im_start|>user\nHi<|im_end|>\n<|im_start|>assistant\n\n" + }, + { + "turns": [ + [ + "system", + "You are terse." + ], + [ + "user", + "Hi" + ] + ], + "options": { + "enable_thinking": true + }, + "text": "<|im_start|>system\nYou are terse.<|im_end|>\n<|im_start|>user\nHi<|im_end|>\n<|im_start|>assistant\n\n" + }, + { + "turns": [ + [ + "system", + "You are terse." + ], + [ + "user", + "Hi" + ] + ], + "options": { + "enable_thinking": false + }, + "text": "<|im_start|>system\nYou are terse.<|im_end|>\n<|im_start|>user\nHi<|im_end|>\n<|im_start|>assistant\n\n\n\n\n" + }, + { + "turns": [ + [ + "system", + "You are terse." + ], + [ + "user", + "Hi" + ] + ], + "options": { + "preserve_thinking": true + }, + "text": "<|im_start|>system\nYou are terse.<|im_end|>\n<|im_start|>user\nHi<|im_end|>\n<|im_start|>assistant\n\n" + }, + { + "turns": [ + [ + "system", + "You are terse." + ], + [ + "user", + "Hi" + ] + ], + "options": { + "preserve_thinking": false, + "enable_thinking": false + }, + "text": "<|im_start|>system\nYou are terse.<|im_end|>\n<|im_start|>user\nHi<|im_end|>\n<|im_start|>assistant\n\n\n\n\n" + }, + { + "turns": [ + [ + "system", + "You are terse." + ], + [ + "user", + "Hi" + ] + ], + "options": { + "reasoning_effort": "low" + }, + "text": "<|im_start|>system\nYou are terse.<|im_end|>\n<|im_start|>user\nHi<|im_end|>\n<|im_start|>assistant\n\n" + }, + { + "turns": [ + [ + "system", + "" + ], + [ + "user", + "Hi" + ] + ], + "options": {}, + "text": "<|im_start|>system\n<|im_end|>\n<|im_start|>user\nHi<|im_end|>\n<|im_start|>assistant\n\n" + }, + { + "turns": [ + [ + "system", + "" + ], + [ + "user", + "Hi" + ] + ], + "options": { + "enable_thinking": true + }, + "text": "<|im_start|>system\n<|im_end|>\n<|im_start|>user\nHi<|im_end|>\n<|im_start|>assistant\n\n" + }, + { + "turns": [ + [ + "system", + "" + ], + [ + "user", + "Hi" + ] + ], + "options": { + "enable_thinking": false + }, + "text": "<|im_start|>system\n<|im_end|>\n<|im_start|>user\nHi<|im_end|>\n<|im_start|>assistant\n\n\n\n\n" + }, + { + "turns": [ + [ + "system", + "" + ], + [ + "user", + "Hi" + ] + ], + "options": { + "preserve_thinking": true + }, + "text": "<|im_start|>system\n<|im_end|>\n<|im_start|>user\nHi<|im_end|>\n<|im_start|>assistant\n\n" + }, + { + "turns": [ + [ + "system", + "" + ], + [ + "user", + "Hi" + ] + ], + "options": { + "preserve_thinking": false, + "enable_thinking": false + }, + "text": "<|im_start|>system\n<|im_end|>\n<|im_start|>user\nHi<|im_end|>\n<|im_start|>assistant\n\n\n\n\n" + }, + { + "turns": [ + [ + "system", + "" + ], + [ + "user", + "Hi" + ] + ], + "options": { + "reasoning_effort": "low" + }, + "text": "<|im_start|>system\n<|im_end|>\n<|im_start|>user\nHi<|im_end|>\n<|im_start|>assistant\n\n" + }, + { + "turns": [ + [ + "system", + "Be brief." + ], + [ + "user", + "Q1" + ], + [ + "assistant", + "A1" + ], + [ + "user", + "Q2" + ] + ], + "options": {}, + "text": "<|im_start|>system\nBe brief.<|im_end|>\n<|im_start|>user\nQ1<|im_end|>\n<|im_start|>assistant\nA1<|im_end|>\n<|im_start|>user\nQ2<|im_end|>\n<|im_start|>assistant\n\n" + }, + { + "turns": [ + [ + "system", + "Be brief." + ], + [ + "user", + "Q1" + ], + [ + "assistant", + "A1" + ], + [ + "user", + "Q2" + ] + ], + "options": { + "enable_thinking": true + }, + "text": "<|im_start|>system\nBe brief.<|im_end|>\n<|im_start|>user\nQ1<|im_end|>\n<|im_start|>assistant\nA1<|im_end|>\n<|im_start|>user\nQ2<|im_end|>\n<|im_start|>assistant\n\n" + }, + { + "turns": [ + [ + "system", + "Be brief." + ], + [ + "user", + "Q1" + ], + [ + "assistant", + "A1" + ], + [ + "user", + "Q2" + ] + ], + "options": { + "enable_thinking": false + }, + "text": "<|im_start|>system\nBe brief.<|im_end|>\n<|im_start|>user\nQ1<|im_end|>\n<|im_start|>assistant\nA1<|im_end|>\n<|im_start|>user\nQ2<|im_end|>\n<|im_start|>assistant\n\n\n\n\n" + }, + { + "turns": [ + [ + "system", + "Be brief." + ], + [ + "user", + "Q1" + ], + [ + "assistant", + "A1" + ], + [ + "user", + "Q2" + ] + ], + "options": { + "preserve_thinking": true + }, + "text": "<|im_start|>system\nBe brief.<|im_end|>\n<|im_start|>user\nQ1<|im_end|>\n<|im_start|>assistant\nA1<|im_end|>\n<|im_start|>user\nQ2<|im_end|>\n<|im_start|>assistant\n\n" + }, + { + "turns": [ + [ + "system", + "Be brief." + ], + [ + "user", + "Q1" + ], + [ + "assistant", + "A1" + ], + [ + "user", + "Q2" + ] + ], + "options": { + "preserve_thinking": false, + "enable_thinking": false + }, + "text": "<|im_start|>system\nBe brief.<|im_end|>\n<|im_start|>user\nQ1<|im_end|>\n<|im_start|>assistant\nA1<|im_end|>\n<|im_start|>user\nQ2<|im_end|>\n<|im_start|>assistant\n\n\n\n\n" + }, + { + "turns": [ + [ + "system", + "Be brief." + ], + [ + "user", + "Q1" + ], + [ + "assistant", + "A1" + ], + [ + "user", + "Q2" + ] + ], + "options": { + "reasoning_effort": "low" + }, + "text": "<|im_start|>system\nBe brief.<|im_end|>\n<|im_start|>user\nQ1<|im_end|>\n<|im_start|>assistant\nA1<|im_end|>\n<|im_start|>user\nQ2<|im_end|>\n<|im_start|>assistant\n\n" + }, + { + "turns": [ + [ + "user", + "Q1" + ], + [ + "assistant", + "\nI reason\n\n\nA1" + ], + [ + "user", + "Q2" + ] + ], + "options": {}, + "text": "<|im_start|>user\nQ1<|im_end|>\n<|im_start|>assistant\nA1<|im_end|>\n<|im_start|>user\nQ2<|im_end|>\n<|im_start|>assistant\n\n" + }, + { + "turns": [ + [ + "user", + "Q1" + ], + [ + "assistant", + "\nI reason\n\n\nA1" + ], + [ + "user", + "Q2" + ] + ], + "options": { + "enable_thinking": true + }, + "text": "<|im_start|>user\nQ1<|im_end|>\n<|im_start|>assistant\nA1<|im_end|>\n<|im_start|>user\nQ2<|im_end|>\n<|im_start|>assistant\n\n" + }, + { + "turns": [ + [ + "user", + "Q1" + ], + [ + "assistant", + "\nI reason\n\n\nA1" + ], + [ + "user", + "Q2" + ] + ], + "options": { + "enable_thinking": false + }, + "text": "<|im_start|>user\nQ1<|im_end|>\n<|im_start|>assistant\nA1<|im_end|>\n<|im_start|>user\nQ2<|im_end|>\n<|im_start|>assistant\n\n\n\n\n" + }, + { + "turns": [ + [ + "user", + "Q1" + ], + [ + "assistant", + "\nI reason\n\n\nA1" + ], + [ + "user", + "Q2" + ] + ], + "options": { + "preserve_thinking": true + }, + "text": "<|im_start|>user\nQ1<|im_end|>\n<|im_start|>assistant\nA1<|im_end|>\n<|im_start|>user\nQ2<|im_end|>\n<|im_start|>assistant\n\n" + }, + { + "turns": [ + [ + "user", + "Q1" + ], + [ + "assistant", + "\nI reason\n\n\nA1" + ], + [ + "user", + "Q2" + ] + ], + "options": { + "preserve_thinking": false, + "enable_thinking": false + }, + "text": "<|im_start|>user\nQ1<|im_end|>\n<|im_start|>assistant\nA1<|im_end|>\n<|im_start|>user\nQ2<|im_end|>\n<|im_start|>assistant\n\n\n\n\n" + }, + { + "turns": [ + [ + "user", + "Q1" + ], + [ + "assistant", + "\nI reason\n\n\nA1" + ], + [ + "user", + "Q2" + ] + ], + "options": { + "reasoning_effort": "low" + }, + "text": "<|im_start|>user\nQ1<|im_end|>\n<|im_start|>assistant\nA1<|im_end|>\n<|im_start|>user\nQ2<|im_end|>\n<|im_start|>assistant\n\n" + }, + { + "turns": [ + [ + "user", + "Q1" + ], + [ + "assistant", + "A1" + ] + ], + "options": {}, + "text": "<|im_start|>user\nQ1<|im_end|>\n<|im_start|>assistant\n\n\n\n\nA1<|im_end|>\n<|im_start|>assistant\n\n" + }, + { + "turns": [ + [ + "user", + "Q1" + ], + [ + "assistant", + "A1" + ] + ], + "options": { + "enable_thinking": true + }, + "text": "<|im_start|>user\nQ1<|im_end|>\n<|im_start|>assistant\n\n\n\n\nA1<|im_end|>\n<|im_start|>assistant\n\n" + }, + { + "turns": [ + [ + "user", + "Q1" + ], + [ + "assistant", + "A1" + ] + ], + "options": { + "enable_thinking": false + }, + "text": "<|im_start|>user\nQ1<|im_end|>\n<|im_start|>assistant\n\n\n\n\nA1<|im_end|>\n<|im_start|>assistant\n\n\n\n\n" + }, + { + "turns": [ + [ + "user", + "Q1" + ], + [ + "assistant", + "A1" + ] + ], + "options": { + "preserve_thinking": true + }, + "text": "<|im_start|>user\nQ1<|im_end|>\n<|im_start|>assistant\n\n\n\n\nA1<|im_end|>\n<|im_start|>assistant\n\n" + }, + { + "turns": [ + [ + "user", + "Q1" + ], + [ + "assistant", + "A1" + ] + ], + "options": { + "preserve_thinking": false, + "enable_thinking": false + }, + "text": "<|im_start|>user\nQ1<|im_end|>\n<|im_start|>assistant\n\n\n\n\nA1<|im_end|>\n<|im_start|>assistant\n\n\n\n\n" + }, + { + "turns": [ + [ + "user", + "Q1" + ], + [ + "assistant", + "A1" + ] + ], + "options": { + "reasoning_effort": "low" + }, + "text": "<|im_start|>user\nQ1<|im_end|>\n<|im_start|>assistant\n\n\n\n\nA1<|im_end|>\n<|im_start|>assistant\n\n" + }, + { + "turns": [ + [ + "user", + " padded \n" + ], + [ + "assistant", + " A " + ], + [ + "user", + "\nx\n" + ] + ], + "options": {}, + "text": "<|im_start|>user\npadded<|im_end|>\n<|im_start|>assistant\n\n\n\n\nA<|im_end|>\n<|im_start|>user\n\nx\n<|im_end|>\n<|im_start|>assistant\n\n" + }, + { + "turns": [ + [ + "user", + " padded \n" + ], + [ + "assistant", + " A " + ], + [ + "user", + "\nx\n" + ] + ], + "options": { + "enable_thinking": true + }, + "text": "<|im_start|>user\npadded<|im_end|>\n<|im_start|>assistant\n\n\n\n\nA<|im_end|>\n<|im_start|>user\n\nx\n<|im_end|>\n<|im_start|>assistant\n\n" + }, + { + "turns": [ + [ + "user", + " padded \n" + ], + [ + "assistant", + " A " + ], + [ + "user", + "\nx\n" + ] + ], + "options": { + "enable_thinking": false + }, + "text": "<|im_start|>user\npadded<|im_end|>\n<|im_start|>assistant\n\n\n\n\nA<|im_end|>\n<|im_start|>user\n\nx\n<|im_end|>\n<|im_start|>assistant\n\n\n\n\n" + }, + { + "turns": [ + [ + "user", + " padded \n" + ], + [ + "assistant", + " A " + ], + [ + "user", + "\nx\n" + ] + ], + "options": { + "preserve_thinking": true + }, + "text": "<|im_start|>user\npadded<|im_end|>\n<|im_start|>assistant\n\n\n\n\nA<|im_end|>\n<|im_start|>user\n\nx\n<|im_end|>\n<|im_start|>assistant\n\n" + }, + { + "turns": [ + [ + "user", + " padded \n" + ], + [ + "assistant", + " A " + ], + [ + "user", + "\nx\n" + ] + ], + "options": { + "preserve_thinking": false, + "enable_thinking": false + }, + "text": "<|im_start|>user\npadded<|im_end|>\n<|im_start|>assistant\n\n\n\n\nA<|im_end|>\n<|im_start|>user\n\nx\n<|im_end|>\n<|im_start|>assistant\n\n\n\n\n" + }, + { + "turns": [ + [ + "user", + " padded \n" + ], + [ + "assistant", + " A " + ], + [ + "user", + "\nx\n" + ] + ], + "options": { + "reasoning_effort": "low" + }, + "text": "<|im_start|>user\npadded<|im_end|>\n<|im_start|>assistant\n\n\n\n\nA<|im_end|>\n<|im_start|>user\n\nx\n<|im_end|>\n<|im_start|>assistant\n\n" + }, + { + "turns": [ + [ + "user", + "Q1" + ], + [ + "assistant", + "pre \nr1\n\nmid\n\npost" + ], + [ + "user", + "Q2" + ] + ], + "options": {}, + "text": "<|im_start|>user\nQ1<|im_end|>\n<|im_start|>assistant\npost<|im_end|>\n<|im_start|>user\nQ2<|im_end|>\n<|im_start|>assistant\n\n" + }, + { + "turns": [ + [ + "user", + "Q1" + ], + [ + "assistant", + "pre \nr1\n\nmid\n\npost" + ], + [ + "user", + "Q2" + ] + ], + "options": { + "enable_thinking": true + }, + "text": "<|im_start|>user\nQ1<|im_end|>\n<|im_start|>assistant\npost<|im_end|>\n<|im_start|>user\nQ2<|im_end|>\n<|im_start|>assistant\n\n" + }, + { + "turns": [ + [ + "user", + "Q1" + ], + [ + "assistant", + "pre \nr1\n\nmid\n\npost" + ], + [ + "user", + "Q2" + ] + ], + "options": { + "enable_thinking": false + }, + "text": "<|im_start|>user\nQ1<|im_end|>\n<|im_start|>assistant\npost<|im_end|>\n<|im_start|>user\nQ2<|im_end|>\n<|im_start|>assistant\n\n\n\n\n" + }, + { + "turns": [ + [ + "user", + "Q1" + ], + [ + "assistant", + "pre \nr1\n\nmid\n\npost" + ], + [ + "user", + "Q2" + ] + ], + "options": { + "preserve_thinking": true + }, + "text": "<|im_start|>user\nQ1<|im_end|>\n<|im_start|>assistant\npost<|im_end|>\n<|im_start|>user\nQ2<|im_end|>\n<|im_start|>assistant\n\n" + }, + { + "turns": [ + [ + "user", + "Q1" + ], + [ + "assistant", + "pre \nr1\n\nmid\n\npost" + ], + [ + "user", + "Q2" + ] + ], + "options": { + "preserve_thinking": false, + "enable_thinking": false + }, + "text": "<|im_start|>user\nQ1<|im_end|>\n<|im_start|>assistant\npost<|im_end|>\n<|im_start|>user\nQ2<|im_end|>\n<|im_start|>assistant\n\n\n\n\n" + }, + { + "turns": [ + [ + "user", + "Q1" + ], + [ + "assistant", + "pre \nr1\n\nmid\n\npost" + ], + [ + "user", + "Q2" + ] + ], + "options": { + "reasoning_effort": "low" + }, + "text": "<|im_start|>user\nQ1<|im_end|>\n<|im_start|>assistant\npost<|im_end|>\n<|im_start|>user\nQ2<|im_end|>\n<|im_start|>assistant\n\n" + } + ], + "refusals": [ + { + "name": "no messages", + "turns": [], + "options": {}, + "error": "No messages provided." + }, + { + "name": "system not first", + "turns": [ + [ + "user", + "a" + ], + [ + "system", + "late" + ] + ], + "options": {}, + "error": "System message must be at the beginning." + }, + { + "name": "no user query", + "turns": [ + [ + "assistant", + "no user" + ] + ], + "options": {}, + "error": "No user query found in messages." + }, + { + "name": "only tool-response-shaped user", + "turns": [ + [ + "user", + "\nx\n" + ] + ], + "options": {}, + "error": "No user query found in messages." + }, + { + "name": "unknown role", + "turns": [ + [ + "user", + "a" + ], + [ + "narrator", + "b" + ] + ], + "options": {}, + "error": "Unexpected message role." + } + ] +} \ No newline at end of file diff --git a/crates/aien-inference-abi/src/bin/q36_levers.rs b/crates/aien-inference-abi/src/bin/q36_levers.rs index 531cbe40..39008403 100644 --- a/crates/aien-inference-abi/src/bin/q36_levers.rs +++ b/crates/aien-inference-abi/src/bin/q36_levers.rs @@ -356,6 +356,7 @@ mod tests { eps: 1e-6, eos_token_ids: vec![], moe: None, + fp8: true, } } diff --git a/crates/aien-inference-abi/src/qwen38.rs b/crates/aien-inference-abi/src/qwen38.rs index 64a2de63..35db83cc 100644 --- a/crates/aien-inference-abi/src/qwen38.rs +++ b/crates/aien-inference-abi/src/qwen38.rs @@ -81,6 +81,9 @@ pub struct Qwen38Config { /// `Some` for the MoE variant (`qwen3_5_moe`, Qwen3.6-35B-A3B): every layer's MLP is a routed /// sparse block plus a gated shared expert, and `intermediate` is unused (0). pub moe: Option, + /// `config.json` names an FP8 `quantization_config` (projections FP8 e4m3, 128 x 128 block + /// scales); false: the projections are stored bf16 (e.g. the official Qwen3.5-9B). + pub fp8: bool, } /// The sparse MLP of a `qwen3_5_moe` layer (transformers `Qwen3_5MoeSparseMoeBlock`): router @@ -227,6 +230,7 @@ impl Qwen38Config { eps: f64_field(text, "rms_norm_eps")? as f32, eos_token_ids, moe, + fp8: raw.get("quantization_config").is_some(), }; c.validate()?; Ok(c) @@ -439,11 +443,21 @@ pub(crate) fn read_bf16_words( Ok(words) } +/// Reads the `[len]` vector `name` as f32: bf16 widened, or f32 as stored (Qwen3.5-9B keeps +/// `linear_attn.A_log` and `linear_attn.norm.weight` in F32). pub(crate) fn read_vec( source: &mut dyn TensorSource, name: &str, len: usize, ) -> Result, String> { + if source.dtype_of(name)?.as_deref() == Some("F32") { + let mut bytes = vec![0u8; len * 4]; + source.read_into(name, "F32", &[len], &mut bytes)?; + return Ok(bytes + .chunks_exact(4) + .map(|b| f32::from_le_bytes([b[0], b[1], b[2], b[3]])) + .collect()); + } Ok(read_bf16_words(source, name, &[len])? .into_iter() .map(bf16_to_f32) @@ -642,7 +656,7 @@ fn rms_norm_zc(x: &mut [f32], w: &[f32], eps: f32) { } } -fn silu(x: f32) -> f32 { +pub(crate) fn silu(x: f32) -> f32 { x / (1.0 + (-x).exp()) } @@ -1296,6 +1310,23 @@ mod tests { } } + #[test] + fn read_vec_takes_bf16_and_f32_exactly_and_refuses_other_dtypes() { + let mut m = Mem::default(); + let vals = [1.0f32 / 3.0, -2.5e-7, 7.75]; + let bytes = vals.iter().flat_map(|v| v.to_le_bytes()).collect(); + m.tensors.insert("f".into(), ("F32".into(), vec![3], bytes)); + assert_eq!(read_vec(&mut m, "f", 3).unwrap(), vals); + m.bf16("b", &[3], 0.5, 0.0); + let words = read_bf16_words(&mut m, "b", &[3]).unwrap(); + let want: Vec = words.into_iter().map(bf16_to_f32).collect(); + assert_eq!(read_vec(&mut m, "b", 3).unwrap(), want); + assert!(read_vec(&mut m, "f", 4).is_err()); + m.tensors + .insert("h".into(), ("F16".into(), vec![3], vec![0; 6])); + assert!(read_vec(&mut m, "h", 3).is_err()); + } + fn tiny() -> Qwen38Config { Qwen38Config { hidden: 256, @@ -1316,6 +1347,7 @@ mod tests { eps: 1e-6, eos_token_ids: vec![1], moe: None, + fp8: true, } } @@ -1425,6 +1457,7 @@ mod tests { assert_eq!(c.conv_dim(), 10240); assert_eq!(c.full_attention, vec![false, false, false, true]); assert_eq!(c.eos_token_ids, vec![248046, 248044]); + assert!(c.fp8); let tied = json.replace( "\"tie_word_embeddings\":false", "\"tie_word_embeddings\":true", @@ -1434,6 +1467,54 @@ mod tests { assert!(Qwen38Config::from_json(&int8, None).is_err()); } + #[test] + fn the_dense_door_takes_the_27b_and_the_9b_shape() { + let j27 = r#"{"model_type":"qwen3_5","tie_word_embeddings":false, + "quantization_config":{"quant_method":"fp8","fmt":"e4m3","weight_block_size":[128,128]}, + "text_config":{"attn_output_gate":true,"hidden_act":"silu","hidden_size":5120, + "num_hidden_layers":4,"vocab_size":248320,"intermediate_size":17408, + "layer_types":["linear_attention","linear_attention","linear_attention","full_attention"], + "num_attention_heads":24,"num_key_value_heads":4,"head_dim":256, + "rope_parameters":{"rope_theta":10000000,"partial_rotary_factor":0.25}, + "linear_num_key_heads":16,"linear_num_value_heads":48,"linear_key_head_dim":128, + "linear_value_head_dim":128,"linear_conv_kernel_dim":4,"rms_norm_eps":1e-6, + "eos_token_id":248044}}"#; + let c27 = Qwen38Config::from_json(j27, None).unwrap(); + let s27 = crate::qwen38_omega::dense_shape(&c27).unwrap(); + assert_eq!(s27, aien_omega_q38::Shape::Q38_27B); + // Qwen3.5-9B (HF Qwen/Qwen3.5-9B config.json text_config) + let j9 = j27 + .replace("\"hidden_size\":5120", "\"hidden_size\":4096") + .replace("\"intermediate_size\":17408", "\"intermediate_size\":12288") + .replace("\"num_attention_heads\":24", "\"num_attention_heads\":16") + .replace( + "\"linear_num_value_heads\":48", + "\"linear_num_value_heads\":32", + ); + let c9 = Qwen38Config::from_json(&j9, None).unwrap(); + let s9 = crate::qwen38_omega::dense_shape(&c9).unwrap(); + assert_eq!( + (s9.hidden, s9.inter, s9.q_heads, s9.kv_heads, s9.gdn_heads), + (4096, 12288, 16, 4, 32) + ); + assert_eq!( + (s9.gdn_qkv(), s9.gdn_mix(), s9.att_mix(), s9.mixer_out()), + (8192, 12288, 10240, 4096) + ); + // refused: a head_dim the kernels do not have, and a GDN head count outside {32, 48} + let hd = j9.replace("\"head_dim\":256", "\"head_dim\":128"); + assert!( + crate::qwen38_omega::dense_shape(&Qwen38Config::from_json(&hd, None).unwrap()).is_err() + ); + let gh = j9.replace( + "\"linear_num_value_heads\":32", + "\"linear_num_value_heads\":16", + ); + assert!( + crate::qwen38_omega::dense_shape(&Qwen38Config::from_json(&gh, None).unwrap()).is_err() + ); + } + #[test] fn fp8_matmul_matches_the_scalar_formula() { let mut m = Mem::default(); diff --git a/crates/aien-inference-abi/src/qwen38_omega.rs b/crates/aien-inference-abi/src/qwen38_omega.rs index 6c50f67e..49f21041 100644 --- a/crates/aien-inference-abi/src/qwen38_omega.rs +++ b/crates/aien-inference-abi/src/qwen38_omega.rs @@ -31,6 +31,7 @@ //! stored; input / post-attention norms folded to `1 + w` (the model's zero-centred RMSNorm). //! - The final norm folded to `1 + w`; lm_head bf16 `[vocab][5120]` as stored. The embedding //! stays on the host (one row per token is widened and written before the token). +//! BF16 projections are not supported: a checkpoint without FP8 e4m3 block scales is refused. //! //! The decode graph covers one token at a time; prompts run through it token by token until the //! prefill path lands (sc #642 step 9). @@ -59,7 +60,8 @@ use crate::qwen3_moe_omega::{ShardSource, TensorSource}; /// l2norm eps of the DeltaNet q/k (the reference's constant). const EPS_L2: f32 = 1e-6; -/// One layer's device tensors (kept alive for the graph). +/// One layer's device tensors (kept alive for the graph). Projections are FP8. The DeltaNet a|b +/// tensor stays bf16, which is the graph's existing GEMV, not a bf16 projection path. struct LayerTensors { mix: Fp8Tensor, ab: Option, @@ -270,15 +272,20 @@ pub fn need_bytes(c: &Qwen38Config, max_pos: usize, chunk: usize) -> u64 { if attn { (2 * c.heads * c.head_dim + 2 * c.kv_dim()) as u64 * h + o + mlp } else { - (c.conv_dim() + c.lin_value_dim()) as u64 * h + o + mlp + 4 * 2 * 2 * 48 * h + (c.conv_dim() + c.lin_value_dim()) as u64 * h + + o + + mlp + + 4 * 2 * 2 * c.lin_v_heads as u64 * h } }) .sum(); + // FP8: one byte per weight plus the block scales. BF16 projections are not supported. let weights = layers + layers / 4096 + 2 * c.vocab as u64 * h; let n_attn = c.full_attention.iter().filter(|&&a| a).count() as u64; let n_gdn = c.layers as u64 - n_attn; let kv = n_attn * 2 * 4 * max_pos as u64 * 512 + max_pos as u64 * 1024; - // xin, xq, xs, mix, act, out, plus the DeltaNet prefill scratch (omega_gpu_gdn_api.h). + // xin, xq, xs, mix, act, out, plus the DeltaNet prefill scratch (omega_gpu_gdn_api.h), at + // the 27B widths (the widest the dense graph takes: an upper bound for smaller shapes). let m = chunk as u64; let bufs = m * (6144 * 4 + 17408 + 136 * 4 + 16384 * 4 + 17408 * 2 + 5120 * 4) + m * (40960 + 3 * 24576 + 384) @@ -299,11 +306,42 @@ fn gpu(stage: &str) -> impl Fn(aien_omega_gpu::OmegaGpuError) -> String + '_ { move |e| format!("{stage}: {e}") } +/// The dense graph's shape for a checkpoint, or why it does not fit: 256-wide attention heads, +/// 16 DeltaNet key heads of 128, value heads of 128, conv kernel 4 (Qwen3.8-27B and Qwen3.5-9B), +/// and widths within [`aien_omega_q38::Shape::check`]. +pub fn dense_shape(c: &Qwen38Config) -> Result { + use aien_omega_q38 as q; + let fixed = c.head_dim == q::HEAD_DIM + && c.lin_k_heads == 16 + && c.lin_k_dim == q::GDN_HEAD_DIM + && c.lin_v_dim == q::GDN_HEAD_DIM + && c.conv_kernel == q::GDN_CONV_KERNEL + && c.kv_heads > 0; + let shape = q::Shape { + hidden: c.hidden, + inter: c.intermediate, + q_heads: c.heads, + kv_heads: c.kv_heads, + gdn_heads: c.lin_v_heads, + }; + if !fixed || shape.check().is_err() { + return Err(format!( + "qwen38 omega: the checkpoint's shape ({shape:?}, head_dim {}, DeltaNet {} key heads of {} / value dim {}, conv {}) is not one the dense graph takes", + c.head_dim, c.lin_k_heads, c.lin_k_dim, c.lin_v_dim, c.conv_kernel + )); + } + Ok(shape) +} + /// `1 + w`, the zero-centred RMSNorm weight the graph's norms multiply by. fn fold(w: Vec) -> Vec { w.into_iter().map(|v| 1.0 + v).collect() } +fn upload_fp8(name: &str, m: Matrix) -> Result { + fuse_fp8(name, vec![m]) +} + /// FP8 projections stacked by rows into one tensor (every part `[n_i][k]`, whole 128 blocks). fn fuse_fp8(name: &str, parts: Vec) -> Result { let (mut n, mut k0) = (0usize, None); @@ -325,7 +363,7 @@ fn fuse_fp8(name: &str, parts: Vec) -> Result { } Matrix::Bf16 { .. } => { return Err(format!( - "{name}: a bf16 part (the graph takes FP8 projections)" + "{name}: a bf16 part (BF16 projections are not supported; the graph takes FP8)" )) } } @@ -334,10 +372,6 @@ fn fuse_fp8(name: &str, parts: Vec) -> Result { Fp8Tensor::upload(1, n, k, &w, &scales).map_err(gpu(name)) } -fn upload_fp8(name: &str, m: Matrix) -> Result { - fuse_fp8(name, vec![m]) -} - /// `in_proj_a` / `in_proj_b` interleaved by rows and scaled by 2^-64 (exact for every normal /// bf16: only the exponent moves; the checkpoint's values sit far above 2^-62). fn ab_rows(a: &Matrix, b: &Matrix) -> Result<(usize, usize, Vec), String> { @@ -471,27 +505,12 @@ impl Qwen38Omega { } if heads != 1 { return Err(format!( - "qwen38 omega: {heads} heads (the 27B dense graph strokes one conversation)" + "qwen38 omega: {heads} heads (the dense graph strokes one conversation)" )); } use aien_omega_q38 as q; let c = &config; - let shape_ok = c.hidden == q::HIDDEN - && c.intermediate == q::INTER - && c.heads * c.head_dim == q::MIXER_OUT - && c.head_dim == q::HEAD_DIM - && c.kv_heads * c.head_dim * 2 + 2 * c.heads * c.head_dim == q::ATT_MIX - && c.conv_dim() == q::GDN_QKV - && c.conv_dim() + c.lin_value_dim() == q::GDN_MIX - && c.lin_v_heads == q::GDN_HEADS - && c.lin_v_dim == q::GDN_HEAD_DIM - && c.conv_kernel == q::GDN_CONV_KERNEL; - if !shape_ok { - return Err( - "qwen38 omega: the checkpoint is not the Qwen3.8-27B shape the graph is built for" - .into(), - ); - } + let shape = dense_shape(c)?; if c.layers > q::MAX_LAYERS { return Err(format!( "qwen38 omega: {} layers (at most {})", @@ -546,14 +565,28 @@ impl Qwen38Omega { let n_attn = c.full_attention.iter().filter(|&&a| a).count(); let n_gdn = c.layers - n_attn; let mut gdn = if n_gdn > 0 { - Some(Gdn::alloc(n_gdn).map_err(gpu("gdn alloc"))?) + Some(Gdn::alloc_ratio(n_gdn, c.lin_v_heads / c.lin_k_heads).map_err(gpu("gdn alloc"))?) } else { None }; + // The 27B keeps omega's default attention shape (zeros); others name their heads. + let (aq, akv, agroup) = if shape == q::Shape::Q38_27B { + (0, 0, 0) + } else { + (c.heads, c.kv_heads, c.heads / c.kv_heads) + }; let mut attn = if n_attn > 0 { Some( - Attn256Cache::alloc(n_attn, max_pos, c.rope_theta, c.rotary_dim) - .map_err(gpu("attn256 alloc"))?, + Attn256Cache::alloc_shape( + n_attn, + max_pos, + c.rope_theta, + c.rotary_dim, + aq, + akv, + agroup, + ) + .map_err(gpu("attn256 alloc"))?, ) } else { None @@ -675,7 +708,7 @@ impl Qwen38Omega { norms.push((in_norm, post_norm)); } - let cfg = GraphConfig { + let mut cfg = GraphConfig { layers: c.layers as u32, attn_mask, vocab: v as u32, @@ -686,7 +719,13 @@ impl Qwen38Omega { .as_ref() .map_or(std::ptr::null_mut(), Attn256Cache::as_raw), lm_head: lm_head.as_raw(), + hidden: 0, + inter: 0, + q_heads: 0, + kv_heads: 0, + gdn_heads: 0, }; + cfg.set_shape(shape); // SAFETY: gdn, attn and lm_head are live omega objects owned by the returned value, which // drops the graph before them (field order). let mut graph = unsafe { Q38Graph::create(&cfg) }.map_err(gpu("q38 graph create"))?; @@ -695,7 +734,7 @@ impl Qwen38Omega { t.ab.as_ref() .map_or(std::ptr::null_mut(), Bf16Tensor::as_raw); // SAFETY: the tensors live in `layers`, owned by the returned value and dropped after - // the graph. + // the graph. BF16 projections are not supported. unsafe { graph.set_layer( l, @@ -750,14 +789,13 @@ impl Qwen38Omega { /// Bytes resident on the device for the weights (tensors as uploaded, not the KV cache). pub fn weight_bytes(&self) -> usize { - let fp8 = |t: &Fp8Tensor| t.resident_bytes(); self.layers .iter() .map(|t| { - fp8(&t.mix) - + fp8(&t.o) - + fp8(&t.gate_up) - + fp8(&t.down) + t.mix.resident_bytes() + + t.o.resident_bytes() + + t.gate_up.resident_bytes() + + t.down.resident_bytes() + t.ab.as_ref().map_or(0, Bf16Tensor::resident_bytes) }) .sum::() diff --git a/crates/aien-inference-abi/src/qwen38_omega/prefill.rs b/crates/aien-inference-abi/src/qwen38_omega/prefill.rs index c834a395..e9798a00 100644 --- a/crates/aien-inference-abi/src/qwen38_omega/prefill.rs +++ b/crates/aien-inference-abi/src/qwen38_omega/prefill.rs @@ -53,7 +53,7 @@ use aien_omega_pf::{ use aien_omega_q38 as q; use rayon::prelude::*; -use super::{gpu, Graph, Qwen38Omega, EPS_L2}; +use super::{dense_shape, gpu, Graph, Qwen38Omega, EPS_L2}; use crate::qwen3_moe::bf16_to_f32; use crate::tensor::rmsnorm; @@ -91,22 +91,25 @@ pub(super) struct PfState { bm: usize, max_tiles: usize, padded_rows: usize, - /// HOST f32 `[m][6144]`: quantiser input (normed x, mixer output, post-normed x). + /// HOST f32 `[m][max(mixer_out, hidden)]` (6144 for the 27B): quantiser input (normed x, + /// mixer output, post-normed x). xin: PfMem, - /// DEV e4m3 `[m + bm][17408]` and f32 scales `[m + bm][17408 / 128]` (a GEMM tile reads + /// DEV e4m3 `[m + bm][inter]` and f32 scales `[m + bm][inter / 128]` (a GEMM tile reads /// activation rows up to `row0 + bm - 1`). xq: PfMem, xs: PfMem, - /// HOST f32 `[m][16384]`: the mixer projection (row stride = that GEMM's `n`). + /// HOST f32 `[m][max(gdn_mix, att_mix)]`: the mixer projection (row stride = that GEMM's `n`). mix: PfMem, - /// DEV bf16 `[m][17408]`: SwiGLU act rows. + /// DEV bf16 `[m][inter]`: SwiGLU act rows. act: PfMem, - /// HOST f32 `[m][5120]`: o_proj and down outputs. + /// HOST f32 `[m][hidden]`: o_proj and down outputs. out: PfMem, /// HOST `max_tiles` x 32 bytes: one GEMM's tile table (every call is synchronous). tiles: PfMem, - /// [`q::gather_table`] for the model's rotary width. + /// [`q::gather_table`] for the model's rotary width and heads. gather: Vec, + /// The model's widths. + shape: q::Shape, } fn ns(t: Instant) -> u64 { @@ -237,19 +240,25 @@ fn reading_device(rows: usize) -> Result { } impl PfState { - fn new(m: usize, rotary: usize, mut dev: ScopedPfDevice) -> Result { + fn new( + m: usize, + rotary: usize, + shape: q::Shape, + mut dev: ScopedPfDevice, + ) -> Result { let bm = dev.qgemm_bm(); - let kq = q::INTER; // widest quantiser input + let kq = shape.inter.max(shape.hidden).max(shape.mixer_out()); // widest quantiser input let max_tiles = m.div_ceil(bm) + 1; Ok(Self { - xin: dev.alloc_host(m * q::MIXER_OUT * 4)?, + xin: dev.alloc_host(m * shape.mixer_out().max(shape.hidden) * 4)?, xq: dev.alloc_dev((m + bm) * kq)?, xs: dev.alloc_dev((m + bm) * (kq / BLOCK) * 4)?, - mix: dev.alloc_host(m * q::GDN_MIX * 4)?, - act: dev.alloc_dev(m * q::INTER * 2)?, - out: dev.alloc_host(m * q::HIDDEN * 4)?, + mix: dev.alloc_host(m * shape.gdn_mix().max(shape.att_mix()) * 4)?, + act: dev.alloc_dev(m * shape.inter * 2)?, + out: dev.alloc_host(m * shape.hidden * 4)?, tiles: dev.alloc_host(max_tiles * TILE_BYTES)?, - gather: q::gather_table(rotary), + gather: q::gather_table(rotary, shape), + shape, dev, m, bm, @@ -447,14 +456,17 @@ impl Qwen38Omega { return Err(format!("qwen38 prefill: token {t} outside the vocab {v}")); } let want = chunk.min(n); + let shape = dense_shape(&self.config)?; let dev = reading_device(want)?; let reusable = self.pf.as_ref().is_some_and(|p| { - dev.workspace_fits(p.m, p.padded_rows, p.max_tiles, want) - .unwrap_or(p.m >= want && p.bm == dev.qgemm_bm() && p.dev.same_profile(&dev)) + p.shape == shape + && dev + .workspace_fits(p.m, p.padded_rows, p.max_tiles, want) + .unwrap_or(p.m >= want && p.bm == dev.qgemm_bm() && p.dev.same_profile(&dev)) }); if !reusable { self.pf = None; // free incompatible storage before allocating - self.pf = Some(PfState::new(want, self.config.rotary_dim, dev)?); + self.pf = Some(PfState::new(want, self.config.rotary_dim, shape, dev)?); } else { let pf = self.pf.as_mut().expect("workspace admitted"); // Every matrix call rebuilds its tile table using this selected height. @@ -492,8 +504,10 @@ impl Qwen38Omega { let m = toks.len(); let pos0 = self.pos; let (h, eps, layers) = (self.config.hidden, self.config.eps, self.config.layers); - let (mo, inter) = (q::MIXER_OUT, q::INTER); let pf = self.pf.as_mut().expect("prefill buffers sized"); + let sh = pf.shape; + let (mo, inter) = (sh.mixer_out(), sh.inter); + let (att_qkv, gdn_qkv) = (sh.att_qkv(), sh.gdn_qkv()); let t = Instant::now(); let mut x: Vec = toks @@ -508,10 +522,10 @@ impl Qwen38Omega { // Reuse the same cached temporaries across layers. After the mixer consumes // qkv, that scratch also holds o/down output; no second output copy is live. // The largest live set is the existing DeltaNet mix/split/a|b stage. - let mut mix_scratch = vec![0f32; m * q::GDN_MIX.max(q::ATT_MIX)]; - let mut split_scratch = vec![0f32; m * q::GDN_QKV.max(q::ATT_QKV).max(h)]; + let mut mix_scratch = vec![0f32; m * sh.gdn_mix().max(sh.att_mix())]; + let mut split_scratch = vec![0f32; m * gdn_qkv.max(att_qkv).max(h)]; let mut side_scratch = vec![0f32; m * mo]; - let mut ab = vec![0f32; m * q::AB]; + let mut ab = vec![0f32; m * sh.ab()]; st.host_ns += ns(t); let (mut gi, mut ai) = (0usize, 0usize); @@ -529,7 +543,11 @@ impl Qwen38Omega { let xin_va = pf.xin.va(); pf.quant(h, QuantIn::F32, xin_va, m, st) .map_err(|e| format!("layer {l} quant x: {e}"))?; - let mix_n = if attention { q::ATT_MIX } else { q::GDN_MIX }; + let mix_n = if attention { + sh.att_mix() + } else { + sh.gdn_mix() + }; let mix_va = pf.mix.va(); pf.gemm(<.mix, mix_n, h, Layout::Plain, mix_va, m, st) .map_err(|e| format!("layer {l} mixer gemm x{m}: {e}"))?; @@ -540,10 +558,10 @@ impl Qwen38Omega { st.host_ns += ns(t); if attention { let t = Instant::now(); - let qkv = &mut split_scratch[..m * q::ATT_QKV]; + let qkv = &mut split_scratch[..m * att_qkv]; let gate = &mut side_scratch[..m * mo]; - let (gq, gg) = pf.gather.split_at(q::ATT_QKV); - qkv.par_chunks_mut(q::ATT_QKV) + let (gq, gg) = pf.gather.split_at(att_qkv); + qkv.par_chunks_mut(att_qkv) .zip(gate.par_chunks_mut(mo)) .zip(mix.par_chunks(mix_n)) .for_each(|((a, g), r)| { @@ -585,14 +603,14 @@ impl Qwen38Omega { st.host_ns += ns(t); } else { let t = Instant::now(); - let qkv = &mut split_scratch[..m * q::GDN_QKV]; + let qkv = &mut split_scratch[..m * gdn_qkv]; let z = &mut side_scratch[..m * mo]; - qkv.par_chunks_mut(q::GDN_QKV) + qkv.par_chunks_mut(gdn_qkv) .zip(z.par_chunks_mut(mo)) .zip(mix.par_chunks(mix_n)) .for_each(|((a, b), r)| { - a.copy_from_slice(&r[..q::GDN_QKV]); - b.copy_from_slice(&r[q::GDN_QKV..]); + a.copy_from_slice(&r[..gdn_qkv]); + b.copy_from_slice(&r[gdn_qkv..]); }); st.host_ns += ns(t); let t = Instant::now(); diff --git a/crates/aien-inference-abi/src/tokenizer.rs b/crates/aien-inference-abi/src/tokenizer.rs index 50e91ec9..470035cb 100644 --- a/crates/aien-inference-abi/src/tokenizer.rs +++ b/crates/aien-inference-abi/src/tokenizer.rs @@ -116,6 +116,11 @@ pub enum ChatTemplate { /// template splits out of a ``-bearing content. Tool turns are refused. Selected only by /// the pinned text. Qwen36, + /// Qwen3.5 (the pinned template `QWEN35`, Qwen3.5-9B): the [`Self::Qwen36`] rendering without + /// the `preserve_thinking` switch (the template has none, so earlier assistant turns before the + /// last user query always render plain and the option is ignored as the template ignores it). + /// Selected only by the pinned text. + Qwen35, /// The model directory has no chat template at all (a base model). Plain text encode /// and decode work; every chat render is refused (`try_render` errors with /// "no chat template"). Chosen only when neither `tokenizer_config.json` `chat_template` @@ -156,10 +161,17 @@ const QWEN38: &str = include_str!("../fixtures/chat-templates/qwen3.8-27b/chat_t /// earlier assistant turns render plain) and a `` split of assistant content. const QWEN36: &str = include_str!("../fixtures/chat-templates/qwen3.6-35b-a3b/chat_template.jinja"); +/// The Qwen3.5-9B chat template, byte for byte (Hugging Face `Qwen/Qwen3.5-9B` revision +/// c202236235762e1c871ad0ccb60c8ee5ba337b9a, Apache-2.0; see +/// `fixtures/chat-templates/qwen3.5-9b/PROVENANCE.md`). Text-only, it renders as [`QWEN36`] with +/// `preserve_thinking` always off. +const QWEN35: &str = include_str!("../fixtures/chat-templates/qwen3.5-9b/chat_template.jinja"); + /// Template switches a request may set (`chat_template_kwargs`). `None` = the template's default. -/// Only [`ChatTemplate::Qwen38`] and [`ChatTemplate::Qwen36`] read them; the other layouts ignore -/// them. `reasoning_effort` is the 27B template's switch (the 35B template ignores it); -/// `preserve_thinking` is the 35B template's switch (the 27B renderer here keeps every think block). +/// Only [`ChatTemplate::Qwen38`], [`ChatTemplate::Qwen36`] and [`ChatTemplate::Qwen35`] read them; +/// the other layouts ignore them. `reasoning_effort` is the 27B template's switch (the 35B and 9B +/// templates ignore it); `preserve_thinking` is the 35B template's switch (the 27B renderer here +/// keeps every think block; the 9B template has none). #[derive(Debug, Clone, Default, PartialEq, Eq)] pub struct ChatOptions { pub enable_thinking: Option, @@ -350,6 +362,9 @@ fn parse_chatml(template_text: &str) -> Result { if text == QWEN36.trim() { return Ok(ChatTemplate::Qwen36); } + if text == QWEN35.trim() { + return Ok(ChatTemplate::Qwen35); + } if text == CHATML_PLAIN { return Ok(ChatTemplate::ChatMl { default_system: None, @@ -486,8 +501,8 @@ fn render_qwen3_nothink(turns: &[(&str, &str)]) -> Result render_qwen38(turns, opts), Self::Qwen36 => render_qwen36(turns, opts), + Self::Qwen35 => render_qwen36( + turns, + &ChatOptions { + preserve_thinking: None, + ..opts.clone() + }, + ), _ => self.try_render(turns), } } @@ -531,6 +553,7 @@ impl ChatTemplate { Self::ChatMlQwen3NoThink => "chatml-qwen3-nothink (Qwen3-8B, thinking off)", Self::Qwen38 => "qwen3.8 (Qwen3.8-27B, thinking per request, template default on)", Self::Qwen36 => "qwen3.6 (Qwen3.6-35B-A3B, thinking per request, template default on)", + Self::Qwen35 => "qwen3.5 (Qwen3.5-9B, thinking per request, template default on)", Self::None => "none (plain text model)", } } @@ -611,7 +634,8 @@ impl ChatTemplate { | Self::ChatMlQwen3 | Self::ChatMlQwen3NoThink | Self::Qwen38 - | Self::Qwen36 => { + | Self::Qwen36 + | Self::Qwen35 => { unreachable!("ChatML returned above") } Self::None => unreachable!("plain model refused above"), @@ -625,7 +649,8 @@ impl ChatTemplate { | Self::ChatMlQwen3 | Self::ChatMlQwen3NoThink | Self::Qwen38 - | Self::Qwen36 => { + | Self::Qwen36 + | Self::Qwen35 => { unreachable!("ChatML returned above") } Self::None => unreachable!("plain model refused above"), @@ -730,7 +755,10 @@ impl ChatTokenizer { /// end-of-sequence set of the model directory `dir`: /// - template: detected from `chat_template` in `tokenizer_config.json`, else from /// `chat_template.jinja`; - /// - stop set: `eos_token_id` of `generation_config.json`, else of `config.json`; + /// - stop set: `eos_token_id` of `generation_config.json`; without one, `eos_token_id` of + /// `config.json` (or of its `text_config`), preceded by the id of `tokenizer_config.json` + /// `eos_token` when that is not already in it (Qwen3.5-9B ships no generation config: its + /// text config names `<|endoftext|>` and its tokenizer `<|im_end|>`, the chat turn end); /// - context limit: `max_position_embeddings` of `config.json`, or of its `text_config` /// (default 2048). pub fn from_model_dir( @@ -741,7 +769,8 @@ impl ChatTokenizer { let mut tokenizer = Self::from_file(tokenizer_json.unwrap_or(&default_json))?; // A present `chat_template` key must be a string; any other form (the HF list // form, null, an object) is an unrecognized template and never falls back to plain. - let config_template = match read_json(&dir.join("tokenizer_config.json"))? + let tokenizer_config = read_json(&dir.join("tokenizer_config.json"))?; + let config_template = match tokenizer_config .as_ref() .and_then(|c| c.get("chat_template")) { @@ -781,16 +810,34 @@ impl ChatTokenizer { None => ChatTemplate::None, }; let config = read_json(&dir.join("config.json"))?; - let stop = read_json(&dir.join("generation_config.json"))? + let stop = match read_json(&dir.join("generation_config.json"))? .as_ref() .and_then(eos_token_ids_from_json) - .or_else(|| config.as_ref().and_then(eos_token_ids_from_json)) - .ok_or_else(|| { - TokenizerError::LoadError(format!( - "no eos_token_id in {}/generation_config.json or config.json", - dir.display() - )) - })?; + { + Some(stop) => Some(stop), + None => config + .as_ref() + .and_then(|c| { + eos_token_ids_from_json(c) + .or_else(|| c.get("text_config").and_then(eos_token_ids_from_json)) + }) + .map(|mut stop| { + let declared = tokenizer_config + .as_ref() + .and_then(|t| t.get("eos_token")?.as_str()) + .and_then(|tok| tokenizer.token_to_id(tok)); + if let Some(id) = declared.filter(|id| !stop.contains(id)) { + stop.insert(0, id); + } + stop + }), + } + .ok_or_else(|| { + TokenizerError::LoadError(format!( + "no eos_token_id in {}/generation_config.json or config.json", + dir.display() + )) + })?; if stop.is_empty() { return Err(TokenizerError::LoadError(format!( "empty eos_token_id in {}", diff --git a/crates/aien-inference-abi/tests/plain_model_load.rs b/crates/aien-inference-abi/tests/plain_model_load.rs index 351ef2b0..496df9af 100644 --- a/crates/aien-inference-abi/tests/plain_model_load.rs +++ b/crates/aien-inference-abi/tests/plain_model_load.rs @@ -127,3 +127,46 @@ fn render_refusal_is_its_own_variant_not_a_load_failure() { assert!(text.contains("no chat template"), "{text}"); assert!(!text.contains("Failed to load tokenizer"), "{text}"); } + +/// Without `generation_config.json` the stop set is the config's `eos_token_id`, also read from +/// `text_config` (the Qwen3.5-9B layout), preceded by the tokenizer's declared `eos_token`. +/// With a generation config, its list is used as is and the tokenizer's token is not added. +#[test] +fn stop_set_without_generation_config_reads_text_config_and_tokenizer_eos() { + let dir = scratch("eos-fallback"); + std::fs::remove_file(dir.join("generation_config.json")).unwrap(); + std::fs::write( + dir.join("config.json"), + r#"{"model_type":"qwen3_5","text_config":{"eos_token_id":2,"max_position_embeddings":16}}"#, + ) + .unwrap(); + std::fs::write( + dir.join("tokenizer_config.json"), + r#"{"eos_token":""}"#, + ) + .unwrap(); + let tok = ChatTokenizer::from_model_dir(&dir, None).unwrap(); + assert_eq!(tok.stop_token_ids(), &[0, 2]); + // The declared token already in the list is not repeated. + std::fs::write( + dir.join("tokenizer_config.json"), + r#"{"eos_token":""}"#, + ) + .unwrap(); + let tok = ChatTokenizer::from_model_dir(&dir, None).unwrap(); + assert_eq!(tok.stop_token_ids(), &[2]); + // A generation config decides alone. + std::fs::write( + dir.join("tokenizer_config.json"), + r#"{"eos_token":""}"#, + ) + .unwrap(); + std::fs::write(dir.join("generation_config.json"), r#"{"eos_token_id":2}"#).unwrap(); + let tok = ChatTokenizer::from_model_dir(&dir, None).unwrap(); + assert_eq!(tok.stop_token_ids(), &[2]); + // No eos anywhere is still refused. + std::fs::remove_file(dir.join("generation_config.json")).unwrap(); + std::fs::write(dir.join("config.json"), r#"{"model_type":"qwen3_5"}"#).unwrap(); + assert!(ChatTokenizer::from_model_dir(&dir, None).is_err()); + let _ = std::fs::remove_dir_all(&dir); +} diff --git a/crates/aien-inference-abi/tests/qwen36_chat_template.rs b/crates/aien-inference-abi/tests/qwen36_chat_template.rs index 5bd1591f..daeffa47 100644 --- a/crates/aien-inference-abi/tests/qwen36_chat_template.rs +++ b/crates/aien-inference-abi/tests/qwen36_chat_template.rs @@ -205,3 +205,80 @@ fn golden_prompt_tokenizes_to_the_reference_ids() { let long = "word ".repeat(30_000); assert!(tk.encode_with_special(&long, true).unwrap().len() > 2048); } + +/// Qwen3.5-9B (Hugging Face `Qwen/Qwen3.5-9B` revision c2022362, +/// fixtures/chat-templates/qwen3.5-9b): the 35B template minus `preserve_thinking`. Its +/// `render_oracle.json` is the same 48 conversations x options and 5 refusals rendered by jinja2 +/// 3.1.2 from the 9B text; it differs from the 35B oracle only in the 3 cases that set +/// `preserve_thinking: true` on a conversation with an assistant turn before the last user query. +const DIR35: &str = concat!( + env!("CARGO_MANIFEST_DIR"), + "/fixtures/chat-templates/qwen3.5-9b" +); + +fn oracle35() -> serde_json::Value { + serde_json::from_str(&std::fs::read_to_string(format!("{DIR35}/render_oracle.json")).unwrap()) + .unwrap() +} + +#[test] +fn qwen35_pinned_template_is_selected_and_distinct() { + let text = std::fs::read_to_string(format!("{DIR35}/chat_template.jinja")).unwrap(); + assert_eq!(ChatTemplate::detect(&text).unwrap(), ChatTemplate::Qwen35); + assert_eq!( + ChatTemplate::detect(text.trim_end()).unwrap(), + ChatTemplate::Qwen35 + ); + // One byte off the pinned text is refused, not approximated. + let edited = text.replacen("last_query_index", "last_query_indeks", 1); + assert!(ChatTemplate::detect(&edited).is_err()); +} + +#[test] +fn qwen35_rendering_and_refusals_match_the_jinja_reference() { + let q36 = oracle(); + let oracle = oracle35(); + let text = std::fs::read_to_string(format!("{DIR35}/chat_template.jinja")).unwrap(); + let tpl = ChatTemplate::detect(&text).unwrap(); + let cases = oracle["cases"].as_array().unwrap(); + assert_eq!(cases.len(), 48); + let mut differ_from_35b = 0; + for (i, case) in cases.iter().enumerate() { + let turns = turns_of(case); + let refs: Vec<(&str, &str)> = turns + .iter() + .map(|(r, c)| (r.as_str(), c.as_str())) + .collect(); + let o = opts(&case["options"]); + let got = tpl.try_render_with(&refs, &o).unwrap(); + assert_eq!( + got, + case["text"].as_str().unwrap(), + "case {i} options {o:?}" + ); + if got != q36["cases"][i]["text"].as_str().unwrap() { + assert_eq!(o.preserve_thinking, Some(true), "case {i}"); + differ_from_35b += 1; + } + } + // The oracle exercises the one switch the 9B template lacks. + assert_eq!(differ_from_35b, 3); + let refusals = oracle["refusals"].as_array().unwrap(); + assert_eq!(refusals.len(), 5); + for case in refusals { + let turns = turns_of(case); + let refs: Vec<(&str, &str)> = turns + .iter() + .map(|(r, c)| (r.as_str(), c.as_str())) + .collect(); + let want = case["error"].as_str().expect("the template raised"); + let err = tpl + .try_render_with(&refs, &opts(&case["options"])) + .expect_err(&format!("{}: must be refused", case["name"])); + assert!( + err.to_string().contains(want), + "{}: {err} should carry {want:?}", + case["name"] + ); + } +} diff --git a/crates/aien-omega-q38/build.rs b/crates/aien-omega-q38/build.rs index 459ce52d..c573d882 100644 --- a/crates/aien-omega-q38/build.rs +++ b/crates/aien-omega-q38/build.rs @@ -24,6 +24,16 @@ //! * `AIEN_OMEGA_DIR=`: native when the checkout has `src/omega_gpu_q38_graph.h`. //! * otherwise: stub (every call returns `Unavailable`). //! +//! Native linkage also requires the shape ABI this crate calls: +//! `int omega_q38_gather_table(uint32_t q_heads, uint32_t kv_heads, uint32_t *tab)`. +//! Older omega (including the previous pin a647b6a9) declares +//! `void omega_q38_gather_table(uint32_t *tab)`. The names match, so the 3-arg call would link +//! and then treat `q_heads` as the table pointer. A header is checked for the 3-arg declaration. +//! An archive cannot show C argument counts, so the witness is +//! `omega_gpu_q38_graph_set_layer_bf16`, which shipped in the same omega change as that +//! signature (omega-mv#905, on main at f9a9a40). A q38 omega without it fails the build. +//! A checkout or archive with no q38 graph at all still stubs. +//! //! `cfg(has_omega_q38_prefill)` is set when, in addition, the prefill entries are linked //! (`omega_gpu_gdn_prefill` and `omega_gpu_prefill_attn256`, omega#543 / #545; with //! `AIEN_OMEGA_DIR`, the header `src/omega_gpu_prefill_attn256_api.h`). @@ -52,6 +62,12 @@ fn main() { if let Ok(lib) = std::env::var("AIEN_OMEGA_GPU_LIB") { println!("cargo:rerun-if-changed={lib}"); if archive_defines(Path::new(&lib), "omega_gpu_q38_graph_create") { + if !archive_defines(Path::new(&lib), "omega_gpu_q38_graph_set_layer_bf16") { + refuse_shape_abi( + &lib, + "nm did not find T omega_gpu_q38_graph_set_layer_bf16. That symbol shipped with the 3-arg gather; nm cannot see C argument counts, and omega_q38_gather_table keeps its name.", + ); + } if archive_defines(Path::new(&lib), "omega_gpu_q38_exact_extra_bytes") { println!("cargo:rustc-cfg=has_omega_q38_exact"); } @@ -77,10 +93,14 @@ fn main() { let header = Path::new(&dir).join("src/omega_gpu_q38_graph.h"); println!("cargo:rerun-if-changed={}", header.display()); if header.is_file() { - if std::fs::read_to_string(&header) - .unwrap_or_default() - .contains("omega_gpu_q38_exact_extra_bytes(") - { + let text = std::fs::read_to_string(&header).unwrap_or_default(); + if !shape_gather_declared(&text) { + refuse_shape_abi( + &header.display().to_string(), + "the header does not declare int omega_q38_gather_table(uint32_t q_heads, uint32_t kv_heads, uint32_t *tab).", + ); + } + if text.contains("omega_gpu_q38_exact_extra_bytes(") { println!("cargo:rustc-cfg=has_omega_q38_exact"); } println!("cargo:rustc-cfg=has_omega_q38"); @@ -108,6 +128,34 @@ fn main() { } } +/// True when `header` declares the 3-arg gather this crate calls. Whitespace is ignored so +/// `uint32_t *tab` and `uint32_t* tab` match. The 1-arg `void omega_q38_gather_table(uint32_t *tab)` +/// does not. +fn shape_gather_declared(header: &str) -> bool { + let flat: String = header.chars().filter(|c| !c.is_whitespace()).collect(); + flat.contains("intomega_q38_gather_table(uint32_tq_heads,uint32_tkv_heads,uint32_t*tab)") +} + +fn omega_pin() -> String { + let root = std::path::PathBuf::from(std::env::var_os("CARGO_MANIFEST_DIR").unwrap()); + std::fs::read_to_string(root.join("../../omega.lock")) + .unwrap_or_default() + .trim() + .to_string() +} + +fn refuse_shape_abi(where_: &str, detail: &str) -> ! { + let pin = omega_pin(); + panic!( + "aien-omega-q38: {where_} has the Qwen3.8 graph but not the shape ABI this crate calls.\n\ + required: int omega_q38_gather_table(uint32_t q_heads, uint32_t kv_heads, uint32_t *tab)\n\ + omega.lock pins {pin}, which is an omega-mv main commit that exports that signature.\n\ + {detail}\n\ + The 1-arg form is `void omega_q38_gather_table(uint32_t *tab)`. The names match, so the 3-arg call would link and then write through q_heads as a pointer.\n\ + Point AIEN_OMEGA_DIR or AIEN_OMEGA_GPU_LIB at the pinned commit, or unset them for the CPU stub." + ); +} + fn archive_defines(lib: &Path, symbol: &str) -> bool { let Ok(out) = Command::new("nm").arg(lib).output() else { println!("cargo:warning=aien-omega-q38: nm not available, assuming the archive lacks the q38 graph API"); diff --git a/crates/aien-omega-q38/src/lib.rs b/crates/aien-omega-q38/src/lib.rs index ac94a20a..1d7f4c66 100644 --- a/crates/aien-omega-q38/src/lib.rs +++ b/crates/aien-omega-q38/src/lib.rs @@ -79,6 +79,106 @@ pub const GDN_PF_MAX_T: usize = 65536; /// Most tokens one attention prefill call takes (`OMEGA_GPU_PATTN256_MAX_M`). pub const PATTN_MAX_M: usize = 32768; +/// A dense model's shape (omega `OmegaGpuQ38GraphConfig` hidden .. gdn_heads): the constants above +/// are the Qwen3.8-27B's ([`Shape::Q38_27B`], the widest); Qwen3.5-9B is hidden 4096, inter 12288, +/// 16 / 4 attention heads, 32 DeltaNet value heads. Head widths (256 attention, 128 DeltaNet), the +/// 16 DeltaNet key heads and the conv kernel are fixed. +#[derive(Debug, Clone, Copy, PartialEq, Eq)] +pub struct Shape { + pub hidden: usize, + pub inter: usize, + pub q_heads: usize, + pub kv_heads: usize, + pub gdn_heads: usize, +} + +impl Shape { + pub const Q38_27B: Self = Self { + hidden: HIDDEN, + inter: INTER, + q_heads: 24, + kv_heads: 4, + gdn_heads: GDN_HEADS, + }; + + /// What omega's graph takes (the checks of `omega_gpu_q38_graph_create`): hidden a multiple of + /// 1024 up to 5120, inter a multiple of 256 up to 17408, q heads up to 24 in groups of at most + /// 8 per kv head, 32 or 48 DeltaNet value heads, and one mixer width (q heads x 256 = value + /// heads x 128). + pub fn check(self) -> Result<(), OmegaGpuError> { + let ok = self.hidden > 0 + && self.hidden.is_multiple_of(1024) + && self.hidden <= HIDDEN + && self.inter > 0 + && self.inter.is_multiple_of(256) + && self.inter <= INTER + && self.q_heads > 0 + && self.q_heads <= 24 + && self.kv_heads > 0 + && self.q_heads.is_multiple_of(self.kv_heads) + && self.q_heads / self.kv_heads <= 8 + && (self.gdn_heads == 32 || self.gdn_heads == 48) + && self.q_heads * HEAD_DIM == self.gdn_heads * GDN_HEAD_DIM; + if ok { + Ok(()) + } else { + Err(bad(format!( + "q38 shape {self:?}: outside what the graph takes" + ))) + } + } + + /// DeltaNet in_proj_qkv rows (the conv width): q and k 16 x 128 each, v heads x 128. + pub const fn gdn_qkv(self) -> usize { + (32 + self.gdn_heads) * GDN_HEAD_DIM + } + + /// DeltaNet fused projection rows: in_proj_qkv | in_proj_z. + pub const fn gdn_mix(self) -> usize { + self.gdn_qkv() + self.gdn_heads * GDN_HEAD_DIM + } + + /// DeltaNet a|b rows, interleaved per head. + pub const fn ab(self) -> usize { + 2 * self.gdn_heads + } + + /// Attention fused projection rows: q_proj (q heads x [q 256 | gate 256]) | k_proj | v_proj. + pub const fn att_mix(self) -> usize { + (self.q_heads + self.kv_heads) * 2 * HEAD_DIM + } + + /// The attention kernel's q|k|v row. + pub const fn att_qkv(self) -> usize { + (self.q_heads + 2 * self.kv_heads) * HEAD_DIM + } + + /// Mixer output width, the o_proj input. + pub const fn mixer_out(self) -> usize { + self.q_heads * HEAD_DIM + } + + /// omega's config fields: zeros for the 27B (its defaults, so the 27B config is unchanged). + const fn config_fields(self) -> [u32; 5] { + if self.hidden == HIDDEN + && self.inter == INTER + && self.q_heads == 24 + && self.kv_heads == 4 + && self.gdn_heads == GDN_HEADS + { + [0; 5] + } else { + [ + self.hidden as u32, + self.inter as u32, + self.q_heads as u32, + self.kv_heads as u32, + self.gdn_heads as u32, + ] + } + } +} + /// True when the Qwen3.8 decode API is linked (not the stub). pub const fn is_native() -> bool { cfg!(has_omega_q38) @@ -154,23 +254,25 @@ pub fn checkpoint_cut( } } -/// Source index in the attention projection row (`[ATT_MIX]`: q_proj 24 x [q 256 | gate 256], +/// Source index in the attention projection row (`[att_mix]`: q_proj q_heads x [q 256 | gate 256], /// k_proj, v_proj) of every slot of the gathered row: q permuted | k permuted | v (the first -/// [`ATT_QKV`], the attention kernel's row) | gate (`[MIXER_OUT]`). Mirror of +/// `att_qkv`, the attention kernel's row) | gate (`[mixer_out]`). Mirror of /// `omega_q38_gather_table` (the decode graph's GATHER). -pub fn gather_table(rotary: usize) -> Vec { - let qp = 24 * 512; - let kp = qp + 4 * 256; - (0..ATT_MIX) +pub fn gather_table(rotary: usize, shape: Shape) -> Vec { + let (qn, kn) = (shape.q_heads * HEAD_DIM, shape.kv_heads * HEAD_DIM); + let qkv = shape.att_qkv(); + let qp = shape.q_heads * 2 * HEAD_DIM; + let kp = qp + kn; + (0..shape.att_mix()) .map(|n| { - let s = if n < 6144 { + let s = if n < qn { (n / 256) * 512 + perm_slot(n % 256, rotary) - } else if n < 7168 { - qp + ((n - 6144) / 256) * 256 + perm_slot(n % 256, rotary) - } else if n < ATT_QKV { - kp + (n - 7168) + } else if n < qn + kn { + qp + ((n - qn) / 256) * 256 + perm_slot(n % 256, rotary) + } else if n < qkv { + kp + (n - qn - kn) } else { - ((n - ATT_QKV) / 256) * 512 + 256 + (n - ATT_QKV) % 256 + ((n - qkv) / 256) * 512 + 256 + (n - qkv) % 256 }; s as u32 }) @@ -235,16 +337,16 @@ pub enum Buf { } impl Buf { - /// The buffer's capacity in f32. - pub const fn capacity(self) -> usize { + /// The buffer's capacity in f32 for a graph of `shape`. + pub const fn capacity(self, shape: Shape) -> usize { match self { - Self::X | Self::Xq | Self::O | Self::Hidden => HIDDEN, - Self::Mix => GDN_MIX, - Self::Ab => AB, - Self::Agg => ATT_MIX, - Self::Att => MIXER_OUT, - Self::Gu => 2 * INTER, - Self::Act => INTER, + Self::X | Self::Xq | Self::O | Self::Hidden => shape.hidden, + Self::Mix => shape.gdn_mix(), + Self::Ab => shape.ab(), + Self::Agg => shape.att_mix(), + Self::Att => shape.mixer_out(), + Self::Gu => 2 * shape.inter, + Self::Act => shape.inter, } } } @@ -307,8 +409,41 @@ pub struct GraphConfig { pub gdn: *mut c_void, /// [`Attn256Cache::as_raw`]: one entry per attention layer, in model order; rotary 64. pub attn: *mut c_void, - /// `Bf16Tensor::as_raw`, `[vocab][HIDDEN]`. + /// `Bf16Tensor::as_raw`, `[vocab][hidden]`. pub lm_head: *const c_void, + /// The shape ([`GraphConfig::set_shape`]); all zero = the 27B. The attention cache must have + /// the same q / kv heads and the DeltaNet state the same value heads. + pub hidden: u32, + pub inter: u32, + pub q_heads: u32, + pub kv_heads: u32, + pub gdn_heads: u32, +} + +impl GraphConfig { + /// Sets the shape fields (zeros for the 27B, omega's defaults). + pub fn set_shape(&mut self, shape: Shape) { + [ + self.hidden, + self.inter, + self.q_heads, + self.kv_heads, + self.gdn_heads, + ] = shape.config_fields(); + } + + /// The shape the fields name (zeros resolved to the 27B). + pub fn shape(&self) -> Shape { + let or = |v: u32, d: usize| if v == 0 { d } else { v as usize }; + let d = Shape::Q38_27B; + Shape { + hidden: or(self.hidden, d.hidden), + inter: or(self.inter, d.inter), + q_heads: or(self.q_heads, d.q_heads), + kv_heads: or(self.kv_heads, d.kv_heads), + gdn_heads: or(self.gdn_heads, d.gdn_heads), + } + } } #[cfg(has_omega_q38)] @@ -452,7 +587,7 @@ mod ffi { pub fn omega_gpu_q38_graph_kind_name(kind: u8) -> *const c_char; pub fn omega_gpu_q38_graph_set_flush_each(g: *mut OmegaGpuQ38Graph, on: i32); pub fn omega_gpu_session_last_error() -> *const c_char; - pub fn omega_q38_gather_table(tab: *mut u32); + pub fn omega_q38_gather_table(q_heads: u32, kv_heads: u32, tab: *mut u32) -> i32; } #[cfg(has_omega_q38_prefill)] @@ -508,26 +643,37 @@ mod ffi { /// a diagnostic for the attention block-count experiment, never a server setting. Without the q38 library there is /// no attention launch to configure, and the call does nothing. pub fn decode_attn256_set_per_split(per_split: u32) { - #[cfg(has_omega_q38)] // SAFETY: a plain setter that takes omega's session lock; no pointers cross. + #[cfg(has_omega_q38)] unsafe { ffi::omega_gpu_decode_attn256_set_per_split(per_split) } + // The stub has no attention launch to configure; every launch already returns Unavailable. #[cfg(not(has_omega_q38))] let _ = per_split; } -/// omega's own gather table (`omega_q38_gather_table`), for checking [`gather_table`]. -pub fn gather_table_c() -> Result, OmegaGpuError> { +/// omega's own gather table (`omega_q38_gather_table`) for `shape`'s heads, for checking +/// [`gather_table`]. +pub fn gather_table_c(shape: Shape) -> Result, OmegaGpuError> { #[cfg(has_omega_q38)] { let mut t = vec![0u32; ATT_MIX]; - // SAFETY: omega writes exactly OMEGA_GPU_Q38_ATT_MIX entries. - unsafe { ffi::omega_q38_gather_table(t.as_mut_ptr()) }; + // SAFETY: omega writes (q_heads + kv_heads) * 512 <= OMEGA_GPU_Q38_ATT_MIX entries. + let rc = unsafe { + ffi::omega_q38_gather_table(shape.q_heads as u32, shape.kv_heads as u32, t.as_mut_ptr()) + }; + if rc != 0 { + return Err(bad(format!("gather table: omega refuses {shape:?}"))); + } + t.truncate(shape.att_mix()); Ok(t) } #[cfg(not(has_omega_q38))] - Err(OmegaGpuError::Unavailable) + { + let _ = shape; + Err(OmegaGpuError::Unavailable) + } } /// omega's own name for a launch kind (`omega_gpu_q38_graph_kind_name`); the table above in @@ -827,8 +973,8 @@ impl Gdn { /// `tokens` new tokens of DeltaNet layer `layer` (its index among the DeltaNet layers) in one /// call (`omega_gpu_gdn_prefill`), continuing from the layer's tail and state exactly as /// `tokens` decode steps would and leaving them for the next call or decode step. Plain - /// values in and out (scales 1): `qkv` `[tokens][10240]`, `z` `[tokens][6144]`, `ab` - /// `[tokens][96]` ({a, b} per head), `out` `[tokens][6144]` (the out_proj input). + /// values in and out (scales 1): `qkv` `[tokens][qkv()]` (10240 at ratio 3), `z` and `out` + /// `[tokens][heads() x 128]` (6144), `ab` `[tokens][2 heads()]` ({a, b} per head; 96). #[allow(clippy::too_many_arguments)] pub fn prefill( &mut self, @@ -846,10 +992,11 @@ impl Gdn { "gdn prefill: {tokens} tokens, {GDN_PF_MIN_T}..={GDN_PF_MAX_T} supported" ))); } - check_len("gdn prefill qkv", tokens * GDN_QKV, qkv.len())?; - check_len("gdn prefill z", tokens * MIXER_OUT, z.len())?; - check_len("gdn prefill ab", tokens * AB, ab.len())?; - check_len("gdn prefill out", tokens * MIXER_OUT, out.len())?; + let (vw, abw) = (self.heads() * GDN_HEAD_DIM, 2 * self.heads()); + check_len("gdn prefill qkv", tokens * self.qkv(), qkv.len())?; + check_len("gdn prefill z", tokens * vw, z.len())?; + check_len("gdn prefill ab", tokens * abw, ab.len())?; + check_len("gdn prefill out", tokens * vw, out.len())?; if layer >= self.layers { return Err(bad(format!( "gdn prefill: layer {layer} of {}", @@ -915,6 +1062,9 @@ pub struct Attn256Cache { layers: usize, max_pos: usize, rotary: usize, + /// Attention q / kv heads (the 27B's 24 / 4 for `alloc_shape` zeros). + q_heads: usize, + kv_heads: usize, } // SAFETY: an owning handle to device buffers; moved between threads, never shared unlocked. @@ -998,6 +1148,8 @@ impl Attn256Cache { layers, max_pos, rotary, + q_heads: if q_heads == 0 { 24 } else { q_heads }, + kv_heads: if kv_heads == 0 { 4 } else { kv_heads }, }) } #[cfg(not(has_omega_q38))] @@ -1071,10 +1223,10 @@ impl Attn256Cache { /// Causal prefill attention for attention layer `layer` (its index among the attention /// layers), `omega_gpu_prefill_attn256`: `m` tokens at positions `pos0 .. pos0 + m` (positions - /// before `pos0` already in the cache). `qkv` `[m][8192]` in the decode call's row layout - /// ([`gather_table`]'s first [`ATT_QKV`] slots, raw: the q/k norms and RoPE are applied - /// here); appends their K and V and writes `out` `[m][6144]` (head h at h * 256, before the - /// output gate). + /// before `pos0` already in the cache). `qkv` `[m][(q_heads + 2 kv_heads) x 256]` (8192 for the + /// 27B) in the decode call's row layout ([`gather_table`]'s first `att_qkv` slots, raw: the q/k + /// norms and RoPE are applied here); appends their K and V and writes `out` + /// `[m][q_heads x 256]` (head h at h * 256, before the output gate). pub fn prefill( &mut self, layer: usize, @@ -1127,8 +1279,13 @@ impl Attn256Cache { self.max_pos ))); } - check_len("attn256 prefill qkv", m * ATT_QKV, qkv.len())?; - check_len("attn256 prefill out", m * MIXER_OUT, out.len())?; + let qkv_w = (self.q_heads + 2 * self.kv_heads) * HEAD_DIM; + check_len("attn256 prefill qkv", m * qkv_w, qkv.len())?; + check_len( + "attn256 prefill out", + m * self.q_heads * HEAD_DIM, + out.len(), + )?; if layer >= self.layers { return Err(bad(format!( "attn256 prefill: layer {layer} of {}", @@ -1244,7 +1401,7 @@ pub fn check_config(cfg: &GraphConfig) -> Result<(), OmegaGpuError> { if cfg.lm_head.is_null() { return Err(bad("q38 graph: the lm_head must be a device tensor".into())); } - Ok(()) + cfg.shape().check() } /// Additional memory admitted by the Omega plan for the experimental exact head. @@ -1268,6 +1425,7 @@ pub struct Q38Graph { layers: usize, attn_mask: u64, vocab: usize, + shape: Shape, } // SAFETY: an owning handle to device buffers; moved between threads, never shared unlocked. @@ -1303,6 +1461,7 @@ impl Q38Graph { layers: cfg.layers as usize, attn_mask: cfg.attn_mask, vocab: cfg.vocab as usize, + shape: cfg.shape(), }) } #[cfg(not(has_omega_q38))] @@ -1317,15 +1476,21 @@ impl Q38Graph { self.vocab } + /// The model shape the graph was built for. + pub fn shape(&self) -> Shape { + self.shape + } + /// True when model layer `l` is full attention. pub fn is_attention(&self, l: usize) -> bool { l < 64 && self.attn_mask >> l & 1 == 1 } /// Binds one layer's projections (omega checks the shapes) and copies its norms (f32 - /// `[HIDDEN]` each, already folded to `1 + w`). DeltaNet: `mix` `[16384][5120]`, `ab` bf16 - /// `[96][5120]` (a/b interleaved, each value times 2^-64). Attention: `mix` `[14336][5120]`, - /// `ab` null. Both: `o` `[5120][6144]`, `gate_up` `[34816][5120]`, `down` `[5120][17408]`. + /// `[hidden]` each, already folded to `1 + w`). 27B widths shown (the graph's [`Shape`] in + /// general): DeltaNet: `mix` `[16384][5120]`, `ab` bf16 `[96][5120]` (a/b interleaved, each + /// value times 2^-64). Attention: `mix` `[14336][5120]`, `ab` null. Both: `o` `[5120][6144]`, + /// `gate_up` `[34816][5120]`, `down` `[5120][17408]`. /// /// # Safety /// The handles are live `OmegaGpuFp8Tensor` / `OmegaGpuBf16Tensor` pointers that outlive the @@ -1342,21 +1507,7 @@ impl Q38Graph { in_norm: &[f32], post_norm: &[f32], ) -> Result<(), OmegaGpuError> { - check_len("q38 graph in_norm", HIDDEN, in_norm.len())?; - check_len("q38 graph post_norm", HIDDEN, post_norm.len())?; - if layer >= self.layers { - return Err(bad(format!("q38 graph: layer {layer} of {}", self.layers))); - } - if mix.is_null() || o.is_null() || gate_up.is_null() || down.is_null() { - return Err(bad(format!( - "q38 graph layer {layer}: a projection has no device handle" - ))); - } - if ab.is_null() != self.is_attention(layer) { - return Err(bad(format!( - "q38 graph layer {layer}: the a|b tensor is for DeltaNet layers only" - ))); - } + self.check_layer(layer, mix, ab, o, gate_up, down, in_norm, post_norm)?; #[cfg(has_omega_q38)] { let rc = ffi::omega_gpu_q38_graph_set_layer( @@ -1379,7 +1530,37 @@ impl Q38Graph { Err(OmegaGpuError::Unavailable) } - /// Uses an FP8 lm_head (`[vocab][HIDDEN]`, one expert) for every later token instead of the bf16 one + #[allow(clippy::too_many_arguments)] + fn check_layer( + &self, + layer: usize, + mix: *const c_void, + ab: *const c_void, + o: *const c_void, + gate_up: *const c_void, + down: *const c_void, + in_norm: &[f32], + post_norm: &[f32], + ) -> Result<(), OmegaGpuError> { + check_len("q38 graph in_norm", self.shape.hidden, in_norm.len())?; + check_len("q38 graph post_norm", self.shape.hidden, post_norm.len())?; + if layer >= self.layers { + return Err(bad(format!("q38 graph: layer {layer} of {}", self.layers))); + } + if mix.is_null() || o.is_null() || gate_up.is_null() || down.is_null() { + return Err(bad(format!( + "q38 graph layer {layer}: a projection has no device handle" + ))); + } + if ab.is_null() != self.is_attention(layer) { + return Err(bad(format!( + "q38 graph layer {layer}: the a|b tensor is for DeltaNet layers only" + ))); + } + Ok(()) + } + + /// Uses an FP8 lm_head (`[vocab][hidden]`, one expert) for every later token instead of the bf16 one /// (omega `omega_gpu_q38_graph_set_lm_head_fp8`, qwen38/decode-speed); null goes back to bf16. /// /// # Safety @@ -1454,12 +1635,12 @@ impl Q38Graph { } } - /// Copies the final RMSNorm weight (f32 `[HIDDEN]`, folded to `1 + w`). + /// Copies the final RMSNorm weight (f32 `[hidden]`, folded to `1 + w`). pub fn set_final_norm(&mut self, final_norm: &[f32]) -> Result<(), OmegaGpuError> { - check_len("q38 graph final_norm", HIDDEN, final_norm.len())?; + check_len("q38 graph final_norm", self.shape.hidden, final_norm.len())?; #[cfg(has_omega_q38)] { - // SAFETY: ptr is live; the slice holds HIDDEN f32 (checked). + // SAFETY: ptr is live; the slice holds hidden f32 (checked). let rc = unsafe { ffi::omega_gpu_q38_graph_set_final_norm(self.ptr, final_norm.as_ptr()) }; if rc != 0 { @@ -1472,20 +1653,20 @@ impl Q38Graph { } /// One whole token as one command list: `x_embed` (the token's embedding row, f32 - /// `[HIDDEN]`) at position `pos` -> the greedy token (lowest index of the max logit) and what + /// `[hidden]`) at position `pos` -> the greedy token (lowest index of the max logit) and what /// it cost. Attention layers append K/V at `pos`; DeltaNet layers advance their state. pub fn token( &mut self, x_embed: &[f32], pos: usize, ) -> Result<(u32, GraphStats), OmegaGpuError> { - check_len("q38 graph x_embed", HIDDEN, x_embed.len())?; + check_len("q38 graph x_embed", self.shape.hidden, x_embed.len())?; let pos = u32::try_from(pos).map_err(|_| bad(format!("q38 graph: pos {pos} too large")))?; #[cfg(has_omega_q38)] { let mut token = 0u32; let mut st = GraphStats::default(); - // SAFETY: ptr is live; x_embed holds HIDDEN f32 (checked); token and st are local. + // SAFETY: ptr is live; x_embed holds hidden f32 (checked); token and st are local. let rc = unsafe { ffi::omega_gpu_q38_graph_token(self.ptr, x_embed.as_ptr(), pos, &mut token, &mut st) }; @@ -1501,7 +1682,7 @@ impl Q38Graph { } } - /// Copies the last token's device residual `x`, final-normed `hidden` (both `[HIDDEN]`) and + /// Copies the last token's device residual `x`, final-normed `hidden` (both `[hidden]`) and /// `logits` (`[vocab]`); any may be `None`. Costs a device read. pub fn read( &mut self, @@ -1510,10 +1691,10 @@ impl Q38Graph { logits: Option<&mut [f32]>, ) -> Result<(), OmegaGpuError> { if let Some(x) = &x { - check_len("q38 graph read x", HIDDEN, x.len())?; + check_len("q38 graph read x", self.shape.hidden, x.len())?; } if let Some(h) = &hidden { - check_len("q38 graph read hidden", HIDDEN, h.len())?; + check_len("q38 graph read hidden", self.shape.hidden, h.len())?; } if let Some(l) = &logits { check_len("q38 graph read logits", self.vocab, l.len())?; @@ -1534,11 +1715,11 @@ impl Q38Graph { /// Copies the first `out.len()` f32 of one intermediate of the last token (test and trace). pub fn read_buf(&mut self, which: Buf, out: &mut [f32]) -> Result<(), OmegaGpuError> { - if out.len() > which.capacity() { + if out.len() > which.capacity(self.shape) { return Err(bad(format!( "q38 graph read_buf {which:?}: {} values, the buffer holds {}", out.len(), - which.capacity() + which.capacity(self.shape) ))); } #[cfg(has_omega_q38)] @@ -1683,6 +1864,32 @@ pub fn quantize_fp8_bf16( mod tests { use super::*; + /// Same predicate as `shape_gather_declared` in `build.rs`. + fn shape_gather_declared(header: &str) -> bool { + let flat: String = header.chars().filter(|c| !c.is_whitespace()).collect(); + flat.contains("intomega_q38_gather_table(uint32_tq_heads,uint32_tkv_heads,uint32_t*tab)") + } + + #[test] + fn shape_gather_abi_rejects_the_one_arg_symbol() { + let build = include_str!("../build.rs"); + assert!( + build.contains( + "intomega_q38_gather_table(uint32_tq_heads,uint32_tkv_heads,uint32_t*tab)" + ), + "build.rs no longer checks the 3-arg gather declaration" + ); + assert!(!shape_gather_declared( + "void omega_q38_gather_table(uint32_t *tab);" + )); + assert!(shape_gather_declared( + "int omega_q38_gather_table(uint32_t q_heads, uint32_t kv_heads, uint32_t *tab);" + )); + assert!(shape_gather_declared( + "int omega_q38_gather_table(uint32_t q_heads, uint32_t kv_heads, uint32_t*tab);" + )); + } + fn nonowning_attention_fixture() -> std::mem::ManuallyDrop { // Deliberately has no device allocation. Refusal checks must never dereference it. std::mem::ManuallyDrop::new(Attn256Cache { @@ -1691,6 +1898,8 @@ mod tests { layers: 1, max_pos: 32, rotary: 64, + q_heads: 24, + kv_heads: 4, }) } @@ -1737,7 +1946,7 @@ mod tests { #[test] fn gather_table_is_a_permutation_and_matches_omega() { - let t = gather_table(64); + let t = gather_table(64, Shape::Q38_27B); let mut seen = vec![false; ATT_MIX]; for &s in &t { assert!(!std::mem::replace(&mut seen[s as usize], true), "{s} twice"); @@ -1746,7 +1955,72 @@ mod tests { // q head 0 dim 0 comes from row 0; the gate of head 0 from row 256; v from after k. assert_eq!((t[0], t[ATT_QKV], t[7168]), (0, 256, 24 * 512 + 4 * 256)); if is_native() { - assert_eq!(gather_table_c().unwrap(), t); + assert_eq!(gather_table_c(Shape::Q38_27B).unwrap(), t); + } + } + + const Q35_9B: Shape = Shape { + hidden: 4096, + inter: 12288, + q_heads: 16, + kv_heads: 4, + gdn_heads: 32, + }; + + #[test] + fn the_9b_shape_widths_and_gather_table() { + Q35_9B.check().unwrap(); + Shape::Q38_27B.check().unwrap(); + assert_eq!( + (Q35_9B.gdn_qkv(), Q35_9B.gdn_mix(), Q35_9B.ab()), + (8192, 12288, 64) + ); + assert_eq!( + (Q35_9B.att_mix(), Q35_9B.att_qkv(), Q35_9B.mixer_out()), + (10240, 6144, 4096) + ); + let d = Shape::Q38_27B; + assert_eq!( + ( + d.gdn_qkv(), + d.gdn_mix(), + d.ab(), + d.att_mix(), + d.att_qkv(), + d.mixer_out() + ), + (GDN_QKV, GDN_MIX, AB, ATT_MIX, ATT_QKV, MIXER_OUT) + ); + let t = gather_table(64, Q35_9B); + assert_eq!(t.len(), 10240); + let mut seen = vec![false; 10240]; + for &s in &t { + assert!(!std::mem::replace(&mut seen[s as usize], true), "{s} twice"); + } + // q head 0 from row 0, k head 0 dim 0 from after q_proj, v after k_proj, gate 0 from row 256. + assert_eq!((t[0], t[4096], t[5120], t[6144]), (0, 8192, 9216, 256)); + if is_native() { + assert_eq!(gather_table_c(Q35_9B).unwrap(), t); + } + for bad in [ + Shape { + hidden: 4000, + ..Q35_9B + }, + Shape { + inter: 17664, + ..Q35_9B + }, + Shape { + kv_heads: 3, + ..Q35_9B + }, + Shape { + gdn_heads: 48, + ..Q35_9B + }, + ] { + assert!(bad.check().is_err(), "{bad:?}"); } } @@ -1790,6 +2064,11 @@ mod tests { gdn: std::ptr::null_mut(), attn: std::ptr::null_mut(), lm_head: (&mut lm as *mut u8).cast(), + hidden: 0, + inter: 0, + q_heads: 0, + kv_heads: 0, + gdn_heads: 0, }; assert!(check_config(&cfg).is_err()); let ok = GraphConfig { @@ -1806,6 +2085,21 @@ mod tests { }; assert!(check_config(&gdn_only).is_ok()); assert!(check_config(&GraphConfig { layers: 65, ..ok }).is_err()); + let mut nine = ok; + nine.set_shape(Q35_9B); + assert_eq!( + (nine.hidden, nine.gdn_heads, nine.shape()), + (4096, 32, Q35_9B) + ); + assert!(check_config(&nine).is_ok()); + let mut back = nine; + back.set_shape(Shape::Q38_27B); + assert_eq!((back.hidden, back.inter, back.q_heads), (0, 0, 0)); + assert!(check_config(&GraphConfig { + hidden: 6144, + ..nine + }) + .is_err()); } } diff --git a/crates/aien-runtime/src/compose/bridge.rs b/crates/aien-runtime/src/compose/bridge.rs index 6566aecf..715d7072 100644 --- a/crates/aien-runtime/src/compose/bridge.rs +++ b/crates/aien-runtime/src/compose/bridge.rs @@ -678,7 +678,8 @@ pub fn compose_assistant_prefix(template: &aien_inference_abi::ChatTemplate) -> | ChatTemplate::ChatMlQwen3 | ChatTemplate::ChatMlQwen3NoThink | ChatTemplate::Qwen38 - | ChatTemplate::Qwen36 => "filename:", + | ChatTemplate::Qwen36 + | ChatTemplate::Qwen35 => "filename:", } } diff --git a/crates/aien-serve-http/src/codec.rs b/crates/aien-serve-http/src/codec.rs index 774a4436..e1611577 100644 --- a/crates/aien-serve-http/src/codec.rs +++ b/crates/aien-serve-http/src/codec.rs @@ -119,7 +119,7 @@ impl Codec for HfCodec { fn reasoning_end_id(&self) -> Option { if !matches!( self.tokenizer.template(), - ChatTemplate::Qwen38 | ChatTemplate::Qwen36 + ChatTemplate::Qwen38 | ChatTemplate::Qwen36 | ChatTemplate::Qwen35 ) { return None; } diff --git a/docs/inference/evidence/q35-9b-fp8-gb10-20261031/README.md b/docs/inference/evidence/q35-9b-fp8-gb10-20261031/README.md new file mode 100644 index 00000000..9e154b80 --- /dev/null +++ b/docs/inference/evidence/q35-9b-fp8-gb10-20261031/README.md @@ -0,0 +1,44 @@ +# q35-9b FP8 serving on GB10, 2026-10-31 quiet window (CoreChip) + +Label: EXERCISED on an unqualified development build. Not QUALIFIED. + +## What ran + +- Server: `aien-serve-http` built from this branch at ab77b970ed5c132a2d62b5bedab277a8a1627ec4, + linked against omega-mv#905 `libomega_gpu.a` through `AIEN_OMEGA_GPU_LIB` (a development + override; the exact omega sha and library sha256 are in each `*/session.start`). +- Model: `~/models/qwen3.5-9b-c2022362-fp8b128`, `--max-context 8192 --max-tokens-cap 1024 --thinking off`, port 18295. +- Client: HeadToHead `bench/bench.py` at e430e23f with one change, an + `Authorization: Bearer` header (the server refuses to start without + `AIEN_SERVE_HTTP_BEARER_TOKEN`; a fresh random token per run, not recorded). + 16 prompts `prompts/decode.jsonl`, greedy, 128 tokens, concurrency 1. +- Chip route: spark-window `--gb10 none --quiet exclusive --lease 20`, the runner holds + `flock -x /tmp/aien-gb10.lock` and sets `AIEN_GB10_LOCK_HELD=1` inside it. The server verifies + an exclusive ancestor holder (`chip_reservation.rs`) and reports `Inherited`. Flint was stopped + by Main for the quiet window; no other model on the chip. +- Negative control `negctl`: the same checkpoint with 3072 bytes of shard 2 + (`model.safetensors-00002-of-00004.safetensors`, first difference at byte 50345306) altered; + sha256 of the altered shard 0165e59632a08893ed1976ff502e43e44807b40b016cde872e35a7dc2866f327. + +## Results + +| Run | window | rc | ready / load s | HTTP | outputs | +|---|---|---|---|---|---| +| clean | 20261031T081315Z-809e71 | 0 | 1 / 17 | 16 x 200 | 16 of 16 texts byte-identical to `~/handoffs/H2H9B/ours-evidence/main/agree.jsonl` (same prompts, 128 tokens) | +| negctl | 20261031T081515Z-f54001 | 0 | 1 / 12 | 16 x 200 | 0 of 16 texts equal to clean; first differing character at 0 or 4 | + +Server log (clean): decode about 22.6 tok/s per request at 128 tokens, graph chip 44.5 ms/token. +These are shared-machine figures, not a timing gate. + +## Earlier attempts in this window (not committed, kept under /tmp/corechip/e-attempt1, e-attempt2) + +1. 08:09Z: the server exited before listening: `AIEN_SERVE_HTTP_BEARER_TOKEN must be set`. +2. 08:12Z: shared window route: the server refused the chip: `AIEN_GB10_LOCK_HELD=1 but nobody + holds /tmp/aien-gb10.lock` (a shared flock does not count as a reservation). Correct refusal. + +## NOT_RUN + +- A qualified build (omega-mv#905 merged and pinned, no `AIEN_OMEGA_GPU_LIB` override). +- Timing gates and CI-equivalent value gates on the chip. + +`SHA256SUMS` covers every file in this directory except itself. diff --git a/docs/inference/evidence/q35-9b-fp8-gb10-20261031/SHA256SUMS b/docs/inference/evidence/q35-9b-fp8-gb10-20261031/SHA256SUMS new file mode 100644 index 00000000..ef8794c1 --- /dev/null +++ b/docs/inference/evidence/q35-9b-fp8-gb10-20261031/SHA256SUMS @@ -0,0 +1,25 @@ +1891e283bc7c9c7a3803622889abf9b79156ac7d67e02727394bb427f976ba25 ./clean/agree.jsonl +7f77e176732cf68072a2e08abfaa5d93a6d85afdb5371a7930adc969bf7d7d86 ./clean/client.log +51f4c5dda40fa233b4d24c524cf2125e7074fcbfbaf11a6bb167ebc743108be9 ./clean/models.json +689a1e8d1e40e23b0ae5c40e549e6a8206bb580013c679b477fd8bdacfc8c6d6 ./clean/server.log +0047fdfd45c71e501da6e494e6f6bd070875f64885cdd3ba5171b617f992e0ba ./clean/session.log +afd784087f783040eaf31683e96525d2a8f891a3db7af6aa9fdf09cf6bdbea9d ./clean/session.start +f38acdd2e6a5366f6a2f5ca50b4e7141a3449b145a6bcf64406ec93618c14651 ./negctl/agree.jsonl +e97f7aaaf4d53a20c5ab0a49d8bb9d97cee5d63dbbda3dd0bfc909c01cd1acf5 ./negctl/client.log +550d6498e8c9a417e80ca4b651b3b1959a32cfd6cf1a75a737496be8c6ceec19 ./negctl/models.json +05c945e2019b465e23a3842e71521aaa5086d702055f06ad253d2054b50db045 ./negctl/server.log +8f675776cf185cb2e0e85d8f7355056017d34429a3d3d1831c9185e6dc8b0bf0 ./negctl/session.log +5535f33459ab2b7ebca06a02fa54ec0222274a31a2d7e6ac2861233149b96bdf ./negctl/session.start +f471f5a7a3506c5ed10bbde82cc885f612c4cde3ed275904ef364556bad98164 ./q35-9b-clean.dmon +f7aeb6ebf2a035c1e09cf9f06fb4389498a936aaf69b1a0638d13f01f88842a0 ./q35-9b-clean.end +e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 ./q35-9b-clean.err +0047fdfd45c71e501da6e494e6f6bd070875f64885cdd3ba5171b617f992e0ba ./q35-9b-clean.raw +9a271f2a916b0b6ee6cecb2426f0b3206ef074578be55d9bc94f6f3fe3ab86aa ./q35-9b-clean.rc +ba67247cefb505cfd00d8ef2ff6f936089fe8e8b1613a409bf9029cf7b9b1c74 ./q35-9b-clean.start +0fdf86d9b5ad0a7f03d12ea7ee18aeffc32c1fd5b6a7e38fd49e11fc534c9ad0 ./q35-9b-negctl.dmon +fdf67053ed94b3361306d02d443bad3a4db0b55f41dc4af1b123104b77a21259 ./q35-9b-negctl.end +e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 ./q35-9b-negctl.err +8f675776cf185cb2e0e85d8f7355056017d34429a3d3d1831c9185e6dc8b0bf0 ./q35-9b-negctl.raw +9a271f2a916b0b6ee6cecb2426f0b3206ef074578be55d9bc94f6f3fe3ab86aa ./q35-9b-negctl.rc +94ad8f81e3603113d349b7276ea0ce04bf57ad45d66b75d4da7d79447265ba67 ./q35-9b-negctl.start +16b30b78a4c66ed6d65235d2a90d1aa105ffab1ae8ad565423e98dd6c005574b ./README.md diff --git a/docs/inference/evidence/q35-9b-fp8-gb10-20261031/clean/agree.jsonl b/docs/inference/evidence/q35-9b-fp8-gb10-20261031/clean/agree.jsonl new file mode 100644 index 00000000..6721dc4b --- /dev/null +++ b/docs/inference/evidence/q35-9b-fp8-gb10-20261031/clean/agree.jsonl @@ -0,0 +1,16 @@ +{"t_send": 202020.021286266, "t_first": 202020.271675894, "t_last": 202025.941169738, "chunks": 128, "text": "The invention of the printing press stands as one of the most pivotal moments in human history, fundamentally altering the trajectory of civilization, knowledge dissemination, and cultural evolution. Before its advent, the production of books was a painstaking, labor-intensive process that limited literacy to the elite and confined the spread of ideas to narrow circles. The story of the printing press is not merely a tale of mechanical innovation but a narrative of how technology can dismantle barriers to information and ignite the fires of intellectual revolution.\n\nThe origins of the concept can be traced back to ancient China, where Bi Sheng invented movable type printing using clay characters around 1040 AD", "usage": {"aien_sampling": {"greedy_tokens": 128, "kept": [], "kept_max": 0, "kept_mean": 0.0, "kept_median": 0, "kept_min": 0, "kept_single": 0, "mode": "greedy", "p_repeat": 1.0, "reply_logprob": 0.0, "sampled_tokens": 0, "seed": 0, "temperature": 0.0, "top_k": 20, "top_k_applied": false, "top_p": 1.0, "top_prob_mean": 1.0, "top_prob_min": 1.0}, "completion_tokens": 128, "prompt_tokens": 43, "total_tokens": 171}, "finish_reason": "length", "error": null, "http_status": 200, "busy_retries": 0, "arm": "OURS", "round": "clean", "metric": "agree", "rep": 0, "warmup": false, "concurrency": 1, "stream_index": 0, "batch_id": "f9322c169c49", "load1_start": 8.83, "load1_end": 9.24, "wall_utc": 1793434415.5737836, "max_tokens": 128, "prompt_id": "d00", "cell_run": "CoreChip-790-clean", "server_cpus": null, "client_cpus": null} +{"t_send": 202025.941744447, "t_first": 202026.157130283, "t_last": 202031.838159237, "chunks": 128, "text": "The formation of a river delta is one of the most spectacular and complex geological processes on Earth, representing the final chapter in the life cycle of a river. It is a dynamic landscape where the relentless flow of water from the interior of a continent meets the stillness of an ocean, a lake, or a bay. This convergence creates a unique environment characterized by the deposition of sediment, the shifting of channels, and the creation of intricate networks of waterways and wetlands. To understand how a delta forms, one must first appreciate the journey of the river itself, which acts as a massive conveyor belt, transporting tons of eroded material from its", "usage": {"aien_sampling": {"greedy_tokens": 128, "kept": [], "kept_max": 0, "kept_mean": 0.0, "kept_median": 0, "kept_min": 0, "kept_single": 0, "mode": "greedy", "p_repeat": 1.0, "reply_logprob": 0.0, "sampled_tokens": 0, "seed": 0, "temperature": 0.0, "top_k": 20, "top_k_applied": false, "top_p": 1.0, "top_prob_mean": 1.0, "top_prob_min": 1.0}, "completion_tokens": 128, "prompt_tokens": 42, "total_tokens": 170}, "finish_reason": "length", "error": null, "http_status": 200, "busy_retries": 0, "arm": "OURS", "round": "clean", "metric": "agree", "rep": 1, "warmup": false, "concurrency": 1, "stream_index": 0, "batch_id": "f115925cfcd6", "load1_start": 9.24, "load1_end": 9.38, "wall_utc": 1793434421.4944546, "max_tokens": 128, "prompt_id": "d01", "cell_run": "CoreChip-790-clean", "server_cpus": null, "client_cpus": null} +{"t_send": 202031.83891478, "t_first": 202032.07042933, "t_last": 202037.848565234, "chunks": 128, "text": "The life cycle of a star is one of the most profound and intricate narratives in the cosmos, a saga that spans billions of years and dictates the very existence of matter as we know it. Unlike living organisms on Earth, which grow, reproduce, and die within a human timeframe, a star's journey is measured in epochs, beginning in the cold, dark void of interstellar space and culminating in a spectacular finale that scatters the seeds of new life across the galaxy. This process is governed entirely by the delicate, yet powerful, balance between gravity and nuclear fusion, a cosmic dance that determines whether a star will end its days quietly or", "usage": {"aien_sampling": {"greedy_tokens": 128, "kept": [], "kept_max": 0, "kept_mean": 0.0, "kept_median": 0, "kept_min": 0, "kept_single": 0, "mode": "greedy", "p_repeat": 1.0, "reply_logprob": 0.0, "sampled_tokens": 0, "seed": 0, "temperature": 0.0, "top_k": 20, "top_k_applied": false, "top_p": 1.0, "top_prob_mean": 1.0, "top_prob_min": 1.0}, "completion_tokens": 128, "prompt_tokens": 43, "total_tokens": 171}, "finish_reason": "length", "error": null, "http_status": 200, "busy_retries": 0, "arm": "OURS", "round": "clean", "metric": "agree", "rep": 2, "warmup": false, "concurrency": 1, "stream_index": 0, "batch_id": "648c8f27a45d", "load1_start": 9.38, "load1_end": 9.51, "wall_utc": 1793434427.391509, "max_tokens": 128, "prompt_id": "d02", "cell_run": "CoreChip-790-clean", "server_cpus": null, "client_cpus": null} +{"t_send": 202037.849155752, "t_first": 202038.076356852, "t_last": 202043.900376113, "chunks": 128, "text": "The journey of building a wooden boat by hand is not merely a construction project; it is a profound dialogue between human intent and the natural world. It begins long before the first piece of timber is cut, rooted in a deep reverence for the materials that will eventually become a vessel capable of conquering the elements. Unlike modern fiberglass or steel hulls, which are often mass-produced in sterile factories, a wooden boat is born from the forest. The builder must select trees with specific grain patterns, density, and flexibility, often seeking out old-growth timber that has stood for centuries, absorbing the slow rhythm of the seasons. This initial selection process", "usage": {"aien_sampling": {"greedy_tokens": 128, "kept": [], "kept_max": 0, "kept_mean": 0.0, "kept_median": 0, "kept_min": 0, "kept_single": 0, "mode": "greedy", "p_repeat": 1.0, "reply_logprob": 0.0, "sampled_tokens": 0, "seed": 0, "temperature": 0.0, "top_k": 20, "top_k_applied": false, "top_p": 1.0, "top_prob_mean": 1.0, "top_prob_min": 1.0}, "completion_tokens": 128, "prompt_tokens": 43, "total_tokens": 171}, "finish_reason": "length", "error": null, "http_status": 200, "busy_retries": 0, "arm": "OURS", "round": "clean", "metric": "agree", "rep": 3, "warmup": false, "concurrency": 1, "stream_index": 0, "batch_id": "57eebb8a9007", "load1_start": 9.51, "load1_end": 9.63, "wall_utc": 1793434433.4018734, "max_tokens": 128, "prompt_id": "d03", "cell_run": "CoreChip-790-clean", "server_cpus": null, "client_cpus": null} +{"t_send": 202043.900960471, "t_first": 202044.125888141, "t_last": 202049.819950983, "chunks": 128, "text": "The history of global communication is punctuated by moments of profound technological leap, yet few events in the mid-19th century carry the weight of drama, desperation, and ultimate triumph quite like the laying of the first transatlantic telegraph cable. Completed in 1858, this monumental engineering feat did more than simply connect two continents; it fundamentally altered the human perception of time and space, shrinking the vast Atlantic Ocean from a barrier of weeks-long voyages into a mere conduit of seconds. Before this achievement, the exchange of news between Europe and the Americas was governed by the whims of the wind and the tides, relying", "usage": {"aien_sampling": {"greedy_tokens": 128, "kept": [], "kept_max": 0, "kept_mean": 0.0, "kept_median": 0, "kept_min": 0, "kept_single": 0, "mode": "greedy", "p_repeat": 1.0, "reply_logprob": 0.0, "sampled_tokens": 0, "seed": 0, "temperature": 0.0, "top_k": 20, "top_k_applied": false, "top_p": 1.0, "top_prob_mean": 1.0, "top_prob_min": 1.0}, "completion_tokens": 128, "prompt_tokens": 45, "total_tokens": 173}, "finish_reason": "length", "error": null, "http_status": 200, "busy_retries": 0, "arm": "OURS", "round": "clean", "metric": "agree", "rep": 4, "warmup": false, "concurrency": 1, "stream_index": 0, "batch_id": "56b08da02a11", "load1_start": 9.63, "load1_end": 10.38, "wall_utc": 1793434439.453664, "max_tokens": 128, "prompt_id": "d04", "cell_run": "CoreChip-790-clean", "server_cpus": null, "client_cpus": null} +{"t_send": 202049.820650093, "t_first": 202050.026786351, "t_last": 202055.688073191, "chunks": 128, "text": "The decision to relocate a hive is one of the most critical and complex events in the life cycle of a honeybee colony. Unlike individual insects that might wander aimlessly in search of food, the relocation of an entire colony is a highly organized, democratic process driven by the collective intelligence of the swarm. This phenomenon, known as swarming, typically occurs in late spring or early summer when the colony has grown too large for its current home, or when the queen bee has mated and is ready to establish a new territory. The journey to finding a new home is not a random flight but a sophisticated algorithm of communication, evaluation, and consensus", "usage": {"aien_sampling": {"greedy_tokens": 128, "kept": [], "kept_max": 0, "kept_mean": 0.0, "kept_median": 0, "kept_min": 0, "kept_single": 0, "mode": "greedy", "p_repeat": 1.0, "reply_logprob": 0.0, "sampled_tokens": 0, "seed": 0, "temperature": 0.0, "top_k": 20, "top_k_applied": false, "top_p": 1.0, "top_prob_mean": 1.0, "top_prob_min": 1.0}, "completion_tokens": 128, "prompt_tokens": 44, "total_tokens": 172}, "finish_reason": "length", "error": null, "http_status": 200, "busy_retries": 0, "arm": "OURS", "round": "clean", "metric": "agree", "rep": 5, "warmup": false, "concurrency": 1, "stream_index": 0, "batch_id": "9f4c2afcc295", "load1_start": 10.38, "load1_end": 11.42, "wall_utc": 1793434445.373246, "max_tokens": 128, "prompt_id": "d05", "cell_run": "CoreChip-790-clean", "server_cpus": null, "client_cpus": null} +{"t_send": 202055.688655629, "t_first": 202055.891047403, "t_last": 202061.561450049, "chunks": 128, "text": "The dawn breaks not with the chirping of birds, but with the rhythmic, heavy thud of a blacksmith's hammer striking hot iron against an anvil. In the sleepy hamlet of Oakhaven, nestled within the crooked folds of the English countryside, the morning mist still clings to the cobblestones, obscuring the thatched roofs of the cottages until the sun begins its slow ascent. This is the hour of awakening for the medieval market town, a place where the air is thick with the scent of woodsmoke, damp earth, and the promise of commerce. As the first light pierces the glo", "usage": {"aien_sampling": {"greedy_tokens": 128, "kept": [], "kept_max": 0, "kept_mean": 0.0, "kept_median": 0, "kept_min": 0, "kept_single": 0, "mode": "greedy", "p_repeat": 1.0, "reply_logprob": 0.0, "sampled_tokens": 0, "seed": 0, "temperature": 0.0, "top_k": 20, "top_k_applied": false, "top_p": 1.0, "top_prob_mean": 1.0, "top_prob_min": 1.0}, "completion_tokens": 128, "prompt_tokens": 44, "total_tokens": 172}, "finish_reason": "length", "error": null, "http_status": 200, "busy_retries": 0, "arm": "OURS", "round": "clean", "metric": "agree", "rep": 6, "warmup": false, "concurrency": 1, "stream_index": 0, "batch_id": "92c744effdbd", "load1_start": 11.42, "load1_end": 12.03, "wall_utc": 1793434451.2413273, "max_tokens": 128, "prompt_id": "d06", "cell_run": "CoreChip-790-clean", "server_cpus": null, "client_cpus": null} +{"t_send": 202061.562236312, "t_first": 202061.764453652, "t_last": 202067.411115535, "chunks": 128, "text": "The bicycle stands as one of the most elegant and efficient machines ever conceived by human engineering, a testament to the seamless integration of classical mechanics and material science. At its core, the bicycle is a study in the conservation of energy and the manipulation of forces, allowing a rider to traverse distances with a fraction of the effort required by a horse or a motor vehicle. To understand the physics of a bicycle is to explore the delicate balance between rotational dynamics, friction, aerodynamics, and the structural integrity of its components. It is a machine that defies the intuitive notion that heavier is always better, instead relying on the principles of leverage and momentum to", "usage": {"aien_sampling": {"greedy_tokens": 128, "kept": [], "kept_max": 0, "kept_mean": 0.0, "kept_median": 0, "kept_min": 0, "kept_single": 0, "mode": "greedy", "p_repeat": 1.0, "reply_logprob": 0.0, "sampled_tokens": 0, "seed": 0, "temperature": 0.0, "top_k": 20, "top_k_applied": false, "top_p": 1.0, "top_prob_mean": 1.0, "top_prob_min": 1.0}, "completion_tokens": 128, "prompt_tokens": 42, "total_tokens": 170}, "finish_reason": "length", "error": null, "http_status": 200, "busy_retries": 0, "arm": "OURS", "round": "clean", "metric": "agree", "rep": 7, "warmup": false, "concurrency": 1, "stream_index": 0, "batch_id": "cd0b03ca4f09", "load1_start": 12.03, "load1_end": 12.51, "wall_utc": 1793434457.1148052, "max_tokens": 128, "prompt_id": "d07", "cell_run": "CoreChip-790-clean", "server_cpus": null, "client_cpus": null} +{"t_send": 202067.411872358, "t_first": 202067.615612528, "t_last": 202073.265271791, "chunks": 128, "text": "The transformation of a rugged mountain landscape into a serene, U-shaped valley is one of the most profound geological processes on Earth, driven almost entirely by the slow, relentless power of glaciers. While rivers and wind are constant agents of erosion, they typically carve out narrow, V-shaped channels that reflect the efficiency of flowing water cutting downward. In contrast, glaciers act as massive, mobile sculptors, grinding away at bedrock and plucking chunks of stone to reshape the very topography of the land. This process, known as glacial erosion, is not merely a matter of wearing down rock; it is a dynamic interaction between ice, gravity,", "usage": {"aien_sampling": {"greedy_tokens": 128, "kept": [], "kept_max": 0, "kept_mean": 0.0, "kept_median": 0, "kept_min": 0, "kept_single": 0, "mode": "greedy", "p_repeat": 1.0, "reply_logprob": 0.0, "sampled_tokens": 0, "seed": 0, "temperature": 0.0, "top_k": 20, "top_k_applied": false, "top_p": 1.0, "top_prob_mean": 1.0, "top_prob_min": 1.0}, "completion_tokens": 128, "prompt_tokens": 41, "total_tokens": 169}, "finish_reason": "length", "error": null, "http_status": 200, "busy_retries": 0, "arm": "OURS", "round": "clean", "metric": "agree", "rep": 8, "warmup": false, "concurrency": 1, "stream_index": 0, "batch_id": "8a1d3a750b5a", "load1_start": 12.51, "load1_end": 13.03, "wall_utc": 1793434462.9644482, "max_tokens": 128, "prompt_id": "d08", "cell_run": "CoreChip-790-clean", "server_cpus": null, "client_cpus": null} +{"t_send": 202073.265984454, "t_first": 202073.475051586, "t_last": 202079.140150652, "chunks": 128, "text": "The invention of the mechanical clock stands as one of the most profound milestones in human history, marking a decisive shift from the fluid, natural rhythms of timekeeping to the rigid, quantifiable precision of human engineering. Before the advent of the mechanical clock, humanity relied on celestial bodies, the movement of shadows, and the burning of candles or water clocks to measure the passage of hours. These methods were inherently tied to the environment; they were unreliable at night, during cloudy weather, or in the absence of sunlight. The transition to a device that could operate independently of the sun, driven solely by internal mechanics, fundamentally altered not only how societies organized", "usage": {"aien_sampling": {"greedy_tokens": 128, "kept": [], "kept_max": 0, "kept_mean": 0.0, "kept_median": 0, "kept_min": 0, "kept_single": 0, "mode": "greedy", "p_repeat": 1.0, "reply_logprob": 0.0, "sampled_tokens": 0, "seed": 0, "temperature": 0.0, "top_k": 20, "top_k_applied": false, "top_p": 1.0, "top_prob_mean": 1.0, "top_prob_min": 1.0}, "completion_tokens": 128, "prompt_tokens": 43, "total_tokens": 171}, "finish_reason": "length", "error": null, "http_status": 200, "busy_retries": 0, "arm": "OURS", "round": "clean", "metric": "agree", "rep": 9, "warmup": false, "concurrency": 1, "stream_index": 0, "batch_id": "4101a96104ec", "load1_start": 13.03, "load1_end": 13.42, "wall_utc": 1793434468.8186126, "max_tokens": 128, "prompt_id": "d09", "cell_run": "CoreChip-790-clean", "server_cpus": null, "client_cpus": null} +{"t_send": 202079.140716913, "t_first": 202079.34932865, "t_last": 202085.017354679, "chunks": 128, "text": "The winter in the North Atlantic does not merely arrive; it besieges. For Elias Thorne, the keeper of the Blackwood Reef Light, the season was not a passage of time but a state of being, a relentless siege that tested the very limits of human endurance against the indifferent fury of the ocean. His world had shrunk to the dimensions of the lantern room and the spiral staircase leading down to the fog signal, a stark, iron-bound existence where the only constants were the freezing wind, the biting cold, and the rhythmic, hypnotic pulse of the great Fresnel lens rotating above him. Outside, the sea was a", "usage": {"aien_sampling": {"greedy_tokens": 128, "kept": [], "kept_max": 0, "kept_mean": 0.0, "kept_median": 0, "kept_min": 0, "kept_single": 0, "mode": "greedy", "p_repeat": 1.0, "reply_logprob": 0.0, "sampled_tokens": 0, "seed": 0, "temperature": 0.0, "top_k": 20, "top_k_applied": false, "top_p": 1.0, "top_prob_mean": 1.0, "top_prob_min": 1.0}, "completion_tokens": 128, "prompt_tokens": 43, "total_tokens": 171}, "finish_reason": "length", "error": null, "http_status": 200, "busy_retries": 0, "arm": "OURS", "round": "clean", "metric": "agree", "rep": 10, "warmup": false, "concurrency": 1, "stream_index": 0, "batch_id": "1a155032402b", "load1_start": 13.42, "load1_end": 13.79, "wall_utc": 1793434474.6934364, "max_tokens": 128, "prompt_id": "d10", "cell_run": "CoreChip-790-clean", "server_cpus": null, "client_cpus": null} +{"t_send": 202085.01804435, "t_first": 202085.218600777, "t_last": 202090.883813635, "chunks": 128, "text": "The formation of coral reefs is one of the most remarkable biological engineering feats on Earth, a process that transforms the barren, sun-drenched expanses of the ocean floor into some of the most biodiverse and structurally complex ecosystems in existence. At the heart of this phenomenon lies a symbiotic relationship between tiny marine invertebrates known as corals and microscopic algae called zooxanthellae. While the individual coral polyps are often no larger than a grain of rice, their collective growth over millennia creates massive structures that can rise hundreds of feet above the sea surface, providing habitats for a quarter of all marine species. Understanding how these reefs", "usage": {"aien_sampling": {"greedy_tokens": 128, "kept": [], "kept_max": 0, "kept_mean": 0.0, "kept_median": 0, "kept_min": 0, "kept_single": 0, "mode": "greedy", "p_repeat": 1.0, "reply_logprob": 0.0, "sampled_tokens": 0, "seed": 0, "temperature": 0.0, "top_k": 20, "top_k_applied": false, "top_p": 1.0, "top_prob_mean": 1.0, "top_prob_min": 1.0}, "completion_tokens": 128, "prompt_tokens": 41, "total_tokens": 169}, "finish_reason": "length", "error": null, "http_status": 200, "busy_retries": 0, "arm": "OURS", "round": "clean", "metric": "agree", "rep": 11, "warmup": false, "concurrency": 1, "stream_index": 0, "batch_id": "0774b1f83802", "load1_start": 13.79, "load1_end": 14.36, "wall_utc": 1793434480.5707295, "max_tokens": 128, "prompt_id": "d11", "cell_run": "CoreChip-790-clean", "server_cpus": null, "client_cpus": null} +{"t_send": 202090.884910381, "t_first": 202091.09512546, "t_last": 202096.749208219, "chunks": 128, "text": "The Roman aqueduct stands as one of the most enduring testaments to human engineering ingenuity, a monumental feat that transcended its utilitarian purpose to become a symbol of imperial power and civic pride. While often romanticized in popular culture as towering stone arches spanning vast valleys, the true genius of Roman water management lay not merely in the visible structures, but in the sophisticated integration of gravity-fed hydraulics, precise surveying, and durable construction techniques. These systems were designed to transport fresh water from distant sources, often miles away from urban centers, to supply public baths, fountains, private villas, and industrial processes, fundamentally transforming", "usage": {"aien_sampling": {"greedy_tokens": 128, "kept": [], "kept_max": 0, "kept_mean": 0.0, "kept_median": 0, "kept_min": 0, "kept_single": 0, "mode": "greedy", "p_repeat": 1.0, "reply_logprob": 0.0, "sampled_tokens": 0, "seed": 0, "temperature": 0.0, "top_k": 20, "top_k_applied": false, "top_p": 1.0, "top_prob_mean": 1.0, "top_prob_min": 1.0}, "completion_tokens": 128, "prompt_tokens": 44, "total_tokens": 172}, "finish_reason": "length", "error": null, "http_status": 200, "busy_retries": 0, "arm": "OURS", "round": "clean", "metric": "agree", "rep": 12, "warmup": false, "concurrency": 1, "stream_index": 0, "batch_id": "689a4a3c3f14", "load1_start": 14.36, "load1_end": 14.65, "wall_utc": 1793434486.4375753, "max_tokens": 128, "prompt_id": "d12", "cell_run": "CoreChip-790-clean", "server_cpus": null, "client_cpus": null} +{"t_send": 202096.749902834, "t_first": 202096.957893507, "t_last": 202102.616537614, "chunks": 128, "text": "The journey along the Silk Road was never a single, continuous path, but rather a vast, shifting network of caravan tracks that stitched together the disparate civilizations of Eurasia, stretching from the misty peaks of the Pamir Mountains to the bustling ports of the Mediterranean. To traverse this ancient artery was to step into a world where the boundaries of geography dissolved into a tapestry of culture, religion, and commerce. It was a perilous undertaking that demanded not only physical endurance but also a profound adaptability, as travelers moved from the arid deserts of Central Asia to the lush oases of the Tarim Basin, and from the frozen", "usage": {"aien_sampling": {"greedy_tokens": 128, "kept": [], "kept_max": 0, "kept_mean": 0.0, "kept_median": 0, "kept_min": 0, "kept_single": 0, "mode": "greedy", "p_repeat": 1.0, "reply_logprob": 0.0, "sampled_tokens": 0, "seed": 0, "temperature": 0.0, "top_k": 20, "top_k_applied": false, "top_p": 1.0, "top_prob_mean": 1.0, "top_prob_min": 1.0}, "completion_tokens": 128, "prompt_tokens": 43, "total_tokens": 171}, "finish_reason": "length", "error": null, "http_status": 200, "busy_retries": 0, "arm": "OURS", "round": "clean", "metric": "agree", "rep": 13, "warmup": false, "concurrency": 1, "stream_index": 0, "batch_id": "169f5e280da2", "load1_start": 14.65, "load1_end": 15.08, "wall_utc": 1793434492.3025694, "max_tokens": 128, "prompt_id": "d13", "cell_run": "CoreChip-790-clean", "server_cpus": null, "client_cpus": null} +{"t_send": 202102.617134868, "t_first": 202102.80976133, "t_last": 202108.556753729, "chunks": 128, "text": "The formation of volcanic islands is one of the most dramatic and transformative processes in the Earth's geological history, representing a continuous battle between the planet's molten interior and its solid crust. These islands are not merely random accumulations of rock floating on the ocean; they are the visible crowns of immense geological engines that have been active for millions of years. The story of how a barren stretch of ocean floor becomes a lush, habitable landmass is a tale of immense pressure, superheated magma, and the relentless force of nature reshaping the globe. It begins deep within the Earth, where the tectonic plates that form the", "usage": {"aien_sampling": {"greedy_tokens": 128, "kept": [], "kept_max": 0, "kept_mean": 0.0, "kept_median": 0, "kept_min": 0, "kept_single": 0, "mode": "greedy", "p_repeat": 1.0, "reply_logprob": 0.0, "sampled_tokens": 0, "seed": 0, "temperature": 0.0, "top_k": 20, "top_k_applied": false, "top_p": 1.0, "top_prob_mean": 1.0, "top_prob_min": 1.0}, "completion_tokens": 128, "prompt_tokens": 43, "total_tokens": 171}, "finish_reason": "length", "error": null, "http_status": 200, "busy_retries": 0, "arm": "OURS", "round": "clean", "metric": "agree", "rep": 14, "warmup": false, "concurrency": 1, "stream_index": 0, "batch_id": "aa4fe5ae413a", "load1_start": 15.08, "load1_end": 15.87, "wall_utc": 1793434498.1698399, "max_tokens": 128, "prompt_id": "d14", "cell_run": "CoreChip-790-clean", "server_cpus": null, "client_cpus": null} +{"t_send": 202108.557349206, "t_first": 202108.787962783, "t_last": 202114.528366534, "chunks": 128, "text": "The history of paper money is a fascinating journey through human ingenuity, economic necessity, and the evolution of trust. Long before the first bill was printed, commerce relied on tangible commodities like cattle, grain, or precious metals. These early forms of currency were heavy, difficult to transport, and prone to degradation. The transition from barter and metal coinage to paper represented a monumental shift in how societies valued exchange, moving from the intrinsic worth of the material to the abstract concept of credit and government authority. This transformation did not happen overnight but evolved over centuries, driven by the practical needs of merchants and the administrative ambitions of empires.\n\n", "usage": {"aien_sampling": {"greedy_tokens": 128, "kept": [], "kept_max": 0, "kept_mean": 0.0, "kept_median": 0, "kept_min": 0, "kept_single": 0, "mode": "greedy", "p_repeat": 1.0, "reply_logprob": 0.0, "sampled_tokens": 0, "seed": 0, "temperature": 0.0, "top_k": 20, "top_k_applied": false, "top_p": 1.0, "top_prob_mean": 1.0, "top_prob_min": 1.0}, "completion_tokens": 128, "prompt_tokens": 42, "total_tokens": 170}, "finish_reason": "length", "error": null, "http_status": 200, "busy_retries": 0, "arm": "OURS", "round": "clean", "metric": "agree", "rep": 15, "warmup": false, "concurrency": 1, "stream_index": 0, "batch_id": "9d0c3f013269", "load1_start": 15.87, "load1_end": 16.68, "wall_utc": 1793434504.1100614, "max_tokens": 128, "prompt_id": "d15", "cell_run": "CoreChip-790-clean", "server_cpus": null, "client_cpus": null} diff --git a/docs/inference/evidence/q35-9b-fp8-gb10-20261031/clean/models.json b/docs/inference/evidence/q35-9b-fp8-gb10-20261031/clean/models.json new file mode 100644 index 00000000..d3e58550 --- /dev/null +++ b/docs/inference/evidence/q35-9b-fp8-gb10-20261031/clean/models.json @@ -0,0 +1 @@ +{"object":"list","data":[{"id":"q35-9b-fp8","object":"model","created":1793434415,"owned_by":"aien/omega-qwen38"}]} \ No newline at end of file diff --git a/docs/inference/evidence/q35-9b-fp8-gb10-20261031/clean/session.start b/docs/inference/evidence/q35-9b-fp8-gb10-20261031/clean/session.start new file mode 100644 index 00000000..aebf4ae6 --- /dev/null +++ b/docs/inference/evidence/q35-9b-fp8-gb10-20261031/clean/session.start @@ -0,0 +1,11 @@ +start 2026-10-31T08:13:18Z window 20261031T081315Z-809e71 gb10_lock_held 1 +sc commit ab77b970ed5c132a2d62b5bedab277a8a1627ec4 +binary /tmp/corechip/t790/release/aien-serve-http sha256 47cb6117e9a37a6ed7b854ff87637564adf8b2a69c99ca91a28b3b63c4ebfaa3 +omega /tmp/corechip/omega905 at d7f1bff90f7e7a449c50ba18ba3859d1f6d9f0cf (omega-mv#905 head), libomega_gpu.a sha256 56da02a36f70b6b388974cb342bf80e586fb656983f9d81e61b568dbb5a434e1, linked as AIEN_OMEGA_GPU_LIB (development override, not a qualified build) +model /home/drakestapleton/models/qwen3.5-9b-c2022362-fp8b128 bytes 12394969960 admission need_kB 45180445 MemAvailable_kB 100783612 +cmd /tmp/corechip/t790/release/aien-serve-http --engine omega --model-dir /home/drakestapleton/models/qwen3.5-9b-c2022362-fp8b128 --model-id q35-9b-fp8 --max-context 8192 --max-tokens-cap 1024 --thinking off --bind 127.0.0.1 --port 18295 +client python3 /home/drakestapleton/handoffs/HeadToHead/repo/bench/bench.py --port 18295 --model q35-9b-fp8 --arm OURS --round clean --metric agree --prompts /home/drakestapleton/handoffs/HeadToHead/repo/prompts/decode.jsonl --concurrency 1 --max-tokens 128 --warmup 0 --reps 16 +pid, process_name, used_gpu_memory [MiB] +name, driver_version, utilization.gpu [%], temperature.gpu, power.draw [W], pstate +NVIDIA GB10, 580.173.02, 0 %, 52, 5.94 W, P8 +client script /tmp/corechip/bench-auth.py sha256 ebd9490a149315bf5f5c6437617fba18093f3843bb8469094be7f2695474e992: HeadToHead bench/bench.py at e430e23f plus one change, an Authorization: Bearer header from AIEN_SERVE_HTTP_BEARER_TOKEN diff --git a/docs/inference/evidence/q35-9b-fp8-gb10-20261031/negctl/agree.jsonl b/docs/inference/evidence/q35-9b-fp8-gb10-20261031/negctl/agree.jsonl new file mode 100644 index 00000000..8b2ae58c --- /dev/null +++ b/docs/inference/evidence/q35-9b-fp8-gb10-20261031/negctl/agree.jsonl @@ -0,0 +1,16 @@ +{"t_send": 202410.113959773, "t_first": 202410.358075818, "t_last": 202416.100702591, "chunks": 128, "text": "The history of the printing press stands as one of the most transformative chapters in human civilization, marking a definitive shift from the medieval era to the modern age. Before its invention, the dissemination of knowledge was a slow, arduous, and exclusive process dominated by hand-copying. For centuries, the scribe in a scriptorium was the sole architect of information, laboriously reproducing texts by hand. This method not only resulted in high costs and limited availability but also introduced inevitable human errors, meaning that every copy of a book was unique and potentially flawed. The invention of the movable type printing press by Johannes Gutenberg in the mid-1", "usage": {"aien_sampling": {"greedy_tokens": 128, "kept": [], "kept_max": 0, "kept_mean": 0.0, "kept_median": 0, "kept_min": 0, "kept_single": 0, "mode": "greedy", "p_repeat": 1.0, "reply_logprob": 0.0, "sampled_tokens": 0, "seed": 0, "temperature": 0.0, "top_k": 20, "top_k_applied": false, "top_p": 1.0, "top_prob_mean": 1.0, "top_prob_min": 1.0}, "completion_tokens": 128, "prompt_tokens": 43, "total_tokens": 171}, "finish_reason": "length", "error": null, "http_status": 200, "busy_retries": 0, "arm": "OURS", "round": "negctl", "metric": "agree", "rep": 0, "warmup": false, "concurrency": 1, "stream_index": 0, "batch_id": "1b829dc328cf", "load1_start": 11.14, "load1_end": 11.17, "wall_utc": 1793434805.6663597, "max_tokens": 128, "prompt_id": "d00", "cell_run": "CoreChip-790-negctl", "server_cpus": null, "client_cpus": null} +{"t_send": 202416.101269797, "t_first": 202416.345643443, "t_last": 202422.045146716, "chunks": 128, "text": "The formation of a river delta is one of the most spectacular and dynamic geological processes on Earth, representing the final chapter in the journey of a river from its mountainous source to the vast expanse of the ocean. A delta is essentially a landform created by the deposition of sediment that occurs as a river flows into another body of water, such as a lake, a bay, an ocean, or another river. This process is driven by the fundamental principle of sediment transport and the sudden change in the river's energy levels upon entering a standing body of water. As the river approaches its mouth, its velocity decreases significantly because the gradient flattens", "usage": {"aien_sampling": {"greedy_tokens": 128, "kept": [], "kept_max": 0, "kept_mean": 0.0, "kept_median": 0, "kept_min": 0, "kept_single": 0, "mode": "greedy", "p_repeat": 1.0, "reply_logprob": 0.0, "sampled_tokens": 0, "seed": 0, "temperature": 0.0, "top_k": 20, "top_k_applied": false, "top_p": 1.0, "top_prob_mean": 1.0, "top_prob_min": 1.0}, "completion_tokens": 128, "prompt_tokens": 42, "total_tokens": 170}, "finish_reason": "length", "error": null, "http_status": 200, "busy_retries": 0, "arm": "OURS", "round": "negctl", "metric": "agree", "rep": 1, "warmup": false, "concurrency": 1, "stream_index": 0, "batch_id": "ffa5829aa719", "load1_start": 11.17, "load1_end": 10.59, "wall_utc": 1793434811.653965, "max_tokens": 128, "prompt_id": "d01", "cell_run": "CoreChip-790-negctl", "server_cpus": null, "client_cpus": null} +{"t_send": 202422.045750657, "t_first": 202422.284678892, "t_last": 202427.994462961, "chunks": 128, "text": "The life cycle of a star is one of the most magnificent and complex narratives in the universe, a cosmic saga that spans billions of years and dictates the very existence of matter as we know it. This journey begins in the cold, dark void of interstellar space, where vast clouds of gas and dust, known as nebulae, drift silently. These nebulae are primarily composed of hydrogen and helium, the primordial elements forged in the Big Bang, but they also contain trace amounts of heavier elements left over from previous generations of stars. Gravity, the invisible architect of the cosmos, begins its work by pulling these particles together. As the", "usage": {"aien_sampling": {"greedy_tokens": 128, "kept": [], "kept_max": 0, "kept_mean": 0.0, "kept_median": 0, "kept_min": 0, "kept_single": 0, "mode": "greedy", "p_repeat": 1.0, "reply_logprob": 0.0, "sampled_tokens": 0, "seed": 0, "temperature": 0.0, "top_k": 20, "top_k_applied": false, "top_p": 1.0, "top_prob_mean": 1.0, "top_prob_min": 1.0}, "completion_tokens": 128, "prompt_tokens": 43, "total_tokens": 171}, "finish_reason": "length", "error": null, "http_status": 200, "busy_retries": 0, "arm": "OURS", "round": "negctl", "metric": "agree", "rep": 2, "warmup": false, "concurrency": 1, "stream_index": 0, "batch_id": "43ed70125fec", "load1_start": 10.59, "load1_end": 10.63, "wall_utc": 1793434817.5984273, "max_tokens": 128, "prompt_id": "d02", "cell_run": "CoreChip-790-negctl", "server_cpus": null, "client_cpus": null} +{"t_send": 202427.995092727, "t_first": 202428.199820734, "t_last": 202433.966172455, "chunks": 128, "text": "The journey of building a wooden boat by hand is not merely a construction project; it is a profound dialogue between human ingenuity and the natural world. It is a process that demands patience, reverence for materials, and a deep understanding of the physics of water. Unlike modern fiberglass or steel vessels, which are often mass-produced in factories with a focus on speed and uniformity, a hand-built wooden boat is a unique artifact, shaped by the specific grain of the timber and the steady rhythm of the builder's hands. The endeavor begins long before the first plank is laid, in the quiet contemplation of design and the careful selection of materials.", "usage": {"aien_sampling": {"greedy_tokens": 128, "kept": [], "kept_max": 0, "kept_mean": 0.0, "kept_median": 0, "kept_min": 0, "kept_single": 0, "mode": "greedy", "p_repeat": 1.0, "reply_logprob": 0.0, "sampled_tokens": 0, "seed": 0, "temperature": 0.0, "top_k": 20, "top_k_applied": false, "top_p": 1.0, "top_prob_mean": 1.0, "top_prob_min": 1.0}, "completion_tokens": 128, "prompt_tokens": 43, "total_tokens": 171}, "finish_reason": "length", "error": null, "http_status": 200, "busy_retries": 0, "arm": "OURS", "round": "negctl", "metric": "agree", "rep": 3, "warmup": false, "concurrency": 1, "stream_index": 0, "batch_id": "eb00ed84bc5b", "load1_start": 10.63, "load1_end": 10.82, "wall_utc": 1793434823.54779, "max_tokens": 128, "prompt_id": "d03", "cell_run": "CoreChip-790-negctl", "server_cpus": null, "client_cpus": null} +{"t_send": 202433.966829069, "t_first": 202434.171458354, "t_last": 202439.886489473, "chunks": 128, "text": "The laying of the first transatlantic telegraph cable stands as one of the most audacious engineering feats in human history, a monumental achievement that fundamentally altered the course of global communication and geopolitics. Completed in 1858, this endeavor was not merely a technical triumph but a testament to the relentless human drive to shrink the world, connecting the two great landmasses of the Atlantic Ocean with an invisible thread of copper and gutta-percha. Before this innovation, the only means of crossing the Atlantic were the slow, perilous journeys of steamships, which could take weeks to traverse the distance. The dream of an instantaneous", "usage": {"aien_sampling": {"greedy_tokens": 128, "kept": [], "kept_max": 0, "kept_mean": 0.0, "kept_median": 0, "kept_min": 0, "kept_single": 0, "mode": "greedy", "p_repeat": 1.0, "reply_logprob": 0.0, "sampled_tokens": 0, "seed": 0, "temperature": 0.0, "top_k": 20, "top_k_applied": false, "top_p": 1.0, "top_prob_mean": 1.0, "top_prob_min": 1.0}, "completion_tokens": 128, "prompt_tokens": 45, "total_tokens": 173}, "finish_reason": "length", "error": null, "http_status": 200, "busy_retries": 0, "arm": "OURS", "round": "negctl", "metric": "agree", "rep": 4, "warmup": false, "concurrency": 1, "stream_index": 0, "batch_id": "069ba35fb690", "load1_start": 10.82, "load1_end": 10.99, "wall_utc": 1793434829.5194952, "max_tokens": 128, "prompt_id": "d04", "cell_run": "CoreChip-790-negctl", "server_cpus": null, "client_cpus": null} +{"t_send": 202439.887263192, "t_first": 202440.128871356, "t_last": 202445.807631358, "chunks": 128, "text": "The selection of a new hive site by honeybees is one of the most complex, collaborative, and biologically sophisticated behaviors in the animal kingdom. It is a process that requires the collective intelligence of thousands of individuals, blending individual sensory capabilities with a democratic decision-making system that rivals the most advanced human algorithms. This phenomenon, known as swarming, occurs typically in late spring or early summer when a colony has grown too large for its current home, necessitating the search for a new residence that can support the expanding population and ensure the survival of the species. The journey begins not with a random flight, but with a highly organized departure from", "usage": {"aien_sampling": {"greedy_tokens": 128, "kept": [], "kept_max": 0, "kept_mean": 0.0, "kept_median": 0, "kept_min": 0, "kept_single": 0, "mode": "greedy", "p_repeat": 1.0, "reply_logprob": 0.0, "sampled_tokens": 0, "seed": 0, "temperature": 0.0, "top_k": 20, "top_k_applied": false, "top_p": 1.0, "top_prob_mean": 1.0, "top_prob_min": 1.0}, "completion_tokens": 128, "prompt_tokens": 44, "total_tokens": 172}, "finish_reason": "length", "error": null, "http_status": 200, "busy_retries": 0, "arm": "OURS", "round": "negctl", "metric": "agree", "rep": 5, "warmup": false, "concurrency": 1, "stream_index": 0, "batch_id": "128b8066df8e", "load1_start": 10.99, "load1_end": 11.15, "wall_utc": 1793434835.4398248, "max_tokens": 128, "prompt_id": "d05", "cell_run": "CoreChip-790-negctl", "server_cpus": null, "client_cpus": null} +{"t_send": 202445.808384709, "t_first": 202446.030147852, "t_last": 202451.788075513, "chunks": 128, "text": "The dawn breaks not with the chirping of birds, but with the rhythmic clatter of hooves on cobblestones and the lowing of cattle in the muddy yards surrounding the town square. In the medieval market town of Oakhaven, the morning mist still clings to the thatched roofs of the timber-framed houses, obscuring the spire of the local church until the sun begins its slow ascent. The air is thick with the scent of damp earth, woodsmoke, and the sharp, metallic tang of iron being forged in the blacksmith's forge just off the main street. As the first light pierces the", "usage": {"aien_sampling": {"greedy_tokens": 128, "kept": [], "kept_max": 0, "kept_mean": 0.0, "kept_median": 0, "kept_min": 0, "kept_single": 0, "mode": "greedy", "p_repeat": 1.0, "reply_logprob": 0.0, "sampled_tokens": 0, "seed": 0, "temperature": 0.0, "top_k": 20, "top_k_applied": false, "top_p": 1.0, "top_prob_mean": 1.0, "top_prob_min": 1.0}, "completion_tokens": 128, "prompt_tokens": 44, "total_tokens": 172}, "finish_reason": "length", "error": null, "http_status": 200, "busy_retries": 0, "arm": "OURS", "round": "negctl", "metric": "agree", "rep": 6, "warmup": false, "concurrency": 1, "stream_index": 0, "batch_id": "58837904c0e2", "load1_start": 11.15, "load1_end": 11.3, "wall_utc": 1793434841.3609796, "max_tokens": 128, "prompt_id": "d06", "cell_run": "CoreChip-790-negctl", "server_cpus": null, "client_cpus": null} +{"t_send": 202451.788730048, "t_first": 202451.9975219, "t_last": 202457.739795952, "chunks": 128, "text": "The bicycle stands as one of the most elegant and efficient machines ever conceived by human engineering, a testament to the seamless integration of classical mechanics and material science. At its core, the bicycle is a study in the conservation of energy and the transmission of force, transforming the chemical energy stored in the rider's muscles into kinetic energy that propels the vehicle forward with remarkable economy. To understand the physics of a bicycle is to understand how leverage, friction, rotational dynamics, and aerodynamics converge to create a mode of transport that defies the complexity of modern automobiles while maintaining a simplicity that belies its sophistication.\n\nThe fundamental mechanism of propulsion relies on", "usage": {"aien_sampling": {"greedy_tokens": 128, "kept": [], "kept_max": 0, "kept_mean": 0.0, "kept_median": 0, "kept_min": 0, "kept_single": 0, "mode": "greedy", "p_repeat": 1.0, "reply_logprob": 0.0, "sampled_tokens": 0, "seed": 0, "temperature": 0.0, "top_k": 20, "top_k_applied": false, "top_p": 1.0, "top_prob_mean": 1.0, "top_prob_min": 1.0}, "completion_tokens": 128, "prompt_tokens": 42, "total_tokens": 170}, "finish_reason": "length", "error": null, "http_status": 200, "busy_retries": 0, "arm": "OURS", "round": "negctl", "metric": "agree", "rep": 7, "warmup": false, "concurrency": 1, "stream_index": 0, "batch_id": "6cc05d88bf0a", "load1_start": 11.3, "load1_end": 11.51, "wall_utc": 1793434847.341398, "max_tokens": 128, "prompt_id": "d07", "cell_run": "CoreChip-790-negctl", "server_cpus": null, "client_cpus": null} +{"t_send": 202457.740524407, "t_first": 202457.953582315, "t_last": 202463.657414975, "chunks": 128, "text": "The formation of glacial valleys represents one of the most dramatic and transformative geological processes on Earth, sculpting landscapes with a slow, relentless, and powerful force that dwarfs the work of wind or water. While rivers carve out V-shaped valleys through the erosive power of flowing water cutting downward into bedrock, glaciers act as massive, grinding saws that widen, deepen, and straighten these channels, creating the distinctive U-shaped troughs that define many mountain ranges today. This process, known as glacial erosion, is not merely a matter of volume but of mechanics; the immense weight of ice combined with its basal movement creates a unique", "usage": {"aien_sampling": {"greedy_tokens": 128, "kept": [], "kept_max": 0, "kept_mean": 0.0, "kept_median": 0, "kept_min": 0, "kept_single": 0, "mode": "greedy", "p_repeat": 1.0, "reply_logprob": 0.0, "sampled_tokens": 0, "seed": 0, "temperature": 0.0, "top_k": 20, "top_k_applied": false, "top_p": 1.0, "top_prob_mean": 1.0, "top_prob_min": 1.0}, "completion_tokens": 128, "prompt_tokens": 41, "total_tokens": 169}, "finish_reason": "length", "error": null, "http_status": 200, "busy_retries": 0, "arm": "OURS", "round": "negctl", "metric": "agree", "rep": 8, "warmup": false, "concurrency": 1, "stream_index": 0, "batch_id": "4f011778b1b7", "load1_start": 11.51, "load1_end": 10.99, "wall_utc": 1793434853.2931721, "max_tokens": 128, "prompt_id": "d08", "cell_run": "CoreChip-790-negctl", "server_cpus": null, "client_cpus": null} +{"t_send": 202463.658028325, "t_first": 202463.859430746, "t_last": 202469.567272944, "chunks": 128, "text": "The invention of the mechanical clock stands as one of the most profound milestones in human history, marking a decisive shift from the fluid, observational measurement of time to a rigid, quantifiable discipline. Before the advent of mechanical timekeeping, humanity relied almost exclusively on natural phenomena to gauge the passage of hours. The sun, the moon, and the stars provided a reliable but continuous and unsegmented flow of time. In ancient civilizations, sundials offered precision only during daylight hours, while water clocks (clepsydrae) and candle clocks provided rough estimates that were heavily susceptible to environmental variables such as temperature, humidity, and fuel consumption. It", "usage": {"aien_sampling": {"greedy_tokens": 128, "kept": [], "kept_max": 0, "kept_mean": 0.0, "kept_median": 0, "kept_min": 0, "kept_single": 0, "mode": "greedy", "p_repeat": 1.0, "reply_logprob": 0.0, "sampled_tokens": 0, "seed": 0, "temperature": 0.0, "top_k": 20, "top_k_applied": false, "top_p": 1.0, "top_prob_mean": 1.0, "top_prob_min": 1.0}, "completion_tokens": 128, "prompt_tokens": 43, "total_tokens": 171}, "finish_reason": "length", "error": null, "http_status": 200, "busy_retries": 0, "arm": "OURS", "round": "negctl", "metric": "agree", "rep": 9, "warmup": false, "concurrency": 1, "stream_index": 0, "batch_id": "ce873db7e6ee", "load1_start": 10.99, "load1_end": 10.99, "wall_utc": 1793434859.2106903, "max_tokens": 128, "prompt_id": "d09", "cell_run": "CoreChip-790-negctl", "server_cpus": null, "client_cpus": null} +{"t_send": 202469.567897078, "t_first": 202469.793180158, "t_last": 202475.588966129, "chunks": 128, "text": "The winter at Blackwood Point is not merely a season; it is a relentless, freezing adversary that tests the resolve of anyone foolish enough to call the lighthouse home. For Elias, the keeper, the arrival of the first snowflake was not a moment of poetic beauty but the opening salvo of a siege that would last for months. The air outside the lantern room grew heavy and sharp, biting through wool and leather alike, carrying the scent of salt, ice, and the deep, metallic tang of the ocean trying to reclaim the land. As the days shortened and the nights stretched into an endless, starless gray, the rhythm of Elias", "usage": {"aien_sampling": {"greedy_tokens": 128, "kept": [], "kept_max": 0, "kept_mean": 0.0, "kept_median": 0, "kept_min": 0, "kept_single": 0, "mode": "greedy", "p_repeat": 1.0, "reply_logprob": 0.0, "sampled_tokens": 0, "seed": 0, "temperature": 0.0, "top_k": 20, "top_k_applied": false, "top_p": 1.0, "top_prob_mean": 1.0, "top_prob_min": 1.0}, "completion_tokens": 128, "prompt_tokens": 43, "total_tokens": 171}, "finish_reason": "length", "error": null, "http_status": 200, "busy_retries": 0, "arm": "OURS", "round": "negctl", "metric": "agree", "rep": 10, "warmup": false, "concurrency": 1, "stream_index": 0, "batch_id": "7a6f5192dbde", "load1_start": 10.99, "load1_end": 11.14, "wall_utc": 1793434865.1205115, "max_tokens": 128, "prompt_id": "d10", "cell_run": "CoreChip-790-negctl", "server_cpus": null, "client_cpus": null} +{"t_send": 202475.589715929, "t_first": 202475.814798382, "t_last": 202481.517355226, "chunks": 128, "text": "**The Living Architecture of Coral Reefs: A Symphony of Symbiosis and Time**\n\nCoral reefs are among the most complex and biologically diverse ecosystems on Earth, often referred to as the \"rainforests of the sea.\" Despite their reputation as ancient geological formations, the reality is that coral reefs are living, breathing structures that grow incrementally through a remarkable biological process involving symbiosis, calcification, and the relentless accumulation of calcium carbonate over millennia. To understand how these underwater cities rise from the ocean floor, one must look beyond the colorful fish and vibrant marine life that inhabit them and examine the microscopic machinery of the coral pol", "usage": {"aien_sampling": {"greedy_tokens": 128, "kept": [], "kept_max": 0, "kept_mean": 0.0, "kept_median": 0, "kept_min": 0, "kept_single": 0, "mode": "greedy", "p_repeat": 1.0, "reply_logprob": 0.0, "sampled_tokens": 0, "seed": 0, "temperature": 0.0, "top_k": 20, "top_k_applied": false, "top_p": 1.0, "top_prob_mean": 1.0, "top_prob_min": 1.0}, "completion_tokens": 128, "prompt_tokens": 41, "total_tokens": 169}, "finish_reason": "length", "error": null, "http_status": 200, "busy_retries": 0, "arm": "OURS", "round": "negctl", "metric": "agree", "rep": 11, "warmup": false, "concurrency": 1, "stream_index": 0, "batch_id": "a88267449510", "load1_start": 11.14, "load1_end": 11.13, "wall_utc": 1793434871.1423833, "max_tokens": 128, "prompt_id": "d11", "cell_run": "CoreChip-790-negctl", "server_cpus": null, "client_cpus": null} +{"t_send": 202481.518028304, "t_first": 202481.727555939, "t_last": 202487.400664051, "chunks": 128, "text": "The engineering marvels known as Roman aqueducts stand as some of the most enduring testaments to the ingenuity, ambition, and organizational prowess of the Roman Empire. Spanning centuries and covering vast distances across diverse terrains, these structures were not merely functional conduits for water; they were sophisticated feats of hydraulic engineering that transformed the urban landscape of the ancient world. To understand the design of Roman aqueducts is to appreciate a complex synthesis of gravity-based physics, precise surveying techniques, and an aesthetic sensibility that elevated utility into art.\n\nThe fundamental principle governing the design of every Roman aqueduct was gravity. Unlike modern pressur", "usage": {"aien_sampling": {"greedy_tokens": 128, "kept": [], "kept_max": 0, "kept_mean": 0.0, "kept_median": 0, "kept_min": 0, "kept_single": 0, "mode": "greedy", "p_repeat": 1.0, "reply_logprob": 0.0, "sampled_tokens": 0, "seed": 0, "temperature": 0.0, "top_k": 20, "top_k_applied": false, "top_p": 1.0, "top_prob_mean": 1.0, "top_prob_min": 1.0}, "completion_tokens": 128, "prompt_tokens": 44, "total_tokens": 172}, "finish_reason": "length", "error": null, "http_status": 200, "busy_retries": 0, "arm": "OURS", "round": "negctl", "metric": "agree", "rep": 12, "warmup": false, "concurrency": 1, "stream_index": 0, "batch_id": "14a7414c86a0", "load1_start": 11.13, "load1_end": 10.32, "wall_utc": 1793434877.0707016, "max_tokens": 128, "prompt_id": "d12", "cell_run": "CoreChip-790-negctl", "server_cpus": null, "client_cpus": null} +{"t_send": 202487.401412555, "t_first": 202487.631051083, "t_last": 202493.36666132, "chunks": 128, "text": "The journey along the Silk Road was never a single, paved highway stretching from the bustling markets of Chang'an to the distant shores of the Mediterranean. Instead, it was a vast, shifting network of caravan tracks, mountain passes, and desert oases that connected the known world for over a millennium. To travel this route was to step into a living tapestry of cultures, where the scent of roasting lamb mingled with the dust of the Taklamakan Desert, and the sound of Buddhist chants echoed alongside the clatter of camel bells. It was a path defined not by a fixed destination, but by the relentless pursuit of connection between East", "usage": {"aien_sampling": {"greedy_tokens": 128, "kept": [], "kept_max": 0, "kept_mean": 0.0, "kept_median": 0, "kept_min": 0, "kept_single": 0, "mode": "greedy", "p_repeat": 1.0, "reply_logprob": 0.0, "sampled_tokens": 0, "seed": 0, "temperature": 0.0, "top_k": 20, "top_k_applied": false, "top_p": 1.0, "top_prob_mean": 1.0, "top_prob_min": 1.0}, "completion_tokens": 128, "prompt_tokens": 43, "total_tokens": 171}, "finish_reason": "length", "error": null, "http_status": 200, "busy_retries": 0, "arm": "OURS", "round": "negctl", "metric": "agree", "rep": 13, "warmup": false, "concurrency": 1, "stream_index": 0, "batch_id": "25d0d7ef3937", "load1_start": 10.32, "load1_end": 10.37, "wall_utc": 1793434882.9540145, "max_tokens": 128, "prompt_id": "d13", "cell_run": "CoreChip-790-negctl", "server_cpus": null, "client_cpus": null} +{"t_send": 202493.367313183, "t_first": 202493.57526293, "t_last": 202499.305334871, "chunks": 128, "text": "The formation of volcanic islands is one of the most dramatic and transformative geological processes on Earth, representing a continuous battle between the molten fury of the planet's interior and the erosive forces of the ocean. These islands are not merely random accumulations of rock floating on water; they are the visible crowns of massive underwater mountains, born from the relentless movement of tectonic plates and the churning of the mantle. To understand how these landmasses emerge from the depths, one must first appreciate the dynamic nature of the Earth's crust and the specific mechanisms that drive volcanic activity beneath the sea.\n\nThe primary engine behind the creation of", "usage": {"aien_sampling": {"greedy_tokens": 128, "kept": [], "kept_max": 0, "kept_mean": 0.0, "kept_median": 0, "kept_min": 0, "kept_single": 0, "mode": "greedy", "p_repeat": 1.0, "reply_logprob": 0.0, "sampled_tokens": 0, "seed": 0, "temperature": 0.0, "top_k": 20, "top_k_applied": false, "top_p": 1.0, "top_prob_mean": 1.0, "top_prob_min": 1.0}, "completion_tokens": 128, "prompt_tokens": 43, "total_tokens": 171}, "finish_reason": "length", "error": null, "http_status": 200, "busy_retries": 0, "arm": "OURS", "round": "negctl", "metric": "agree", "rep": 14, "warmup": false, "concurrency": 1, "stream_index": 0, "batch_id": "f518323c69cb", "load1_start": 10.37, "load1_end": 10.58, "wall_utc": 1793434888.9199138, "max_tokens": 128, "prompt_id": "d14", "cell_run": "CoreChip-790-negctl", "server_cpus": null, "client_cpus": null} +{"t_send": 202499.306041997, "t_first": 202499.539530162, "t_last": 202505.219670282, "chunks": 128, "text": "The evolution of paper money is one of the most profound chapters in human economic history, representing a radical shift from the tangible weight of precious metals to the abstract concept of value stored on thin sheets of plant fiber. This journey began not in the bustling markets of Europe, but in the bustling trade hubs of ancient China, where the logistical burdens of carrying heavy coinage eventually gave way to a more efficient system of exchange. By the Tang and Song dynasties, merchants in China faced the arduous task of transporting vast quantities of copper coins over long distances. These coins, often made of bronze or copper, were heavy, prone to wear", "usage": {"aien_sampling": {"greedy_tokens": 128, "kept": [], "kept_max": 0, "kept_mean": 0.0, "kept_median": 0, "kept_min": 0, "kept_single": 0, "mode": "greedy", "p_repeat": 1.0, "reply_logprob": 0.0, "sampled_tokens": 0, "seed": 0, "temperature": 0.0, "top_k": 20, "top_k_applied": false, "top_p": 1.0, "top_prob_mean": 1.0, "top_prob_min": 1.0}, "completion_tokens": 128, "prompt_tokens": 42, "total_tokens": 170}, "finish_reason": "length", "error": null, "http_status": 200, "busy_retries": 0, "arm": "OURS", "round": "negctl", "metric": "agree", "rep": 15, "warmup": false, "concurrency": 1, "stream_index": 0, "batch_id": "e432749f9bbd", "load1_start": 10.58, "load1_end": 10.7, "wall_utc": 1793434894.8587031, "max_tokens": 128, "prompt_id": "d15", "cell_run": "CoreChip-790-negctl", "server_cpus": null, "client_cpus": null} diff --git a/docs/inference/evidence/q35-9b-fp8-gb10-20261031/negctl/models.json b/docs/inference/evidence/q35-9b-fp8-gb10-20261031/negctl/models.json new file mode 100644 index 00000000..fb794f84 --- /dev/null +++ b/docs/inference/evidence/q35-9b-fp8-gb10-20261031/negctl/models.json @@ -0,0 +1 @@ +{"object":"list","data":[{"id":"q35-9b-fp8","object":"model","created":1793434805,"owned_by":"aien/omega-qwen38"}]} \ No newline at end of file diff --git a/docs/inference/evidence/q35-9b-fp8-gb10-20261031/negctl/session.start b/docs/inference/evidence/q35-9b-fp8-gb10-20261031/negctl/session.start new file mode 100644 index 00000000..633db08c --- /dev/null +++ b/docs/inference/evidence/q35-9b-fp8-gb10-20261031/negctl/session.start @@ -0,0 +1,11 @@ +start 2026-10-31T08:19:53Z window 20261031T081515Z-f54001 gb10_lock_held 1 +sc commit ab77b970ed5c132a2d62b5bedab277a8a1627ec4 +binary /tmp/corechip/t790/release/aien-serve-http sha256 47cb6117e9a37a6ed7b854ff87637564adf8b2a69c99ca91a28b3b63c4ebfaa3 +omega /tmp/corechip/omega905 at d7f1bff90f7e7a449c50ba18ba3859d1f6d9f0cf (omega-mv#905 head), libomega_gpu.a sha256 56da02a36f70b6b388974cb342bf80e586fb656983f9d81e61b568dbb5a434e1, linked as AIEN_OMEGA_GPU_LIB (development override, not a qualified build) +model /tmp/corechip/negctl9b bytes 12394969960 admission need_kB 45180445 MemAvailable_kB 100678944 +cmd /tmp/corechip/t790/release/aien-serve-http --engine omega --model-dir /tmp/corechip/negctl9b --model-id q35-9b-fp8 --max-context 8192 --max-tokens-cap 1024 --thinking off --bind 127.0.0.1 --port 18295 +client python3 /home/drakestapleton/handoffs/HeadToHead/repo/bench/bench.py --port 18295 --model q35-9b-fp8 --arm OURS --round negctl --metric agree --prompts /home/drakestapleton/handoffs/HeadToHead/repo/prompts/decode.jsonl --concurrency 1 --max-tokens 128 --warmup 0 --reps 16 +pid, process_name, used_gpu_memory [MiB] +name, driver_version, utilization.gpu [%], temperature.gpu, power.draw [W], pstate +NVIDIA GB10, 580.173.02, 0 %, 51, 5.86 W, P8 +client script /tmp/corechip/bench-auth.py sha256 ebd9490a149315bf5f5c6437617fba18093f3843bb8469094be7f2695474e992: HeadToHead bench/bench.py at e430e23f plus one change, an Authorization: Bearer header from AIEN_SERVE_HTTP_BEARER_TOKEN diff --git a/docs/inference/evidence/q35-9b-fp8-gb10-20261031/q35-9b-clean.dmon b/docs/inference/evidence/q35-9b-fp8-gb10-20261031/q35-9b-clean.dmon new file mode 100644 index 00000000..e5f88762 --- /dev/null +++ b/docs/inference/evidence/q35-9b-fp8-gb10-20261031/q35-9b-clean.dmon @@ -0,0 +1,120 @@ +#Time gpu pwr gtemp mtemp sm mem enc dec jpg ofa mclk pclk fb bar1 ccpm +#HH:MM:SS Idx W C C % % % % % % MHz MHz MB MB MB + 03:13:18 0 5 52 - 0 0 0 0 0 0 - 208 - - 0 + 03:13:19 0 5 52 - 0 0 0 0 0 0 - 208 - - 0 + 03:13:20 0 5 51 - 0 0 0 0 0 0 - 208 - - 0 + 03:13:21 0 5 51 - 0 0 0 0 0 0 - 208 - - 0 + 03:13:22 0 5 51 - 0 0 0 0 0 0 - 208 - - 0 + 03:13:23 0 5 51 - 0 0 0 0 0 0 - 208 - - 0 + 03:13:24 0 6 51 - 0 0 0 0 0 0 - 214 - - 0 + 03:13:25 0 6 51 - 0 0 0 0 0 0 - 208 - - 0 + 03:13:26 0 6 52 - 0 0 0 0 0 0 - 208 - - 0 + 03:13:27 0 6 52 - 0 0 0 0 0 0 - 208 - - 0 + 03:13:28 0 6 52 - 0 0 0 0 0 0 - 208 - - 0 + 03:13:29 0 6 52 - 0 0 0 0 0 0 - 208 - - 0 + 03:13:30 0 6 52 - 0 0 0 0 0 0 - 208 - - 0 + 03:13:31 0 6 52 - 0 0 0 0 0 0 - 208 - - 0 + 03:13:32 0 6 52 - 0 0 0 0 0 0 - 208 - - 0 + 03:13:33 0 6 52 - 0 0 0 0 0 0 - 208 - - 0 + 03:13:34 0 6 52 - 0 0 0 0 0 0 - 208 - - 0 + 03:13:35 0 6 52 - 0 0 0 0 0 0 - 208 - - 0 + 03:13:36 0 26 57 - 96 0 0 0 0 0 - 2281 - - 0 + 03:13:37 0 35 58 - 96 0 0 0 0 0 - 2262 - - 0 + 03:13:38 0 36 58 - 96 0 0 0 0 0 - 2255 - - 0 + 03:13:39 0 36 58 - 96 0 0 0 0 0 - 2262 - - 0 + 03:13:40 0 36 58 - 96 0 0 0 0 0 - 2255 - - 0 + 03:13:41 0 36 59 - 96 0 0 0 0 0 - 2242 - - 0 + 03:13:42 0 34 59 - 96 0 0 0 0 0 - 2268 - - 0 + 03:13:43 0 36 59 - 96 0 0 0 0 0 - 2242 - - 0 + 03:13:44 0 36 58 - 96 0 0 0 0 0 - 2268 - - 0 + 03:13:45 0 36 59 - 96 0 0 0 0 0 - 2288 - - 0 + 03:13:46 0 36 60 - 96 0 0 0 0 0 - 2255 - - 0 + 03:13:47 0 36 60 - 93 0 0 0 0 0 - 2236 - - 0 + 03:13:48 0 34 61 - 96 0 0 0 0 0 - 2255 - - 0 + 03:13:49 0 36 61 - 96 0 0 0 0 0 - 2242 - - 0 + 03:13:50 0 36 60 - 96 0 0 0 0 0 - 2249 - - 0 + 03:13:51 0 36 61 - 96 0 0 0 0 0 - 2281 - - 0 + 03:13:52 0 36 61 - 96 0 0 0 0 0 - 2255 - - 0 + 03:13:53 0 36 61 - 96 0 0 0 0 0 - 2268 - - 0 + 03:13:54 0 34 62 - 96 0 0 0 0 0 - 2262 - - 0 + 03:13:55 0 36 61 - 96 0 0 0 0 0 - 2288 - - 0 + 03:13:56 0 36 61 - 96 0 0 0 0 0 - 2288 - - 0 + 03:13:57 0 36 62 - 96 0 0 0 0 0 - 2281 - - 0 + 03:13:58 0 36 62 - 96 0 0 0 0 0 - 2236 - - 0 + 03:13:59 0 36 62 - 96 0 0 0 0 0 - 2281 - - 0 + 03:14:00 0 34 62 - 96 0 0 0 0 0 - 2294 - - 0 + 03:14:01 0 36 62 - 96 0 0 0 0 0 - 2281 - - 0 +#Time gpu pwr gtemp mtemp sm mem enc dec jpg ofa mclk pclk fb bar1 ccpm +#HH:MM:SS Idx W C C % % % % % % MHz MHz MB MB MB + 03:14:02 0 37 61 - 96 0 0 0 0 0 - 2249 - - 0 + 03:14:03 0 36 62 - 96 0 0 0 0 0 - 2301 - - 0 + 03:14:04 0 36 61 - 96 0 0 0 0 0 - 2262 - - 0 + 03:14:05 0 36 61 - 83 0 0 0 0 0 - 2223 - - 0 + 03:14:06 0 35 61 - 96 0 0 0 0 0 - 2255 - - 0 + 03:14:07 0 37 62 - 96 0 0 0 0 0 - 2301 - - 0 + 03:14:08 0 36 63 - 96 0 0 0 0 0 - 2242 - - 0 + 03:14:09 0 37 62 - 96 0 0 0 0 0 - 2268 - - 0 + 03:14:10 0 37 63 - 96 0 0 0 0 0 - 2255 - - 0 + 03:14:11 0 35 61 - 55 0 0 0 0 0 - 2275 - - 0 + 03:14:12 0 37 63 - 96 0 0 0 0 0 - 2262 - - 0 + 03:14:13 0 36 63 - 96 0 0 0 0 0 - 2275 - - 0 + 03:14:14 0 37 62 - 96 0 0 0 0 0 - 2242 - - 0 + 03:14:15 0 37 63 - 96 0 0 0 0 0 - 2281 - - 0 + 03:14:16 0 36 63 - 96 0 0 0 0 0 - 2223 - - 0 + 03:14:17 0 35 63 - 91 0 0 0 0 0 - 2366 - - 0 + 03:14:18 0 37 63 - 96 0 0 0 0 0 - 2249 - - 0 + 03:14:19 0 37 63 - 96 0 0 0 0 0 - 2268 - - 0 + 03:14:20 0 37 63 - 96 0 0 0 0 0 - 2242 - - 0 + 03:14:21 0 37 63 - 96 0 0 0 0 0 - 2255 - - 0 + 03:14:22 0 37 62 - 96 0 0 0 0 0 - 2229 - - 0 + 03:14:23 0 35 63 - 96 0 0 0 0 0 - 2236 - - 0 + 03:14:24 0 37 63 - 96 0 0 0 0 0 - 2281 - - 0 + 03:14:25 0 37 63 - 96 0 0 0 0 0 - 2242 - - 0 + 03:14:26 0 37 63 - 96 0 0 0 0 0 - 2281 - - 0 + 03:14:27 0 37 63 - 96 0 0 0 0 0 - 2255 - - 0 + 03:14:28 0 37 63 - 96 0 0 0 0 0 - 2242 - - 0 + 03:14:29 0 35 62 - 96 0 0 0 0 0 - 2223 - - 0 + 03:14:30 0 37 63 - 96 0 0 0 0 0 - 2281 - - 0 + 03:14:31 0 37 64 - 96 0 0 0 0 0 - 2236 - - 0 + 03:14:32 0 37 63 - 96 0 0 0 0 0 - 2281 - - 0 + 03:14:33 0 37 64 - 96 0 0 0 0 0 - 2268 - - 0 + 03:14:34 0 37 63 - 96 0 0 0 0 0 - 2223 - - 0 + 03:14:35 0 35 64 - 96 0 0 0 0 0 - 2229 - - 0 + 03:14:36 0 37 63 - 96 0 0 0 0 0 - 2255 - - 0 + 03:14:37 0 37 63 - 96 0 0 0 0 0 - 2236 - - 0 + 03:14:38 0 37 63 - 96 0 0 0 0 0 - 2229 - - 0 + 03:14:39 0 37 64 - 96 0 0 0 0 0 - 2294 - - 0 + 03:14:40 0 37 63 - 96 0 0 0 0 0 - 2229 - - 0 + 03:14:41 0 37 63 - 96 0 0 0 0 0 - 2229 - - 0 + 03:14:42 0 37 64 - 96 0 0 0 0 0 - 2281 - - 0 + 03:14:43 0 37 63 - 96 0 0 0 0 0 - 2236 - - 0 + 03:14:44 0 37 64 - 96 0 0 0 0 0 - 2281 - - 0 + 03:14:45 0 37 63 - 96 0 0 0 0 0 - 2262 - - 0 +#Time gpu pwr gtemp mtemp sm mem enc dec jpg ofa mclk pclk fb bar1 ccpm +#HH:MM:SS Idx W C C % % % % % % MHz MHz MB MB MB + 03:14:46 0 35 64 - 96 0 0 0 0 0 - 2275 - - 0 + 03:14:47 0 37 63 - 96 0 0 0 0 0 - 2268 - - 0 + 03:14:49 0 37 64 - 96 0 0 0 0 0 - 2268 - - 0 + 03:14:50 0 37 64 - 96 0 0 0 0 0 - 2229 - - 0 + 03:14:51 0 37 63 - 96 0 0 0 0 0 - 2236 - - 0 + 03:14:52 0 37 64 - 96 0 0 0 0 0 - 2236 - - 0 + 03:14:53 0 36 64 - 50 0 0 0 0 0 - 2288 - - 0 + 03:14:54 0 37 64 - 96 0 0 0 0 0 - 2236 - - 0 + 03:14:55 0 37 64 - 96 0 0 0 0 0 - 2281 - - 0 + 03:14:56 0 37 64 - 96 0 0 0 0 0 - 2229 - - 0 + 03:14:57 0 37 63 - 96 0 0 0 0 0 - 2242 - - 0 + 03:14:58 0 37 64 - 96 0 0 0 0 0 - 2249 - - 0 + 03:14:59 0 36 64 - 76 0 0 0 0 0 - 2275 - - 0 + 03:15:00 0 37 64 - 96 0 0 0 0 0 - 2236 - - 0 + 03:15:01 0 37 64 - 96 0 0 0 0 0 - 2242 - - 0 + 03:15:02 0 37 64 - 96 0 0 0 0 0 - 2268 - - 0 + 03:15:03 0 37 64 - 96 0 0 0 0 0 - 2229 - - 0 + 03:15:04 0 37 63 - 96 0 0 0 0 0 - 2223 - - 0 + 03:15:05 0 35 64 - 83 0 0 0 0 0 - 2223 - - 0 + 03:15:06 0 37 64 - 96 0 0 0 0 0 - 2236 - - 0 + 03:15:07 0 37 65 - 96 0 0 0 0 0 - 2281 - - 0 + 03:15:08 0 37 65 - 96 0 0 0 0 0 - 2275 - - 0 + 03:15:09 0 37 65 - 96 0 0 0 0 0 - 2242 - - 0 + 03:15:10 0 37 65 - 96 0 0 0 0 0 - 2262 - - 0 + 03:15:11 0 12 60 - 5 0 0 0 0 0 - 591 - - 0 + 03:15:12 0 7 59 - 0 0 0 0 0 0 - 598 - - 0 diff --git a/docs/inference/evidence/q35-9b-fp8-gb10-20261031/q35-9b-clean.end b/docs/inference/evidence/q35-9b-fp8-gb10-20261031/q35-9b-clean.end new file mode 100644 index 00000000..09be114c --- /dev/null +++ b/docs/inference/evidence/q35-9b-fp8-gb10-20261031/q35-9b-clean.end @@ -0,0 +1,3 @@ +end 2026-10-31T08:15:14Z +min MemAvailable_kB during run 89201908 + 03:15:14 up 2 days, 8:08, 5 users, load average: 16.95, 9.17, 5.94 diff --git a/docs/inference/evidence/q35-9b-fp8-gb10-20261031/q35-9b-clean.err b/docs/inference/evidence/q35-9b-fp8-gb10-20261031/q35-9b-clean.err new file mode 100644 index 00000000..e69de29b diff --git a/docs/inference/evidence/q35-9b-fp8-gb10-20261031/q35-9b-clean.raw b/docs/inference/evidence/q35-9b-fp8-gb10-20261031/q35-9b-clean.raw new file mode 100644 index 00000000..e7db1fc7 --- /dev/null +++ b/docs/inference/evidence/q35-9b-fp8-gb10-20261031/q35-9b-clean.raw @@ -0,0 +1,3 @@ +ready=1 load_s=17 +client exit 0 +server stopped 2026-10-31T08:15:11Z min MemAvailable_kB 89209024 port 18295 listeners_after 0 diff --git a/docs/inference/evidence/q35-9b-fp8-gb10-20261031/q35-9b-clean.rc b/docs/inference/evidence/q35-9b-fp8-gb10-20261031/q35-9b-clean.rc new file mode 100644 index 00000000..573541ac --- /dev/null +++ b/docs/inference/evidence/q35-9b-fp8-gb10-20261031/q35-9b-clean.rc @@ -0,0 +1 @@ +0 diff --git a/docs/inference/evidence/q35-9b-fp8-gb10-20261031/q35-9b-clean.start b/docs/inference/evidence/q35-9b-fp8-gb10-20261031/q35-9b-clean.start new file mode 100644 index 00000000..2c52e68d --- /dev/null +++ b/docs/inference/evidence/q35-9b-fp8-gb10-20261031/q35-9b-clean.start @@ -0,0 +1,15 @@ +start 2026-10-31T08:13:15Z +sc commit ab77b970ed5c132a2d62b5bedab277a8a1627ec4 worktree /tmp/corechip/w790 +binary /tmp/corechip/run790.sh sha256 25c097a2b4ea741c18e1e909e814f9a16b7296130a968b1bffddc60e18ba665c +omega /tmp/corechip/omega636 a647b6a9821fffcf52ba9ce813f75afa4b84be62 +admission model /home/drakestapleton/models/qwen3.5-9b-c2022362-fp8b128 bytes 12394969960 need_kB 45180445 MemAvailable_kB 100922816 +window flags --gb10 none --quiet exclusive lease 20; chip lock: flock -x /tmp/aien-gb10.lock around the command +cmd env AIEN_GB10_LOCK_HELD=1 bash /tmp/corechip/run790.sh clean /home/drakestapleton/models/qwen3.5-9b-c2022362-fp8b128 +pid, process_name, used_gpu_memory [MiB] +name, driver_version, utilization.gpu [%], temperature.gpu, power.draw [W], pstate, clocks.current.sm [MHz], clocks.current.memory [MHz] +NVIDIA GB10, 580.173.02, 0 %, 52, 5.90 W, P8, 208 MHz, [N/A] +listeners: 100.64.0.2:18110 100.64.0.2:18112 100.64.0.2:18132 127.0.0.1:18080 127.0.0.1:18092 127.0.0.1:18095 127.0.0.1:18096 127.0.0.1:18171 + 03:13:15 up 2 days, 8:06, 5 users, load average: 8.23, 5.51, 4.51 +7.0.0-1019-nvidia +window 20261031T081315Z-809e71 +lock acquired 2026-10-31T08:13:18Z diff --git a/docs/inference/evidence/q35-9b-fp8-gb10-20261031/q35-9b-negctl.dmon b/docs/inference/evidence/q35-9b-fp8-gb10-20261031/q35-9b-negctl.dmon new file mode 100644 index 00000000..a4dcce73 --- /dev/null +++ b/docs/inference/evidence/q35-9b-fp8-gb10-20261031/q35-9b-negctl.dmon @@ -0,0 +1,116 @@ +#Time gpu pwr gtemp mtemp sm mem enc dec jpg ofa mclk pclk fb bar1 ccpm +#HH:MM:SS Idx W C C % % % % % % MHz MHz MB MB MB + 03:19:53 0 5 51 - 0 0 0 0 0 0 - 208 - - 0 + 03:19:54 0 5 51 - 0 0 0 0 0 0 - 208 - - 0 + 03:19:55 0 5 51 - 0 0 0 0 0 0 - 208 - - 0 + 03:19:56 0 6 51 - 0 0 0 0 0 0 - 208 - - 0 + 03:19:57 0 6 51 - 0 0 0 0 0 0 - 208 - - 0 + 03:19:58 0 6 51 - 0 0 0 0 0 0 - 208 - - 0 + 03:19:59 0 6 51 - 0 0 0 0 0 0 - 208 - - 0 + 03:20:00 0 6 51 - 0 0 0 0 0 0 - 208 - - 0 + 03:20:01 0 6 51 - 0 0 0 0 0 0 - 208 - - 0 + 03:20:02 0 6 52 - 0 0 0 0 0 0 - 208 - - 0 + 03:20:03 0 6 52 - 0 0 0 0 0 0 - 208 - - 0 + 03:20:04 0 6 52 - 0 0 0 0 0 0 - 208 - - 0 + 03:20:05 0 6 52 - 0 0 0 0 0 0 - 208 - - 0 + 03:20:06 0 27 57 - 96 0 0 0 0 0 - 2255 - - 0 + 03:20:07 0 36 58 - 96 0 0 0 0 0 - 2301 - - 0 + 03:20:08 0 36 57 - 96 0 0 0 0 0 - 2242 - - 0 + 03:20:09 0 35 58 - 96 0 0 0 0 0 - 2281 - - 0 + 03:20:10 0 35 58 - 96 0 0 0 0 0 - 2288 - - 0 + 03:20:11 0 35 59 - 96 0 0 0 0 0 - 2288 - - 0 + 03:20:12 0 33 59 - 96 0 0 0 0 0 - 2249 - - 0 + 03:20:13 0 36 59 - 96 0 0 0 0 0 - 2242 - - 0 + 03:20:14 0 36 60 - 96 0 0 0 0 0 - 2242 - - 0 + 03:20:15 0 36 60 - 96 0 0 0 0 0 - 2281 - - 0 + 03:20:16 0 36 60 - 96 0 0 0 0 0 - 2288 - - 0 + 03:20:17 0 36 61 - 96 0 0 0 0 0 - 2288 - - 0 + 03:20:18 0 34 61 - 96 0 0 0 0 0 - 2255 - - 0 + 03:20:19 0 36 61 - 96 0 0 0 0 0 - 2288 - - 0 + 03:20:20 0 36 61 - 96 0 0 0 0 0 - 2275 - - 0 + 03:20:21 0 37 62 - 96 0 0 0 0 0 - 2307 - - 0 + 03:20:22 0 37 61 - 96 0 0 0 0 0 - 2275 - - 0 + 03:20:23 0 37 62 - 96 0 0 0 0 0 - 2281 - - 0 + 03:20:24 0 35 61 - 96 0 0 0 0 0 - 2281 - - 0 + 03:20:25 0 37 61 - 96 0 0 0 0 0 - 2255 - - 0 + 03:20:26 0 36 62 - 96 0 0 0 0 0 - 2255 - - 0 + 03:20:27 0 36 62 - 96 0 0 0 0 0 - 2294 - - 0 + 03:20:28 0 36 62 - 96 0 0 0 0 0 - 2249 - - 0 + 03:20:29 0 36 62 - 96 0 0 0 0 0 - 2229 - - 0 + 03:20:30 0 35 62 - 96 0 0 0 0 0 - 2249 - - 0 + 03:20:31 0 37 63 - 96 0 0 0 0 0 - 2255 - - 0 + 03:20:32 0 37 63 - 96 0 0 0 0 0 - 2249 - - 0 + 03:20:33 0 37 63 - 96 0 0 0 0 0 - 2268 - - 0 + 03:20:34 0 37 63 - 96 0 0 0 0 0 - 2216 - - 0 + 03:20:35 0 35 62 - 62 0 0 0 0 0 - 2223 - - 0 + 03:20:36 0 35 63 - 96 0 0 0 0 0 - 2268 - - 0 +#Time gpu pwr gtemp mtemp sm mem enc dec jpg ofa mclk pclk fb bar1 ccpm +#HH:MM:SS Idx W C C % % % % % % MHz MHz MB MB MB + 03:20:37 0 37 63 - 96 0 0 0 0 0 - 2255 - - 0 + 03:20:38 0 37 63 - 96 0 0 0 0 0 - 2236 - - 0 + 03:20:39 0 37 64 - 96 0 0 0 0 0 - 2223 - - 0 + 03:20:40 0 37 64 - 96 0 0 0 0 0 - 2249 - - 0 + 03:20:41 0 36 62 - 44 0 0 0 0 0 - 2249 - - 0 + 03:20:42 0 36 64 - 96 0 0 0 0 0 - 2262 - - 0 + 03:20:43 0 37 63 - 96 0 0 0 0 0 - 2275 - - 0 + 03:20:44 0 37 64 - 96 0 0 0 0 0 - 2301 - - 0 + 03:20:45 0 37 64 - 96 0 0 0 0 0 - 2275 - - 0 + 03:20:46 0 37 64 - 96 0 0 0 0 0 - 2275 - - 0 + 03:20:47 0 36 63 - 52 0 0 0 0 0 - 2262 - - 0 + 03:20:48 0 38 65 - 96 0 0 0 0 0 - 2255 - - 0 + 03:20:49 0 37 65 - 96 0 0 0 0 0 - 2236 - - 0 + 03:20:50 0 37 64 - 96 0 0 0 0 0 - 2268 - - 0 + 03:20:51 0 37 65 - 96 0 0 0 0 0 - 2281 - - 0 + 03:20:52 0 37 65 - 96 0 0 0 0 0 - 2268 - - 0 + 03:20:53 0 35 64 - 63 0 0 0 0 0 - 2210 - - 0 + 03:20:54 0 37 65 - 96 0 0 0 0 0 - 2275 - - 0 + 03:20:56 0 38 65 - 96 0 0 0 0 0 - 2236 - - 0 + 03:20:57 0 38 64 - 96 0 0 0 0 0 - 2242 - - 0 + 03:20:58 0 37 65 - 96 0 0 0 0 0 - 2268 - - 0 + 03:20:59 0 37 65 - 96 0 0 0 0 0 - 2236 - - 0 + 03:21:00 0 36 65 - 95 0 0 0 0 0 - 2268 - - 0 + 03:21:01 0 37 65 - 96 0 0 0 0 0 - 2223 - - 0 + 03:21:02 0 37 65 - 96 0 0 0 0 0 - 2216 - - 0 + 03:21:03 0 38 66 - 96 0 0 0 0 0 - 2236 - - 0 + 03:21:04 0 38 66 - 96 0 0 0 0 0 - 2236 - - 0 + 03:21:05 0 38 65 - 96 0 0 0 0 0 - 2249 - - 0 + 03:21:06 0 35 65 - 96 0 0 0 0 0 - 2223 - - 0 + 03:21:07 0 37 65 - 96 0 0 0 0 0 - 2229 - - 0 + 03:21:08 0 37 65 - 96 0 0 0 0 0 - 2223 - - 0 + 03:21:09 0 37 66 - 96 0 0 0 0 0 - 2275 - - 0 + 03:21:10 0 38 66 - 96 0 0 0 0 0 - 2301 - - 0 + 03:21:11 0 37 66 - 96 0 0 0 0 0 - 2281 - - 0 + 03:21:12 0 36 66 - 96 0 0 0 0 0 - 2255 - - 0 + 03:21:13 0 38 66 - 96 0 0 0 0 0 - 2275 - - 0 + 03:21:14 0 38 66 - 96 0 0 0 0 0 - 2288 - - 0 + 03:21:15 0 37 66 - 96 0 0 0 0 0 - 2275 - - 0 + 03:21:16 0 37 66 - 96 0 0 0 0 0 - 2262 - - 0 + 03:21:17 0 37 65 - 96 0 0 0 0 0 - 2229 - - 0 + 03:21:18 0 36 65 - 96 0 0 0 0 0 - 2281 - - 0 + 03:21:19 0 38 65 - 96 0 0 0 0 0 - 2281 - - 0 + 03:21:20 0 38 66 - 96 0 0 0 0 0 - 2229 - - 0 + 03:21:21 0 38 66 - 96 0 0 0 0 0 - 2236 - - 0 +#Time gpu pwr gtemp mtemp sm mem enc dec jpg ofa mclk pclk fb bar1 ccpm +#HH:MM:SS Idx W C C % % % % % % MHz MHz MB MB MB + 03:21:22 0 38 65 - 96 0 0 0 0 0 - 2236 - - 0 + 03:21:23 0 36 65 - 96 0 0 0 0 0 - 2268 - - 0 + 03:21:24 0 36 66 - 96 0 0 0 0 0 - 2281 - - 0 + 03:21:25 0 37 65 - 96 0 0 0 0 0 - 2275 - - 0 + 03:21:26 0 38 67 - 96 0 0 0 0 0 - 2268 - - 0 + 03:21:27 0 38 66 - 96 0 0 0 0 0 - 2268 - - 0 + 03:21:28 0 38 65 - 96 0 0 0 0 0 - 2236 - - 0 + 03:21:29 0 37 65 - 96 0 0 0 0 0 - 2242 - - 0 + 03:21:30 0 38 67 - 96 0 0 0 0 0 - 2275 - - 0 + 03:21:31 0 38 65 - 96 0 0 0 0 0 - 2229 - - 0 + 03:21:32 0 38 66 - 96 0 0 0 0 0 - 2255 - - 0 + 03:21:33 0 38 66 - 96 0 0 0 0 0 - 2236 - - 0 + 03:21:34 0 38 66 - 96 0 0 0 0 0 - 2255 - - 0 + 03:21:35 0 36 65 - 96 0 0 0 0 0 - 2262 - - 0 + 03:21:36 0 37 66 - 96 0 0 0 0 0 - 2242 - - 0 + 03:21:37 0 38 66 - 96 0 0 0 0 0 - 2229 - - 0 + 03:21:38 0 38 67 - 96 0 0 0 0 0 - 2281 - - 0 + 03:21:39 0 38 66 - 96 0 0 0 0 0 - 2288 - - 0 + 03:21:40 0 38 65 - 96 0 0 0 0 0 - 2249 - - 0 + 03:21:41 0 29 62 - 96 0 0 0 0 0 - 1404 - - 0 + 03:21:42 0 7 61 - 5 0 0 0 0 0 - 604 - - 0 + 03:21:43 0 7 61 - 0 0 0 0 0 0 - 208 - - 0 diff --git a/docs/inference/evidence/q35-9b-fp8-gb10-20261031/q35-9b-negctl.end b/docs/inference/evidence/q35-9b-fp8-gb10-20261031/q35-9b-negctl.end new file mode 100644 index 00000000..bb96f7f3 --- /dev/null +++ b/docs/inference/evidence/q35-9b-fp8-gb10-20261031/q35-9b-negctl.end @@ -0,0 +1,3 @@ +end 2026-10-31T08:21:45Z +min MemAvailable_kB during run 88406004 + 03:21:45 up 2 days, 8:15, 6 users, load average: 11.44, 12.09, 8.74 diff --git a/docs/inference/evidence/q35-9b-fp8-gb10-20261031/q35-9b-negctl.err b/docs/inference/evidence/q35-9b-fp8-gb10-20261031/q35-9b-negctl.err new file mode 100644 index 00000000..e69de29b diff --git a/docs/inference/evidence/q35-9b-fp8-gb10-20261031/q35-9b-negctl.raw b/docs/inference/evidence/q35-9b-fp8-gb10-20261031/q35-9b-negctl.raw new file mode 100644 index 00000000..bea0715d --- /dev/null +++ b/docs/inference/evidence/q35-9b-fp8-gb10-20261031/q35-9b-negctl.raw @@ -0,0 +1,3 @@ +ready=1 load_s=12 +client exit 0 +server stopped 2026-10-31T08:21:42Z min MemAvailable_kB 88401696 port 18295 listeners_after 0 diff --git a/docs/inference/evidence/q35-9b-fp8-gb10-20261031/q35-9b-negctl.rc b/docs/inference/evidence/q35-9b-fp8-gb10-20261031/q35-9b-negctl.rc new file mode 100644 index 00000000..573541ac --- /dev/null +++ b/docs/inference/evidence/q35-9b-fp8-gb10-20261031/q35-9b-negctl.rc @@ -0,0 +1 @@ +0 diff --git a/docs/inference/evidence/q35-9b-fp8-gb10-20261031/q35-9b-negctl.start b/docs/inference/evidence/q35-9b-fp8-gb10-20261031/q35-9b-negctl.start new file mode 100644 index 00000000..093f5f5e --- /dev/null +++ b/docs/inference/evidence/q35-9b-fp8-gb10-20261031/q35-9b-negctl.start @@ -0,0 +1,15 @@ +start 2026-10-31T08:15:14Z +sc commit ab77b970ed5c132a2d62b5bedab277a8a1627ec4 worktree /tmp/corechip/w790 +binary /tmp/corechip/run790.sh sha256 25c097a2b4ea741c18e1e909e814f9a16b7296130a968b1bffddc60e18ba665c +omega /tmp/corechip/omega636 a647b6a9821fffcf52ba9ce813f75afa4b84be62 +admission model /tmp/corechip/negctl9b bytes 12394969960 need_kB 45180445 MemAvailable_kB 100452852 +window flags --gb10 none --quiet exclusive lease 20; chip lock: flock -x /tmp/aien-gb10.lock around the command +cmd env AIEN_GB10_LOCK_HELD=1 bash /tmp/corechip/run790.sh negctl /tmp/corechip/negctl9b +pid, process_name, used_gpu_memory [MiB] +name, driver_version, utilization.gpu [%], temperature.gpu, power.draw [W], pstate, clocks.current.sm [MHz], clocks.current.memory [MHz] +NVIDIA GB10, 580.173.02, 0 %, 58, 6.50 W, P8, 208 MHz, [N/A] +listeners: 100.64.0.2:18110 100.64.0.2:18112 100.64.0.2:18132 127.0.0.1:18080 127.0.0.1:18092 127.0.0.1:18095 127.0.0.1:18096 127.0.0.1:18171 + 03:15:15 up 2 days, 8:08, 5 users, load average: 16.95, 9.17, 5.94 +7.0.0-1019-nvidia +window 20261031T081515Z-f54001 +lock acquired 2026-10-31T08:19:53Z diff --git a/native-artifacts.lock b/native-artifacts.lock index 8ca3b6b3..a6273723 100644 --- a/native-artifacts.lock +++ b/native-artifacts.lock @@ -48,3 +48,8 @@ libomega_gpu.a 18f8fdd974edea2e778ff16a49f88c878ffac1c0 aarch64-unknown-linux-gn # independent omega make from a fresh checkout of the three pins. librx_compose.a a647b6a9821fffcf52ba9ce813f75afa4b84be62 aarch64-unknown-linux-gnu 0a711939f498d90fcc23f55230d578f2b836aeeb9bc57ffa14a9813cf8a3cebd cc (Ubuntu 13.3.0-6ubuntu2~24.04.1) 13.3.0 libomega_gpu.a a647b6a9821fffcf52ba9ce813f75afa4b84be62 aarch64-unknown-linux-gnu 036b7491d85a2d0781360c194402f345ad2f63720dab1b8f6d0cbc5c09f87d3e cc (Ubuntu 13.3.0-6ubuntu2~24.04.1) 13.3.0 +# omega f9a9a40 (omega-mv main, merge of #995 carrying #905). omega.lock pins it. physics.lock +# 048e5f5e and aienos.lock b84c0a67 at that commit are unchanged from a647b6a9. No archive line +# is added here: native-artifacts.lock is updated only from scripts/abi-qualify.sh, and that +# aarch64 qualification was not run for f9a9a40. A checkout build of this pin warns and reports +# digest "unrecorded" until those lines exist. diff --git a/omega.lock b/omega.lock index b1bf4a77..c8e0c477 100644 --- a/omega.lock +++ b/omega.lock @@ -1 +1 @@ -a647b6a9821fffcf52ba9ce813f75afa4b84be62 +f9a9a40b598928fc6f92d7ffa6ff386941182663 ```