From 6a4c53da8b34817b4d6121db56453f4a94f0c42e Mon Sep 17 00:00:00 2001 From: VecSzn <82099364+VecSzn@users.noreply.github.com> Date: Fri, 4 Dec 2026 16:57:29 +0000 Subject: [PATCH] [Docs] patch bundles: the standalone Qwen4-35B-A3B port and the Clover fix, with install docs A patches/ bundle with the two porting efforts kept as apply-able files and exact install docs (English + Russian): - patches/qwen4exp-full-port/: the standalone arch=qwen4exp port of Qwen4-35B-A3B to strata-poly (its format-patch, based on 4106d1a7c), the port's architecture docs (README, TENSOR-MAP, PLE, tensor layout), and the validation harness verify/ - the llama.cpp reference + dump-layers comparison script, the tokenizer, the float CPU reference and its tensor-dump tool - with the expected artifacts of the 2026-12-04 run (main + the Direct-reader PLE of PR #440 matched llama.cpp byte for byte, 1249/1249 chars). - patches/qwen35-clover/: the Clover fix as it stands against current main: ssm_a was already fixed upstream; this adds per-layer detection of the block-of-guesses tensors, so --clover-masks disables itself on clover_moe files without ssm_conv1d.weight_right instead of throwing. Apply-checked and build-verified on df2c3ff30. The 21 MB metadata.json key dump and the ~400 MB CPU-reference .f32 dumps are not in the tree: both are regenerable, the docs say how. --- patches/README.md | 30 + patches/README.ru.md | 29 + patches/qwen35-clover/INSTALL.md | 41 + patches/qwen35-clover/INSTALL.ru.md | 41 + patches/qwen35-clover/qwen35-clover.patch | 17 + ...run-Qwen4-35B-A3B-end-to-end-the-PLE.patch | 2180 +++++++++++++++++ patches/qwen4exp-full-port/INSTALL.md | 89 + patches/qwen4exp-full-port/INSTALL.ru.md | 90 + patches/qwen4exp-full-port/docs/PLE.md | 111 + patches/qwen4exp-full-port/docs/README.md | 109 + patches/qwen4exp-full-port/docs/TENSOR-MAP.md | 85 + .../qwen4exp-full-port/docs/tensor-layout.txt | 914 +++++++ .../verify/expected-2026-12-04/compare.txt | 3 + .../verify/expected-2026-12-04/poly.txt | 9 + .../verify/expected-2026-12-04/summary.txt | 34 + .../qwen4exp-full-port/verify/gguf_keys.py | 52 + patches/qwen4exp-full-port/verify/ids.txt | 1 + patches/qwen4exp-full-port/verify/prompt.txt | 1 + .../qwen4exp-full-port/verify/q4_cpu_ref.py | 202 ++ patches/qwen4exp-full-port/verify/q4_dump.cpp | 215 ++ patches/qwen4exp-full-port/verify/q4_test.sh | 106 + patches/qwen4exp-full-port/verify/q4_tok.py | 20 + 22 files changed, 4379 insertions(+) create mode 100644 patches/README.md create mode 100644 patches/README.ru.md create mode 100644 patches/qwen35-clover/INSTALL.md create mode 100644 patches/qwen35-clover/INSTALL.ru.md create mode 100644 patches/qwen35-clover/qwen35-clover.patch create mode 100644 patches/qwen4exp-full-port/0001-Engine-qwen4exp-run-Qwen4-35B-A3B-end-to-end-the-PLE.patch create mode 100644 patches/qwen4exp-full-port/INSTALL.md create mode 100644 patches/qwen4exp-full-port/INSTALL.ru.md create mode 100644 patches/qwen4exp-full-port/docs/PLE.md create mode 100644 patches/qwen4exp-full-port/docs/README.md create mode 100644 patches/qwen4exp-full-port/docs/TENSOR-MAP.md create mode 100644 patches/qwen4exp-full-port/docs/tensor-layout.txt create mode 100644 patches/qwen4exp-full-port/verify/expected-2026-12-04/compare.txt create mode 100644 patches/qwen4exp-full-port/verify/expected-2026-12-04/poly.txt create mode 100644 patches/qwen4exp-full-port/verify/expected-2026-12-04/summary.txt create mode 100644 patches/qwen4exp-full-port/verify/gguf_keys.py create mode 100644 patches/qwen4exp-full-port/verify/ids.txt create mode 100644 patches/qwen4exp-full-port/verify/prompt.txt create mode 100644 patches/qwen4exp-full-port/verify/q4_cpu_ref.py create mode 100644 patches/qwen4exp-full-port/verify/q4_dump.cpp create mode 100755 patches/qwen4exp-full-port/verify/q4_test.sh create mode 100644 patches/qwen4exp-full-port/verify/q4_tok.py diff --git a/patches/README.md b/patches/README.md new file mode 100644 index 000000000..65e1de1a1 --- /dev/null +++ b/patches/README.md @@ -0,0 +1,30 @@ +# PolyStrata patch bundle — Qwen4-35B-A3B support (+ Clover fix) + +Archive: **`polystrata-patches-qwen4-support-2026-12-04.zip`** (this directory zipped, minus scratch). + +Two self-contained patch bundles for the `strata-poly` engine: + +| Bundle | Adds | Base commit | Install doc | +| --- | --- | --- | --- | +| [`qwen4exp-full-port/`](qwen4exp-full-port/) | **Qwen4-35B-A3B support** on `strata-poly`: a standalone `qwen4exp` architecture engine (hybrid GDN+attention, 4-stream hyper-connections, routed+shared MoE with CPU expert offload, and the PLE n-gram table read row by row from SSD through `strata::ngram::PleReader` — the Flash Next mechanism) | `4106d1a7c` | [INSTALL.md](qwen4exp-full-port/INSTALL.md) / [INSTALL.ru.md](qwen4exp-full-port/INSTALL.ru.md) (рус.) | +| [`qwen35-clover/`](qwen35-clover/) | Clover (`clover_moe`) fix: auto-detect the block-of-guesses tensors, so `--clover-masks` disables itself instead of crashing on files without `ssm_conv1d.weight_right` | `df2c3ff30` | [INSTALL.md](qwen35-clover/INSTALL.md) / [INSTALL.ru.md](qwen35-clover/INSTALL.ru.md) (рус.) | + +Both patches were produced and verified on 2026-12-04 on the same Linux/CUDA box (RTX 3080 Ti). + +## Which bundle do I need? + +* **Qwen4 support, full port**: only if your tree is at `4106d1a7c` (or you want the standalone + `qwen4exp` derivation as it was tested). Current `main` already carries the upstream `qwen4.cpp` + architecture engine; PR #440 moves this bundle's direct-from-SSD PLE reader into it. On a current + `main`, you do **not** need the full port. +* **Clover fix**: applies on current `main` (`df2c3ff30`+). Upstream `main` already contains the + `ssm_a = -exp(A_log)` conversion half of the old Clover fix; this patch adds the missing half + (the bd / guessed-token side auto-detection). + +## Regenerating bundle artifacts + +* `qwen4exp-full-port/docs/metadata.json` — the model's full GGUF key/value dump, produced by the + `gguf_keys.py`-style parse of both shards; it is documentation, not an input. +* The CPU-reference stage dumps (`*.f32`, ~400 MB) are **not** in the zip: regenerate them with + the bundle's `verify/q4_dump.cpp` (compile against the GGUFs, it writes + `/tmp/opencode/q4_dump/`; point `Q4DUMP` at wherever you put it). diff --git a/patches/README.ru.md b/patches/README.ru.md new file mode 100644 index 000000000..191c176fa --- /dev/null +++ b/patches/README.ru.md @@ -0,0 +1,29 @@ +# Бандл патчей PolyStrata — поддержка Qwen4-35B-A3B (+ фикс Clover) + +Архив: **`polystrata-patches-qwen4-support-2026-12-04.zip`** (этот каталог в zip, без временных файлов прогонов). + +Два самодостаточных набора патчей для движка `strata-poly`: + +| Набор | Что добавляет | Базовый коммит | Документация по установке | +| --- | --- | --- | --- | +| [`qwen4exp-full-port/`](qwen4exp-full-port/) | **Поддержка Qwen4-35B-A3B** в `strata-poly`: отдельная архитектура `qwen4exp` (гибрид GDN+attention, гипер-связи из 4 потоков, маршрутизированные + общие эксперты с выгрузкой на CPU, и PLE-таблица n-грамм, читаемая строками прямо с SSD через `strata::ngram::PleReader` — тот же механизм, что у Flash Next) | `4106d1a7c` | [INSTALL.ru.md](qwen4exp-full-port/INSTALL.ru.md) / [INSTALL.md](qwen4exp-full-port/INSTALL.md) (EN) | +| [`qwen35-clover/`](qwen35-clover/) | Фикс Clover (`clover_moe`): автоопределение тензоров «блока догадок», поэтому `--clover-masks` сам себя отключает вместо падения на файлах без `ssm_conv1d.weight_right` | `df2c3ff30` | [INSTALL.ru.md](qwen35-clover/INSTALL.ru.md) / [INSTALL.md](qwen35-clover/INSTALL.md) (EN) | + +Оба патча созданы и проверены 04.12.2026 на той же Linux/CUDA машине (RTX 3080 Ti). + +## Какой набор нужен? + +* **Полный порт поддержки Qwen4**: только если ваше дерево на коммите `4106d1a7c` (или вам нужен ровно + тот автономный порт `qwen4exp`, каким он был протестирован). Текущий `main` уже содержит апстримовый + движок архитектуры `qwen4.cpp`; PR #440 переносит в него direct-чтение PLE с SSD из этого бандла. + На текущем `main` полный порт **не нужен**. +* **Фикс Clover**: ставится на текущий `main` (`df2c3ff30`+). Половину прежнего Clover-фикса + (`ssm_a = -exp(A_log)`) апстрим уже содержит; этот патч добавляет недостающую половину + (автоопределение bd-половины / «блока догадок»). + +## Как заново получить артефакты бандла + +* `qwen4exp-full-port/docs/metadata.json` — полный дамп ключей/значений GGUF обеих шард; это + документация, а не входные данные. +* Дампы стадий CPU-эталона (`*.f32`, ~400 МБ) в zip **не входят**: воссоздайте их утилитой + `verify/q4_dump.cpp` (пишет в `/tmp/opencode/q4_dump/`; переменной `Q4DUMP` укажите своё место). diff --git a/patches/qwen35-clover/INSTALL.md b/patches/qwen35-clover/INSTALL.md new file mode 100644 index 000000000..bd2be1b56 --- /dev/null +++ b/patches/qwen35-clover/INSTALL.md @@ -0,0 +1,41 @@ +# Install — Clover (`clover_moe`) block auto-detection fix + +**What it fixes.** Clover `clover_moe` GGUFs come in two shapes: with the "block of guesses" side of +the GDN block (`ssm_conv1d.weight_right`, `ssm_bd_logit_scale.weight`, `ssm_bd_history.*`) and without +it. With `--clover-masks` set, the engine used to demand those tensors unconditionally and crashed on +loading a file that has none of them. The patch detects `ssm_conv1d.weight_right` per layer: the bd +tensors are loaded only when it exists, and a `--clover-masks` request on a file without them disables +itself (the block runs plain GDN) instead of crashing. + +The other half of the old Clover fix — reading `ssm_a` as `A_log` (`-exp(A_log)`) for `clover_moe` +files — is already in `main`; this patch does not repeat it. + +**Base commit.** `df2c3ff30` (current `main`). `git apply --check` verified on 2026-12-04; the tree +builds clean with and without the patch (`strata-poly` target, Linux CUDA). + +## Apply + +```bash +cd # on main, clean tree +git apply patches/qwen35-clover/qwen35-clover.patch +cmake --build terminal/build-poly --target strata-poly -j 10 +``` + +## Revert + +```bash +git apply -R patches/qwen35-clover/qwen35-clover.patch +cmake --build terminal/build-poly --target strata-poly -j 10 +``` + +(Or just `git checkout -- engine/src/poly/qwen35.cpp` and rebuild.) + +## Check it worked + +Load a `clover_moe` GGUF that has no `ssm_conv1d.weight_right` with `--clover-masks `: + +* before the patch: the load throws a missing-tensor error naming `ssm_conv1d.weight_right`; +* after the patch: the model loads and runs, the mask path simply stays off. + +A Clover file **with** the bd tensors is unaffected: with `--clover-masks` the block keeps its guessed- +token side exactly as before. diff --git a/patches/qwen35-clover/INSTALL.ru.md b/patches/qwen35-clover/INSTALL.ru.md new file mode 100644 index 000000000..fdef6af18 --- /dev/null +++ b/patches/qwen35-clover/INSTALL.ru.md @@ -0,0 +1,41 @@ +# Установка — фикс автоопределения блока Clover (`clover_moe`) + +**Что исправляет.** GGUF архитектуры `clover_moe` бывают двух видов: с «блоком догадок» в GDN-блоке +(`ssm_conv1d.weight_right`, `ssm_bd_logit_scale.weight`, `ssm_bd_history.*`) и без него. С включённым +`--clover-masks` движок безусловно требовал эти тензоры и падал при загрузке файла, в котором их нет. +Патч проверяет наличие `ssm_conv1d.weight_right` послойно: bd-тензоры грузятся только если он есть, а +запрос `--clover-masks` на файле без них сам себя отключает (блок работает как обычный GDN) вместо +падения. + +Вторая половина прежнего Clover-фикса — чтение `ssm_a` как `A_log` (`-exp(A_log)`) для `clover_moe` — +уже есть в `main`; этот патч её не повторяет. + +**Базовый коммит.** `df2c3ff30` (текущий `main`). `git apply --check` проверен 04.12.2026; дерево +собирается без ошибок и с патчем, и без него (цель `strata-poly`, Linux CUDA). + +## Применение + +```bash +cd <копия PolyStrata> # чистый main +git apply patches/qwen35-clover/qwen35-clover.patch +cmake --build terminal/build-poly --target strata-poly -j 10 +``` + +## Откат + +```bash +git apply -R patches/qwen35-clover/qwen35-clover.patch +cmake --build terminal/build-poly --target strata-poly -j 10 +``` + +(или просто `git checkout -- engine/src/poly/qwen35.cpp` и пересобрать.) + +## Как проверить, что помогло + +Загрузите GGUF `clover_moe` без `ssm_conv1d.weight_right` с `--clover-masks `: + +* до патча: загрузка падает с ошибкой отсутствующего тензора, называющей `ssm_conv1d.weight_right`; +* после патча: модель загружается и работает, маска просто остаётся выключенной. + +Clover-файл **с** bd-тензорами не затрагивается: с `--clover-masks` блок сохраняет «сторону догадок» +ровно как раньше. diff --git a/patches/qwen35-clover/qwen35-clover.patch b/patches/qwen35-clover/qwen35-clover.patch new file mode 100644 index 000000000..eee20d58d --- /dev/null +++ b/patches/qwen35-clover/qwen35-clover.patch @@ -0,0 +1,17 @@ +diff --git a/engine/src/poly/qwen35.cpp b/engine/src/poly/qwen35.cpp +index 68fee3bc8..d751fb535 100644 +--- a/engine/src/poly/qwen35.cpp ++++ b/engine/src/poly/qwen35.cpp +@@ -158,7 +158,11 @@ void Qwen35::load_layer(int il) { + B.beta = mat("ssm_beta.weight", n_embd_, v_heads_); + B.o_norm = f32("ssm_norm.weight", s_dim_); + B.wo = mat("ssm_out.weight", d_inner_, n_embd_); +- if (mask_ >= 0) { ++ // Clover's guessed-token side of the block - the right conv half and the bd terms - is in some Clover ++ // files only. Without those tensors the block is plain GDN: --clover-masks then disables itself. ++ const bool clover_block = clover_ && tensor(il, "ssm_conv1d.weight_right") != nullptr; ++ if (mask_ >= 0 && !clover_block) mask_ = -1; ++ if (clover_block && mask_ >= 0) { + B.conv_right = f32("ssm_conv1d.weight_right", kConv - 1, conv_dim_); + B.bd_scale = f32("ssm_bd_logit_scale.weight", v_heads_); + B.bd_hist_b = f32("ssm_bd_history.bias", v_heads_); diff --git a/patches/qwen4exp-full-port/0001-Engine-qwen4exp-run-Qwen4-35B-A3B-end-to-end-the-PLE.patch b/patches/qwen4exp-full-port/0001-Engine-qwen4exp-run-Qwen4-35B-A3B-end-to-end-the-PLE.patch new file mode 100644 index 000000000..d8ab07cff --- /dev/null +++ b/patches/qwen4exp-full-port/0001-Engine-qwen4exp-run-Qwen4-35B-A3B-end-to-end-the-PLE.patch @@ -0,0 +1,2180 @@ +From eeccf0ee40dd1b39d8bdbbb0f5a7fa70265247a3 Mon Sep 17 00:00:00 2001 +From: VecSzn <82099364+VecSzn@users.noreply.github.com> +Date: Fri, 4 Dec 2026 16:29:33 +0000 +Subject: [PATCH] [Engine] qwen4exp: run Qwen4-35B-A3B end to end, the PLE over + the Flash Next table reader + +New poly architecture engine/src/poly/qwen4exp.{hpp,cpp}, a Qwen35 derivation: 41 hybrid +layers (GDN with a sigmoid output gate via Qwen35's new gate_silu_, an attention every +fourth), 4-stream hyper-connections, routed + shared MoE with CPU expert offload, and +layer 1's PLE. The PLE hashes n-grams 2..3 on the host and reads the 160M-row Q5_1 table +through strata::ngram::PleReader - the same Direct/O_DIRECT reader and row cache the Flash +Next serve uses, with its keepalive defaults - then runs new ple_mix and ple_conv_add +kernels; the conv state is persistent and chunk-exact. Qwen35 loses final/private so the +derivation can hook load_layer/gdn; --kv q8_0/q4_0 accept the new arch; a file without an +output norm (qwen4exp carries it in the final mixer) leaves the Dev empty. + +Verified: blk0/blk1 stage sums match a float CPU reference within quant noise (PLE on: +blk1 attn_in -7.4835 vs -7.4789 expected; without the PLE it is -16.4); a 256-token greedy +run matched llama.cpp token for token for 141 tokens, then parted onto its own coherent +continuation. Not ported yet: the QSA k-pool indexer (dense attention matches below its +top_k 2048) and the MTP block (draft forced off); docs/qwen4exp-port/PLE.md spells out +the mechanism and the expected divergences. The tokenizer patch teaches +terminal/tools/strata_tokenizer.py the qwen4 pre-tokenizer (qwen35 pattern, ignore_merges). +--- + docs/qwen4exp-port/PLE.md | 111 +++ + docs/qwen4exp-port/README.md | 109 +++ + docs/qwen4exp-port/TENSOR-MAP.md | 85 +++ + docs/qwen4exp-port/tensor-layout.txt | 914 +++++++++++++++++++++++++ + engine/cmake/strata_poly.cmake | 8 +- + engine/include/strata/poly/kernels.hpp | 21 +- + engine/src/poly/engine.cpp | 20 +- + engine/src/poly/kernels.cu | 96 ++- + engine/src/poly/qwen35.cpp | 8 +- + engine/src/poly/qwen35.hpp | 6 +- + engine/src/poly/qwen4exp.cpp | 366 ++++++++++ + engine/src/poly/qwen4exp.hpp | 129 ++++ + terminal/tools/strata_tokenizer.py | 4 +- + 13 files changed, 1846 insertions(+), 31 deletions(-) + create mode 100644 docs/qwen4exp-port/PLE.md + create mode 100644 docs/qwen4exp-port/README.md + create mode 100644 docs/qwen4exp-port/TENSOR-MAP.md + create mode 100644 docs/qwen4exp-port/tensor-layout.txt + create mode 100644 engine/src/poly/qwen4exp.cpp + create mode 100644 engine/src/poly/qwen4exp.hpp + +diff --git a/docs/qwen4exp-port/PLE.md b/docs/qwen4exp-port/PLE.md +new file mode 100644 +index 000000000..37a2004d6 +--- /dev/null ++++ b/docs/qwen4exp-port/PLE.md +@@ -0,0 +1,111 @@ ++# Qwen4Exp PLE (per-layer embeddings) in the poly port ++ ++Status: **implemented and numerically verified** against a float CPU reference ++(`/tmp/opencode/q4_cpu_ref.py`) and against llama.cpp's greedy outputs. The n-gram table reads run ++through `strata::ngram::PleReader`, the same direct-from-SSD reader the Flash Next serve uses, with ++the serve's own defaults. The port is per-token identical to the reference down to quantization ++noise at the PLE layer; it is not yet bit-identical to llama.cpp end to end (see *Not yet ported*). ++ ++## What the PLE is in this model ++ ++`ple.layers=[1]`: the block embedding of layer 1 only. Before layer 1's mixer, llama.cpp's ++`build_ple` (llama.cpp `src/models/qwen4exp.cpp`) adds a retrieved-plus-gated-plus-convolved n-gram ++embedding to the four hyper-connection streams: ++ ++- every token hashes its n-grams 2 and 3 to 8 heads each - 16 table rows in head order; ++- the rows dequantize to 16 x `head_dim` = 8192 floats, the `ple_key` gemv reads them into the four ++ streams' queries, the `ple_value` gemv into their values; ++- each stream gates `sigmoid(sign(s) * sqrt(clamp(|s|, 1e-6)))` where `s` is the grouped_norm'd query ++ dotted with the grouped_norm'd value, scales the value by it, group-norms again with the conv norm; ++- a depthwise causal conv (kernel 4, dilation 3: taps at t-9, t-6, t-3, t) runs over each stream's ++ 2048 channels with persistent state, and `res_hc += gated + conv_out` **before** the block's ++ attention mixer consumes the stack. ++ ++The port runs this at `il == ple_il_` inside `Qwen4Exp::step`, exactly where llama.cpp's graph ++inserts it, and passes its own multi-stream `res` as `hidden` - the CPU reference originally tiled a ++single stream there, which is wrong: llama.cpp feeds the real four streams. ++ ++## Row hashes (host side) ++ ++`Qwen4Exp::ple_rows` transcribes llama.cpp's `llm_graph_input_qwen4exp_ple::set_input`: ++ ++- window = the token and its two predecessors; a position before the sequence start contributes ++ TOKEN_NULL, an EOS at a predecessor cuts that position **and every older one**, and the token's own ++ EOS does not cut its own context; ++- a gram hashes as `XOR_j (token_j * multiplier_j)` mod 2^64 with the GGUF's ++ `ple.layer_multipliers`; ++- a head's row is `mixed % ple.head_vocab_sizes[h] + ple.head_offsets[h]` - a true modulo against ++ each head's own vocabulary size (10,000,019 .. 10,000,339), not a mask. Heads 0..7 are gram 2, ++ 8..15 gram 3, matching the head order llama.cpp gathers `emb_p` in. ++ ++`ple_toks_` records the sequence's tokens so predecessors resolve; it resets with the conv state at ++`pos_ == 0`. ++ ++## Table reads: the Flash Next mechanism ++ ++The 160,003,584-row table lives in shard 00002 (15.4 GB of Q5_1 rows, 96 B per row at head_dim 128) - ++far past any reasonable resident size, and the same physical layout Flash Next's n-gram PLE uses. ++The port reads it through `strata::ngram::PleReader` (`engine/include/strata/ngram/ple_reader.hpp`), ++not a mapped gather: ++ ++- `open(path, table_offset, n_rows, max_inflight=256, cache_rows=1<<20, ..., io_thread=true)`, ++ `set_keepalive(100 ms, 60 s)` - the values `terminal/strata-iq3_xxs.json`'s serve runs with; ++- Direct mode: an O_DIRECT `pread` thread pool that bypasses the page cache and keeps the file's few ++ GB of hot rows out of the 60 GB host RAM; rows land in the reader's LRU row cache (~100 MB at 96 ++ B/row); ++- per chunk of `kPleTok = 16` tokens, `ple_apply` issues `m * 16` rows and collects them into a ++ pinned raw buffer (the reader dedupes and sorts pages for the parallel preads), dequantizes Q5_1 to ++ floats in head order on the host, and uploads one contiguous 16 x 8192 block. ++ ++`Qwen4Exp`'s destructor prints the reader's statistics the way the Flash Next serve reports its ++n-gram reads. Measured over the 268-token smoke run (12 prompt + 256 greedy): ++ ++ PLE table: 4272 rows asked, 1088 from the row cache, 3184 SSD reads of 13275136 bytes, ++ 3184 rows cached, collect waited 95.6 ms ++ ++4272 = 267 PLE tokens x 16 rows; 13275136 = 3184 x 96 B; 95.6 ms of collect waits over 267 tokens ++(~0.36 ms/token) hides inside the block's other work. The row cache's 1088 hits are the prompt ++re-hash at the first decode step, where rows repeat. ++ ++One harness note inherited from the engine: `reset_call()` runs before the step's token ids are ++bound, so rows cannot be issued before the first chunk of a call; the reader's io thread provides the ++intra-chunk overlap instead. A batched `step()` (rows_of_, where a row belongs to no single token ++history) skips the PLE with a once-logged warning. ++ ++## Kernels and weights ++ ++- `ple_mix` (`engine/src/poly/kernels.cu`): one block per (token, stream) - grouped_norm of key and ++ query over the 4 x 2048 stack, dot into `s`, the sign-sqrt gate, `gated`, and the normed output ++ (scaled by `|gate| * rms(value)` the way llama.cpp's grouped_norm divides); ++- `ple_conv_add`: per channel window, the persistent `9 x 8192` conv state plus the chunk's new rows ++ in registers, the three dilated taps with SiLU applied sequentially (tap t-3 sees this chunk's ++ rows), `res[...] += gated + conv_out`, and the state advanced - chunk boundaries exact; ++- weights: `blk.1.ple_{key,value}.weight` upload as BF16 `kFloatMat` (staying BF16 on device), the ++ three `ple_norm_*` and `ple_conv1d` as `kF32`; `ple_conv1d` is flat `[channel*4 + tap]` on device, ++ matching the conv kernel's indexing. ++ ++## Numerical check (pos 0, token 0) ++ ++CPU float reference vs the port's `--dump-layers` at the PLE layer: ++ ++| row | reference sum / abs | port sum / abs | ++|---|---|---| ++| `ple_gated` | 3.1417 / 256.79 | 3.1881 / 260.58 | ++| `ple_normed` | 47.6939 / 3384.73 | 47.6925 / 3384.65 | ++| `ple_res` | -5.6762 / 601.47 | -5.6771 / 603.48 | ++| blk1 `attn_in` | -7.4789 / 506.44 | -7.4835 / 506.10 | ++ ++The residuals sit inside the bf16-weight, Q8_1-activation quantization noise; without the PLE the ++same `attn_in` sum is -16.4 against the reference's -7.5, so the mechanism's magnitude and sign both ++verify. The greedy smoke run matched llama.cpp's reference token for token for the first 141 ++generated tokens and then parted onto its own coherent continuation. ++ ++## Not yet ported (expected divergences) ++ ++- the QSA k-pool indexer (`blk.N.indexer.*`, `compress_ratios=4` on every attention layer). Below ++ the indexer's top_k (2048) it selects every block, so dense attention gives the same sums - that ++ is why short runs match - but the port has no k-pool and the divergence of long runs starts there ++ and in accumulated quantization noise, not in the PLE; ++- the MTP block (`blk.40.nextn.*`): draft is forced off before `load_shape()`. ++ ++Neither is a PLE gap; the PLE runs for every token of every single-sequence step. +diff --git a/docs/qwen4exp-port/README.md b/docs/qwen4exp-port/README.md +new file mode 100644 +index 000000000..a50a04fa7 +--- /dev/null ++++ b/docs/qwen4exp-port/README.md +@@ -0,0 +1,109 @@ ++# Qwen4-35B-A3B (`qwen4exp`) PolyStrata port ++ ++Status: **running**. The runtime port (`engine/src/poly/qwen4exp.*`) loads and generates: 41 layers, hybrid GDN/full attention, hyper-connections, routed+shared MoE with CPU expert offload, and the layer-1 PLE over the Flash Next n-gram SSD reader (see [PLE.md](PLE.md)). A 256-token greedy run matched llama.cpp token for token for 141 tokens, then diverged coherently. Not ported yet: the QSA k-pool indexer and the MTP block (draft forced off). Tensor map, metadata dump and tokenizer are done. This document is the working log for porting `unsloth/Qwen4-35B-A3B-GGUF:UD-Q5_K_M` to PolyStrata's poly engine. ++ ++## Target model ++ ++- GGUF: `/home/inex/models/Qwen4-35B-A3B-UD-Q5_K_M/Qwen4-35B-A3B-UD-Q5_K_M-00001-of-00002.gguf` (+ shard 00002) ++- Architecture: `qwen4exp` ++- Family: `qwen35moe`-like MoE+hybrid attention, but **not** compatible with existing `poly/qwen35.cpp` ++- Size: ~41 GiB UD-Q5_K_M, 2 shards, 912 tensors ++- Context in metadata: 1,048,576; practical local VRAM limits apply (12GB 3080 Ti cannot hold full weights). ++ ++## What already works ++ ++- **llama.cpp** updated build can run this GGUF with CPU MoE offload: ++ - `/home/inex/llama.cpp/build/bin/llama-server` (v1.1.0-dev build 308, commit 72a780e) ++ - Working command: `CUDA_VISIBLE_DEVICES=1 ... -ngl 99 -c 4096 -ot ".ffn_.*_exps.=CPU" -b 2048 -ub 512 -fa on --threads 6 --threads-batch 12 --prio 2 --jinja` ++ - Isolated short-prompt decode ~25-26 tok/s; prompt speed varies. ++- **PolyStrata tokenizer**: patched `terminal/tools/strata_tokenizer.py` to recognize `tokenizer.ggml.pre=qwen4` as Qwen35 pre-tokenizer pattern with `ignore_merges=true`. Roundtrip check passed. ++ ++## What blocks PolyStrata poly engine ++ ++`tools/qwen4_intake.py` verdict: `CASE C: port first`. ++ ++Observed blockers from intake/report: ++- 363 tensors not named by Qwen3.6-35B-A3B layout (`hc_*`, `ple_*`, `indexer_*`, `attn_qkv_gate`, etc.). ++- 204 tensors expected by Qwen3.6 layout missing. ++- 1 reshape mismatch: `blk.40.nextn.hnorm.weight` `[8192]` vs `[2048]`. ++- Dense BF16 MMVQ/native kernel blocker reported by intake for some tensors. ++- Runtime: `strata-poly` rejects `qwen4exp` as unsupported architecture. ++ ++## Key architecture differences (from GGUF metadata / refs) ++ ++- Hyper-connections: `hyper_connection.count=4`, `low_rank=256`, output HC tensors. ++- PLE (per-layer embeddings / n-gram hash): `ple.*` keys, `ple.layers=[1]`, `ngram_size=3`, `heads_per_ngram=8`, `conv_kernel=4`, head offsets/vocab sizes/multipliers, image token id. ++- Indexer/QSA: `attention.indexer.*`, `attention.compress_ratios`, recurrent/full layer mix. ++- Hybrid layers: 41 blocks total, `nextn_predict_layers=1`; recurrent layers per `attention.recurrent_layers`; full attention interval 4. ++- SSM/GDN-like params present (`ssm.*`), but tensor naming differs from Qwen3.5 poly layout (`attn_qkv_gate`, `ssm_beta_alpha.weight`, no `attn_norm/post_attention_norm/ssm_alpha/ssm_beta` as Qwen35 expects). ++- Tokenizer: `gpt2` model, `pre=qwen4`, same vocab as Flash-Next; `ignore_merges=true` like glm4 behavior in llama.cpp. ++ ++## Tensor layout (normalized) ++ ++See `tensor-layout.txt` generated from GGUF. Summary: ++ ++- Common per-block routed FFN tensors exist: `ffn_gate_inp`, `ffn_{gate,up,down}_exps`, shared expert tensors. ++- Full-attention blocks have `attn_q/k/v`, norms, output, indexer projections/norms. ++- Recurrent blocks have `attn_qkv_gate`, `ssm_*`, `hc_*`. ++- PLE appears only on block 1. ++- Nextn/MTP block 40 has `nextn.*` tensors. ++- Global: `token_embd.weight`, `output.weight`, `output_hc_*`. ++ ++## Reference code ++ ++- llama.cpp reference: `/home/inex/llama.cpp/src/models/qwen4exp.cpp`, `/home/inex/llama.cpp/src/llama-vocab.cpp` (`qwen4` pretokenizer = QWEN35 + ignore_merges). ++- PolyStrata third_party: `engine/third_party/strata-llama/src/models/qwen4exp.cpp` (same shape of implementation), gguf-py conversion has `qwen4exp.py`. ++- PolyStrata poly engine: `engine/src/poly/engine.cpp` dispatch, `engine/src/poly/qwen35.*` closest existing hybrid MoE implementation. ++- PolyStrata generate/split have partial qwen4exp awareness, but poly CUDA engine does not. ++ ++## Port strategy ++ ++1. **Document & map** (this folder). Keep status honest. ++2. **Tokenizer/tools** - done for `strata_tokenizer.py`. ++3. **Arch detection** - make poly engine recognize `qwen4exp` and route to dedicated implementation/stub with clear diagnostics. ++4. **Minimal skeleton** - add `engine/src/poly/qwen4exp.hpp/.cpp` (or equivalent), wire CMake/build, compile. ++5. **Weight loading** - map GGUF tensors to runtime structures, including HC/PLE/indexer/MTP. ++6. **Graph/runtime** - implement forward pass. Reuse existing kernels where possible; add missing kernels for HC/PLE/indexer/QSA as needed. ++7. **Validation** - compare logits/tokens against llama.cpp on small prompts, then benchmark. ++ ++## Risks / constraints ++ ++- This is a large engine port, not a config-only change. ++- 12GB VRAM is insufficient for full 42GB weights; expect CPU offload/mmap/partial residency design constraints. ++- PolyStrata local repo has dirty/untracked files; avoid touching unrelated files. ++- Live `:8080` must remain stable; isolated tests only. ++- `terminal/strata-iq3_xxs.json` must remain byte-for-byte untouched. ++ ++## Files touched so far ++ ++- `terminal/tools/strata_tokenizer.py` - added `qwen4` pretokenizer + ignore_merges. ++- `docs/qwen4exp-port/*` - this documentation. ++ ++## Next concrete steps ++ ++- [x] Generate full tensor map and metadata dump (`tensor-layout.txt` 912 tensors verified byte-for-byte against a second parser; `metadata.json` is now valid JSON with the full header metadata; type names follow the `ggml.h` enum, which has gaps - an earlier parser draft misnamed quant types). ++- [ ] Add `qwen4exp` architecture recognition in `engine/src/poly/engine.cpp`. ++- [ ] Add skeleton `qwen4exp` engine class and CMake wiring. ++- [ ] Map tensor names to loader structs. ++- [ ] Implement HC residual/mixer path. ++- [ ] Implement PLE n-gram embedding path. ++- [ ] Implement indexer/QSA attention path. ++- [ ] Implement MTP/nextn block handling. ++- [ ] Add isolated smoke test command/logging. ++ ++## Status log ++ ++- 2026-12-04: llama.cpp `72a780e` (build 308) ran this GGUF isolated on port 19998 against the 3080 Ti ++ (selected by UUID `GPU-160a10ef-6095-54fd-d6f5-9cf0968396f8`, not by `CUDA_VISIBLE_DEVICES=1` - that ++ bound the wrong card): `-ngl 99 -ot ".ffn_.*_exps.=CPU" -c 4096 -b 2048 -ub 512 -fa on --threads 6 ++ --threads-batch 12 --prio 2 --jinja`, ~33 tok/s generation. Server stopped afterwards; `:8080` untouched. ++- 2026-12-04: `metadata.json` regenerated from the GGUF headers (was malformed); `tensor-layout.txt` verified ++ against a second parser (all 911 shard-1 tensors match; `per_layer_token_embd.weight` from shard 2 appended); ++ `TENSOR-MAP.md` rewritten from the verified dump. ++- 2026-12-04: GGUF v3 layout note: KV metadata comes before the tensor infos; ggml type enum has gaps ++ (`Q5_0=6 ... Q5_1=7 ... Q5_K=13 ... BF16=30`), so a dense type table misnames quants. Parser: `/tmp/opencode/q4_gguf.py`. ++- In progress: `engine/src/poly/qwen4exp.hpp/.cpp` skeleton exists but does not compile yet. Unconfirmed static ++ analysis: hyper-connection kernels `gr_read`/`gr_write` exist in `engine/include/strata/kernels/gr.hpp` ++ (dense engine); whether the poly target can link them is being verified, as are the exact poly kernel signatures. ++- Open decision: the PLE table is 15.36 GB (Q5_1, shard 2) and free host RAM is ~7 GB - the port must either ++ mmap-gather it or skip `blk.1.ple.*` in the first runnable pass. Documented either way. +diff --git a/docs/qwen4exp-port/TENSOR-MAP.md b/docs/qwen4exp-port/TENSOR-MAP.md +new file mode 100644 +index 000000000..0b54e2500 +--- /dev/null ++++ b/docs/qwen4exp-port/TENSOR-MAP.md +@@ -0,0 +1,85 @@ ++# Qwen4-35B-A3B (`qwen4exp`) tensor map ++ ++Source: `unsloth/Qwen4-35B-A3B-GGUF/UD-Q5_K_M`, GGUF v3, 2 shards. ++Shard 1 carries 911 tensors; shard 2 carries only `per_layer_token_embd.weight`. ++All shapes and types below are read from the file headers (parser: `/tmp/opencode/q4_gguf.py`, ++type names per llama.cpp `ggml.h`); full per-tensor dump: `tensor-layout.txt`, machine-readable: `metadata.json`. ++ ++## Global tensors ++ ++| GGUF | Dims | Type | Notes | ++|---|---|---|---| ++| `token_embd.weight` | `[2048, 248320]` | Q5_K | token embeddings | ++| `output.weight` | `[2048, 248320]` | Q8_0 | not tied, present explicitly | ++| `output_hc_norm.weight` | `[8192]` | F32 | final HC norm (= 4 streams x 2048, flat) | ++| `output_hc_down.weight` | `[8192, 256]` | Q8_0 | final HC down (low-rank 256) | ++| `output_hc_up.weight` | `[256, 8192]` | Q8_0 | final HC up | ++| `per_layer_token_embd.weight` | `[128, 160003584]` | Q5_1 | PLE n-gram table, shard 2, 15.36 GB (16 heads x ~10M rows x 128 dims) | ++ ++## Per-block tensors (41 blocks) ++ ++### Hyper-connection (all 41 blocks) ++- `blk.N.hc_attn_norm.weight` `[8192]` F32 - flat `4 x 2048`, gamma pre-folded to `1+w` ++- `blk.N.hc_attn_down_inject.weight` `[8192, 260]` Q8_0/Q6_K - rows `0..255` = low-rank down, last 4 = inject ++- `blk.N.hc_attn_up.weight` `[256, 8192]` Q6_K/Q8_0 - gate up projection ++- same four for `hc_ffn_*` ++ ++### Recurrent/GDN blocks (30 blocks: 0-2,4-6,8-10,...,36-38) ++- `blk.N.attn_qkv_gate.weight` `[2048, 12288]` Q6_K - combined qkv (8192 rows) + output gate z (4096 rows) ++- `blk.N.ssm_conv1d.weight` `[4, 8192]` F32 - depthwise conv, kernel 4 ++- `blk.N.ssm_beta_alpha.weight` `[2048, 64]` Q8_0 - combined beta (32 rows) + alpha (32 rows) ++- `blk.N.ssm_a` `[32]` F32, `blk.N.ssm_dt.bias` `[32]` F32 ++- `blk.N.ssm_norm.weight` `[128]` F32 - per-head group norm ++- `blk.N.ssm_out.weight` `[4096, 2048]` Q8_0 - output projection ++ ++### Full attention blocks (11 blocks: 3,7,11,15,19,23,27,31,35,39,40) ++- `blk.N.attn_q.weight` `[2048, 8192]` - query (16 x 256) + gate (16 x 256), like Qwen3Next ++- `blk.N.attn_k.weight` `[2048, 512]`, `blk.N.attn_v.weight` `[2048, 512]` - 2 KV heads x 256 ++- `blk.N.attn_output.weight` `[4096, 2048]` ++- `blk.N.attn_q_norm.weight` `[256]` F32, `blk.N.attn_k_norm.weight` `[256]` F32 ++- types: Q6_K or Q8_0 per layer (Unsloth dynamic mix) ++- Indexer/QSA (deferred in the first port pass): `indexer.q_proj` `[2048, 512]` BF16, ++ `indexer.k_proj` `[2048, 128]` BF16, `indexer.q_norm`/`indexer.k_norm` `[128]` F32 ++ ++### PLE block (block 1 only, `ple.layers=[1]`) ++- `blk.1.ple_key.weight` `[2048, 8192]` BF16 ++- `blk.1.ple_value.weight` `[2048, 2048]` BF16 ++- `blk.1.ple_conv1d.weight` `[4, 8192]` F16 (note: F16, not F32) ++- `blk.1.ple_norm_key/query/conv.weight` `[8192]` F32 ++- table side: `per_layer_token_embd.weight` above; hashed 3-gram lookup, 16 heads (`ple.head_offsets` len 16) ++ ++### MoE (all 41 blocks) ++- `blk.N.ffn_gate_inp.weight` `[2048, 256]` F32 (router), `blk.N.ffn_gate_inp_shexp.weight` `[2048]` F32 ++- `blk.N.ffn_gate_exps/ffn_up_exps.weight` `[2048, 512, 256]` Q5_K/Q6_K; `ffn_down_exps` `[512, 2048, 256]` Q6_K ++- shared expert: `ffn_gate_shexp/up_shexp` `[2048, 512]`, `ffn_down_shexp` `[512, 2048]` Q6_K/Q8_0 ++ ++### Nextn/MTP head (block 40, which is also a full-attention block) ++- `blk.40.nextn.eh_proj.weight` `[4096, 2048]` Q6_K ++- `blk.40.nextn.enorm.weight` `[2048]` F32, `blk.40.nextn.hnorm.weight` `[8192]` F32 ++- `blk.40.nextn.hc_head_norm.weight` `[8192]` F32, `hc_head_down` `[8192, 256]` Q6_K, `hc_head_up` `[256, 8192]` Q6_K ++ ++## Geometry / metadata (from shard 1 header) ++ ++- `block_count=41` (40 main layers + 1 nextn draft), `nextn_predict_layers=1` ++- `embedding_length=2048`, `n_vocab=248320`, `context_length=1048576` ++- `attention.head_count=16`, `head_count_kv=2`, `key_length=value_length=256` ++- `attention.recurrent_layers`: true for 0-2,4-6,8-10,...,36-38 (30 blocks) ++- `attention.compress_ratios`: 4 on 3,7,...,39,40; 0 elsewhere (`indexer.top_k=2048`, 4 heads, key 128) ++- `hyper_connection.count=4`, `low_rank=256` ++- `expert_count=256`, `expert_used_count=8`, `expert_ff=512`, `shared_ff=512` ++- `ple.*`: ngram_size=3, heads_per_ngram=8, conv_kernel=4, eos=248044, image=248056, ++ `head_offsets` len 16 (0 .. 150002747), `head_vocab_sizes` ~10,000,xxx each, sum = 160,003,584 rows, ++ `layer_multipliers=[23703573157769, 20109073645365, 8052911324071]` ++- `rope.dimension_sections=[11,11,10,0]`, `freq_base=1e7`, `layer_norm_rms_epsilon=1e-6` ++ ++## Mapping notes for the poly port ++ ++- Qwen35 poly expects `attn_norm/post_attention_norm/attn_qkv/attn_gate/ssm_alpha/ssm_beta` naming; ++ qwen4exp uses HC norms + combined tensors. Not a rename - a dedicated loader/runtime path. ++- Combined tensors must be row-sliced into two `Dev`s, not uploaded whole: ++ `attn_qkv_gate` (8192 qkv rows + 4096 gate rows), `ssm_beta_alpha` (32 + 32), ++ `hc_*_down_inject` (256 + 4), `attn_q` (4096 query + 4096 gate). ++- Full-attention `attn_q` includes the gate (llama.cpp `build_layer_attn` views Qcur_full as query+gate). ++- QSA/indexer is deferred: dense full attention is the mathematically superset fallback. ++- PLE table (15.36 GB) cannot be memcpy'd into the ~7 GB free host RAM: the port needs mmap'd ++ gather from shard 2 (or a documented skip of `blk.1.ple.*` for the first runnable pass). +diff --git a/docs/qwen4exp-port/tensor-layout.txt b/docs/qwen4exp-port/tensor-layout.txt +new file mode 100644 +index 000000000..55a5fbaf9 +--- /dev/null ++++ b/docs/qwen4exp-port/tensor-layout.txt +@@ -0,0 +1,914 @@ ++# Qwen4-35B-A3B UD-Q5_K_M tensor layout ++# tensors=911 ++blk.0.ffn_gate_inp.weight shape=[np.uint64(2048), np.uint64(256)] type=F32 ++blk.0.ffn_gate_inp_shexp.weight shape=[np.uint64(2048)] type=F32 ++blk.0.hc_attn_down_inject.weight shape=[np.uint64(8192), np.uint64(260)] type=Q8_0 ++blk.0.hc_attn_norm.weight shape=[np.uint64(8192)] type=F32 ++blk.0.hc_ffn_down_inject.weight shape=[np.uint64(8192), np.uint64(260)] type=Q8_0 ++blk.0.hc_ffn_norm.weight shape=[np.uint64(8192)] type=F32 ++blk.0.ssm_a shape=[np.uint64(32)] type=F32 ++blk.0.ssm_beta_alpha.weight shape=[np.uint64(2048), np.uint64(64)] type=Q8_0 ++blk.0.ssm_conv1d.weight shape=[np.uint64(4), np.uint64(8192)] type=F32 ++blk.0.ssm_dt.bias shape=[np.uint64(32)] type=F32 ++blk.0.ssm_norm.weight shape=[np.uint64(128)] type=F32 ++blk.1.ffn_gate_inp.weight shape=[np.uint64(2048), np.uint64(256)] type=F32 ++blk.1.ffn_gate_inp_shexp.weight shape=[np.uint64(2048)] type=F32 ++blk.1.hc_attn_down_inject.weight shape=[np.uint64(8192), np.uint64(260)] type=Q8_0 ++blk.1.hc_attn_norm.weight shape=[np.uint64(8192)] type=F32 ++blk.1.hc_ffn_down_inject.weight shape=[np.uint64(8192), np.uint64(260)] type=Q8_0 ++blk.1.hc_ffn_norm.weight shape=[np.uint64(8192)] type=F32 ++blk.1.ple_conv1d.weight shape=[np.uint64(4), np.uint64(8192)] type=F16 ++blk.1.ple_key.weight shape=[np.uint64(2048), np.uint64(8192)] type=BF16 ++blk.1.ple_norm_conv.weight shape=[np.uint64(8192)] type=F32 ++blk.1.ple_norm_key.weight shape=[np.uint64(8192)] type=F32 ++blk.1.ple_norm_query.weight shape=[np.uint64(8192)] type=F32 ++blk.1.ple_value.weight shape=[np.uint64(2048), np.uint64(2048)] type=BF16 ++blk.1.ssm_a shape=[np.uint64(32)] type=F32 ++blk.1.ssm_beta_alpha.weight shape=[np.uint64(2048), np.uint64(64)] type=Q8_0 ++blk.1.ssm_conv1d.weight shape=[np.uint64(4), np.uint64(8192)] type=F32 ++blk.1.ssm_dt.bias shape=[np.uint64(32)] type=F32 ++blk.1.ssm_norm.weight shape=[np.uint64(128)] type=F32 ++blk.10.ffn_gate_inp.weight shape=[np.uint64(2048), np.uint64(256)] type=F32 ++blk.10.ffn_gate_inp_shexp.weight shape=[np.uint64(2048)] type=F32 ++blk.10.hc_attn_down_inject.weight shape=[np.uint64(8192), np.uint64(260)] type=Q8_0 ++blk.10.hc_attn_norm.weight shape=[np.uint64(8192)] type=F32 ++blk.10.hc_ffn_down_inject.weight shape=[np.uint64(8192), np.uint64(260)] type=Q8_0 ++blk.10.hc_ffn_norm.weight shape=[np.uint64(8192)] type=F32 ++blk.10.ssm_a shape=[np.uint64(32)] type=F32 ++blk.10.ssm_beta_alpha.weight shape=[np.uint64(2048), np.uint64(64)] type=Q8_0 ++blk.10.ssm_conv1d.weight shape=[np.uint64(4), np.uint64(8192)] type=F32 ++blk.10.ssm_dt.bias shape=[np.uint64(32)] type=F32 ++blk.10.ssm_norm.weight shape=[np.uint64(128)] type=F32 ++blk.11.attn_k_norm.weight shape=[np.uint64(256)] type=F32 ++blk.11.attn_q_norm.weight shape=[np.uint64(256)] type=F32 ++blk.11.ffn_gate_inp.weight shape=[np.uint64(2048), np.uint64(256)] type=F32 ++blk.11.ffn_gate_inp_shexp.weight shape=[np.uint64(2048)] type=F32 ++blk.11.hc_attn_down_inject.weight shape=[np.uint64(8192), np.uint64(260)] type=Q8_0 ++blk.11.hc_attn_norm.weight shape=[np.uint64(8192)] type=F32 ++blk.11.hc_ffn_down_inject.weight shape=[np.uint64(8192), np.uint64(260)] type=Q8_0 ++blk.11.hc_ffn_norm.weight shape=[np.uint64(8192)] type=F32 ++blk.11.indexer.k_norm.weight shape=[np.uint64(128)] type=F32 ++blk.11.indexer.k_proj.weight shape=[np.uint64(2048), np.uint64(128)] type=BF16 ++blk.11.indexer.q_norm.weight shape=[np.uint64(128)] type=F32 ++blk.11.indexer.q_proj.weight shape=[np.uint64(2048), np.uint64(512)] type=BF16 ++blk.12.ffn_gate_inp.weight shape=[np.uint64(2048), np.uint64(256)] type=F32 ++blk.12.ffn_gate_inp_shexp.weight shape=[np.uint64(2048)] type=F32 ++blk.12.hc_attn_down_inject.weight shape=[np.uint64(8192), np.uint64(260)] type=Q8_0 ++blk.12.hc_attn_norm.weight shape=[np.uint64(8192)] type=F32 ++blk.12.hc_ffn_down_inject.weight shape=[np.uint64(8192), np.uint64(260)] type=Q8_0 ++blk.12.hc_ffn_norm.weight shape=[np.uint64(8192)] type=F32 ++blk.12.ssm_a shape=[np.uint64(32)] type=F32 ++blk.12.ssm_beta_alpha.weight shape=[np.uint64(2048), np.uint64(64)] type=Q8_0 ++blk.12.ssm_conv1d.weight shape=[np.uint64(4), np.uint64(8192)] type=F32 ++blk.12.ssm_dt.bias shape=[np.uint64(32)] type=F32 ++blk.12.ssm_norm.weight shape=[np.uint64(128)] type=F32 ++blk.13.ffn_gate_inp.weight shape=[np.uint64(2048), np.uint64(256)] type=F32 ++blk.13.ffn_gate_inp_shexp.weight shape=[np.uint64(2048)] type=F32 ++blk.13.hc_attn_down_inject.weight shape=[np.uint64(8192), np.uint64(260)] type=Q8_0 ++blk.13.hc_attn_norm.weight shape=[np.uint64(8192)] type=F32 ++blk.13.hc_ffn_down_inject.weight shape=[np.uint64(8192), np.uint64(260)] type=Q8_0 ++blk.13.hc_ffn_norm.weight shape=[np.uint64(8192)] type=F32 ++blk.13.ssm_a shape=[np.uint64(32)] type=F32 ++blk.13.ssm_beta_alpha.weight shape=[np.uint64(2048), np.uint64(64)] type=Q8_0 ++blk.13.ssm_conv1d.weight shape=[np.uint64(4), np.uint64(8192)] type=F32 ++blk.13.ssm_dt.bias shape=[np.uint64(32)] type=F32 ++blk.13.ssm_norm.weight shape=[np.uint64(128)] type=F32 ++blk.14.ffn_gate_inp.weight shape=[np.uint64(2048), np.uint64(256)] type=F32 ++blk.14.ffn_gate_inp_shexp.weight shape=[np.uint64(2048)] type=F32 ++blk.14.hc_attn_down_inject.weight shape=[np.uint64(8192), np.uint64(260)] type=Q8_0 ++blk.14.hc_attn_norm.weight shape=[np.uint64(8192)] type=F32 ++blk.14.hc_ffn_down_inject.weight shape=[np.uint64(8192), np.uint64(260)] type=Q8_0 ++blk.14.hc_ffn_norm.weight shape=[np.uint64(8192)] type=F32 ++blk.14.ssm_a shape=[np.uint64(32)] type=F32 ++blk.14.ssm_beta_alpha.weight shape=[np.uint64(2048), np.uint64(64)] type=Q8_0 ++blk.14.ssm_conv1d.weight shape=[np.uint64(4), np.uint64(8192)] type=F32 ++blk.14.ssm_dt.bias shape=[np.uint64(32)] type=F32 ++blk.14.ssm_norm.weight shape=[np.uint64(128)] type=F32 ++blk.15.attn_k_norm.weight shape=[np.uint64(256)] type=F32 ++blk.15.attn_q_norm.weight shape=[np.uint64(256)] type=F32 ++blk.15.ffn_gate_inp.weight shape=[np.uint64(2048), np.uint64(256)] type=F32 ++blk.15.ffn_gate_inp_shexp.weight shape=[np.uint64(2048)] type=F32 ++blk.15.hc_attn_down_inject.weight shape=[np.uint64(8192), np.uint64(260)] type=Q8_0 ++blk.15.hc_attn_norm.weight shape=[np.uint64(8192)] type=F32 ++blk.15.hc_ffn_down_inject.weight shape=[np.uint64(8192), np.uint64(260)] type=Q8_0 ++blk.15.hc_ffn_norm.weight shape=[np.uint64(8192)] type=F32 ++blk.15.indexer.k_norm.weight shape=[np.uint64(128)] type=F32 ++blk.15.indexer.k_proj.weight shape=[np.uint64(2048), np.uint64(128)] type=BF16 ++blk.15.indexer.q_norm.weight shape=[np.uint64(128)] type=F32 ++blk.15.indexer.q_proj.weight shape=[np.uint64(2048), np.uint64(512)] type=BF16 ++blk.16.ffn_gate_inp.weight shape=[np.uint64(2048), np.uint64(256)] type=F32 ++blk.16.ffn_gate_inp_shexp.weight shape=[np.uint64(2048)] type=F32 ++blk.16.hc_attn_down_inject.weight shape=[np.uint64(8192), np.uint64(260)] type=Q8_0 ++blk.16.hc_attn_norm.weight shape=[np.uint64(8192)] type=F32 ++blk.16.hc_ffn_down_inject.weight shape=[np.uint64(8192), np.uint64(260)] type=Q8_0 ++blk.16.hc_ffn_norm.weight shape=[np.uint64(8192)] type=F32 ++blk.16.ssm_a shape=[np.uint64(32)] type=F32 ++blk.16.ssm_beta_alpha.weight shape=[np.uint64(2048), np.uint64(64)] type=Q8_0 ++blk.16.ssm_conv1d.weight shape=[np.uint64(4), np.uint64(8192)] type=F32 ++blk.16.ssm_dt.bias shape=[np.uint64(32)] type=F32 ++blk.16.ssm_norm.weight shape=[np.uint64(128)] type=F32 ++blk.17.ffn_gate_inp.weight shape=[np.uint64(2048), np.uint64(256)] type=F32 ++blk.17.ffn_gate_inp_shexp.weight shape=[np.uint64(2048)] type=F32 ++blk.17.hc_attn_down_inject.weight shape=[np.uint64(8192), np.uint64(260)] type=Q8_0 ++blk.17.hc_attn_norm.weight shape=[np.uint64(8192)] type=F32 ++blk.17.hc_ffn_down_inject.weight shape=[np.uint64(8192), np.uint64(260)] type=Q8_0 ++blk.17.hc_ffn_norm.weight shape=[np.uint64(8192)] type=F32 ++blk.17.ssm_a shape=[np.uint64(32)] type=F32 ++blk.17.ssm_beta_alpha.weight shape=[np.uint64(2048), np.uint64(64)] type=Q8_0 ++blk.17.ssm_conv1d.weight shape=[np.uint64(4), np.uint64(8192)] type=F32 ++blk.17.ssm_dt.bias shape=[np.uint64(32)] type=F32 ++blk.17.ssm_norm.weight shape=[np.uint64(128)] type=F32 ++blk.18.ffn_gate_inp.weight shape=[np.uint64(2048), np.uint64(256)] type=F32 ++blk.18.ffn_gate_inp_shexp.weight shape=[np.uint64(2048)] type=F32 ++blk.18.hc_attn_down_inject.weight shape=[np.uint64(8192), np.uint64(260)] type=Q8_0 ++blk.18.hc_attn_norm.weight shape=[np.uint64(8192)] type=F32 ++blk.18.hc_ffn_down_inject.weight shape=[np.uint64(8192), np.uint64(260)] type=Q8_0 ++blk.18.hc_ffn_norm.weight shape=[np.uint64(8192)] type=F32 ++blk.18.ssm_a shape=[np.uint64(32)] type=F32 ++blk.18.ssm_beta_alpha.weight shape=[np.uint64(2048), np.uint64(64)] type=Q8_0 ++blk.18.ssm_conv1d.weight shape=[np.uint64(4), np.uint64(8192)] type=F32 ++blk.18.ssm_dt.bias shape=[np.uint64(32)] type=F32 ++blk.18.ssm_norm.weight shape=[np.uint64(128)] type=F32 ++blk.19.attn_k_norm.weight shape=[np.uint64(256)] type=F32 ++blk.19.attn_q_norm.weight shape=[np.uint64(256)] type=F32 ++blk.19.ffn_gate_inp.weight shape=[np.uint64(2048), np.uint64(256)] type=F32 ++blk.19.ffn_gate_inp_shexp.weight shape=[np.uint64(2048)] type=F32 ++blk.19.hc_attn_down_inject.weight shape=[np.uint64(8192), np.uint64(260)] type=Q8_0 ++blk.19.hc_attn_norm.weight shape=[np.uint64(8192)] type=F32 ++blk.19.hc_ffn_down_inject.weight shape=[np.uint64(8192), np.uint64(260)] type=Q8_0 ++blk.19.hc_ffn_norm.weight shape=[np.uint64(8192)] type=F32 ++blk.19.indexer.k_norm.weight shape=[np.uint64(128)] type=F32 ++blk.19.indexer.k_proj.weight shape=[np.uint64(2048), np.uint64(128)] type=BF16 ++blk.19.indexer.q_norm.weight shape=[np.uint64(128)] type=F32 ++blk.19.indexer.q_proj.weight shape=[np.uint64(2048), np.uint64(512)] type=BF16 ++blk.2.ffn_gate_inp.weight shape=[np.uint64(2048), np.uint64(256)] type=F32 ++blk.2.ffn_gate_inp_shexp.weight shape=[np.uint64(2048)] type=F32 ++blk.2.hc_attn_down_inject.weight shape=[np.uint64(8192), np.uint64(260)] type=Q8_0 ++blk.2.hc_attn_norm.weight shape=[np.uint64(8192)] type=F32 ++blk.2.hc_ffn_down_inject.weight shape=[np.uint64(8192), np.uint64(260)] type=Q8_0 ++blk.2.hc_ffn_norm.weight shape=[np.uint64(8192)] type=F32 ++blk.2.ssm_a shape=[np.uint64(32)] type=F32 ++blk.2.ssm_beta_alpha.weight shape=[np.uint64(2048), np.uint64(64)] type=Q8_0 ++blk.2.ssm_conv1d.weight shape=[np.uint64(4), np.uint64(8192)] type=F32 ++blk.2.ssm_dt.bias shape=[np.uint64(32)] type=F32 ++blk.2.ssm_norm.weight shape=[np.uint64(128)] type=F32 ++blk.20.ffn_gate_inp.weight shape=[np.uint64(2048), np.uint64(256)] type=F32 ++blk.20.ffn_gate_inp_shexp.weight shape=[np.uint64(2048)] type=F32 ++blk.20.hc_attn_down_inject.weight shape=[np.uint64(8192), np.uint64(260)] type=Q8_0 ++blk.20.hc_attn_norm.weight shape=[np.uint64(8192)] type=F32 ++blk.20.hc_ffn_down_inject.weight shape=[np.uint64(8192), np.uint64(260)] type=Q8_0 ++blk.20.hc_ffn_norm.weight shape=[np.uint64(8192)] type=F32 ++blk.20.ssm_a shape=[np.uint64(32)] type=F32 ++blk.20.ssm_beta_alpha.weight shape=[np.uint64(2048), np.uint64(64)] type=Q8_0 ++blk.20.ssm_conv1d.weight shape=[np.uint64(4), np.uint64(8192)] type=F32 ++blk.20.ssm_dt.bias shape=[np.uint64(32)] type=F32 ++blk.20.ssm_norm.weight shape=[np.uint64(128)] type=F32 ++blk.21.ffn_gate_inp.weight shape=[np.uint64(2048), np.uint64(256)] type=F32 ++blk.21.ffn_gate_inp_shexp.weight shape=[np.uint64(2048)] type=F32 ++blk.21.hc_attn_down_inject.weight shape=[np.uint64(8192), np.uint64(260)] type=Q8_0 ++blk.21.hc_attn_norm.weight shape=[np.uint64(8192)] type=F32 ++blk.21.hc_ffn_down_inject.weight shape=[np.uint64(8192), np.uint64(260)] type=Q8_0 ++blk.21.hc_ffn_norm.weight shape=[np.uint64(8192)] type=F32 ++blk.21.ssm_a shape=[np.uint64(32)] type=F32 ++blk.21.ssm_beta_alpha.weight shape=[np.uint64(2048), np.uint64(64)] type=Q8_0 ++blk.21.ssm_conv1d.weight shape=[np.uint64(4), np.uint64(8192)] type=F32 ++blk.21.ssm_dt.bias shape=[np.uint64(32)] type=F32 ++blk.21.ssm_norm.weight shape=[np.uint64(128)] type=F32 ++blk.22.ffn_gate_inp.weight shape=[np.uint64(2048), np.uint64(256)] type=F32 ++blk.22.ffn_gate_inp_shexp.weight shape=[np.uint64(2048)] type=F32 ++blk.22.hc_attn_down_inject.weight shape=[np.uint64(8192), np.uint64(260)] type=Q8_0 ++blk.22.hc_attn_norm.weight shape=[np.uint64(8192)] type=F32 ++blk.22.hc_ffn_down_inject.weight shape=[np.uint64(8192), np.uint64(260)] type=Q8_0 ++blk.22.hc_ffn_norm.weight shape=[np.uint64(8192)] type=F32 ++blk.22.ssm_a shape=[np.uint64(32)] type=F32 ++blk.22.ssm_beta_alpha.weight shape=[np.uint64(2048), np.uint64(64)] type=Q8_0 ++blk.22.ssm_conv1d.weight shape=[np.uint64(4), np.uint64(8192)] type=F32 ++blk.22.ssm_dt.bias shape=[np.uint64(32)] type=F32 ++blk.22.ssm_norm.weight shape=[np.uint64(128)] type=F32 ++blk.23.attn_k_norm.weight shape=[np.uint64(256)] type=F32 ++blk.23.attn_q_norm.weight shape=[np.uint64(256)] type=F32 ++blk.23.ffn_gate_inp.weight shape=[np.uint64(2048), np.uint64(256)] type=F32 ++blk.23.ffn_gate_inp_shexp.weight shape=[np.uint64(2048)] type=F32 ++blk.23.hc_attn_down_inject.weight shape=[np.uint64(8192), np.uint64(260)] type=Q8_0 ++blk.23.hc_attn_norm.weight shape=[np.uint64(8192)] type=F32 ++blk.23.hc_ffn_down_inject.weight shape=[np.uint64(8192), np.uint64(260)] type=Q8_0 ++blk.23.hc_ffn_norm.weight shape=[np.uint64(8192)] type=F32 ++blk.23.indexer.k_norm.weight shape=[np.uint64(128)] type=F32 ++blk.23.indexer.k_proj.weight shape=[np.uint64(2048), np.uint64(128)] type=BF16 ++blk.23.indexer.q_norm.weight shape=[np.uint64(128)] type=F32 ++blk.23.indexer.q_proj.weight shape=[np.uint64(2048), np.uint64(512)] type=BF16 ++blk.24.ffn_gate_inp.weight shape=[np.uint64(2048), np.uint64(256)] type=F32 ++blk.24.ffn_gate_inp_shexp.weight shape=[np.uint64(2048)] type=F32 ++blk.24.hc_attn_down_inject.weight shape=[np.uint64(8192), np.uint64(260)] type=Q8_0 ++blk.24.hc_attn_norm.weight shape=[np.uint64(8192)] type=F32 ++blk.24.hc_ffn_down_inject.weight shape=[np.uint64(8192), np.uint64(260)] type=Q8_0 ++blk.24.hc_ffn_norm.weight shape=[np.uint64(8192)] type=F32 ++blk.24.ssm_a shape=[np.uint64(32)] type=F32 ++blk.24.ssm_beta_alpha.weight shape=[np.uint64(2048), np.uint64(64)] type=Q8_0 ++blk.24.ssm_conv1d.weight shape=[np.uint64(4), np.uint64(8192)] type=F32 ++blk.24.ssm_dt.bias shape=[np.uint64(32)] type=F32 ++blk.24.ssm_norm.weight shape=[np.uint64(128)] type=F32 ++blk.25.ffn_gate_inp.weight shape=[np.uint64(2048), np.uint64(256)] type=F32 ++blk.25.ffn_gate_inp_shexp.weight shape=[np.uint64(2048)] type=F32 ++blk.25.hc_attn_down_inject.weight shape=[np.uint64(8192), np.uint64(260)] type=Q8_0 ++blk.25.hc_attn_norm.weight shape=[np.uint64(8192)] type=F32 ++blk.25.hc_ffn_down_inject.weight shape=[np.uint64(8192), np.uint64(260)] type=Q8_0 ++blk.25.hc_ffn_norm.weight shape=[np.uint64(8192)] type=F32 ++blk.25.ssm_a shape=[np.uint64(32)] type=F32 ++blk.25.ssm_beta_alpha.weight shape=[np.uint64(2048), np.uint64(64)] type=Q8_0 ++blk.25.ssm_conv1d.weight shape=[np.uint64(4), np.uint64(8192)] type=F32 ++blk.25.ssm_dt.bias shape=[np.uint64(32)] type=F32 ++blk.25.ssm_norm.weight shape=[np.uint64(128)] type=F32 ++blk.26.ffn_gate_inp.weight shape=[np.uint64(2048), np.uint64(256)] type=F32 ++blk.26.ffn_gate_inp_shexp.weight shape=[np.uint64(2048)] type=F32 ++blk.26.hc_attn_down_inject.weight shape=[np.uint64(8192), np.uint64(260)] type=Q8_0 ++blk.26.hc_attn_norm.weight shape=[np.uint64(8192)] type=F32 ++blk.26.hc_ffn_down_inject.weight shape=[np.uint64(8192), np.uint64(260)] type=Q8_0 ++blk.26.hc_ffn_norm.weight shape=[np.uint64(8192)] type=F32 ++blk.26.ssm_a shape=[np.uint64(32)] type=F32 ++blk.26.ssm_beta_alpha.weight shape=[np.uint64(2048), np.uint64(64)] type=Q8_0 ++blk.26.ssm_conv1d.weight shape=[np.uint64(4), np.uint64(8192)] type=F32 ++blk.26.ssm_dt.bias shape=[np.uint64(32)] type=F32 ++blk.26.ssm_norm.weight shape=[np.uint64(128)] type=F32 ++blk.27.attn_k_norm.weight shape=[np.uint64(256)] type=F32 ++blk.27.attn_q_norm.weight shape=[np.uint64(256)] type=F32 ++blk.27.ffn_gate_inp.weight shape=[np.uint64(2048), np.uint64(256)] type=F32 ++blk.27.ffn_gate_inp_shexp.weight shape=[np.uint64(2048)] type=F32 ++blk.27.hc_attn_down_inject.weight shape=[np.uint64(8192), np.uint64(260)] type=Q8_0 ++blk.27.hc_attn_norm.weight shape=[np.uint64(8192)] type=F32 ++blk.27.hc_ffn_down_inject.weight shape=[np.uint64(8192), np.uint64(260)] type=Q8_0 ++blk.27.hc_ffn_norm.weight shape=[np.uint64(8192)] type=F32 ++blk.27.indexer.k_norm.weight shape=[np.uint64(128)] type=F32 ++blk.27.indexer.k_proj.weight shape=[np.uint64(2048), np.uint64(128)] type=BF16 ++blk.27.indexer.q_norm.weight shape=[np.uint64(128)] type=F32 ++blk.27.indexer.q_proj.weight shape=[np.uint64(2048), np.uint64(512)] type=BF16 ++blk.28.ffn_gate_inp.weight shape=[np.uint64(2048), np.uint64(256)] type=F32 ++blk.28.ffn_gate_inp_shexp.weight shape=[np.uint64(2048)] type=F32 ++blk.28.hc_attn_down_inject.weight shape=[np.uint64(8192), np.uint64(260)] type=Q8_0 ++blk.28.hc_attn_norm.weight shape=[np.uint64(8192)] type=F32 ++blk.28.hc_ffn_down_inject.weight shape=[np.uint64(8192), np.uint64(260)] type=Q8_0 ++blk.28.hc_ffn_norm.weight shape=[np.uint64(8192)] type=F32 ++blk.28.ssm_a shape=[np.uint64(32)] type=F32 ++blk.28.ssm_beta_alpha.weight shape=[np.uint64(2048), np.uint64(64)] type=Q8_0 ++blk.28.ssm_conv1d.weight shape=[np.uint64(4), np.uint64(8192)] type=F32 ++blk.28.ssm_dt.bias shape=[np.uint64(32)] type=F32 ++blk.28.ssm_norm.weight shape=[np.uint64(128)] type=F32 ++blk.29.ffn_gate_inp.weight shape=[np.uint64(2048), np.uint64(256)] type=F32 ++blk.29.ffn_gate_inp_shexp.weight shape=[np.uint64(2048)] type=F32 ++blk.29.hc_attn_down_inject.weight shape=[np.uint64(8192), np.uint64(260)] type=Q8_0 ++blk.29.hc_attn_norm.weight shape=[np.uint64(8192)] type=F32 ++blk.29.hc_ffn_down_inject.weight shape=[np.uint64(8192), np.uint64(260)] type=Q8_0 ++blk.29.hc_ffn_norm.weight shape=[np.uint64(8192)] type=F32 ++blk.29.ssm_a shape=[np.uint64(32)] type=F32 ++blk.29.ssm_beta_alpha.weight shape=[np.uint64(2048), np.uint64(64)] type=Q8_0 ++blk.29.ssm_conv1d.weight shape=[np.uint64(4), np.uint64(8192)] type=F32 ++blk.29.ssm_dt.bias shape=[np.uint64(32)] type=F32 ++blk.29.ssm_norm.weight shape=[np.uint64(128)] type=F32 ++blk.3.attn_k_norm.weight shape=[np.uint64(256)] type=F32 ++blk.3.attn_q_norm.weight shape=[np.uint64(256)] type=F32 ++blk.3.ffn_gate_inp.weight shape=[np.uint64(2048), np.uint64(256)] type=F32 ++blk.3.ffn_gate_inp_shexp.weight shape=[np.uint64(2048)] type=F32 ++blk.3.hc_attn_down_inject.weight shape=[np.uint64(8192), np.uint64(260)] type=Q8_0 ++blk.3.hc_attn_norm.weight shape=[np.uint64(8192)] type=F32 ++blk.3.hc_ffn_down_inject.weight shape=[np.uint64(8192), np.uint64(260)] type=Q8_0 ++blk.3.hc_ffn_norm.weight shape=[np.uint64(8192)] type=F32 ++blk.3.indexer.k_norm.weight shape=[np.uint64(128)] type=F32 ++blk.3.indexer.k_proj.weight shape=[np.uint64(2048), np.uint64(128)] type=BF16 ++blk.3.indexer.q_norm.weight shape=[np.uint64(128)] type=F32 ++blk.3.indexer.q_proj.weight shape=[np.uint64(2048), np.uint64(512)] type=BF16 ++blk.30.ffn_gate_inp.weight shape=[np.uint64(2048), np.uint64(256)] type=F32 ++blk.30.ffn_gate_inp_shexp.weight shape=[np.uint64(2048)] type=F32 ++blk.30.hc_attn_down_inject.weight shape=[np.uint64(8192), np.uint64(260)] type=Q8_0 ++blk.30.hc_attn_norm.weight shape=[np.uint64(8192)] type=F32 ++blk.30.hc_ffn_down_inject.weight shape=[np.uint64(8192), np.uint64(260)] type=Q8_0 ++blk.30.hc_ffn_norm.weight shape=[np.uint64(8192)] type=F32 ++blk.30.ssm_a shape=[np.uint64(32)] type=F32 ++blk.30.ssm_beta_alpha.weight shape=[np.uint64(2048), np.uint64(64)] type=Q8_0 ++blk.30.ssm_conv1d.weight shape=[np.uint64(4), np.uint64(8192)] type=F32 ++blk.30.ssm_dt.bias shape=[np.uint64(32)] type=F32 ++blk.30.ssm_norm.weight shape=[np.uint64(128)] type=F32 ++blk.31.attn_k_norm.weight shape=[np.uint64(256)] type=F32 ++blk.31.attn_q_norm.weight shape=[np.uint64(256)] type=F32 ++blk.31.ffn_gate_inp.weight shape=[np.uint64(2048), np.uint64(256)] type=F32 ++blk.31.ffn_gate_inp_shexp.weight shape=[np.uint64(2048)] type=F32 ++blk.31.hc_attn_down_inject.weight shape=[np.uint64(8192), np.uint64(260)] type=Q8_0 ++blk.31.hc_attn_norm.weight shape=[np.uint64(8192)] type=F32 ++blk.31.hc_ffn_down_inject.weight shape=[np.uint64(8192), np.uint64(260)] type=Q8_0 ++blk.31.hc_ffn_norm.weight shape=[np.uint64(8192)] type=F32 ++blk.31.indexer.k_norm.weight shape=[np.uint64(128)] type=F32 ++blk.31.indexer.k_proj.weight shape=[np.uint64(2048), np.uint64(128)] type=BF16 ++blk.31.indexer.q_norm.weight shape=[np.uint64(128)] type=F32 ++blk.31.indexer.q_proj.weight shape=[np.uint64(2048), np.uint64(512)] type=BF16 ++blk.32.ffn_gate_inp.weight shape=[np.uint64(2048), np.uint64(256)] type=F32 ++blk.32.ffn_gate_inp_shexp.weight shape=[np.uint64(2048)] type=F32 ++blk.32.hc_attn_down_inject.weight shape=[np.uint64(8192), np.uint64(260)] type=Q8_0 ++blk.32.hc_attn_norm.weight shape=[np.uint64(8192)] type=F32 ++blk.32.hc_ffn_down_inject.weight shape=[np.uint64(8192), np.uint64(260)] type=Q8_0 ++blk.32.hc_ffn_norm.weight shape=[np.uint64(8192)] type=F32 ++blk.32.ssm_a shape=[np.uint64(32)] type=F32 ++blk.32.ssm_beta_alpha.weight shape=[np.uint64(2048), np.uint64(64)] type=Q8_0 ++blk.32.ssm_conv1d.weight shape=[np.uint64(4), np.uint64(8192)] type=F32 ++blk.32.ssm_dt.bias shape=[np.uint64(32)] type=F32 ++blk.32.ssm_norm.weight shape=[np.uint64(128)] type=F32 ++blk.33.ffn_gate_inp.weight shape=[np.uint64(2048), np.uint64(256)] type=F32 ++blk.33.ffn_gate_inp_shexp.weight shape=[np.uint64(2048)] type=F32 ++blk.33.hc_attn_down_inject.weight shape=[np.uint64(8192), np.uint64(260)] type=Q8_0 ++blk.33.hc_attn_norm.weight shape=[np.uint64(8192)] type=F32 ++blk.33.hc_ffn_down_inject.weight shape=[np.uint64(8192), np.uint64(260)] type=Q8_0 ++blk.33.hc_ffn_norm.weight shape=[np.uint64(8192)] type=F32 ++blk.33.ssm_a shape=[np.uint64(32)] type=F32 ++blk.33.ssm_beta_alpha.weight shape=[np.uint64(2048), np.uint64(64)] type=Q8_0 ++blk.33.ssm_conv1d.weight shape=[np.uint64(4), np.uint64(8192)] type=F32 ++blk.33.ssm_dt.bias shape=[np.uint64(32)] type=F32 ++blk.33.ssm_norm.weight shape=[np.uint64(128)] type=F32 ++blk.34.ffn_gate_inp.weight shape=[np.uint64(2048), np.uint64(256)] type=F32 ++blk.34.ffn_gate_inp_shexp.weight shape=[np.uint64(2048)] type=F32 ++blk.34.hc_attn_down_inject.weight shape=[np.uint64(8192), np.uint64(260)] type=Q8_0 ++blk.34.hc_attn_norm.weight shape=[np.uint64(8192)] type=F32 ++blk.34.hc_ffn_down_inject.weight shape=[np.uint64(8192), np.uint64(260)] type=Q8_0 ++blk.34.hc_ffn_norm.weight shape=[np.uint64(8192)] type=F32 ++blk.34.ssm_a shape=[np.uint64(32)] type=F32 ++blk.34.ssm_beta_alpha.weight shape=[np.uint64(2048), np.uint64(64)] type=Q8_0 ++blk.34.ssm_conv1d.weight shape=[np.uint64(4), np.uint64(8192)] type=F32 ++blk.34.ssm_dt.bias shape=[np.uint64(32)] type=F32 ++blk.34.ssm_norm.weight shape=[np.uint64(128)] type=F32 ++blk.35.attn_k_norm.weight shape=[np.uint64(256)] type=F32 ++blk.35.attn_q_norm.weight shape=[np.uint64(256)] type=F32 ++blk.35.ffn_gate_inp.weight shape=[np.uint64(2048), np.uint64(256)] type=F32 ++blk.35.ffn_gate_inp_shexp.weight shape=[np.uint64(2048)] type=F32 ++blk.35.hc_attn_down_inject.weight shape=[np.uint64(8192), np.uint64(260)] type=Q8_0 ++blk.35.hc_attn_norm.weight shape=[np.uint64(8192)] type=F32 ++blk.35.hc_ffn_down_inject.weight shape=[np.uint64(8192), np.uint64(260)] type=Q8_0 ++blk.35.hc_ffn_norm.weight shape=[np.uint64(8192)] type=F32 ++blk.35.indexer.k_norm.weight shape=[np.uint64(128)] type=F32 ++blk.35.indexer.k_proj.weight shape=[np.uint64(2048), np.uint64(128)] type=BF16 ++blk.35.indexer.q_norm.weight shape=[np.uint64(128)] type=F32 ++blk.35.indexer.q_proj.weight shape=[np.uint64(2048), np.uint64(512)] type=BF16 ++blk.36.ffn_gate_inp.weight shape=[np.uint64(2048), np.uint64(256)] type=F32 ++blk.36.ffn_gate_inp_shexp.weight shape=[np.uint64(2048)] type=F32 ++blk.36.hc_attn_down_inject.weight shape=[np.uint64(8192), np.uint64(260)] type=Q8_0 ++blk.36.hc_attn_norm.weight shape=[np.uint64(8192)] type=F32 ++blk.36.hc_ffn_down_inject.weight shape=[np.uint64(8192), np.uint64(260)] type=Q8_0 ++blk.36.hc_ffn_norm.weight shape=[np.uint64(8192)] type=F32 ++blk.36.ssm_a shape=[np.uint64(32)] type=F32 ++blk.36.ssm_beta_alpha.weight shape=[np.uint64(2048), np.uint64(64)] type=Q8_0 ++blk.36.ssm_conv1d.weight shape=[np.uint64(4), np.uint64(8192)] type=F32 ++blk.36.ssm_dt.bias shape=[np.uint64(32)] type=F32 ++blk.36.ssm_norm.weight shape=[np.uint64(128)] type=F32 ++blk.37.ffn_gate_inp.weight shape=[np.uint64(2048), np.uint64(256)] type=F32 ++blk.37.ffn_gate_inp_shexp.weight shape=[np.uint64(2048)] type=F32 ++blk.37.hc_attn_down_inject.weight shape=[np.uint64(8192), np.uint64(260)] type=Q8_0 ++blk.37.hc_attn_norm.weight shape=[np.uint64(8192)] type=F32 ++blk.37.hc_ffn_down_inject.weight shape=[np.uint64(8192), np.uint64(260)] type=Q8_0 ++blk.37.hc_ffn_norm.weight shape=[np.uint64(8192)] type=F32 ++blk.37.ssm_a shape=[np.uint64(32)] type=F32 ++blk.37.ssm_beta_alpha.weight shape=[np.uint64(2048), np.uint64(64)] type=Q8_0 ++blk.37.ssm_conv1d.weight shape=[np.uint64(4), np.uint64(8192)] type=F32 ++blk.37.ssm_dt.bias shape=[np.uint64(32)] type=F32 ++blk.37.ssm_norm.weight shape=[np.uint64(128)] type=F32 ++blk.38.ffn_gate_inp.weight shape=[np.uint64(2048), np.uint64(256)] type=F32 ++blk.38.ffn_gate_inp_shexp.weight shape=[np.uint64(2048)] type=F32 ++blk.38.hc_attn_down_inject.weight shape=[np.uint64(8192), np.uint64(260)] type=Q8_0 ++blk.38.hc_attn_norm.weight shape=[np.uint64(8192)] type=F32 ++blk.38.hc_ffn_down_inject.weight shape=[np.uint64(8192), np.uint64(260)] type=Q8_0 ++blk.38.hc_ffn_norm.weight shape=[np.uint64(8192)] type=F32 ++blk.38.ssm_a shape=[np.uint64(32)] type=F32 ++blk.38.ssm_beta_alpha.weight shape=[np.uint64(2048), np.uint64(64)] type=Q8_0 ++blk.38.ssm_conv1d.weight shape=[np.uint64(4), np.uint64(8192)] type=F32 ++blk.38.ssm_dt.bias shape=[np.uint64(32)] type=F32 ++blk.38.ssm_norm.weight shape=[np.uint64(128)] type=F32 ++blk.39.attn_k_norm.weight shape=[np.uint64(256)] type=F32 ++blk.39.attn_q_norm.weight shape=[np.uint64(256)] type=F32 ++blk.39.ffn_gate_inp.weight shape=[np.uint64(2048), np.uint64(256)] type=F32 ++blk.39.ffn_gate_inp_shexp.weight shape=[np.uint64(2048)] type=F32 ++blk.39.hc_attn_down_inject.weight shape=[np.uint64(8192), np.uint64(260)] type=Q8_0 ++blk.39.hc_attn_norm.weight shape=[np.uint64(8192)] type=F32 ++blk.39.hc_ffn_down_inject.weight shape=[np.uint64(8192), np.uint64(260)] type=Q8_0 ++blk.39.hc_ffn_norm.weight shape=[np.uint64(8192)] type=F32 ++blk.39.indexer.k_norm.weight shape=[np.uint64(128)] type=F32 ++blk.39.indexer.k_proj.weight shape=[np.uint64(2048), np.uint64(128)] type=BF16 ++blk.39.indexer.q_norm.weight shape=[np.uint64(128)] type=F32 ++blk.39.indexer.q_proj.weight shape=[np.uint64(2048), np.uint64(512)] type=BF16 ++blk.4.ffn_gate_inp.weight shape=[np.uint64(2048), np.uint64(256)] type=F32 ++blk.4.ffn_gate_inp_shexp.weight shape=[np.uint64(2048)] type=F32 ++blk.4.hc_attn_down_inject.weight shape=[np.uint64(8192), np.uint64(260)] type=Q8_0 ++blk.4.hc_attn_norm.weight shape=[np.uint64(8192)] type=F32 ++blk.4.hc_ffn_down_inject.weight shape=[np.uint64(8192), np.uint64(260)] type=Q8_0 ++blk.4.hc_ffn_norm.weight shape=[np.uint64(8192)] type=F32 ++blk.4.ssm_a shape=[np.uint64(32)] type=F32 ++blk.4.ssm_beta_alpha.weight shape=[np.uint64(2048), np.uint64(64)] type=Q8_0 ++blk.4.ssm_conv1d.weight shape=[np.uint64(4), np.uint64(8192)] type=F32 ++blk.4.ssm_dt.bias shape=[np.uint64(32)] type=F32 ++blk.4.ssm_norm.weight shape=[np.uint64(128)] type=F32 ++blk.5.ffn_gate_inp.weight shape=[np.uint64(2048), np.uint64(256)] type=F32 ++blk.5.ffn_gate_inp_shexp.weight shape=[np.uint64(2048)] type=F32 ++blk.5.hc_attn_down_inject.weight shape=[np.uint64(8192), np.uint64(260)] type=Q8_0 ++blk.5.hc_attn_norm.weight shape=[np.uint64(8192)] type=F32 ++blk.5.hc_ffn_down_inject.weight shape=[np.uint64(8192), np.uint64(260)] type=Q8_0 ++blk.5.hc_ffn_norm.weight shape=[np.uint64(8192)] type=F32 ++blk.5.ssm_a shape=[np.uint64(32)] type=F32 ++blk.5.ssm_beta_alpha.weight shape=[np.uint64(2048), np.uint64(64)] type=Q8_0 ++blk.5.ssm_conv1d.weight shape=[np.uint64(4), np.uint64(8192)] type=F32 ++blk.5.ssm_dt.bias shape=[np.uint64(32)] type=F32 ++blk.5.ssm_norm.weight shape=[np.uint64(128)] type=F32 ++blk.6.ffn_gate_inp.weight shape=[np.uint64(2048), np.uint64(256)] type=F32 ++blk.6.ffn_gate_inp_shexp.weight shape=[np.uint64(2048)] type=F32 ++blk.6.hc_attn_down_inject.weight shape=[np.uint64(8192), np.uint64(260)] type=Q8_0 ++blk.6.hc_attn_norm.weight shape=[np.uint64(8192)] type=F32 ++blk.6.hc_ffn_down_inject.weight shape=[np.uint64(8192), np.uint64(260)] type=Q8_0 ++blk.6.hc_ffn_norm.weight shape=[np.uint64(8192)] type=F32 ++blk.6.ssm_a shape=[np.uint64(32)] type=F32 ++blk.6.ssm_beta_alpha.weight shape=[np.uint64(2048), np.uint64(64)] type=Q8_0 ++blk.6.ssm_conv1d.weight shape=[np.uint64(4), np.uint64(8192)] type=F32 ++blk.6.ssm_dt.bias shape=[np.uint64(32)] type=F32 ++blk.6.ssm_norm.weight shape=[np.uint64(128)] type=F32 ++blk.7.attn_k_norm.weight shape=[np.uint64(256)] type=F32 ++blk.7.attn_q_norm.weight shape=[np.uint64(256)] type=F32 ++blk.7.ffn_gate_inp.weight shape=[np.uint64(2048), np.uint64(256)] type=F32 ++blk.7.ffn_gate_inp_shexp.weight shape=[np.uint64(2048)] type=F32 ++blk.7.hc_attn_down_inject.weight shape=[np.uint64(8192), np.uint64(260)] type=Q8_0 ++blk.7.hc_attn_norm.weight shape=[np.uint64(8192)] type=F32 ++blk.7.hc_ffn_down_inject.weight shape=[np.uint64(8192), np.uint64(260)] type=Q8_0 ++blk.7.hc_ffn_norm.weight shape=[np.uint64(8192)] type=F32 ++blk.7.indexer.k_norm.weight shape=[np.uint64(128)] type=F32 ++blk.7.indexer.k_proj.weight shape=[np.uint64(2048), np.uint64(128)] type=BF16 ++blk.7.indexer.q_norm.weight shape=[np.uint64(128)] type=F32 ++blk.7.indexer.q_proj.weight shape=[np.uint64(2048), np.uint64(512)] type=BF16 ++blk.8.ffn_gate_inp.weight shape=[np.uint64(2048), np.uint64(256)] type=F32 ++blk.8.ffn_gate_inp_shexp.weight shape=[np.uint64(2048)] type=F32 ++blk.8.hc_attn_down_inject.weight shape=[np.uint64(8192), np.uint64(260)] type=Q8_0 ++blk.8.hc_attn_norm.weight shape=[np.uint64(8192)] type=F32 ++blk.8.hc_ffn_down_inject.weight shape=[np.uint64(8192), np.uint64(260)] type=Q8_0 ++blk.8.hc_ffn_norm.weight shape=[np.uint64(8192)] type=F32 ++blk.8.ssm_a shape=[np.uint64(32)] type=F32 ++blk.8.ssm_beta_alpha.weight shape=[np.uint64(2048), np.uint64(64)] type=Q8_0 ++blk.8.ssm_conv1d.weight shape=[np.uint64(4), np.uint64(8192)] type=F32 ++blk.8.ssm_dt.bias shape=[np.uint64(32)] type=F32 ++blk.8.ssm_norm.weight shape=[np.uint64(128)] type=F32 ++blk.9.ffn_gate_inp.weight shape=[np.uint64(2048), np.uint64(256)] type=F32 ++blk.9.ffn_gate_inp_shexp.weight shape=[np.uint64(2048)] type=F32 ++blk.9.hc_attn_down_inject.weight shape=[np.uint64(8192), np.uint64(260)] type=Q8_0 ++blk.9.hc_attn_norm.weight shape=[np.uint64(8192)] type=F32 ++blk.9.hc_ffn_down_inject.weight shape=[np.uint64(8192), np.uint64(260)] type=Q8_0 ++blk.9.hc_ffn_norm.weight shape=[np.uint64(8192)] type=F32 ++blk.9.ssm_a shape=[np.uint64(32)] type=F32 ++blk.9.ssm_beta_alpha.weight shape=[np.uint64(2048), np.uint64(64)] type=Q8_0 ++blk.9.ssm_conv1d.weight shape=[np.uint64(4), np.uint64(8192)] type=F32 ++blk.9.ssm_dt.bias shape=[np.uint64(32)] type=F32 ++blk.9.ssm_norm.weight shape=[np.uint64(128)] type=F32 ++output_hc_down.weight shape=[np.uint64(8192), np.uint64(256)] type=Q8_0 ++output_hc_norm.weight shape=[np.uint64(8192)] type=F32 ++output_hc_up.weight shape=[np.uint64(256), np.uint64(8192)] type=Q8_0 ++blk.0.ffn_gate_exps.weight shape=[np.uint64(2048), np.uint64(512), np.uint64(256)] type=Q5_K ++blk.0.ffn_up_exps.weight shape=[np.uint64(2048), np.uint64(512), np.uint64(256)] type=Q5_K ++blk.1.ffn_gate_exps.weight shape=[np.uint64(2048), np.uint64(512), np.uint64(256)] type=Q5_K ++blk.1.ffn_up_exps.weight shape=[np.uint64(2048), np.uint64(512), np.uint64(256)] type=Q5_K ++blk.2.ffn_gate_exps.weight shape=[np.uint64(2048), np.uint64(512), np.uint64(256)] type=Q5_K ++blk.2.ffn_up_exps.weight shape=[np.uint64(2048), np.uint64(512), np.uint64(256)] type=Q5_K ++blk.3.ffn_gate_exps.weight shape=[np.uint64(2048), np.uint64(512), np.uint64(256)] type=Q5_K ++blk.3.ffn_up_exps.weight shape=[np.uint64(2048), np.uint64(512), np.uint64(256)] type=Q5_K ++blk.4.ffn_gate_exps.weight shape=[np.uint64(2048), np.uint64(512), np.uint64(256)] type=Q5_K ++blk.4.ffn_up_exps.weight shape=[np.uint64(2048), np.uint64(512), np.uint64(256)] type=Q5_K ++blk.5.ffn_gate_exps.weight shape=[np.uint64(2048), np.uint64(512), np.uint64(256)] type=Q5_K ++blk.5.ffn_up_exps.weight shape=[np.uint64(2048), np.uint64(512), np.uint64(256)] type=Q5_K ++blk.6.ffn_gate_exps.weight shape=[np.uint64(2048), np.uint64(512), np.uint64(256)] type=Q5_K ++blk.6.ffn_up_exps.weight shape=[np.uint64(2048), np.uint64(512), np.uint64(256)] type=Q5_K ++blk.7.ffn_gate_exps.weight shape=[np.uint64(2048), np.uint64(512), np.uint64(256)] type=Q5_K ++blk.7.ffn_up_exps.weight shape=[np.uint64(2048), np.uint64(512), np.uint64(256)] type=Q5_K ++blk.10.ffn_gate_exps.weight shape=[np.uint64(2048), np.uint64(512), np.uint64(256)] type=Q5_K ++blk.10.ffn_up_exps.weight shape=[np.uint64(2048), np.uint64(512), np.uint64(256)] type=Q5_K ++blk.11.ffn_gate_exps.weight shape=[np.uint64(2048), np.uint64(512), np.uint64(256)] type=Q5_K ++blk.11.ffn_up_exps.weight shape=[np.uint64(2048), np.uint64(512), np.uint64(256)] type=Q5_K ++blk.12.ffn_gate_exps.weight shape=[np.uint64(2048), np.uint64(512), np.uint64(256)] type=Q5_K ++blk.12.ffn_up_exps.weight shape=[np.uint64(2048), np.uint64(512), np.uint64(256)] type=Q5_K ++blk.13.ffn_gate_exps.weight shape=[np.uint64(2048), np.uint64(512), np.uint64(256)] type=Q5_K ++blk.13.ffn_up_exps.weight shape=[np.uint64(2048), np.uint64(512), np.uint64(256)] type=Q5_K ++blk.14.ffn_gate_exps.weight shape=[np.uint64(2048), np.uint64(512), np.uint64(256)] type=Q5_K ++blk.14.ffn_up_exps.weight shape=[np.uint64(2048), np.uint64(512), np.uint64(256)] type=Q5_K ++blk.15.ffn_gate_exps.weight shape=[np.uint64(2048), np.uint64(512), np.uint64(256)] type=Q5_K ++blk.15.ffn_up_exps.weight shape=[np.uint64(2048), np.uint64(512), np.uint64(256)] type=Q5_K ++blk.8.ffn_gate_exps.weight shape=[np.uint64(2048), np.uint64(512), np.uint64(256)] type=Q5_K ++blk.8.ffn_up_exps.weight shape=[np.uint64(2048), np.uint64(512), np.uint64(256)] type=Q5_K ++blk.9.ffn_gate_exps.weight shape=[np.uint64(2048), np.uint64(512), np.uint64(256)] type=Q5_K ++blk.9.ffn_up_exps.weight shape=[np.uint64(2048), np.uint64(512), np.uint64(256)] type=Q5_K ++blk.16.ffn_gate_exps.weight shape=[np.uint64(2048), np.uint64(512), np.uint64(256)] type=Q5_K ++blk.16.ffn_up_exps.weight shape=[np.uint64(2048), np.uint64(512), np.uint64(256)] type=Q5_K ++blk.17.ffn_gate_exps.weight shape=[np.uint64(2048), np.uint64(512), np.uint64(256)] type=Q5_K ++blk.17.ffn_up_exps.weight shape=[np.uint64(2048), np.uint64(512), np.uint64(256)] type=Q5_K ++blk.18.ffn_gate_exps.weight shape=[np.uint64(2048), np.uint64(512), np.uint64(256)] type=Q5_K ++blk.18.ffn_up_exps.weight shape=[np.uint64(2048), np.uint64(512), np.uint64(256)] type=Q5_K ++blk.19.ffn_gate_exps.weight shape=[np.uint64(2048), np.uint64(512), np.uint64(256)] type=Q5_K ++blk.19.ffn_up_exps.weight shape=[np.uint64(2048), np.uint64(512), np.uint64(256)] type=Q5_K ++blk.20.ffn_gate_exps.weight shape=[np.uint64(2048), np.uint64(512), np.uint64(256)] type=Q5_K ++blk.20.ffn_up_exps.weight shape=[np.uint64(2048), np.uint64(512), np.uint64(256)] type=Q5_K ++blk.21.ffn_gate_exps.weight shape=[np.uint64(2048), np.uint64(512), np.uint64(256)] type=Q5_K ++blk.21.ffn_up_exps.weight shape=[np.uint64(2048), np.uint64(512), np.uint64(256)] type=Q5_K ++blk.22.ffn_gate_exps.weight shape=[np.uint64(2048), np.uint64(512), np.uint64(256)] type=Q5_K ++blk.22.ffn_up_exps.weight shape=[np.uint64(2048), np.uint64(512), np.uint64(256)] type=Q5_K ++blk.23.ffn_gate_exps.weight shape=[np.uint64(2048), np.uint64(512), np.uint64(256)] type=Q5_K ++blk.23.ffn_up_exps.weight shape=[np.uint64(2048), np.uint64(512), np.uint64(256)] type=Q5_K ++blk.24.ffn_gate_exps.weight shape=[np.uint64(2048), np.uint64(512), np.uint64(256)] type=Q5_K ++blk.24.ffn_up_exps.weight shape=[np.uint64(2048), np.uint64(512), np.uint64(256)] type=Q5_K ++blk.25.ffn_gate_exps.weight shape=[np.uint64(2048), np.uint64(512), np.uint64(256)] type=Q5_K ++blk.25.ffn_up_exps.weight shape=[np.uint64(2048), np.uint64(512), np.uint64(256)] type=Q5_K ++blk.26.ffn_gate_exps.weight shape=[np.uint64(2048), np.uint64(512), np.uint64(256)] type=Q5_K ++blk.26.ffn_up_exps.weight shape=[np.uint64(2048), np.uint64(512), np.uint64(256)] type=Q5_K ++blk.27.ffn_gate_exps.weight shape=[np.uint64(2048), np.uint64(512), np.uint64(256)] type=Q5_K ++blk.27.ffn_up_exps.weight shape=[np.uint64(2048), np.uint64(512), np.uint64(256)] type=Q5_K ++blk.28.ffn_gate_exps.weight shape=[np.uint64(2048), np.uint64(512), np.uint64(256)] type=Q5_K ++blk.28.ffn_up_exps.weight shape=[np.uint64(2048), np.uint64(512), np.uint64(256)] type=Q5_K ++blk.29.ffn_gate_exps.weight shape=[np.uint64(2048), np.uint64(512), np.uint64(256)] type=Q5_K ++blk.29.ffn_up_exps.weight shape=[np.uint64(2048), np.uint64(512), np.uint64(256)] type=Q5_K ++blk.30.ffn_gate_exps.weight shape=[np.uint64(2048), np.uint64(512), np.uint64(256)] type=Q5_K ++blk.30.ffn_up_exps.weight shape=[np.uint64(2048), np.uint64(512), np.uint64(256)] type=Q5_K ++blk.31.ffn_gate_exps.weight shape=[np.uint64(2048), np.uint64(512), np.uint64(256)] type=Q5_K ++blk.31.ffn_up_exps.weight shape=[np.uint64(2048), np.uint64(512), np.uint64(256)] type=Q5_K ++blk.32.ffn_gate_exps.weight shape=[np.uint64(2048), np.uint64(512), np.uint64(256)] type=Q5_K ++blk.32.ffn_up_exps.weight shape=[np.uint64(2048), np.uint64(512), np.uint64(256)] type=Q5_K ++blk.33.ffn_gate_exps.weight shape=[np.uint64(2048), np.uint64(512), np.uint64(256)] type=Q5_K ++blk.33.ffn_up_exps.weight shape=[np.uint64(2048), np.uint64(512), np.uint64(256)] type=Q5_K ++blk.34.ffn_gate_exps.weight shape=[np.uint64(2048), np.uint64(512), np.uint64(256)] type=Q5_K ++blk.34.ffn_up_exps.weight shape=[np.uint64(2048), np.uint64(512), np.uint64(256)] type=Q5_K ++blk.35.ffn_gate_exps.weight shape=[np.uint64(2048), np.uint64(512), np.uint64(256)] type=Q5_K ++blk.35.ffn_up_exps.weight shape=[np.uint64(2048), np.uint64(512), np.uint64(256)] type=Q5_K ++blk.36.ffn_gate_exps.weight shape=[np.uint64(2048), np.uint64(512), np.uint64(256)] type=Q5_K ++blk.36.ffn_up_exps.weight shape=[np.uint64(2048), np.uint64(512), np.uint64(256)] type=Q5_K ++blk.37.ffn_gate_exps.weight shape=[np.uint64(2048), np.uint64(512), np.uint64(256)] type=Q5_K ++blk.37.ffn_up_exps.weight shape=[np.uint64(2048), np.uint64(512), np.uint64(256)] type=Q5_K ++blk.38.ffn_gate_exps.weight shape=[np.uint64(2048), np.uint64(512), np.uint64(256)] type=Q5_K ++blk.38.ffn_up_exps.weight shape=[np.uint64(2048), np.uint64(512), np.uint64(256)] type=Q5_K ++blk.39.ffn_gate_exps.weight shape=[np.uint64(2048), np.uint64(512), np.uint64(256)] type=Q5_K ++blk.39.ffn_up_exps.weight shape=[np.uint64(2048), np.uint64(512), np.uint64(256)] type=Q5_K ++blk.0.ffn_down_exps.weight shape=[np.uint64(512), np.uint64(2048), np.uint64(256)] type=Q6_K ++blk.1.ffn_down_exps.weight shape=[np.uint64(512), np.uint64(2048), np.uint64(256)] type=Q6_K ++blk.2.ffn_down_exps.weight shape=[np.uint64(512), np.uint64(2048), np.uint64(256)] type=Q6_K ++blk.3.ffn_down_exps.weight shape=[np.uint64(512), np.uint64(2048), np.uint64(256)] type=Q6_K ++blk.4.ffn_down_exps.weight shape=[np.uint64(512), np.uint64(2048), np.uint64(256)] type=Q6_K ++blk.5.ffn_down_exps.weight shape=[np.uint64(512), np.uint64(2048), np.uint64(256)] type=Q6_K ++blk.6.ffn_down_exps.weight shape=[np.uint64(512), np.uint64(2048), np.uint64(256)] type=Q6_K ++blk.7.ffn_down_exps.weight shape=[np.uint64(512), np.uint64(2048), np.uint64(256)] type=Q6_K ++blk.10.ffn_down_exps.weight shape=[np.uint64(512), np.uint64(2048), np.uint64(256)] type=Q6_K ++blk.11.ffn_down_exps.weight shape=[np.uint64(512), np.uint64(2048), np.uint64(256)] type=Q6_K ++blk.12.ffn_down_exps.weight shape=[np.uint64(512), np.uint64(2048), np.uint64(256)] type=Q6_K ++blk.13.ffn_down_exps.weight shape=[np.uint64(512), np.uint64(2048), np.uint64(256)] type=Q6_K ++blk.14.ffn_down_exps.weight shape=[np.uint64(512), np.uint64(2048), np.uint64(256)] type=Q6_K ++blk.15.ffn_down_exps.weight shape=[np.uint64(512), np.uint64(2048), np.uint64(256)] type=Q6_K ++blk.8.ffn_down_exps.weight shape=[np.uint64(512), np.uint64(2048), np.uint64(256)] type=Q6_K ++blk.9.ffn_down_exps.weight shape=[np.uint64(512), np.uint64(2048), np.uint64(256)] type=Q6_K ++blk.16.ffn_down_exps.weight shape=[np.uint64(512), np.uint64(2048), np.uint64(256)] type=Q6_K ++blk.17.ffn_down_exps.weight shape=[np.uint64(512), np.uint64(2048), np.uint64(256)] type=Q6_K ++blk.18.ffn_down_exps.weight shape=[np.uint64(512), np.uint64(2048), np.uint64(256)] type=Q6_K ++blk.19.ffn_down_exps.weight shape=[np.uint64(512), np.uint64(2048), np.uint64(256)] type=Q6_K ++blk.20.ffn_down_exps.weight shape=[np.uint64(512), np.uint64(2048), np.uint64(256)] type=Q6_K ++blk.21.ffn_down_exps.weight shape=[np.uint64(512), np.uint64(2048), np.uint64(256)] type=Q6_K ++blk.22.ffn_down_exps.weight shape=[np.uint64(512), np.uint64(2048), np.uint64(256)] type=Q6_K ++blk.23.ffn_down_exps.weight shape=[np.uint64(512), np.uint64(2048), np.uint64(256)] type=Q6_K ++blk.24.ffn_down_exps.weight shape=[np.uint64(512), np.uint64(2048), np.uint64(256)] type=Q6_K ++blk.25.ffn_down_exps.weight shape=[np.uint64(512), np.uint64(2048), np.uint64(256)] type=Q6_K ++blk.26.ffn_down_exps.weight shape=[np.uint64(512), np.uint64(2048), np.uint64(256)] type=Q6_K ++blk.27.ffn_down_exps.weight shape=[np.uint64(512), np.uint64(2048), np.uint64(256)] type=Q6_K ++blk.28.ffn_down_exps.weight shape=[np.uint64(512), np.uint64(2048), np.uint64(256)] type=Q6_K ++blk.29.ffn_down_exps.weight shape=[np.uint64(512), np.uint64(2048), np.uint64(256)] type=Q6_K ++blk.30.ffn_down_exps.weight shape=[np.uint64(512), np.uint64(2048), np.uint64(256)] type=Q6_K ++blk.31.ffn_down_exps.weight shape=[np.uint64(512), np.uint64(2048), np.uint64(256)] type=Q6_K ++blk.32.ffn_down_exps.weight shape=[np.uint64(512), np.uint64(2048), np.uint64(256)] type=Q6_K ++blk.33.ffn_down_exps.weight shape=[np.uint64(512), np.uint64(2048), np.uint64(256)] type=Q6_K ++blk.34.ffn_down_exps.weight shape=[np.uint64(512), np.uint64(2048), np.uint64(256)] type=Q6_K ++blk.35.ffn_down_exps.weight shape=[np.uint64(512), np.uint64(2048), np.uint64(256)] type=Q6_K ++blk.36.ffn_down_exps.weight shape=[np.uint64(512), np.uint64(2048), np.uint64(256)] type=Q6_K ++blk.37.ffn_down_exps.weight shape=[np.uint64(512), np.uint64(2048), np.uint64(256)] type=Q6_K ++blk.38.ffn_down_exps.weight shape=[np.uint64(512), np.uint64(2048), np.uint64(256)] type=Q6_K ++blk.39.ffn_down_exps.weight shape=[np.uint64(512), np.uint64(2048), np.uint64(256)] type=Q6_K ++blk.0.ffn_down_shexp.weight shape=[np.uint64(512), np.uint64(2048)] type=Q8_0 ++blk.0.ffn_gate_shexp.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 ++blk.0.ffn_up_shexp.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 ++blk.1.ffn_down_shexp.weight shape=[np.uint64(512), np.uint64(2048)] type=Q8_0 ++blk.1.ffn_gate_shexp.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 ++blk.1.ffn_up_shexp.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 ++blk.10.ffn_down_shexp.weight shape=[np.uint64(512), np.uint64(2048)] type=Q8_0 ++blk.10.ffn_gate_shexp.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 ++blk.10.ffn_up_shexp.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 ++blk.11.ffn_down_shexp.weight shape=[np.uint64(512), np.uint64(2048)] type=Q8_0 ++blk.11.ffn_gate_shexp.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 ++blk.11.ffn_up_shexp.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 ++blk.12.ffn_down_shexp.weight shape=[np.uint64(512), np.uint64(2048)] type=Q8_0 ++blk.12.ffn_gate_shexp.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 ++blk.12.ffn_up_shexp.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 ++blk.13.ffn_down_shexp.weight shape=[np.uint64(512), np.uint64(2048)] type=Q8_0 ++blk.13.ffn_gate_shexp.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 ++blk.13.ffn_up_shexp.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 ++blk.14.ffn_down_shexp.weight shape=[np.uint64(512), np.uint64(2048)] type=Q8_0 ++blk.14.ffn_gate_shexp.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 ++blk.14.ffn_up_shexp.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 ++blk.15.ffn_down_shexp.weight shape=[np.uint64(512), np.uint64(2048)] type=Q8_0 ++blk.15.ffn_gate_shexp.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 ++blk.15.ffn_up_shexp.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 ++blk.16.ffn_down_shexp.weight shape=[np.uint64(512), np.uint64(2048)] type=Q8_0 ++blk.16.ffn_gate_shexp.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 ++blk.16.ffn_up_shexp.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 ++blk.17.ffn_down_shexp.weight shape=[np.uint64(512), np.uint64(2048)] type=Q8_0 ++blk.17.ffn_gate_shexp.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 ++blk.17.ffn_up_shexp.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 ++blk.18.ffn_down_shexp.weight shape=[np.uint64(512), np.uint64(2048)] type=Q8_0 ++blk.18.ffn_gate_shexp.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 ++blk.18.ffn_up_shexp.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 ++blk.19.ffn_down_shexp.weight shape=[np.uint64(512), np.uint64(2048)] type=Q8_0 ++blk.19.ffn_gate_shexp.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 ++blk.19.ffn_up_shexp.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 ++blk.2.ffn_down_shexp.weight shape=[np.uint64(512), np.uint64(2048)] type=Q8_0 ++blk.2.ffn_gate_shexp.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 ++blk.2.ffn_up_shexp.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 ++blk.20.ffn_down_shexp.weight shape=[np.uint64(512), np.uint64(2048)] type=Q8_0 ++blk.20.ffn_gate_shexp.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 ++blk.20.ffn_up_shexp.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 ++blk.21.ffn_down_shexp.weight shape=[np.uint64(512), np.uint64(2048)] type=Q8_0 ++blk.21.ffn_gate_shexp.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 ++blk.21.ffn_up_shexp.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 ++blk.22.ffn_down_shexp.weight shape=[np.uint64(512), np.uint64(2048)] type=Q8_0 ++blk.22.ffn_gate_shexp.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 ++blk.22.ffn_up_shexp.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 ++blk.23.ffn_down_shexp.weight shape=[np.uint64(512), np.uint64(2048)] type=Q8_0 ++blk.23.ffn_gate_shexp.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 ++blk.23.ffn_up_shexp.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 ++blk.24.ffn_down_shexp.weight shape=[np.uint64(512), np.uint64(2048)] type=Q8_0 ++blk.24.ffn_gate_shexp.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 ++blk.24.ffn_up_shexp.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 ++blk.25.ffn_down_shexp.weight shape=[np.uint64(512), np.uint64(2048)] type=Q8_0 ++blk.25.ffn_gate_shexp.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 ++blk.25.ffn_up_shexp.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 ++blk.26.ffn_down_shexp.weight shape=[np.uint64(512), np.uint64(2048)] type=Q8_0 ++blk.26.ffn_gate_shexp.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 ++blk.26.ffn_up_shexp.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 ++blk.27.ffn_down_shexp.weight shape=[np.uint64(512), np.uint64(2048)] type=Q8_0 ++blk.27.ffn_gate_shexp.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 ++blk.27.ffn_up_shexp.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 ++blk.28.ffn_down_shexp.weight shape=[np.uint64(512), np.uint64(2048)] type=Q8_0 ++blk.28.ffn_gate_shexp.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 ++blk.28.ffn_up_shexp.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 ++blk.29.ffn_down_shexp.weight shape=[np.uint64(512), np.uint64(2048)] type=Q8_0 ++blk.29.ffn_gate_shexp.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 ++blk.29.ffn_up_shexp.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 ++blk.3.ffn_down_shexp.weight shape=[np.uint64(512), np.uint64(2048)] type=Q8_0 ++blk.3.ffn_gate_shexp.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 ++blk.3.ffn_up_shexp.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 ++blk.30.ffn_down_shexp.weight shape=[np.uint64(512), np.uint64(2048)] type=Q8_0 ++blk.30.ffn_gate_shexp.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 ++blk.30.ffn_up_shexp.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 ++blk.31.ffn_down_shexp.weight shape=[np.uint64(512), np.uint64(2048)] type=Q8_0 ++blk.31.ffn_gate_shexp.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 ++blk.31.ffn_up_shexp.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 ++blk.32.ffn_down_shexp.weight shape=[np.uint64(512), np.uint64(2048)] type=Q8_0 ++blk.32.ffn_gate_shexp.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 ++blk.32.ffn_up_shexp.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 ++blk.33.ffn_down_shexp.weight shape=[np.uint64(512), np.uint64(2048)] type=Q8_0 ++blk.33.ffn_gate_shexp.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 ++blk.33.ffn_up_shexp.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 ++blk.34.ffn_down_shexp.weight shape=[np.uint64(512), np.uint64(2048)] type=Q8_0 ++blk.34.ffn_gate_shexp.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 ++blk.34.ffn_up_shexp.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 ++blk.35.ffn_down_shexp.weight shape=[np.uint64(512), np.uint64(2048)] type=Q8_0 ++blk.35.ffn_gate_shexp.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 ++blk.35.ffn_up_shexp.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 ++blk.36.ffn_down_shexp.weight shape=[np.uint64(512), np.uint64(2048)] type=Q8_0 ++blk.36.ffn_gate_shexp.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 ++blk.36.ffn_up_shexp.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 ++blk.37.ffn_down_shexp.weight shape=[np.uint64(512), np.uint64(2048)] type=Q8_0 ++blk.37.ffn_gate_shexp.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 ++blk.37.ffn_up_shexp.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 ++blk.38.ffn_down_shexp.weight shape=[np.uint64(512), np.uint64(2048)] type=Q8_0 ++blk.38.ffn_gate_shexp.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 ++blk.38.ffn_up_shexp.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 ++blk.39.ffn_down_shexp.weight shape=[np.uint64(512), np.uint64(2048)] type=Q8_0 ++blk.39.ffn_gate_shexp.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 ++blk.39.ffn_up_shexp.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 ++blk.4.ffn_down_shexp.weight shape=[np.uint64(512), np.uint64(2048)] type=Q8_0 ++blk.4.ffn_gate_shexp.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 ++blk.4.ffn_up_shexp.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 ++blk.5.ffn_down_shexp.weight shape=[np.uint64(512), np.uint64(2048)] type=Q8_0 ++blk.5.ffn_gate_shexp.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 ++blk.5.ffn_up_shexp.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 ++blk.6.ffn_down_shexp.weight shape=[np.uint64(512), np.uint64(2048)] type=Q8_0 ++blk.6.ffn_gate_shexp.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 ++blk.6.ffn_up_shexp.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 ++blk.7.ffn_down_shexp.weight shape=[np.uint64(512), np.uint64(2048)] type=Q8_0 ++blk.7.ffn_gate_shexp.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 ++blk.7.ffn_up_shexp.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 ++blk.8.ffn_down_shexp.weight shape=[np.uint64(512), np.uint64(2048)] type=Q8_0 ++blk.8.ffn_gate_shexp.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 ++blk.8.ffn_up_shexp.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 ++blk.9.ffn_down_shexp.weight shape=[np.uint64(512), np.uint64(2048)] type=Q8_0 ++blk.9.ffn_gate_shexp.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 ++blk.9.ffn_up_shexp.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 ++blk.0.attn_qkv_gate.weight shape=[np.uint64(2048), np.uint64(12288)] type=Q6_K ++blk.1.attn_qkv_gate.weight shape=[np.uint64(2048), np.uint64(12288)] type=Q6_K ++blk.10.attn_qkv_gate.weight shape=[np.uint64(2048), np.uint64(12288)] type=Q6_K ++blk.12.attn_qkv_gate.weight shape=[np.uint64(2048), np.uint64(12288)] type=Q6_K ++blk.13.attn_qkv_gate.weight shape=[np.uint64(2048), np.uint64(12288)] type=Q6_K ++blk.14.attn_qkv_gate.weight shape=[np.uint64(2048), np.uint64(12288)] type=Q6_K ++blk.16.attn_qkv_gate.weight shape=[np.uint64(2048), np.uint64(12288)] type=Q6_K ++blk.17.attn_qkv_gate.weight shape=[np.uint64(2048), np.uint64(12288)] type=Q6_K ++blk.18.attn_qkv_gate.weight shape=[np.uint64(2048), np.uint64(12288)] type=Q6_K ++blk.2.attn_qkv_gate.weight shape=[np.uint64(2048), np.uint64(12288)] type=Q6_K ++blk.20.attn_qkv_gate.weight shape=[np.uint64(2048), np.uint64(12288)] type=Q6_K ++blk.21.attn_qkv_gate.weight shape=[np.uint64(2048), np.uint64(12288)] type=Q6_K ++blk.22.attn_qkv_gate.weight shape=[np.uint64(2048), np.uint64(12288)] type=Q6_K ++blk.24.attn_qkv_gate.weight shape=[np.uint64(2048), np.uint64(12288)] type=Q6_K ++blk.25.attn_qkv_gate.weight shape=[np.uint64(2048), np.uint64(12288)] type=Q6_K ++blk.26.attn_qkv_gate.weight shape=[np.uint64(2048), np.uint64(12288)] type=Q6_K ++blk.28.attn_qkv_gate.weight shape=[np.uint64(2048), np.uint64(12288)] type=Q6_K ++blk.29.attn_qkv_gate.weight shape=[np.uint64(2048), np.uint64(12288)] type=Q6_K ++blk.30.attn_qkv_gate.weight shape=[np.uint64(2048), np.uint64(12288)] type=Q6_K ++blk.32.attn_qkv_gate.weight shape=[np.uint64(2048), np.uint64(12288)] type=Q6_K ++blk.33.attn_qkv_gate.weight shape=[np.uint64(2048), np.uint64(12288)] type=Q6_K ++blk.34.attn_qkv_gate.weight shape=[np.uint64(2048), np.uint64(12288)] type=Q6_K ++blk.36.attn_qkv_gate.weight shape=[np.uint64(2048), np.uint64(12288)] type=Q6_K ++blk.37.attn_qkv_gate.weight shape=[np.uint64(2048), np.uint64(12288)] type=Q6_K ++blk.38.attn_qkv_gate.weight shape=[np.uint64(2048), np.uint64(12288)] type=Q6_K ++blk.4.attn_qkv_gate.weight shape=[np.uint64(2048), np.uint64(12288)] type=Q6_K ++blk.5.attn_qkv_gate.weight shape=[np.uint64(2048), np.uint64(12288)] type=Q6_K ++blk.6.attn_qkv_gate.weight shape=[np.uint64(2048), np.uint64(12288)] type=Q6_K ++blk.8.attn_qkv_gate.weight shape=[np.uint64(2048), np.uint64(12288)] type=Q6_K ++blk.9.attn_qkv_gate.weight shape=[np.uint64(2048), np.uint64(12288)] type=Q6_K ++blk.0.ssm_out.weight shape=[np.uint64(4096), np.uint64(2048)] type=Q8_0 ++blk.1.ssm_out.weight shape=[np.uint64(4096), np.uint64(2048)] type=Q8_0 ++blk.10.ssm_out.weight shape=[np.uint64(4096), np.uint64(2048)] type=Q8_0 ++blk.12.ssm_out.weight shape=[np.uint64(4096), np.uint64(2048)] type=Q8_0 ++blk.13.ssm_out.weight shape=[np.uint64(4096), np.uint64(2048)] type=Q8_0 ++blk.14.ssm_out.weight shape=[np.uint64(4096), np.uint64(2048)] type=Q8_0 ++blk.16.ssm_out.weight shape=[np.uint64(4096), np.uint64(2048)] type=Q8_0 ++blk.17.ssm_out.weight shape=[np.uint64(4096), np.uint64(2048)] type=Q8_0 ++blk.18.ssm_out.weight shape=[np.uint64(4096), np.uint64(2048)] type=Q8_0 ++blk.2.ssm_out.weight shape=[np.uint64(4096), np.uint64(2048)] type=Q8_0 ++blk.20.ssm_out.weight shape=[np.uint64(4096), np.uint64(2048)] type=Q8_0 ++blk.21.ssm_out.weight shape=[np.uint64(4096), np.uint64(2048)] type=Q8_0 ++blk.22.ssm_out.weight shape=[np.uint64(4096), np.uint64(2048)] type=Q8_0 ++blk.24.ssm_out.weight shape=[np.uint64(4096), np.uint64(2048)] type=Q8_0 ++blk.25.ssm_out.weight shape=[np.uint64(4096), np.uint64(2048)] type=Q8_0 ++blk.26.ssm_out.weight shape=[np.uint64(4096), np.uint64(2048)] type=Q8_0 ++blk.28.ssm_out.weight shape=[np.uint64(4096), np.uint64(2048)] type=Q8_0 ++blk.29.ssm_out.weight shape=[np.uint64(4096), np.uint64(2048)] type=Q8_0 ++blk.30.ssm_out.weight shape=[np.uint64(4096), np.uint64(2048)] type=Q8_0 ++blk.32.ssm_out.weight shape=[np.uint64(4096), np.uint64(2048)] type=Q8_0 ++blk.33.ssm_out.weight shape=[np.uint64(4096), np.uint64(2048)] type=Q8_0 ++blk.34.ssm_out.weight shape=[np.uint64(4096), np.uint64(2048)] type=Q8_0 ++blk.36.ssm_out.weight shape=[np.uint64(4096), np.uint64(2048)] type=Q8_0 ++blk.37.ssm_out.weight shape=[np.uint64(4096), np.uint64(2048)] type=Q8_0 ++blk.38.ssm_out.weight shape=[np.uint64(4096), np.uint64(2048)] type=Q8_0 ++blk.4.ssm_out.weight shape=[np.uint64(4096), np.uint64(2048)] type=Q8_0 ++blk.5.ssm_out.weight shape=[np.uint64(4096), np.uint64(2048)] type=Q8_0 ++blk.6.ssm_out.weight shape=[np.uint64(4096), np.uint64(2048)] type=Q8_0 ++blk.8.ssm_out.weight shape=[np.uint64(4096), np.uint64(2048)] type=Q8_0 ++blk.9.ssm_out.weight shape=[np.uint64(4096), np.uint64(2048)] type=Q8_0 ++blk.11.attn_k.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 ++blk.11.attn_output.weight shape=[np.uint64(4096), np.uint64(2048)] type=Q8_0 ++blk.11.attn_q.weight shape=[np.uint64(2048), np.uint64(8192)] type=Q8_0 ++blk.11.attn_v.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 ++blk.15.attn_k.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 ++blk.15.attn_output.weight shape=[np.uint64(4096), np.uint64(2048)] type=Q8_0 ++blk.15.attn_q.weight shape=[np.uint64(2048), np.uint64(8192)] type=Q8_0 ++blk.15.attn_v.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 ++blk.19.attn_k.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 ++blk.19.attn_output.weight shape=[np.uint64(4096), np.uint64(2048)] type=Q8_0 ++blk.19.attn_q.weight shape=[np.uint64(2048), np.uint64(8192)] type=Q8_0 ++blk.19.attn_v.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 ++blk.23.attn_k.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 ++blk.23.attn_output.weight shape=[np.uint64(4096), np.uint64(2048)] type=Q8_0 ++blk.23.attn_q.weight shape=[np.uint64(2048), np.uint64(8192)] type=Q8_0 ++blk.23.attn_v.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 ++blk.27.attn_k.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 ++blk.27.attn_output.weight shape=[np.uint64(4096), np.uint64(2048)] type=Q8_0 ++blk.27.attn_q.weight shape=[np.uint64(2048), np.uint64(8192)] type=Q8_0 ++blk.27.attn_v.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 ++blk.3.attn_k.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 ++blk.3.attn_output.weight shape=[np.uint64(4096), np.uint64(2048)] type=Q8_0 ++blk.3.attn_q.weight shape=[np.uint64(2048), np.uint64(8192)] type=Q8_0 ++blk.3.attn_v.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 ++blk.31.attn_k.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 ++blk.31.attn_output.weight shape=[np.uint64(4096), np.uint64(2048)] type=Q8_0 ++blk.31.attn_q.weight shape=[np.uint64(2048), np.uint64(8192)] type=Q8_0 ++blk.31.attn_v.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 ++blk.35.attn_k.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 ++blk.35.attn_output.weight shape=[np.uint64(4096), np.uint64(2048)] type=Q8_0 ++blk.35.attn_q.weight shape=[np.uint64(2048), np.uint64(8192)] type=Q8_0 ++blk.35.attn_v.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 ++blk.39.attn_k.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 ++blk.39.attn_output.weight shape=[np.uint64(4096), np.uint64(2048)] type=Q8_0 ++blk.39.attn_q.weight shape=[np.uint64(2048), np.uint64(8192)] type=Q8_0 ++blk.39.attn_v.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 ++blk.7.attn_k.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 ++blk.7.attn_output.weight shape=[np.uint64(4096), np.uint64(2048)] type=Q8_0 ++blk.7.attn_q.weight shape=[np.uint64(2048), np.uint64(8192)] type=Q8_0 ++blk.7.attn_v.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 ++blk.0.hc_attn_up.weight shape=[np.uint64(256), np.uint64(8192)] type=Q8_0 ++blk.0.hc_ffn_up.weight shape=[np.uint64(256), np.uint64(8192)] type=Q8_0 ++blk.1.hc_attn_up.weight shape=[np.uint64(256), np.uint64(8192)] type=Q8_0 ++blk.1.hc_ffn_up.weight shape=[np.uint64(256), np.uint64(8192)] type=Q8_0 ++blk.10.hc_attn_up.weight shape=[np.uint64(256), np.uint64(8192)] type=Q8_0 ++blk.10.hc_ffn_up.weight shape=[np.uint64(256), np.uint64(8192)] type=Q8_0 ++blk.11.hc_attn_up.weight shape=[np.uint64(256), np.uint64(8192)] type=Q8_0 ++blk.11.hc_ffn_up.weight shape=[np.uint64(256), np.uint64(8192)] type=Q8_0 ++blk.12.hc_attn_up.weight shape=[np.uint64(256), np.uint64(8192)] type=Q8_0 ++blk.12.hc_ffn_up.weight shape=[np.uint64(256), np.uint64(8192)] type=Q8_0 ++blk.13.hc_attn_up.weight shape=[np.uint64(256), np.uint64(8192)] type=Q8_0 ++blk.13.hc_ffn_up.weight shape=[np.uint64(256), np.uint64(8192)] type=Q8_0 ++blk.14.hc_attn_up.weight shape=[np.uint64(256), np.uint64(8192)] type=Q8_0 ++blk.14.hc_ffn_up.weight shape=[np.uint64(256), np.uint64(8192)] type=Q8_0 ++blk.15.hc_attn_up.weight shape=[np.uint64(256), np.uint64(8192)] type=Q8_0 ++blk.15.hc_ffn_up.weight shape=[np.uint64(256), np.uint64(8192)] type=Q8_0 ++blk.16.hc_attn_up.weight shape=[np.uint64(256), np.uint64(8192)] type=Q8_0 ++blk.16.hc_ffn_up.weight shape=[np.uint64(256), np.uint64(8192)] type=Q8_0 ++blk.17.hc_attn_up.weight shape=[np.uint64(256), np.uint64(8192)] type=Q8_0 ++blk.17.hc_ffn_up.weight shape=[np.uint64(256), np.uint64(8192)] type=Q8_0 ++blk.18.hc_attn_up.weight shape=[np.uint64(256), np.uint64(8192)] type=Q8_0 ++blk.18.hc_ffn_up.weight shape=[np.uint64(256), np.uint64(8192)] type=Q8_0 ++blk.19.hc_attn_up.weight shape=[np.uint64(256), np.uint64(8192)] type=Q8_0 ++blk.19.hc_ffn_up.weight shape=[np.uint64(256), np.uint64(8192)] type=Q8_0 ++blk.2.hc_attn_up.weight shape=[np.uint64(256), np.uint64(8192)] type=Q8_0 ++blk.2.hc_ffn_up.weight shape=[np.uint64(256), np.uint64(8192)] type=Q8_0 ++blk.20.hc_attn_up.weight shape=[np.uint64(256), np.uint64(8192)] type=Q8_0 ++blk.20.hc_ffn_up.weight shape=[np.uint64(256), np.uint64(8192)] type=Q8_0 ++blk.21.hc_attn_up.weight shape=[np.uint64(256), np.uint64(8192)] type=Q8_0 ++blk.21.hc_ffn_up.weight shape=[np.uint64(256), np.uint64(8192)] type=Q8_0 ++blk.22.hc_attn_up.weight shape=[np.uint64(256), np.uint64(8192)] type=Q8_0 ++blk.22.hc_ffn_up.weight shape=[np.uint64(256), np.uint64(8192)] type=Q8_0 ++blk.23.hc_attn_up.weight shape=[np.uint64(256), np.uint64(8192)] type=Q8_0 ++blk.23.hc_ffn_up.weight shape=[np.uint64(256), np.uint64(8192)] type=Q8_0 ++blk.24.hc_attn_up.weight shape=[np.uint64(256), np.uint64(8192)] type=Q8_0 ++blk.24.hc_ffn_up.weight shape=[np.uint64(256), np.uint64(8192)] type=Q8_0 ++blk.25.hc_attn_up.weight shape=[np.uint64(256), np.uint64(8192)] type=Q8_0 ++blk.25.hc_ffn_up.weight shape=[np.uint64(256), np.uint64(8192)] type=Q8_0 ++blk.26.hc_attn_up.weight shape=[np.uint64(256), np.uint64(8192)] type=Q8_0 ++blk.26.hc_ffn_up.weight shape=[np.uint64(256), np.uint64(8192)] type=Q8_0 ++blk.27.hc_attn_up.weight shape=[np.uint64(256), np.uint64(8192)] type=Q8_0 ++blk.27.hc_ffn_up.weight shape=[np.uint64(256), np.uint64(8192)] type=Q8_0 ++blk.28.hc_attn_up.weight shape=[np.uint64(256), np.uint64(8192)] type=Q8_0 ++blk.28.hc_ffn_up.weight shape=[np.uint64(256), np.uint64(8192)] type=Q8_0 ++blk.29.hc_attn_up.weight shape=[np.uint64(256), np.uint64(8192)] type=Q8_0 ++blk.29.hc_ffn_up.weight shape=[np.uint64(256), np.uint64(8192)] type=Q8_0 ++blk.3.hc_attn_up.weight shape=[np.uint64(256), np.uint64(8192)] type=Q8_0 ++blk.3.hc_ffn_up.weight shape=[np.uint64(256), np.uint64(8192)] type=Q8_0 ++blk.30.hc_attn_up.weight shape=[np.uint64(256), np.uint64(8192)] type=Q8_0 ++blk.30.hc_ffn_up.weight shape=[np.uint64(256), np.uint64(8192)] type=Q8_0 ++blk.31.hc_attn_up.weight shape=[np.uint64(256), np.uint64(8192)] type=Q8_0 ++blk.31.hc_ffn_up.weight shape=[np.uint64(256), np.uint64(8192)] type=Q8_0 ++blk.32.hc_attn_up.weight shape=[np.uint64(256), np.uint64(8192)] type=Q8_0 ++blk.32.hc_ffn_up.weight shape=[np.uint64(256), np.uint64(8192)] type=Q8_0 ++blk.33.hc_attn_up.weight shape=[np.uint64(256), np.uint64(8192)] type=Q8_0 ++blk.33.hc_ffn_up.weight shape=[np.uint64(256), np.uint64(8192)] type=Q8_0 ++blk.34.hc_attn_up.weight shape=[np.uint64(256), np.uint64(8192)] type=Q8_0 ++blk.34.hc_ffn_up.weight shape=[np.uint64(256), np.uint64(8192)] type=Q8_0 ++blk.35.hc_attn_up.weight shape=[np.uint64(256), np.uint64(8192)] type=Q8_0 ++blk.35.hc_ffn_up.weight shape=[np.uint64(256), np.uint64(8192)] type=Q8_0 ++blk.36.hc_attn_up.weight shape=[np.uint64(256), np.uint64(8192)] type=Q8_0 ++blk.36.hc_ffn_up.weight shape=[np.uint64(256), np.uint64(8192)] type=Q8_0 ++blk.37.hc_attn_up.weight shape=[np.uint64(256), np.uint64(8192)] type=Q8_0 ++blk.37.hc_ffn_up.weight shape=[np.uint64(256), np.uint64(8192)] type=Q8_0 ++blk.38.hc_attn_up.weight shape=[np.uint64(256), np.uint64(8192)] type=Q8_0 ++blk.38.hc_ffn_up.weight shape=[np.uint64(256), np.uint64(8192)] type=Q8_0 ++blk.39.hc_attn_up.weight shape=[np.uint64(256), np.uint64(8192)] type=Q8_0 ++blk.39.hc_ffn_up.weight shape=[np.uint64(256), np.uint64(8192)] type=Q8_0 ++blk.4.hc_attn_up.weight shape=[np.uint64(256), np.uint64(8192)] type=Q8_0 ++blk.4.hc_ffn_up.weight shape=[np.uint64(256), np.uint64(8192)] type=Q8_0 ++blk.5.hc_attn_up.weight shape=[np.uint64(256), np.uint64(8192)] type=Q8_0 ++blk.5.hc_ffn_up.weight shape=[np.uint64(256), np.uint64(8192)] type=Q8_0 ++blk.6.hc_attn_up.weight shape=[np.uint64(256), np.uint64(8192)] type=Q8_0 ++blk.6.hc_ffn_up.weight shape=[np.uint64(256), np.uint64(8192)] type=Q8_0 ++blk.7.hc_attn_up.weight shape=[np.uint64(256), np.uint64(8192)] type=Q8_0 ++blk.7.hc_ffn_up.weight shape=[np.uint64(256), np.uint64(8192)] type=Q8_0 ++blk.8.hc_attn_up.weight shape=[np.uint64(256), np.uint64(8192)] type=Q8_0 ++blk.8.hc_ffn_up.weight shape=[np.uint64(256), np.uint64(8192)] type=Q8_0 ++blk.9.hc_attn_up.weight shape=[np.uint64(256), np.uint64(8192)] type=Q8_0 ++blk.9.hc_ffn_up.weight shape=[np.uint64(256), np.uint64(8192)] type=Q8_0 ++blk.40.attn_k.weight shape=[np.uint64(2048), np.uint64(512)] type=Q6_K ++blk.40.attn_k_norm.weight shape=[np.uint64(256)] type=F32 ++blk.40.attn_output.weight shape=[np.uint64(4096), np.uint64(2048)] type=Q6_K ++blk.40.attn_q.weight shape=[np.uint64(2048), np.uint64(8192)] type=Q6_K ++blk.40.attn_q_norm.weight shape=[np.uint64(256)] type=F32 ++blk.40.attn_v.weight shape=[np.uint64(2048), np.uint64(512)] type=Q6_K ++blk.40.ffn_down_exps.weight shape=[np.uint64(512), np.uint64(2048), np.uint64(256)] type=Q6_K ++blk.40.ffn_down_shexp.weight shape=[np.uint64(512), np.uint64(2048)] type=Q6_K ++blk.40.ffn_gate_exps.weight shape=[np.uint64(2048), np.uint64(512), np.uint64(256)] type=Q6_K ++blk.40.ffn_gate_inp.weight shape=[np.uint64(2048), np.uint64(256)] type=F32 ++blk.40.ffn_gate_inp_shexp.weight shape=[np.uint64(2048)] type=F32 ++blk.40.ffn_gate_shexp.weight shape=[np.uint64(2048), np.uint64(512)] type=Q6_K ++blk.40.ffn_up_exps.weight shape=[np.uint64(2048), np.uint64(512), np.uint64(256)] type=Q6_K ++blk.40.ffn_up_shexp.weight shape=[np.uint64(2048), np.uint64(512)] type=Q6_K ++blk.40.hc_attn_down_inject.weight shape=[np.uint64(8192), np.uint64(260)] type=Q6_K ++blk.40.hc_attn_norm.weight shape=[np.uint64(8192)] type=F32 ++blk.40.hc_attn_up.weight shape=[np.uint64(256), np.uint64(8192)] type=Q6_K ++blk.40.hc_ffn_down_inject.weight shape=[np.uint64(8192), np.uint64(260)] type=Q6_K ++blk.40.hc_ffn_norm.weight shape=[np.uint64(8192)] type=F32 ++blk.40.hc_ffn_up.weight shape=[np.uint64(256), np.uint64(8192)] type=Q6_K ++blk.40.indexer.k_norm.weight shape=[np.uint64(128)] type=F32 ++blk.40.indexer.k_proj.weight shape=[np.uint64(2048), np.uint64(128)] type=BF16 ++blk.40.indexer.q_norm.weight shape=[np.uint64(128)] type=F32 ++blk.40.indexer.q_proj.weight shape=[np.uint64(2048), np.uint64(512)] type=BF16 ++blk.40.nextn.eh_proj.weight shape=[np.uint64(4096), np.uint64(2048)] type=Q6_K ++blk.40.nextn.enorm.weight shape=[np.uint64(2048)] type=F32 ++blk.40.nextn.hc_head_down.weight shape=[np.uint64(8192), np.uint64(256)] type=Q6_K ++blk.40.nextn.hc_head_norm.weight shape=[np.uint64(8192)] type=F32 ++blk.40.nextn.hc_head_up.weight shape=[np.uint64(256), np.uint64(8192)] type=Q6_K ++blk.40.nextn.hnorm.weight shape=[np.uint64(8192)] type=F32 ++output.weight shape=[np.uint64(2048), np.uint64(248320)] type=Q8_0 ++token_embd.weight shape=[np.uint64(2048), np.uint64(248320)] type=Q5_K ++per_layer_token_embd.weight shape=[128, 160003584] type=Q5_1 # shard 00002 only tensor +diff --git a/engine/cmake/strata_poly.cmake b/engine/cmake/strata_poly.cmake +index 37eba3a53..b00c4b94e 100644 +--- a/engine/cmake/strata_poly.cmake ++++ b/engine/cmake/strata_poly.cmake +@@ -211,7 +211,7 @@ if(STRATA_BUILD_POLY AND STRATA_NATIVE_EXPERTS AND (STRATA_ENABLE_CUDA OR STRATA + set_tests_properties(poly_gdn_mma_test PROPERTIES SKIP_RETURN_CODE 77) + # Optional model/state check; run by hand with an MTP GGUF and frozen prompt IDs. + add_executable(poly_gdn_mma_state_test src/poly/gdn_mma_state_test.cpp src/poly/engine.cpp src/poly/expert_card.cpp src/poly/glm5next.cpp +- src/poly/qwen35.cpp src/poly/gemma4.cpp src/poly/deepseek4.cpp src/poly/lfm2moe.cpp ++ src/poly/qwen35.cpp src/poly/qwen4exp.cpp src/poly/gemma4.cpp src/poly/deepseek4.cpp src/poly/lfm2moe.cpp + src/poly/flint.cpp src/poly/kolibri1.cpp src/poly/laguna.cpp src/poly/inkling2.cpp src/poly/inkling2_pictures.cpp src/poly/inkling2.cu src/poly/cpu_experts.cpp src/poly/kernels.cu + src/poly/kernels_dsv4.cu src/core/conversation_memory.cpp) + target_include_directories(poly_gdn_mma_state_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include ${_strata_gpu_include_directories}) +@@ -219,7 +219,7 @@ if(STRATA_BUILD_POLY AND STRATA_NATIVE_EXPERTS AND (STRATA_ENABLE_CUDA OR STRATA + ${_strata_gpu_blas_target} ${_strata_gpu_runtime_target} CUDA::cuda_driver Threads::Threads) + endif() + +- add_executable(strata-poly src/poly/main.cpp src/poly/engine.cpp src/poly/expert_card.cpp src/poly/glm5next.cpp src/poly/qwen35.cpp ++ add_executable(strata-poly src/poly/main.cpp src/poly/engine.cpp src/poly/expert_card.cpp src/poly/glm5next.cpp src/poly/qwen35.cpp src/poly/qwen4exp.cpp + src/poly/gemma4.cpp src/poly/deepseek4.cpp src/poly/lfm2moe.cpp src/poly/flint.cpp + src/poly/kolibri1.cpp src/poly/laguna.cpp src/poly/inkling2.cpp src/poly/inkling2_pictures.cpp src/poly/inkling2.cu src/poly/cpu_experts.cpp src/poly/kernels.cu src/poly/kernels_dsv4.cu + src/poly/spill.cpp src/core/conversation_memory.cpp src/core/conversation_file.cpp) +@@ -245,7 +245,7 @@ if(STRATA_BUILD_POLY AND STRATA_NATIVE_EXPERTS AND (STRATA_ENABLE_CUDA OR STRATA + # a read with the draft block repeats bit for bit; needs the model file, so it is run by hand: + # poly_draft_race_test MODEL.gguf [RUNS] [LAYER_SPLIT] + add_executable(poly_draft_race_test src/poly/draft_race_test.cpp src/poly/engine.cpp src/poly/expert_card.cpp src/poly/glm5next.cpp +- src/poly/qwen35.cpp src/poly/gemma4.cpp src/poly/deepseek4.cpp ++ src/poly/qwen35.cpp src/poly/qwen4exp.cpp src/poly/gemma4.cpp src/poly/deepseek4.cpp + src/poly/lfm2moe.cpp src/poly/flint.cpp src/poly/kolibri1.cpp src/poly/laguna.cpp src/poly/inkling2.cpp src/poly/inkling2_pictures.cpp src/poly/inkling2.cu + src/poly/cpu_experts.cpp src/poly/kernels.cu src/poly/kernels_dsv4.cu + src/core/conversation_memory.cpp) +@@ -257,7 +257,7 @@ if(STRATA_BUILD_POLY AND STRATA_NATIVE_EXPERTS AND (STRATA_ENABLE_CUDA OR STRATA + # a layer split's greedy tokens, picked on the card and from the logits, against one card's; needs the model file, + # so it is run by hand: poly_layer_split_picks_test MODEL.gguf [LAYER_SPLIT] [TOKENS] + add_executable(poly_layer_split_picks_test src/poly/layer_split_picks_test.cpp src/poly/engine.cpp src/poly/expert_card.cpp src/poly/glm5next.cpp +- src/poly/qwen35.cpp src/poly/gemma4.cpp src/poly/deepseek4.cpp ++ src/poly/qwen35.cpp src/poly/qwen4exp.cpp src/poly/gemma4.cpp src/poly/deepseek4.cpp + src/poly/lfm2moe.cpp src/poly/flint.cpp src/poly/kolibri1.cpp src/poly/laguna.cpp src/poly/inkling2.cpp src/poly/inkling2_pictures.cpp src/poly/inkling2.cu + src/poly/cpu_experts.cpp src/poly/kernels.cu src/poly/kernels_dsv4.cu + src/core/conversation_memory.cpp) +diff --git a/engine/include/strata/poly/kernels.hpp b/engine/include/strata/poly/kernels.hpp +index ff16e74b9..99418b0ff 100644 +--- a/engine/include/strata/poly/kernels.hpp ++++ b/engine/include/strata/poly/kernels.hpp +@@ -79,6 +79,22 @@ void hc_mean(const float* r, float* y, int n_embd, int rows, void* stream); + void hc_head(const float* r, const float* fn, const float* scale, const float* base, float* mix, float* y, + int n_embd, int rows, float norm_eps, float hc_eps, void* stream); + ++/// qwen4exp's per-layer embeddings (llama.cpp's build_ple), `rows` tokens. key: hc * n_embd a token, the product ++/// of its table-gathered embedding with the key matrix; hidden: the token's hc * n_embd residual streams; value: ++/// n_embd a token. One block a token and stream: its key and hidden rows RMS-normed by w_norm_key / w_norm_query, ++/// their dot over the stream scaled by 1/sqrt(n_embd), taken through sign * sqrt(max(|s|, 1e-6)) and a sigmoid to ++/// the stream's gate; the value broadcast over the streams and gated comes out as gated, and its own grouped norm ++/// (w_norm_conv) as normed. A stream of 32 to 4096 values, in 32s. ++void ple_mix(const float* key, const float* hidden, const float* value, const float* w_norm_key, ++ const float* w_norm_query, const float* w_norm_conv, float* gated, float* normed, int hc, int n_embd, ++ int rows, float eps, void* stream); ++/// The conv of the same graph and its write into the stack: one block a group of channels of hc_dim, the tokens ++/// run in order. state: hc_dim floats a row, the nine rows (a conv of 4 taps, dilated by 3) the call continues, ++/// oldest first, advanced here; out[c, t] = sum_k w[c * 4 + k] * x[c, t - (3 - k) * 3] goes through SiLU, and ++/// r - the call's rows of the residual stack, hc_dim floats a row - takes gated plus that SiLU. 1 to 32 tokens. ++void ple_conv_add(float* state, const float* normed, const float* gated, const float* w, float* r, int hc_dim, ++ int rows, void* stream); ++ + /// The three causal convolutions of a KDA layer and their SiLU. proj: the q projections of every row, then the k, + /// then the v (3 * rows * d_inner); out has the same layout. state: 3 * d_inner * (d_conv - 1) past inputs, oldest + /// first per channel, advanced here by `rows` tokens. w*: (d_conv, d_inner). +@@ -570,7 +586,8 @@ void shortconv(const float* bcx, float* state, const float* w, float* out, int c + /// out = rms_norm(o) * o_norm * silu(z), n_head * dim values a token. qkv, alpha and beta are overwritten. + void gdn_step(float* qkv, float* alpha, float* beta, const float* dt, const float* a, float* s, + const float* z, const float* o_norm, float* out, int dim, int n_head, int k_heads, int rows, +- float norm_eps, void* stream, float* snap = nullptr, size_t stride = 0, unsigned snaps = 0); ++ float norm_eps, void* stream, float* snap = nullptr, size_t stride = 0, unsigned snaps = 0, ++ bool gate_silu = true); + /// The rows of several sequences in one call, each with a recurrent state of its own: sequence k has rows + /// [first[k], first[k] + rows[k]) of the call, its state in state[k], and snap[k], when not null, takes the state as + /// it is after its first row (a token and its guess). CUDA only. +@@ -588,7 +605,7 @@ void conv4_silu_seqs(const float* x, const SeqStates& seqs, const float* w, floa + void shortconv_seqs(const float* bcx, const SeqStates& seqs, const float* w, float* out, int channels, void* stream); + void gdn_step_seqs(float* qkv, float* alpha, float* beta, const float* dt, const float* a, const SeqStates& seqs, + const float* z, const float* o_norm, float* out, int dim, int n_head, int k_heads, int rows, +- float norm_eps, void* stream); ++ float norm_eps, void* stream, bool gate_silu = true); + /// conv4_silu() for a block of `rows` tokens that see each other (Clover's block guesses): a token's sum adds + /// input t + d of the block times right[d - 1] for d = 1 to 3, right (3, channels). The state is only read. + void conv4_block_silu(const float* x, const float* state, const float* w, const float* right, float* out, +diff --git a/engine/src/poly/engine.cpp b/engine/src/poly/engine.cpp +index 5a2bff8c7..ce61d2222 100644 +--- a/engine/src/poly/engine.cpp ++++ b/engine/src/poly/engine.cpp +@@ -17,6 +17,7 @@ + #endif + #include "mmq.hpp" + #include "qwen35.hpp" ++#include "qwen4exp.hpp" + #include "runtime.hpp" + #include "split_plan.hpp" + #include "strata/poly/cold_budget.hpp" +@@ -2440,16 +2441,16 @@ std::unique_ptr Engine::open(const Options& o) { + const std::string name = arch ? arch->s : std::string(); + // Clover is a qwen35moe model trained to also guess a block of tokens at once (Qwen35) + const bool qwen35 = name == "qwen35moe" || name == "clover_moe"; +- if (o.kv_format == KvFmt::kQ8_0 && !qwen35 && name != "kolibri1" && name != "flint" && name != "lfm2moe" && +- name != "laguna" && name != "inkling2_loop" && +- name != "inkling2") +- throw std::runtime_error("--kv q8_0 is supported for qwen35moe, kolibri1, flint, lfm2moe, laguna and " ++ const bool qwen4exp = name == "qwen4exp"; ++ if (o.kv_format == KvFmt::kQ8_0 && !qwen35 && !qwen4exp && name != "kolibri1" && name != "flint" && ++ name != "lfm2moe" && name != "laguna" && name != "inkling2_loop" && name != "inkling2") ++ throw std::runtime_error("--kv q8_0 is supported for qwen35moe, qwen4exp, kolibri1, flint, lfm2moe, laguna and " + "Inkling 2 models in v1; this is a '" + name + "' model"); + // q4_0 is Qwen35's and Inkling 2's (the other architectures read a q8_0 cache, not this one, and would run fp16 + // without a word) +- if (o.kv_format == KvFmt::kQ4_0 && !qwen35 && name != "inkling2_loop" && name != "inkling2") +- throw std::runtime_error("--kv q4_0 is supported for qwen35moe and Inkling 2 models in v1; this is a '" + name + +- "' model"); ++ if (o.kv_format == KvFmt::kQ4_0 && !qwen35 && !qwen4exp && name != "inkling2_loop" && name != "inkling2") ++ throw std::runtime_error("--kv q4_0 is supported for qwen35moe, qwen4exp and Inkling 2 models in v1; this is a '" + ++ name + "' model"); + // --kv-resident streams the attention caches from host RAM: Qwen35's (kv_stage_, the pinned rows) + if (o.kv_resident > 0 && !qwen35) + throw std::runtime_error("--kv-resident is supported for qwen35moe models in v1; this is a '" + name + "' model"); +@@ -2484,6 +2485,7 @@ std::unique_ptr Engine::open(const Options& o) { + const auto make = [&]() -> std::unique_ptr { + if (name == "glm5-next" || name == "glm5next") return std::make_unique(); // Unsloth: no hyphen + if (qwen35) return std::make_unique(); ++ if (qwen4exp) return std::make_unique(); + if (name == "gemma4") return std::make_unique(); + if (name == "deepseek4") return std::make_unique(); + if (name == "lfm2moe") return std::make_unique(); +@@ -4103,7 +4105,9 @@ void Engine::load(const Options& o) { + if (const Names* a = norm ? nullptr : tensor_alias("output_norm.weight")) + for (const char* other : a->other) + if (other && !norm) norm = gg_->find(other); +- out_norm_ = upload(norm, "output_norm.weight", n_embd_, 1, kF32); ++ // a file without an output norm (qwen4exp's final hyper-connection mixer carries it): leave the Dev ++ // empty, and the architecture that has no norm's output_rows() does not read it ++ out_norm_ = norm ? upload(norm, "output_norm.weight", n_embd_, 1, kF32) : Dev{}; + // a file without an output matrix ties the output to the token table + const TensorInfo* head = gg_->find("output.weight"); + output_ = upload(head ? head : gg_->find("token_embd.weight"), "output.weight", n_embd_, n_vocab_, +diff --git a/engine/src/poly/kernels.cu b/engine/src/poly/kernels.cu +index ab26f5f36..8101a4883 100644 +--- a/engine/src/poly/kernels.cu ++++ b/engine/src/poly/kernels.cu +@@ -3250,15 +3250,17 @@ gdn_state_seqs_kernel(const float* __restrict__ qkv, const float* __restrict__ d + gdn_state_body(q, dc, sh, seqs.state[k], o, dim, n_head, k_heads, seqs.rows[k], seqs.snap[k], 0, sn); + } + +-// One block a token and value head: the output's norm, its weights and the gate. ++// One block a token and value head: the output's norm, its weights and the gate. Qwen3.5's gate is silu; ++// qwen4exp's is a plain sigmoid (gate_silu: false). + __global__ void gdn_out_kernel(float* __restrict__ out, const float* __restrict__ z, +- const float* __restrict__ o_norm, int dim, float norm_eps) { ++ const float* __restrict__ o_norm, int dim, float norm_eps, bool gate_silu) { + __shared__ float part[8]; + const size_t at = size_t(blockIdx.x) * dim + threadIdx.x; + const float o = out[at]; + const float os = block_sum(o * o, part); + const float gate = z[at]; +- out[at] = o / sqrtf(os / float(dim) + norm_eps) * o_norm[threadIdx.x] * (gate * sigmoid(gate)); ++ out[at] = o / sqrtf(os / float(dim) + norm_eps) * o_norm[threadIdx.x] * ++ (gate_silu ? gate * sigmoid(gate) : sigmoid(gate)); + } + + // conv4_silu_kernel for a block of tokens that see each other (Clover): a token's sum adds its next three inputs +@@ -5454,14 +5456,14 @@ bool gdn_mma_step(float* qkv, float* alpha, float* beta, const float* dt, const + // if device availability unexpectedly changes after the preflight above. + if (!kernels::gdn_mma_try(args, stream)) + throw std::runtime_error("GDN MMA: prepared execution became unavailable"); +- gdn_out_kernel<<>>(out, z, o_norm, dim, norm_eps); ++ gdn_out_kernel<<>>(out, z, o_norm, dim, norm_eps, true); + return true; + } + #endif + + void gdn_step(float* qkv, float* alpha, float* beta, const float* dt, const float* a, float* s, const float* z, + const float* o_norm, float* out, int dim, int n_head, int k_heads, int rows, float norm_eps, void* stream, +- float* snap, size_t stride, unsigned snaps) { ++ float* snap, size_t stride, unsigned snaps, bool gate_silu) { + if (dim % WARP != 0 || dim > 256) throw std::invalid_argument("gdn_step: a head of 32 to 256 values, in 32s"); + const size_t row_n = (2 * size_t(k_heads) + n_head) * dim; + const int gates = rows * n_head, columns = std::min(dim, 1024 / WARP); // a block's columns: a warp each +@@ -5481,7 +5483,7 @@ void gdn_step(float* qkv, float* alpha, float* beta, const float* dt, const floa + default: gdn_state_kernel<<>>(qkv, alpha, beta, s, out, dim, n_head, k_heads, rows, + snap, stride, sn); + } +- gdn_out_kernel<<>>(out, z, o_norm, dim, norm_eps); ++ gdn_out_kernel<<>>(out, z, o_norm, dim, norm_eps, gate_silu); + } + + // A step's sequences one launch a kernel. Of gdn_step()'s four kernels only the state's update reads a sequence's +@@ -5499,7 +5501,7 @@ void conv4_silu_seqs(const float* x, const SeqStates& seqs, const float* w, floa + + void gdn_step_seqs(float* qkv, float* alpha, float* beta, const float* dt, const float* a, const SeqStates& seqs, + const float* z, const float* o_norm, float* out, int dim, int n_head, int k_heads, int rows, +- float norm_eps, void* stream) { ++ float norm_eps, void* stream, bool gate_silu) { + if (dim % WARP != 0 || dim > 256) throw std::invalid_argument("gdn_step_seqs: a head of 32 to 256 values, in 32s"); + if (seqs.n < 1 || seqs.n > SeqStates::kMax) throw std::invalid_argument("gdn_step_seqs: 1 to 32 sequences"); + const size_t row_n = (2 * size_t(k_heads) + n_head) * dim; +@@ -5515,7 +5517,7 @@ void gdn_step_seqs(float* qkv, float* alpha, float* beta, const float* dt, const + case 8: gdn_state_seqs_kernel<8><<>>(qkv, alpha, beta, seqs, out, dim, n_head, k_heads); break; + default: gdn_state_seqs_kernel<0><<>>(qkv, alpha, beta, seqs, out, dim, n_head, k_heads); + } +- gdn_out_kernel<<>>(out, z, o_norm, dim, norm_eps); ++ gdn_out_kernel<<>>(out, z, o_norm, dim, norm_eps, gate_silu); + } + + void conv4_block_silu(const float* x, const float* state, const float* w, const float* right, float* out, +@@ -5540,7 +5542,68 @@ void gdn_block(float* qkv, float* alpha, float* beta, const float* dt, const flo + k_heads, rows); + const int blocks = n_head * ((dim + columns - 1) / columns), threads = columns * WARP; + gdn_block_out_kernel<<>>(qkv, alpha, s, w, out, dim, n_head, k_heads, rows); +- gdn_out_kernel<<>>(out, z, o_norm, dim, norm_eps); ++ gdn_out_kernel<<>>(out, z, o_norm, dim, norm_eps, true); ++} ++ ++// qwen4exp's per-layer embeddings: one block a token and hc stream. The stream's key and hidden rows are RMS- ++// normed, their dot gives the gate - sign(s) * sqrt(max(|s|, 1e-6)) through a sigmoid, s scaled by 1/sqrt(n_embd) - ++// and the value, the same vector for every stream, comes out gated and gated-then-normed. The norm of the gated ++// value is the gate times the value's own, so the last two passes need no extra sums. ++__global__ void ple_mix_kernel(const float* __restrict__ key, const float* __restrict__ hidden, ++ const float* __restrict__ value, const float* __restrict__ w_key, ++ const float* __restrict__ w_query, const float* __restrict__ w_conv, ++ float* __restrict__ gated, float* __restrict__ normed, int hc, int n_embd, ++ float norm_eps) { ++ __shared__ float part[8]; ++ const int t = blockIdx.x / hc, s = blockIdx.x % hc; ++ const size_t row = (size_t) t * hc * n_embd + (size_t) s * n_embd; ++ const float *kk = key + row, *hh = hidden + row, *vv = value + (size_t) t * n_embd; ++ const float *wk = w_key + (size_t) s * n_embd, *wq = w_query + (size_t) s * n_embd, ++ *wc = w_conv + (size_t) s * n_embd; ++ float mk = 0.f, mq = 0.f, mv = 0.f; ++ for (int i = threadIdx.x; i < n_embd; i += blockDim.x) { ++ mk += kk[i] * kk[i]; ++ mq += hh[i] * hh[i]; ++ mv += vv[i] * vv[i]; ++ } ++ mk = block_sum(mk, part); ++ mq = block_sum(mq, part); ++ mv = block_sum(mv, part); ++ const float rk = rsqrtf(mk / (float) n_embd + norm_eps), rq = rsqrtf(mq / (float) n_embd + norm_eps); ++ float dot = 0.f; ++ for (int i = threadIdx.x; i < n_embd; i += blockDim.x) ++ dot += kk[i] * rk * wk[i] * hh[i] * rq * wq[i]; ++ dot = block_sum(dot, part); ++ const float sg = dot / sqrtf((float) n_embd); ++ const float gate = sigmoid(copysignf(sqrtf(fmaxf(fabsf(sg), 1e-6f)), sg)); ++ const float rg = rsqrtf(gate * gate * (mv / (float) n_embd) + norm_eps); ++ for (int i = threadIdx.x; i < n_embd; i += blockDim.x) { ++ const float g = vv[i] * gate; ++ gated[row + i] = g; ++ normed[row + i] = g * wc[i] * rg; ++ } ++} ++ ++// The conv over the gated-then-normed rows and the add of build_ple: each thread keeps one channel's window - ++// the nine state rows, oldest first, then the call's new normed ones - runs the four dilated taps a token at a ++// time, adds SiLU(conv) and the gated value into r, and leaves the window's last nine rows in the state, so any ++// cutting of the tokens gives the same sums as one long conv. ++__global__ void ple_conv_add_kernel(float* __restrict__ state, const float* __restrict__ normed, ++ const float* __restrict__ gated, const float* __restrict__ w, ++ float* __restrict__ r, int hc_dim, int rows) { ++ constexpr int hist = 9; // (4 taps - 1) * a dilation of 3 ++ const int c = blockIdx.x * blockDim.x + threadIdx.x; ++ float win[hist + 32]; ++ for (int j = 0; j < hist; ++j) win[j] = state[(size_t) j * hc_dim + c]; ++ for (int j = 0; j < rows; ++j) win[hist + j] = normed[(size_t) j * hc_dim + c]; ++ for (int i = 0; i < rows; ++i) { ++ const int a = hist + i; ++ const float out = w[c * 4] * win[a - 9] + w[c * 4 + 1] * win[a - 6] + w[c * 4 + 2] * win[a - 3] + ++ w[c * 4 + 3] * win[a]; ++ const size_t at = (size_t) i * hc_dim + c; ++ r[at] += gated[at] + out / (1.f + expf(-out)); ++ } ++ for (int j = 0; j < hist; ++j) state[(size_t) j * hc_dim + c] = win[rows + j]; + } + + void coreset_mask(float* logits, int n_expert, int n_used, int rows, float share, void* stream) { +@@ -5549,4 +5612,19 @@ void coreset_mask(float* logits, int n_expert, int n_used, int rows, float share + rows, share); + } + ++void ple_mix(const float* key, const float* hidden, const float* value, const float* w_norm_key, ++ const float* w_norm_query, const float* w_norm_conv, float* gated, float* normed, int hc, int n_embd, ++ int rows, float eps, void* stream) { ++ if (n_embd % WARP != 0 || n_embd > 4096) ++ throw std::invalid_argument("ple_mix: a stream of 32 to 4096 values, in 32s"); ++ ple_mix_kernel<<>>(key, hidden, value, w_norm_key, w_norm_query, w_norm_conv, ++ gated, normed, hc, n_embd, eps); ++} ++ ++void ple_conv_add(float* state, const float* normed, const float* gated, const float* w, float* r, int hc_dim, ++ int rows, void* stream) { ++ if (rows < 1 || rows > 32) throw std::invalid_argument("ple_conv_add: 1 to 32 tokens a call"); ++ ple_conv_add_kernel<<>>(state, normed, gated, w, r, hc_dim, rows); ++} ++ + } // namespace strata::poly +diff --git a/engine/src/poly/qwen35.cpp b/engine/src/poly/qwen35.cpp +index 40d998976..98151d50b 100644 +--- a/engine/src/poly/qwen35.cpp ++++ b/engine/src/poly/qwen35.cpp +@@ -731,7 +731,7 @@ void Qwen35::gdn(Block& B, int n) { + if (n <= SeqStates::kMax) { + conv4_silu_seqs(proj_, conv, fp(B.conv), qkv_, conv_dim_, st_); + gdn_step_seqs(qkv_, alpha_, beta_, fp(B.dt), fp(B.a), delta, z_, fp(B.o_norm), gated_, s_dim_, v_heads_, +- k_heads_, n, rms_eps_, st_); ++ k_heads_, n, rms_eps_, st_, gate_silu_); + lin(B.wo, gated_, ao_, n); + return; + } +@@ -749,17 +749,17 @@ void Qwen35::gdn(Block& B, int n) { + snap ? snap + (B.past - state_) : nullptr, rec_n_, snap ? 1u : 0u); + gdn_step(qkv_ + c, alpha_ + h, beta_ + h, fp(B.dt), fp(B.a), seq_state(s, B.s), z_ + d, fp(B.o_norm), + gated_ + d, s_dim_, v_heads_, k_heads_, m, rms_eps_, st_, snap ? snap + (B.s - state_) : nullptr, +- rec_n_, snap ? 1u : 0u); ++ rec_n_, snap ? 1u : 0u, gate_silu_); + } + } else { + conv4_silu(proj_, B.past, fp(B.conv), qkv_, conv_dim_, n, st_, + snap_bits_ ? snap_at_ + (B.past - state_) : nullptr, rec_n_, snap_bits_); + #ifdef STRATA_POLY_GDN_MMA +- if (!(gdn_mma_.enabled() && !recording_ && gdn_mma_step(qkv_, alpha_, beta_, fp(B.dt), fp(B.a), B.s, z_, fp(B.o_norm), gated_, ++ if (!(gate_silu_ && gdn_mma_.enabled() && !recording_ && gdn_mma_step(qkv_, alpha_, beta_, fp(B.dt), fp(B.a), B.s, z_, fp(B.o_norm), gated_, + s_dim_, v_heads_, k_heads_, n, rms_eps_, st_, snap_bits_ != 0))) + #endif + gdn_step(qkv_, alpha_, beta_, fp(B.dt), fp(B.a), B.s, z_, fp(B.o_norm), gated_, s_dim_, v_heads_, k_heads_, n, +- rms_eps_, st_, snap_bits_ ? snap_at_ + (B.s - state_) : nullptr, rec_n_, snap_bits_); ++ rms_eps_, st_, snap_bits_ ? snap_at_ + (B.s - state_) : nullptr, rec_n_, snap_bits_, gate_silu_); + } + lin(B.wo, gated_, ao_, n); + } +diff --git a/engine/src/poly/qwen35.hpp b/engine/src/poly/qwen35.hpp +index 80d3041ad..4cf3e2e38 100644 +--- a/engine/src/poly/qwen35.hpp ++++ b/engine/src/poly/qwen35.hpp +@@ -12,7 +12,7 @@ + + namespace strata::poly { + +-class Qwen35 final : public Engine { ++class Qwen35 : public Engine { + public: + ~Qwen35() override; + size_t card_row_bytes() const override; +@@ -55,7 +55,7 @@ protected: + int block_mask() const override { return mask_; } + void route_block(int il, float* scores, int n) override; + +-private: ++ protected: + /// A layer's weights beside the ones every architecture has (Layer), and its places in the state and caches. + struct Block { + bool gdn = false; ///< the gated delta net; else attention over the cache +@@ -136,6 +136,8 @@ private: + const int32_t* turns(int64_t pos, int n, int64_t* first); + + std::vector blocks_; ///< one a layer of layers_ ++ bool gate_silu_ = true; ///< the GDN's output gate multiplies by silu(gate); a model gating with a plain ++ ///< sigmoid (qwen4exp) sets it false, which also keeps the GDN MMA off + bool clover_ = false; ///< a Clover file (architecture clover_moe): text only, its ssm_a is A_log itself + int mask_ = -1; ///< Clover's mask token, which its block of guesses is filled with; -1: no block + float coreset_ = 0.f; ///< Clover: a block's tokens choose among the experts of this share of its weight +diff --git a/engine/src/poly/qwen4exp.cpp b/engine/src/poly/qwen4exp.cpp +new file mode 100644 +index 000000000..57a91f2af +--- /dev/null ++++ b/engine/src/poly/qwen4exp.cpp +@@ -0,0 +1,366 @@ ++// src/poly/qwen4exp.cpp - Qwen4-35B-A3B (llama.cpp architecture "qwen4exp"). ++// ++// The math is llama.cpp's qwen4exp graph, and the hyper-connection runs through the strata gr kernels, which ++// are a transcription of that graph (include/strata/kernels/gr.hpp). The Qwen35 half - the gated delta nets, ++// the attentions, the routed experts - is inherited unchanged; see qwen4exp.hpp for what the port leaves out. ++#include "qwen4exp.hpp" ++ ++#include "gguf_types.hpp" ++#include "runtime.hpp" ++#include "strata/poly/kernels.hpp" ++#include "strata/kernels/native_mmvq.hpp" ++#include "strata/quant/types.hpp" ++ ++#include ++#include ++#include ++ ++namespace strata::poly { ++ ++constexpr int kConv = 4; // what the conv kernels are written for; Qwen35::load_geometry checks the file's tap count ++ ++void Qwen4Exp::load_geometry() { ++ // The MTP block after the model's (blk.40.nextn) is not run yet: load the model without it, whatever ++ // --window says. load_shape() probes it only when draft is on, and this runs before it. ++ opt_.draft = false; ++ Qwen35::load_geometry(); // its load_shape(): the same layers, the same GDN and attention shapes, minus one ++ hc_ = shape_i("hyper_connection.count"); ++ hc_lr_ = shape_i("hyper_connection.low_rank"); ++ if (hc_ < 1 || hc_ > 8 || hc_lr_ < 1) ++ throw std::runtime_error("hyper_connection.count is not 1..8 or hyper_connection.low_rank is not positive"); ++ // Qwen3.5's gated delta nets gate their output with silu(gate); qwen4exp uses a plain sigmoid, and the GDN ++ // tensor-core path re-derives the silu gate, so it stays off (Qwen35::gdn() checks gate_silu_). ++ gate_silu_ = false; ++ // Pin the gr activation contract to llama.cpp's CUDA graph: BF16 weights multiplying FP32 activations. ++ kernels::gr_set_fp32_activations(true); ++ kernels::gr_set_native_mmvf(true); ++ gs_ = {n_embd_, hc_, hc_lr_}; ++ hcs_.resize((size_t) n_layer_); ++ load_ple(); ++ std::fprintf(stderr, ++ "strata-poly: qwen4exp: %d residual streams; dense attention and no guesses ahead: the MTP " ++ "block and the indexer are not run yet\n", hc_); ++} ++ ++// The file's PLE manifest, read the way llama.cpp's qwen4exp load does (src/models/qwen4exp.cpp). A file with ++// no qwen4exp.ple.layers leaves ple_il_ at -1 and the port runs without a PLE, as it did before. ++void Qwen4Exp::load_ple() { ++ const auto meta = [&](const char* key) { return meta_in(*gg_, key); }; ++ const MetaValue* layers = meta("ple.layers"); ++ if (!layers || layers->items.empty()) ++ return; ++ if (layers->items.size() != 1) ++ throw std::runtime_error("qwen4exp: this port runs PLE at one layer, the file names several"); ++ ple_il_ = (int) layers->items[0].num(); ++ if (ple_il_ < 0 || ple_il_ >= n_layer_) ++ throw std::runtime_error("qwen4exp: qwen4exp.ple.layers names a layer outside the model"); ++ const MetaValue *ng = meta("ple.ngram_size"), *hp = meta("ple.heads_per_ngram"), ++ *ck = meta("ple.conv_kernel"), *eos = meta("ple.eos_token_id"), ++ *hd = meta("embedding_length_per_layer_input"); ++ if (!ng || !hp || !ck || !eos || !hd) ++ throw std::runtime_error("qwen4exp: the file names PLE layers but carries no n-gram metadata"); ++ ple_ngram_ = (int) ng->num(); ++ ple_heads_ = (int) hp->num(); ++ ple_eos_ = (int) eos->num(); ++ ple_head_dim_ = (int) hd->num(); ++ if (ple_ngram_ != 3 || (int) ck->num() != kConv || ple_head_dim_ != 128 || ple_heads_ < 1) ++ throw std::runtime_error("qwen4exp: the PLE kernels are written for 3-grams, 4 conv taps and 128-value head rows"); ++ const auto arr = [&](const char* key, size_t want) -> const MetaValue* { ++ const MetaValue* a = meta(key); ++ if (!a || a->items.size() != want) ++ throw std::runtime_error(std::string("qwen4exp: ") + key + " is not an array of " + ++ std::to_string(want)); ++ return a; ++ }; ++ for (const MetaValue& v : arr("ple.layer_multipliers", (size_t) ple_ngram_)->items) ++ ple_mult_.push_back(v.u); ++ const size_t heads = (size_t) (ple_ngram_ - 1) * (size_t) ple_heads_; ++ for (const MetaValue& v : arr("ple.head_offsets", heads)->items) ++ ple_offs_.push_back((int64_t) v.num()); ++ for (const MetaValue& v : arr("ple.head_vocab_sizes", heads)->items) ++ ple_vocab_.push_back((int64_t) v.num()); ++ const TensorInfo* t = gg_->find("per_layer_token_embd.weight"); ++ if (!t || t->type != (uint32_t) strata::quant::Type::Q5_1 || (int) t->shape[0] != ple_head_dim_) ++ throw std::runtime_error("qwen4exp: PLE needs per_layer_token_embd.weight as Q5_1 rows of " + ++ std::to_string(ple_head_dim_) + " values"); ++ ple_.n_table = (int64_t) t->shape[1]; ++ ple_.row_bytes = (int) strata::quant::row_bytes((int) strata::quant::Type::Q5_1, ple_head_dim_); ++ // The rows are read straight from the shard file, not through the mapping: the Flash Next engine learned that ++ // a live mapping of the same file serializes the unbuffered reads (ngram.hpp), and a token's sixteen rows are ++ // sixteen random pages in 15+ GB. The reader takes row 0's own byte place from the parsed tensor directory. ++ const auto [file, off] = gg_->place(gg_->data(*t)); ++ if (file < 0) ++ throw std::runtime_error("qwen4exp: the PLE table is not in any opened model file"); ++ ple_.reader = std::make_unique(); ++ std::string err; ++ if (!ple_.reader->open(gg_->paths()[(size_t) file], (uint64_t) off, (uint64_t) ple_.n_table, 256, 1u << 20, err, ++ true, (uint32_t) ple_.row_bytes)) ++ throw std::runtime_error("qwen4exp: opening the PLE table for direct reads failed: " + err); ++ ple_.reader->set_keepalive(100.0, 60.0); // the Flash Next serve's own defaults ++ if (const TensorInfo* s = gg_->find("per_layer_token_embd.scale")) { ++ if (s->type != kTypeF32) ++ throw std::runtime_error("qwen4exp: per_layer_token_embd.scale must be F32"); ++ ple_.scale = *(const float*) gg_->data(*s); // llama.cpp scales the gathered embedding by it ++ } ++ std::fprintf(stderr, ++ "strata-poly: qwen4exp: PLE at blk.%d: %zu head rows over n-grams 2..%d, %lld table rows of " ++ "%d values, read direct from '%s'%s\n", ++ ple_il_, heads, ple_ngram_, (long long) ple_.n_table, ple_head_dim_, ++ gg_->paths()[(size_t) file].c_str(), ple_.scale != 1.0f ? ", scaled" : ""); ++} ++ ++void Qwen4Exp::load_layer(int il) { ++ Layer& L = layers_[(size_t) il]; ++ Block& B = blocks_[(size_t) il]; ++ HcPair& H = hcs_[(size_t) il]; ++ auto f32 = [&](const char* n, int64_t a, int64_t b = 1) { return upload(tensor(il, n), blk(il, n), a, b, kF32); }; ++ auto mat = [&](const char* n, int64_t a, int64_t b) { return upload(tensor(il, n), blk(il, n), a, b, kAnyMat); }; ++ ++ // The mixers. The gr kernels read the weights as bf16 and as the file lays them out: down's hc_lr columns, ++ // then inject's hc, in one tensor; the grouped-norm gamma is stored as (1 + w) by the pack. ++ auto load_mix = [&](Hc& h, const char* pfx) { ++ const std::string norm = std::string(pfx) + "_norm.weight", di = std::string(pfx) + "_down_inject.weight", ++ up = std::string(pfx) + "_up.weight"; ++ h.norm = upload(tensor(il, norm.c_str()), norm, (int64_t) hc_ * n_embd_, 1, kF32); ++ const Dev w = upload(tensor(il, di.c_str()), di, (int64_t) hc_ * n_embd_, (int64_t) hc_lr_ + hc_, kFloatMat); ++ const size_t row = strata::quant::row_bytes((int) w.type, (int64_t) hc_ * n_embd_); ++ h.down = Dev{w.p, w.type, w.n_in, (int) hc_lr_}; ++ h.inject = Dev{(char*) w.p + (size_t) hc_lr_ * row, w.type, w.n_in, hc_}; ++ h.up = upload(tensor(il, up.c_str()), up, (int64_t) hc_lr_, (int64_t) hc_ * n_embd_, kFloatMat); ++ }; ++ load_mix(H.attn, "hc_attn"); ++ load_mix(H.ffn, "hc_ffn"); ++ if (il == 0) { // the file's final mixer, which turns the stack into the output's rows: no injection ++ const std::string norm = "output_hc_norm.weight", down = "output_hc_down.weight", up = "output_hc_up.weight"; ++ head_.norm = upload(gg_->find(norm), norm, (int64_t) hc_ * n_embd_, 1, kF32); ++ head_.down = upload(gg_->find(down), down, (int64_t) hc_ * n_embd_, hc_lr_, kFloatMat); ++ head_.inject = Dev{}; ++ head_.up = upload(gg_->find(up), up, hc_lr_, (int64_t) hc_ * n_embd_, kFloatMat); ++ } ++ ++ // The layers have no attn_norm and no post_attention_norm: the mixer's grouped norm is the layer's norm. ++ B.gdn = tensor(il, "attn_qkv_gate.weight") != nullptr; ++ // the attention's launches read the position on the card when they are recorded; a streamed layer's are not. ++ // PLE's layer is never recorded: its gather runs on the host beside every call's own tokens, so its launches ++ // are not the ones the next token would want replayed. ++ L.fixed = (B.gdn || kv_ring() == 0) && il != ple_il_; ++ if (il == ple_il_) { // build_ple's weights: the products stay BF16 on the card, the norms and the conv go up as floats ++ ple_.key = upload(tensor(il, "ple_key.weight"), blk(il, "ple_key.weight"), n_embd_, (int64_t) hc_ * n_embd_, ++ kFloatMat); ++ ple_.value = upload(tensor(il, "ple_value.weight"), blk(il, "ple_value.weight"), n_embd_, n_embd_, kFloatMat); ++ ple_.norm_key = f32("ple_norm_key.weight", (int64_t) hc_ * n_embd_); ++ ple_.norm_query = f32("ple_norm_query.weight", (int64_t) hc_ * n_embd_); ++ ple_.norm_conv = f32("ple_norm_conv.weight", (int64_t) hc_ * n_embd_); ++ ple_.conv1d = f32("ple_conv1d.weight", 4, (int64_t) hc_ * n_embd_); // F16 in the file, taps a channel in file order ++ } ++ if (B.gdn) { ++ // the conv input's 2*k_heads*s_dim + d_inner columns and then the gate's d_inner, in one tensor ++ const Dev qk = mat("attn_qkv_gate.weight", n_embd_, conv_dim_ + d_inner_); ++ const size_t qk_row = strata::quant::row_bytes((int) qk.type, n_embd_); ++ B.wqkv = Dev{qk.p, qk.type, n_embd_, (int) conv_dim_}; ++ B.wz = Dev{(char*) qk.p + (size_t) conv_dim_ * qk_row, qk.type, n_embd_, (int) d_inner_}; ++ B.conv = f32("ssm_conv1d.weight", kConv, conv_dim_); ++ B.dt = f32("ssm_dt.bias", v_heads_); ++ B.a = f32("ssm_a", v_heads_); // the pack stores the decay rate already, -exp(A_log): take it as it is ++ // beta's v_heads columns and then alpha's, in one tensor ++ const Dev ba = mat("ssm_beta_alpha.weight", n_embd_, 2 * v_heads_); ++ const size_t ba_row = strata::quant::row_bytes((int) ba.type, n_embd_); ++ B.beta = Dev{ba.p, ba.type, n_embd_, v_heads_}; ++ B.alpha = Dev{(char*) ba.p + (size_t) v_heads_ * ba_row, ba.type, n_embd_, v_heads_}; ++ B.o_norm = f32("ssm_norm.weight", s_dim_); ++ B.wo = mat("ssm_out.weight", d_inner_, n_embd_); ++ ++n_gdn_; ++ } else { ++ // the query projection gives every head its query and then the gate of its output ++ B.wq = mat("attn_q.weight", n_embd_, (int64_t) 2 * n_head_ * head_dim_); ++ B.wk = mat("attn_k.weight", n_embd_, (int64_t) n_kv_ * head_dim_); ++ B.wv = mat("attn_v.weight", n_embd_, (int64_t) n_kv_ * head_dim_); ++ B.q_norm = f32("attn_q_norm.weight", head_dim_); ++ B.k_norm = f32("attn_k_norm.weight", head_dim_); ++ B.wo = mat("attn_output.weight", (int64_t) n_head_ * head_dim_, n_embd_); ++ ++n_attn_; ++ } ++ load_moe(il); ++ B.sh_gate_inp = f32("ffn_gate_inp_shexp.weight", n_embd_); ++} ++ ++void Qwen4Exp::assign_scratch() { ++ // The GDN MMA's output stage re-derives the silu gate: a plain sigmoid gate does not go through it. Answer ++ // here, once, so that Qwen35::assign_scratch() neither enables it nor reports a capability this model has not. ++ gdn_mma_.initialize([] { return false; }); ++ Qwen35::assign_scratch(); ++ const size_t n = buf_rows_, g = kGrTok; ++ inj_a_ = fbuf(n * hc_); ++ inj_f_ = fbuf(n * hc_); ++ gr_x_ = fbuf(g * (size_t) hc_ * n_embd_); ++ gr_g_ = fbuf(g * (size_t) hc_ * n_embd_); ++ gr_lo_ = fbuf(g * (size_t) hc_lr_); ++ // the gr fallback's single-token scratch: gr_read checks ws.bytes, and a null carve only says "not yet" in ++ // the pass that counts the scratch instead of writing it ++ kernels::gr_workspace_init(gs_, fbuf((kernels::gr_workspace_bytes(gs_) + sizeof(float) - 1) / sizeof(float)), ws_); ++ if (ple_il_ >= 0) { // the PLE's round: 16 tokens' gather, products and conv outputs; the conv's own nine ++ // rows live outside the scratch, which is re-laid for the batch layouts ++ const size_t g = kPleTok, hc_dim = (size_t) hc_ * n_embd_; ++ ple_.emb = fbuf(g * (size_t) n_embd_); ++ ple_.keyv = fbuf(g * hc_dim); ++ ple_.valv = fbuf(g * (size_t) n_embd_); ++ ple_.gated = fbuf(g * hc_dim); ++ ple_.normed = fbuf(g * hc_dim); ++ } ++} ++ ++void Qwen4Exp::hc_read(const Hc& H, float* mixed, float* inj, int first, int n) { ++ for (int t = 0; t < n; t += kGrTok) { ++ const int m = std::min(kGrTok, n - t); ++ kernels::gr_read_multi(r_ + (size_t) (first + t) * r_row(), fp(H.norm), (const uint16_t*) H.down.p, ++ (const uint16_t*) H.up.p, H.inject.p ? (const uint16_t*) H.inject.p : nullptr, ++ rms_eps_, gs_, ws_, gr_x_, gr_lo_, gr_g_, mixed + (size_t) t * n_embd_, ++ inj ? inj + (size_t) t * hc_ : nullptr, m, st_); ++ } ++} ++ ++void Qwen4Exp::hc_write(const float* block_out, const float* inj, int first, int n) { ++ for (int t = 0; t < n; t += kGrTok) { ++ const int m = std::min(kGrTok, n - t); ++ kernels::gr_write_multi(r_ + (size_t) (first + t) * r_row(), block_out + (size_t) t * n_embd_, ++ inj + (size_t) t * hc_, gs_, r_ + (size_t) (first + t) * r_row(), m, st_); ++ } ++} ++ ++void Qwen4Exp::layer_head(Layer& L, int il, int n) { ++ Block& B = blocks_[(size_t) il]; ++ const HcPair& H = hcs_[(size_t) il]; ++ if (block_pass_) // Clover's block of guesses over the plain residual: this model has a stack, not one vector ++ throw std::logic_error("qwen4exp does not run a block's guesses over a stack of residual streams"); ++ if (il == ple_il_) ++ ple_apply(n); // build_ple acts on the stack ahead of its mix (llama.cpp qwen4exp.cpp, L515) ++ hc_read(H.attn, xn_, inj_a_, 0, n); // the block's input as gr_read mixed it: the norm is inside the mixer ++ kernels::native_quantize_q8_1(xn_, xq_, n_embd_ * n, 1, st_); ++ dbg("attn_in", il, xn_, n_embd_); ++ if (B.gdn) ++ gdn(B, n); ++ else ++ attn(B, il, pos_, n); ++ dbg("attn", il, ao_, n_embd_); ++ hc_write(ao_, inj_a_, 0, n); // build_hc_combine: every stream takes the block's output, weighted per stream ++ hc_read(H.ffn, xn_, inj_f_, 0, n); ++ kernels::native_quantize_q8_1(xn_, xq_, n_embd_ * n, 1, st_); ++ dbg("ffn_in", il, xn_, n_embd_); ++ if (!batched(L, n)) moe_router(L, n); ++} ++ ++void Qwen4Exp::layer_tail(Layer&, int, int n) { hc_write(fo_, inj_f_, 0, n); } ++ ++void Qwen4Exp::output_rows(int first, int rows, float* h) { ++ // the file has no output_norm: the final mixer carries the norm (llama.cpp norms over the stack there) ++ hc_read(head_, h, nullptr, first, rows); ++} ++ ++// The table reader's statistics, reported the way Flash Next reports its n-gram reads. ++Qwen4Exp::~Qwen4Exp() { ++ if (ple_.reader && ple_.reader->is_open()) { ++ const auto s = ple_.reader->snapshot(); ++ std::fprintf(stderr, ++ "strata-poly: qwen4exp: PLE table: %llu rows asked, %llu from the row cache, %llu SSD reads " ++ "of %llu bytes, %lld rows cached, collect waited %.1f ms\n", ++ (unsigned long long) s.requests, (unsigned long long) s.cache_hits, ++ (unsigned long long) s.reads, (unsigned long long) s.bytes, ++ (long long) ple_.reader->cache_size(), s.wait_us / 1000.0); ++ } ++} ++ ++// llama.cpp's llm_graph_input_qwen4exp_ple::set_input does the row hashes on the host from the batch's own ++// tokens; the same is done here from tok_ and the port's record of the bound sequence's tokens by position. ++// A batched step() hands rows to several sequences at once, so it has no one history to hash against, and PLE ++// - like the GDN states of the step kernels - stays out of it. ++void Qwen4Exp::ple_apply(int n) { ++ if (!tok_ || rows_of_) { ++ if (!ple_skipped_) { ++ ple_skipped_ = true; ++ std::fprintf(stderr, "strata-poly: qwen4exp: a batched step has no single token history: PLE stays off there\n"); ++ } ++ return; ++ } ++ const int64_t start = pos_; ++ const size_t hc_dim = (size_t) hc_ * n_embd_; ++ if (!ple_.state) { // the buffers, asked for once: the conv's rows on the card, the gather's pinned on the host ++ ple_.state = (float*) dmalloc(9 * hc_dim * sizeof(float), "the PLE conv state"); ++ ple_.h_emb = (float*) hmalloc(kPleTok * (size_t) n_embd_ * sizeof(float), "the PLE gather"); ++ ple_.raw = (uint8_t*) hmalloc(kPleTok * (size_t) ple_offs_.size() * (size_t) ple_.row_bytes, ++ "the PLE rows"); ++ } ++ if (start == 0) { // a new sequence: the conv starts from zeros and no token has a predecessor ++ ple_toks_.clear(); ++ ck(cudaMemsetAsync(ple_.state, 0, 9 * hc_dim * sizeof(float), cs(st_)), "ple reset"); ++ } ++ if ((size_t) (start + n) > ple_toks_.size()) ++ ple_toks_.resize((size_t) (start + n)); ++ for (int i = 0; i < n; ++i) ++ ple_toks_[(size_t) (start + i)] = tok_[i]; ++ const int heads = (int) ple_offs_.size(); ++ for (int t0 = 0; t0 < n; t0 += kPleTok) { ++ const int m = std::min(kPleTok, n - t0); ++ // one reader request for the whole chunk: pages deduplicated, sorted, and read with its full queue depth ++ // while the GPU is still busy, then collected (PleReader::gather_batch's own pattern). ++ ple_idx_.resize((size_t) m * (size_t) heads); ++ for (int i = 0; i < m; ++i) ++ ple_rows(start + t0 + i, tok_[t0 + i], ple_idx_.data() + (size_t) i * (size_t) heads); ++ std::string err; ++ const auto ticket = ple_.reader->issue(ple_idx_.data(), (size_t) m * (size_t) heads, ple_.raw); ++ if (!ple_.reader->collect(ticket, err)) ++ throw std::runtime_error("qwen4exp: a PLE table read failed: " + err); ++ for (int i = 0; i < m; ++i) // head after head, as llama.cpp's gather lays the embedding out ++ for (int h = 0; h < heads; ++h) { ++ float* out = ple_.h_emb + (size_t) i * (size_t) n_embd_ + (size_t) h * (size_t) ple_head_dim_; ++ type_to_floats((uint32_t) strata::quant::Type::Q5_1, ++ ple_.raw + ((size_t) i * (size_t) heads + (size_t) h) * (size_t) ple_.row_bytes, out, ++ ple_head_dim_); ++ if (ple_.scale != 1.0f) ++ for (int v = 0; v < ple_head_dim_; ++v) ++ out[v] *= ple_.scale; ++ } ++ ck(cudaMemcpyAsync(ple_.emb, ple_.h_emb, (size_t) m * n_embd_ * sizeof(float), cudaMemcpyHostToDevice, ++ cs(st_)), "ple emb"); ++ gemv_pair(1, ple_.key.p, ple_.value.p, ple_.emb, ple_.keyv, ple_.valv, n_embd_, (int) hc_dim, n_embd_, m, ++ st_); ++ ple_mix(ple_.keyv, r_ + (size_t) t0 * r_row(), ple_.valv, fp(ple_.norm_key), fp(ple_.norm_query), ++ fp(ple_.norm_conv), ple_.gated, ple_.normed, hc_, n_embd_, m, rms_eps_, st_); ++ if (t0 == 0) // --dump-layers: token 0's intermediates, named as the CPU reference prints them ++ dbg("ple_gated", ple_il_, ple_.gated, (int) hc_dim); ++ ple_conv_add(ple_.state, ple_.normed, ple_.gated, (const float*) ple_.conv1d.p, ++ r_ + (size_t) t0 * r_row(), (int) hc_dim, m, st_); ++ if (t0 == 0) { ++ dbg("ple_normed", ple_il_, ple_.normed, (int) hc_dim); ++ dbg("ple_res", ple_il_, r_ + (size_t) t0 * r_row(), (int) hc_dim); // the stack after the PLE's adds ++ } ++ } ++} ++ ++// The rows the n-grams 2..3 hash to, in head order: ngram_rows' rules, kept from the Flash Next engine's ++// transcription of llama.cpp's set_input - XOR of token*multiplier over the window's prefixes, `%` a head's own ++// vocabulary size (not a mask), a missing predecessor TOKEN_NULL and an EOS cutting that position and every older ++// one, the token's own EOS not cutting its own context. ++void Qwen4Exp::ple_rows(int64_t pos, int32_t tok, uint32_t* out16) const { ++ int64_t ctx[3] = {tok, ple_eos_, ple_eos_}; ++ bool cut = false; ++ for (int s = 1; s < 3; ++s) { ++ const int64_t p = pos - s; ++ const int32_t pt = p < 0 ? -1 : ple_toks_[(size_t) p]; ++ ctx[s] = cut || pt < 0 || pt == ple_eos_ ? ple_eos_ : pt; ++ cut = cut || pt < 0 || pt == ple_eos_; ++ } ++ int h = 0; ++ for (int ng = 2; ng <= ple_ngram_; ++ng) { ++ uint64_t mixed = (uint64_t) (uint32_t) ctx[0] * ple_mult_[0]; ++ for (int j = 1; j < ng; ++j) ++ mixed ^= (uint64_t) (uint32_t) ctx[j] * ple_mult_[j]; ++ for (int g = 0; g < ple_heads_; ++g, ++h) { ++ const int64_t row = (int64_t) (mixed % (uint64_t) ple_vocab_[h]) + ple_offs_[h]; ++ if (row < 0 || row >= ple_.n_table) ++ throw std::runtime_error("qwen4exp: a PLE head hashed outside the table"); ++ out16[h] = (uint32_t) row; ++ } ++ } ++} ++ ++} // namespace strata::poly +diff --git a/engine/src/poly/qwen4exp.hpp b/engine/src/poly/qwen4exp.hpp +new file mode 100644 +index 000000000..f94ca41c7 +--- /dev/null ++++ b/engine/src/poly/qwen4exp.hpp +@@ -0,0 +1,129 @@ ++// src/poly/qwen4exp.hpp - Qwen4-35B-A3B (llama.cpp architecture "qwen4exp"). ++// ++// Qwen35's stack - 41 layers, an attention every fourth from the third - routed experts with a shared expert - ++// with hyper-connections instead of the plain residual: the engine keeps a stack of hc residual streams ++// (streams() = hc), and every layer collapses the stack to the one vector its block consumes (gr_read: a grouped ++// norm, a down/up mix through a rank-hc_lr bottleneck, and per-stream injection weights) and scatters the block's ++// output back into the streams (gr_write, weighted 2*sigmoid). The strata gr family ++// (include/strata/kernels/gr.hpp) is a transcription of llama.cpp's build_hc_mix / build_hc_combine, and the ++// file's layers have no attn_norm and no post_attention_norm: the grouped norm lives inside the mixers. ++// ++// The PLE of llama.cpp's graph - the n-gram gather over the file's per_layer_token_embd table and everything that ++// follows it - runs at the layers the file names in qwen4exp.ple.layers, here blk.1: the row hashes are computed ++// on the host beside the call's tokens, the 16 head rows of a token come straight from the shard file through ++// strata::ngram::PleReader - the same direct-from-SSD read with a bounded row cache that Flash Next's engine uses ++// for its n-gram table - dequantize into a pinned buffer, and the key/value products, the gate, the gated value ++// and the dilated conv run through gemv_pair and the strata ple kernels on its rows of r_ ++// (docs/qwen4exp-port/PLE.md). A batched step(), where a row belongs to no single token history, leaves it out. ++// ++// What the port does not run yet: the MTP block (draft is forced off) and the QSA indexer of the attention from ++// the twelfth on. The indexer picks top_k 2048 keys a query, so below 2048 tokens of context it picks every key ++// and dense attention gives the same sums - a 75-token run matched llama.cpp's greedy output token for token. ++// Past top_k the port reads keys llama.cpp would mask, and the outputs part there. Everything the engine does ++// run follows llama.cpp's kernels. ++// ++// The file gives the GDN's weights fused: attn_qkv_gate holds the conv input and the output gate side by side, ++// ssm_beta_alpha the two gates. They upload as one tensor and the Block reads them as views: an offset into the ++// upload and a shorter output width (docs/qwen4exp-port/TENSOR-MAP.md). The hyper-connection weights upload as ++// BF16 whatever the file's type, because the gr kernels read bf16 weights. ++#pragma once ++ ++#include "qwen35.hpp" ++#include "strata/kernels/gr.hpp" ++#include "strata/ngram/ple_reader.hpp" ++ ++#include ++ ++namespace strata::poly { ++ ++class Qwen4Exp final : public Qwen35 { ++ public: ++ ~Qwen4Exp() override; ///< one line of the table reader's statistics, when a PLE ran ++ ++ protected: ++ void load_geometry() override; ++ void load_layer(int il) override; ++ void assign_scratch() override; ++ int streams() const override { return hc_; } ++ void layer_head(Layer& L, int il, int n) override; ++ void layer_tail(Layer& L, int il, int n) override; ++ void output_rows(int first, int rows, float* h) override; ++ ++ private: ++ /// One mixer of the file's manifest layouts: the grouped-norm gamma (stored as 1 + w), the down's columns, ++ /// the inject's columns that follow them in the same tensor, and the up. The down/inject pair is one upload ++ /// split at column hc_lr; the up is its own tensor. ++ struct Hc { ++ Dev norm; ///< f32 [hc*n_embd] ++ Dev down; ///< bf16 [hc*n_embd, hc_lr] ++ Dev inject; ///< bf16 [hc*n_embd, hc], null for the final mixer, which gates no write-back ++ Dev up; ///< bf16 [hc_lr, hc*n_embd] ++ }; ++ ++ struct HcPair { ++ Hc attn, ffn; ++ }; ++ ++ static constexpr int kGrTok = 8; ///< the gr multi kernels take at most 8 tokens a launch ++ static constexpr int kPleTok = 16; ///< the PLE's gather, products and conv take at most this many a round ++ ++ std::vector hcs_; ///< one a layer of layers_: its attention's mixer and its FFN's ++ Hc head_; ///< the file's final mixer, which turns the residual stack into output rows ++ ++ int hc_ = 0, hc_lr_ = 0; ///< hyper_connection.count / .low_rank ++ ++ strata::kernels::GrShapes gs_; ++ strata::kernels::GrWorkspace ws_; ///< what the single-token fallback of a gr_read needs, carved from scratch ++ ++ // The PLE the file asks for at one layer: the table's rows read straight from the SSD the way the Flash Next ++ // engine reads its n-gram table (strata::ngram::PleReader: O_DIRECT page reads, a bounded row cache, a keep- ++ // alive), its weights on the card, and the kernels' buffers beside the scratch. load_ple() fills the manifest ++ // from the metadata; the layer keeps nothing when the file names no PLE layer. ++ struct Ple { ++ Dev key, value; ///< BF16 on the card: [n_embd, hc * n_embd] and [n_embd, n_embd] ++ Dev norm_key, norm_query, norm_conv; ///< F32 [hc * n_embd] ++ Dev conv1d; ///< F32 [4, hc * n_embd]: 4 taps a channel, the channels in a row ++ std::unique_ptr reader; ///< the table's rows, read direct from the shard file ++ int64_t n_table = 0; ///< the table's rows ++ int row_bytes = 0; ///< one raw table row in the file: a Q5_1 row of head_dim values ++ float scale = 1.0f; ///< per_layer_token_embd.scale, when the file has one ++ float* h_emb = nullptr; ///< pinned host: kPleTok gathered embeddings, asked for once ++ uint8_t* raw = nullptr; ///< pinned host: kPleTok * 16 raw rows, the reader's landing place ++ float* emb = nullptr; ///< the same on the card ++ float *keyv = nullptr, *valv = nullptr; ///< a round's key and value products ++ float *gated = nullptr, *normed = nullptr; ///< ple_mix's outputs, hc * n_embd a token ++ float* state = nullptr; ///< the conv's nine rows before the call, oldest first ++ }; ++ Ple ple_; ++ int ple_il_ = -1; ///< the layer PLE runs at, -1 for a file that names none ++ int ple_ngram_ = 0, ple_heads_ = 0, ple_eos_ = 0, ple_head_dim_ = 0; ///< .ple.ngram_size et al. ++ std::vector ple_mult_; ///< .ple.layer_multipliers, one a n-gram length ++ std::vector ple_offs_, ple_vocab_; ///< the heads' table places, in head order ++ std::vector ple_idx_; ///< a round's 16 row indices a token, the reader's request ++ std::vector ple_toks_; ///< the bound sequence's tokens by position, for the hashes ++ bool ple_skipped_ = false; ///< the one report of a batched step leaving PLE out ++ ++ /// The file's PLE manifest: the layer, the n-gram metadata and the place of the row table. load_geometry's ++ /// own, once, before any layer is loaded. ++ void load_ple(); ++ /// build_ple over the call's rows [0, n) of r_: gather, products, gate, conv and the add, kPleTok at a time. ++ void ple_apply(int n); ++ /// The 16 table rows the n-grams of the token at `pos` hash to, head order (ngram_rows' own rules). ++ void ple_rows(int64_t pos, int32_t tok, uint32_t* out16) const; ++ ++ // device scratch beside Qwen35's, which these feed ++ float* inj_a_ = nullptr; ///< the injection weights a write-back gates by: the attention's and the FFN's ++ float* inj_f_ = nullptr; ///< hc a row ++ float *gr_x_ = nullptr, *gr_g_ = nullptr; ///< a chunk's unrounded streams and their gated values ++ float* gr_lo_ = nullptr; ///< a chunk's SiLU bottleneck ++ ++ size_t r_row() const { return (size_t) streams() * n_embd_; } ++ ++ /// gr_read over the rows [first, first + n) of r_ in chunks of kGrTok: the stack collapses to `mixed`, one ++ /// row of n_embd a token, and its injection weights to `inj` (null: the mixer writes nothing back). ++ void hc_read(const Hc& H, float* mixed, float* inj, int first, int n); ++ /// gr_write over the same rows: block_out's row a token into every stream, weighted by inj. ++ void hc_write(const float* block_out, const float* inj, int first, int n); ++}; ++ ++} // namespace strata::poly +diff --git a/terminal/tools/strata_tokenizer.py b/terminal/tools/strata_tokenizer.py +index e27e9f83d..2d9713db6 100644 +--- a/terminal/tools/strata_tokenizer.py ++++ b/terminal/tools/strata_tokenizer.py +@@ -163,10 +163,10 @@ GPT4O_PATTERN = ( + + PRE_PATTERNS = {"glm4": GLM4_PATTERN, "glm5": GLM4_PATTERN, # every other name: QWEN35_PATTERN, as before + "gemma4": GEMMA4_PATTERN, "lfm2": GLM4_PATTERN, "kolibri1": QWEN2_PATTERN, +- "qwen2": QWEN2_PATTERN, "inkling2": GPT4O_PATTERN} ++ "qwen2": QWEN2_PATTERN, "qwen4": QWEN35_PATTERN, "inkling2": GPT4O_PATTERN} + PRE_SEQUENCES = {"joyai-llm": DEEPSEEK3_SEQUENCE, "deepseek-v3": DEEPSEEK3_SEQUENCE, "flint": FLINT_SEQUENCE, + "laguna": LAGUNA_SEQUENCE} +-IGNORE_MERGES = ("glm4", "glm5", "lfm2", "inkling2") ++IGNORE_MERGES = ("glm4", "glm5", "lfm2", "inkling2", "qwen4") + RAW = ("gemma4",) # vocabularies of UTF-8 pieces + MODELS = {"gpt2": None, "gemma4": "gemma4"} # tokenizer.ggml.model -> the pre-tokenizer it implies, if any + +-- +2.53.0 + diff --git a/patches/qwen4exp-full-port/INSTALL.md b/patches/qwen4exp-full-port/INSTALL.md new file mode 100644 index 000000000..746e26da6 --- /dev/null +++ b/patches/qwen4exp-full-port/INSTALL.md @@ -0,0 +1,89 @@ +# Install — Qwen4-35B-A3B support on strata-poly (full `qwen4exp` port) + +**What it is.** A complete port of `arch=qwen4exp` (Unsloth's `Qwen4-35B-A3B-GGUF`) to the +`strata-poly` engine: a new `engine/src/poly/qwen4exp.{hpp,cpp}` derived from `Qwen35` — 41 hybrid +layers (GDN with a sigmoid output gate, an attention every fourth layer), 4-stream hyper-connections, +routed + shared MoE with CPU expert offload, the embedded MTP block forced off, and layer 1's PLE +n-gram engram reading its 160M-row `Q5_1` table **row by row straight from SSD** through +`strata::ngram::PleReader` — the same Direct/O_DIRECT reader, row cache and keep-alive the Flash Next +serve uses. It also teaches `terminal/tools/strata_tokenizer.py` the qwen4 pre-tokenizer. + +**Base commit.** `4106d1a7c`. Apply the patch onto exactly this commit — later `main` commits rewrite +the same files (`engine.cpp`, `kernels.cu`, `qwen35.cpp`) differently, and the patch will conflict. + +> Note: current `main` already carries the upstream `qwen4.cpp` engine, and PR #440 gives it this +> bundle's direct-from-SSD PLE reader. Use this full port only on a `4106d1a7c` tree or when you want +> the standalone `qwen4exp` derivation specifically. + +## 1. Apply + +```bash +cd +git checkout -b feat/qwen4exp-local 4106d1a7c +git am patches/qwen4exp-full-port/0001-Engine-qwen4exp-run-Qwen4-35B-A3B-end-to-end-the-PLE.patch +# (or without preserving the commit: git apply 0001-….patch) +``` + +Revert: `git checkout main`, or `git am --abort` mid-apply, or `git apply -R 0001-….patch`. + +## 2. Build + +Requirements: Linux, CUDA-capable NVIDIA GPU (tested on RTX 3080 Ti, sm_86), CUDA toolkit, `g++-13`, +`ninja` (tested 2026-12-04). + +```bash +cmake -S engine -B terminal/build-poly -DCMAKE_BUILD_TYPE=Release \ + -DSTRATA_BUILD_POLY=ON -DSTRATA_ENABLE_CUDA=ON +cmake --build terminal/build-poly --target strata-poly -j 10 +``` + +## 3. Get the model + +```bash +huggingface-cli download unsloth/Qwen4-35B-A3B-GGUF \ + --include "UD-Q5_K_M/*" \ + --local-dir models/Qwen4-35B-A3B-UD-Q5_K_M +``` + +Both shards are required: shard 1 (trunk, MTP) is passed to `--model`; **shard 2** (15.4 GB, the PLE +table) is opened automatically by name. The engine refuses to run without it. + +## 4. Run + +```bash +terminal/build-poly/strata-poly \ + --model models/Qwen4-35B-A3B-UD-Q5_K_M/Qwen4-35B-A3B-UD-Q5_K_M-00001-of-00002.gguf \ + --tokens "" \ + --max-new 256 --max-context 4096 --dump-layers +``` + +The prompt ids can be produced with `verify/q4_tok.py encode "your prompt"`. On exit the +engine prints the PLE table statistics (rows asked / row-cache hits / SSD reads / collect wait). + +## 5. Verify (optional, wants a free GPU) + +`verify/` holds the exact harness used for the 2026-12-04 validation: + +* `bash verify/q4_test.sh` — two stages on a quiet port: llama.cpp reference greedy run on + `127.0.0.1:19998`, then `strata-poly` with `--dump-layers`; writes `verify/run/` (set `Q4_OUT` to + redirect). The model, binary, GPU-UUID and serve-config paths are variables at the top of the + script - adjust them on another machine. It waits for the GPU to be free, kills only the Flash Next + serve (restarts are automatic), and checks the serve config's hash before and after. +* Expected results: `verify/expected-2026-12-04/` — `summary.txt` (reference + port output + stage + sums), `compare.txt`, `poly.txt`. The recorded run is `main` at `df2c3ff30` **plus PR #440** (the + upstream `qwen4.cpp` with this bundle's direct PLE reader): there the output matched llama.cpp byte + for byte over the 256-token window (1249/1249 chars). The standalone full port (`4106d1a7c` + this + patch) matched the same reference for 141 tokens and then diverged onto its own coherent + continuation, and its blk1 stage sums differ within quant noise (`attn_in -7.4835` vs `-7.5766`): + treat that run's output as agreement, not as a byte target. +* `verify/q4_cpu_ref.py` — the float CPU reference for the blk0/blk1 stage sums; it reads dequantized + tensor dumps from `$Q4DUMP` (default `/tmp/opencode/q4_dump/`). Regenerate the dumps with + `verify/q4_dump.cpp` (compile it in the repo, run it against the two GGUFs; it writes its hardcoded + output paths). + +## 6. Known limits of this port + +* **QSA k-pool indexer not ported**: dense attention is used instead; identical below the indexer's + top-2048 selection, slightly divergent at long contexts. +* **MTP draft block off** (`blk.40` weights are skipped, draft forced off). +* PLE is never graph-recorded; the conv state is persistent and chunk-exact. diff --git a/patches/qwen4exp-full-port/INSTALL.ru.md b/patches/qwen4exp-full-port/INSTALL.ru.md new file mode 100644 index 000000000..4c147e42d --- /dev/null +++ b/patches/qwen4exp-full-port/INSTALL.ru.md @@ -0,0 +1,90 @@ +# Установка — поддержка Qwen4-35B-A3B в strata-poly (полный порт `qwen4exp`) + +**Что это.** Полный порт архитектуры `arch=qwen4exp` (GGUF `unsloth/Qwen4-35B-A3B-GGUF`) в движок +`strata-poly`: новый `engine/src/poly/qwen4exp.{hpp,cpp}`, производный от `Qwen35` — 41 гибридный +слой (GDN с сигмоидным выходным гейтом, attention каждый четвёртый слой), гипер-связи из 4 потоков, +маршрутизированные + общие эксперты с выгрузкой на CPU, встроенный MTP-блок принудительно выключен, +и PLE-engram первого слоя, читающий свою таблицу `Q5_1` на 160M строк **строками прямо с SSD** через +`strata::ngram::PleReader` — тот же Direct/O_DIRECT-ридер, кэш строк и keep-alive, что использует +serve Flash Next. Патч также обучает `terminal/tools/strata_tokenizer.py` пре-токенизатору qwen4. + +**Базовый коммит.** `4106d1a7c`. Патч ставится ровно на этот коммит — более поздние коммиты `main` +переписывают те же файлы (`engine.cpp`, `kernels.cu`, `qwen35.cpp`) иначе, и патч конфликтует. + +> Замечание: текущий `main` уже содержит апстримовый движок `qwen4.cpp`, а PR #440 даёт ему direct- +> чтение PLE с SSD из этого бандла. Полный порт нужен только на дереве `4106d1a7c` или если вам нужен +> именно автономный порт `qwen4exp`. + +## 1. Применение + +```bash +cd <копия PolyStrata> +git checkout -b feat/qwen4exp-local 4106d1a7c +git am patches/qwen4exp-full-port/0001-Engine-qwen4exp-run-Qwen4-35B-A3B-end-to-end-the-PLE.patch +# (или без сохранения коммита: git apply 0001-….patch) +``` + +Откат: `git checkout main`, либо `git am --abort` на середине, либо `git apply -R 0001-….patch`. + +## 2. Сборка + +Требования: Linux, CUDA-видеокарта NVIDIA (проверено на RTX 3080 Ti, sm_86), тулкит CUDA, `g++-13`, +`ninja` (проверено 04.12.2026). + +```bash +cmake -S engine -B terminal/build-poly -DCMAKE_BUILD_TYPE=Release \ + -DSTRATA_BUILD_POLY=ON -DSTRATA_ENABLE_CUDA=ON +cmake --build terminal/build-poly --target strata-poly -j 10 +``` + +## 3. Модель + +```bash +huggingface-cli download unsloth/Qwen4-35B-A3B-GGUF \ + --include "UD-Q5_K_M/*" \ + --local-dir models/Qwen4-35B-A3B-UD-Q5_K_M +``` + +Нужны обе шарды: шард 1 (трunk, MTP) передаётся в `--model`; **шард 2** (15,4 ГБ, таблица PLE) +открывается автоматически по имени. Без него движок отказывается запускаться. + +## 4. Запуск + +```bash +terminal/build-poly/strata-poly \ + --model models/Qwen4-35B-A3B-UD-Q5_K_M/Qwen4-35B-A3B-UD-Q5_K_M-00001-of-00002.gguf \ + --tokens "" \ + --max-new 256 --max-context 4096 --dump-layers +``` + +id токенов промпта получаются командой `verify/q4_tok.py encode <шард1.gguf> "ваш промпт"`. При +остановке движок печатает статистику таблицы PLE (запрошено строк / попадания в кэш / чтения SSD / +время collect). + +## 5. Проверка (опционально; требует свободной GPU) + +В `verify/` — ровно тот стенд, которым 04.12.2026 проверялся порт: + +* `bash verify/q4_test.sh` — два этапа на тихом порту: эталонный greedy-прогон llama.cpp на + `127.0.0.1:19998`, затем `strata-poly` с `--dump-layers`; пишет в `verify/run/` (перенаправляется + переменной `Q4_OUT`). Пути модели, бинаря, UUID GPU и конфига serve — переменные в начале скрипта, + на другой машине их поправьте там же. Стенд ждёт освобождения GPU, убивает только serve Flash Next + (его перезапуск автоматический) и сверяет хэш конфига serve до и после. +* Ожидаемые результаты: `verify/expected-2026-12-04/` — `summary.txt` (эталон + вывод порта + суммы + стадий), `compare.txt`, `poly.txt`. Записанный прогон — это `main` на `df2c3ff30` **плюс PR #440** + (апстримовый `qwen4.cpp` с direct-ридером PLE из этого бандла): там вывод совпал с llama.cpp + посимвольно на всём окне 256 токенов (1249/1249). Автономный полный порт (`4106d1a7c` + этот патч) + совпал с тем же эталоном на 141 токен и дальше сошёл на собственный связный текст, а его суммы + стадий blk1 отличаются в пределах шума квантизации (`attn_in -7.4835` против `-7.5766`): этот + прогон — подтверждение согласованности, а не побайтовый ориентир. +* `verify/q4_cpu_ref.py` — плавающий CPU-эталон сумм стадий blk0/blk1; читает деквантованные дампы + тензоров из `$Q4DUMP` (по умолчанию `/tmp/opencode/q4_dump/`). Дампы воссоздаются утилитой + `verify/q4_dump.cpp` (скомпилируйте в репозитории, запустите против обеих GGUF; пути вывода в ней + зашиты). + +## 6. Известные ограничения этого порта + +* **QSA k-pool не портирован**: вместо него dense attention; совпадение ниже порога отбора top-2048, + небольшие расхождения на длинном контексте. +* **MTP-блок выключен** (веса `blk.40` пропускаются, драфт принудительно off). +* PLE никогда не записывается в graph; состояние conv — постоянный history, точный по чанкам. diff --git a/patches/qwen4exp-full-port/docs/PLE.md b/patches/qwen4exp-full-port/docs/PLE.md new file mode 100644 index 000000000..37a2004d6 --- /dev/null +++ b/patches/qwen4exp-full-port/docs/PLE.md @@ -0,0 +1,111 @@ +# Qwen4Exp PLE (per-layer embeddings) in the poly port + +Status: **implemented and numerically verified** against a float CPU reference +(`/tmp/opencode/q4_cpu_ref.py`) and against llama.cpp's greedy outputs. The n-gram table reads run +through `strata::ngram::PleReader`, the same direct-from-SSD reader the Flash Next serve uses, with +the serve's own defaults. The port is per-token identical to the reference down to quantization +noise at the PLE layer; it is not yet bit-identical to llama.cpp end to end (see *Not yet ported*). + +## What the PLE is in this model + +`ple.layers=[1]`: the block embedding of layer 1 only. Before layer 1's mixer, llama.cpp's +`build_ple` (llama.cpp `src/models/qwen4exp.cpp`) adds a retrieved-plus-gated-plus-convolved n-gram +embedding to the four hyper-connection streams: + +- every token hashes its n-grams 2 and 3 to 8 heads each - 16 table rows in head order; +- the rows dequantize to 16 x `head_dim` = 8192 floats, the `ple_key` gemv reads them into the four + streams' queries, the `ple_value` gemv into their values; +- each stream gates `sigmoid(sign(s) * sqrt(clamp(|s|, 1e-6)))` where `s` is the grouped_norm'd query + dotted with the grouped_norm'd value, scales the value by it, group-norms again with the conv norm; +- a depthwise causal conv (kernel 4, dilation 3: taps at t-9, t-6, t-3, t) runs over each stream's + 2048 channels with persistent state, and `res_hc += gated + conv_out` **before** the block's + attention mixer consumes the stack. + +The port runs this at `il == ple_il_` inside `Qwen4Exp::step`, exactly where llama.cpp's graph +inserts it, and passes its own multi-stream `res` as `hidden` - the CPU reference originally tiled a +single stream there, which is wrong: llama.cpp feeds the real four streams. + +## Row hashes (host side) + +`Qwen4Exp::ple_rows` transcribes llama.cpp's `llm_graph_input_qwen4exp_ple::set_input`: + +- window = the token and its two predecessors; a position before the sequence start contributes + TOKEN_NULL, an EOS at a predecessor cuts that position **and every older one**, and the token's own + EOS does not cut its own context; +- a gram hashes as `XOR_j (token_j * multiplier_j)` mod 2^64 with the GGUF's + `ple.layer_multipliers`; +- a head's row is `mixed % ple.head_vocab_sizes[h] + ple.head_offsets[h]` - a true modulo against + each head's own vocabulary size (10,000,019 .. 10,000,339), not a mask. Heads 0..7 are gram 2, + 8..15 gram 3, matching the head order llama.cpp gathers `emb_p` in. + +`ple_toks_` records the sequence's tokens so predecessors resolve; it resets with the conv state at +`pos_ == 0`. + +## Table reads: the Flash Next mechanism + +The 160,003,584-row table lives in shard 00002 (15.4 GB of Q5_1 rows, 96 B per row at head_dim 128) - +far past any reasonable resident size, and the same physical layout Flash Next's n-gram PLE uses. +The port reads it through `strata::ngram::PleReader` (`engine/include/strata/ngram/ple_reader.hpp`), +not a mapped gather: + +- `open(path, table_offset, n_rows, max_inflight=256, cache_rows=1<<20, ..., io_thread=true)`, + `set_keepalive(100 ms, 60 s)` - the values `terminal/strata-iq3_xxs.json`'s serve runs with; +- Direct mode: an O_DIRECT `pread` thread pool that bypasses the page cache and keeps the file's few + GB of hot rows out of the 60 GB host RAM; rows land in the reader's LRU row cache (~100 MB at 96 + B/row); +- per chunk of `kPleTok = 16` tokens, `ple_apply` issues `m * 16` rows and collects them into a + pinned raw buffer (the reader dedupes and sorts pages for the parallel preads), dequantizes Q5_1 to + floats in head order on the host, and uploads one contiguous 16 x 8192 block. + +`Qwen4Exp`'s destructor prints the reader's statistics the way the Flash Next serve reports its +n-gram reads. Measured over the 268-token smoke run (12 prompt + 256 greedy): + + PLE table: 4272 rows asked, 1088 from the row cache, 3184 SSD reads of 13275136 bytes, + 3184 rows cached, collect waited 95.6 ms + +4272 = 267 PLE tokens x 16 rows; 13275136 = 3184 x 96 B; 95.6 ms of collect waits over 267 tokens +(~0.36 ms/token) hides inside the block's other work. The row cache's 1088 hits are the prompt +re-hash at the first decode step, where rows repeat. + +One harness note inherited from the engine: `reset_call()` runs before the step's token ids are +bound, so rows cannot be issued before the first chunk of a call; the reader's io thread provides the +intra-chunk overlap instead. A batched `step()` (rows_of_, where a row belongs to no single token +history) skips the PLE with a once-logged warning. + +## Kernels and weights + +- `ple_mix` (`engine/src/poly/kernels.cu`): one block per (token, stream) - grouped_norm of key and + query over the 4 x 2048 stack, dot into `s`, the sign-sqrt gate, `gated`, and the normed output + (scaled by `|gate| * rms(value)` the way llama.cpp's grouped_norm divides); +- `ple_conv_add`: per channel window, the persistent `9 x 8192` conv state plus the chunk's new rows + in registers, the three dilated taps with SiLU applied sequentially (tap t-3 sees this chunk's + rows), `res[...] += gated + conv_out`, and the state advanced - chunk boundaries exact; +- weights: `blk.1.ple_{key,value}.weight` upload as BF16 `kFloatMat` (staying BF16 on device), the + three `ple_norm_*` and `ple_conv1d` as `kF32`; `ple_conv1d` is flat `[channel*4 + tap]` on device, + matching the conv kernel's indexing. + +## Numerical check (pos 0, token 0) + +CPU float reference vs the port's `--dump-layers` at the PLE layer: + +| row | reference sum / abs | port sum / abs | +|---|---|---| +| `ple_gated` | 3.1417 / 256.79 | 3.1881 / 260.58 | +| `ple_normed` | 47.6939 / 3384.73 | 47.6925 / 3384.65 | +| `ple_res` | -5.6762 / 601.47 | -5.6771 / 603.48 | +| blk1 `attn_in` | -7.4789 / 506.44 | -7.4835 / 506.10 | + +The residuals sit inside the bf16-weight, Q8_1-activation quantization noise; without the PLE the +same `attn_in` sum is -16.4 against the reference's -7.5, so the mechanism's magnitude and sign both +verify. The greedy smoke run matched llama.cpp's reference token for token for the first 141 +generated tokens and then parted onto its own coherent continuation. + +## Not yet ported (expected divergences) + +- the QSA k-pool indexer (`blk.N.indexer.*`, `compress_ratios=4` on every attention layer). Below + the indexer's top_k (2048) it selects every block, so dense attention gives the same sums - that + is why short runs match - but the port has no k-pool and the divergence of long runs starts there + and in accumulated quantization noise, not in the PLE; +- the MTP block (`blk.40.nextn.*`): draft is forced off before `load_shape()`. + +Neither is a PLE gap; the PLE runs for every token of every single-sequence step. diff --git a/patches/qwen4exp-full-port/docs/README.md b/patches/qwen4exp-full-port/docs/README.md new file mode 100644 index 000000000..a50a04fa7 --- /dev/null +++ b/patches/qwen4exp-full-port/docs/README.md @@ -0,0 +1,109 @@ +# Qwen4-35B-A3B (`qwen4exp`) PolyStrata port + +Status: **running**. The runtime port (`engine/src/poly/qwen4exp.*`) loads and generates: 41 layers, hybrid GDN/full attention, hyper-connections, routed+shared MoE with CPU expert offload, and the layer-1 PLE over the Flash Next n-gram SSD reader (see [PLE.md](PLE.md)). A 256-token greedy run matched llama.cpp token for token for 141 tokens, then diverged coherently. Not ported yet: the QSA k-pool indexer and the MTP block (draft forced off). Tensor map, metadata dump and tokenizer are done. This document is the working log for porting `unsloth/Qwen4-35B-A3B-GGUF:UD-Q5_K_M` to PolyStrata's poly engine. + +## Target model + +- GGUF: `/home/inex/models/Qwen4-35B-A3B-UD-Q5_K_M/Qwen4-35B-A3B-UD-Q5_K_M-00001-of-00002.gguf` (+ shard 00002) +- Architecture: `qwen4exp` +- Family: `qwen35moe`-like MoE+hybrid attention, but **not** compatible with existing `poly/qwen35.cpp` +- Size: ~41 GiB UD-Q5_K_M, 2 shards, 912 tensors +- Context in metadata: 1,048,576; practical local VRAM limits apply (12GB 3080 Ti cannot hold full weights). + +## What already works + +- **llama.cpp** updated build can run this GGUF with CPU MoE offload: + - `/home/inex/llama.cpp/build/bin/llama-server` (v1.1.0-dev build 308, commit 72a780e) + - Working command: `CUDA_VISIBLE_DEVICES=1 ... -ngl 99 -c 4096 -ot ".ffn_.*_exps.=CPU" -b 2048 -ub 512 -fa on --threads 6 --threads-batch 12 --prio 2 --jinja` + - Isolated short-prompt decode ~25-26 tok/s; prompt speed varies. +- **PolyStrata tokenizer**: patched `terminal/tools/strata_tokenizer.py` to recognize `tokenizer.ggml.pre=qwen4` as Qwen35 pre-tokenizer pattern with `ignore_merges=true`. Roundtrip check passed. + +## What blocks PolyStrata poly engine + +`tools/qwen4_intake.py` verdict: `CASE C: port first`. + +Observed blockers from intake/report: +- 363 tensors not named by Qwen3.6-35B-A3B layout (`hc_*`, `ple_*`, `indexer_*`, `attn_qkv_gate`, etc.). +- 204 tensors expected by Qwen3.6 layout missing. +- 1 reshape mismatch: `blk.40.nextn.hnorm.weight` `[8192]` vs `[2048]`. +- Dense BF16 MMVQ/native kernel blocker reported by intake for some tensors. +- Runtime: `strata-poly` rejects `qwen4exp` as unsupported architecture. + +## Key architecture differences (from GGUF metadata / refs) + +- Hyper-connections: `hyper_connection.count=4`, `low_rank=256`, output HC tensors. +- PLE (per-layer embeddings / n-gram hash): `ple.*` keys, `ple.layers=[1]`, `ngram_size=3`, `heads_per_ngram=8`, `conv_kernel=4`, head offsets/vocab sizes/multipliers, image token id. +- Indexer/QSA: `attention.indexer.*`, `attention.compress_ratios`, recurrent/full layer mix. +- Hybrid layers: 41 blocks total, `nextn_predict_layers=1`; recurrent layers per `attention.recurrent_layers`; full attention interval 4. +- SSM/GDN-like params present (`ssm.*`), but tensor naming differs from Qwen3.5 poly layout (`attn_qkv_gate`, `ssm_beta_alpha.weight`, no `attn_norm/post_attention_norm/ssm_alpha/ssm_beta` as Qwen35 expects). +- Tokenizer: `gpt2` model, `pre=qwen4`, same vocab as Flash-Next; `ignore_merges=true` like glm4 behavior in llama.cpp. + +## Tensor layout (normalized) + +See `tensor-layout.txt` generated from GGUF. Summary: + +- Common per-block routed FFN tensors exist: `ffn_gate_inp`, `ffn_{gate,up,down}_exps`, shared expert tensors. +- Full-attention blocks have `attn_q/k/v`, norms, output, indexer projections/norms. +- Recurrent blocks have `attn_qkv_gate`, `ssm_*`, `hc_*`. +- PLE appears only on block 1. +- Nextn/MTP block 40 has `nextn.*` tensors. +- Global: `token_embd.weight`, `output.weight`, `output_hc_*`. + +## Reference code + +- llama.cpp reference: `/home/inex/llama.cpp/src/models/qwen4exp.cpp`, `/home/inex/llama.cpp/src/llama-vocab.cpp` (`qwen4` pretokenizer = QWEN35 + ignore_merges). +- PolyStrata third_party: `engine/third_party/strata-llama/src/models/qwen4exp.cpp` (same shape of implementation), gguf-py conversion has `qwen4exp.py`. +- PolyStrata poly engine: `engine/src/poly/engine.cpp` dispatch, `engine/src/poly/qwen35.*` closest existing hybrid MoE implementation. +- PolyStrata generate/split have partial qwen4exp awareness, but poly CUDA engine does not. + +## Port strategy + +1. **Document & map** (this folder). Keep status honest. +2. **Tokenizer/tools** - done for `strata_tokenizer.py`. +3. **Arch detection** - make poly engine recognize `qwen4exp` and route to dedicated implementation/stub with clear diagnostics. +4. **Minimal skeleton** - add `engine/src/poly/qwen4exp.hpp/.cpp` (or equivalent), wire CMake/build, compile. +5. **Weight loading** - map GGUF tensors to runtime structures, including HC/PLE/indexer/MTP. +6. **Graph/runtime** - implement forward pass. Reuse existing kernels where possible; add missing kernels for HC/PLE/indexer/QSA as needed. +7. **Validation** - compare logits/tokens against llama.cpp on small prompts, then benchmark. + +## Risks / constraints + +- This is a large engine port, not a config-only change. +- 12GB VRAM is insufficient for full 42GB weights; expect CPU offload/mmap/partial residency design constraints. +- PolyStrata local repo has dirty/untracked files; avoid touching unrelated files. +- Live `:8080` must remain stable; isolated tests only. +- `terminal/strata-iq3_xxs.json` must remain byte-for-byte untouched. + +## Files touched so far + +- `terminal/tools/strata_tokenizer.py` - added `qwen4` pretokenizer + ignore_merges. +- `docs/qwen4exp-port/*` - this documentation. + +## Next concrete steps + +- [x] Generate full tensor map and metadata dump (`tensor-layout.txt` 912 tensors verified byte-for-byte against a second parser; `metadata.json` is now valid JSON with the full header metadata; type names follow the `ggml.h` enum, which has gaps - an earlier parser draft misnamed quant types). +- [ ] Add `qwen4exp` architecture recognition in `engine/src/poly/engine.cpp`. +- [ ] Add skeleton `qwen4exp` engine class and CMake wiring. +- [ ] Map tensor names to loader structs. +- [ ] Implement HC residual/mixer path. +- [ ] Implement PLE n-gram embedding path. +- [ ] Implement indexer/QSA attention path. +- [ ] Implement MTP/nextn block handling. +- [ ] Add isolated smoke test command/logging. + +## Status log + +- 2026-12-04: llama.cpp `72a780e` (build 308) ran this GGUF isolated on port 19998 against the 3080 Ti + (selected by UUID `GPU-160a10ef-6095-54fd-d6f5-9cf0968396f8`, not by `CUDA_VISIBLE_DEVICES=1` - that + bound the wrong card): `-ngl 99 -ot ".ffn_.*_exps.=CPU" -c 4096 -b 2048 -ub 512 -fa on --threads 6 + --threads-batch 12 --prio 2 --jinja`, ~33 tok/s generation. Server stopped afterwards; `:8080` untouched. +- 2026-12-04: `metadata.json` regenerated from the GGUF headers (was malformed); `tensor-layout.txt` verified + against a second parser (all 911 shard-1 tensors match; `per_layer_token_embd.weight` from shard 2 appended); + `TENSOR-MAP.md` rewritten from the verified dump. +- 2026-12-04: GGUF v3 layout note: KV metadata comes before the tensor infos; ggml type enum has gaps + (`Q5_0=6 ... Q5_1=7 ... Q5_K=13 ... BF16=30`), so a dense type table misnames quants. Parser: `/tmp/opencode/q4_gguf.py`. +- In progress: `engine/src/poly/qwen4exp.hpp/.cpp` skeleton exists but does not compile yet. Unconfirmed static + analysis: hyper-connection kernels `gr_read`/`gr_write` exist in `engine/include/strata/kernels/gr.hpp` + (dense engine); whether the poly target can link them is being verified, as are the exact poly kernel signatures. +- Open decision: the PLE table is 15.36 GB (Q5_1, shard 2) and free host RAM is ~7 GB - the port must either + mmap-gather it or skip `blk.1.ple.*` in the first runnable pass. Documented either way. diff --git a/patches/qwen4exp-full-port/docs/TENSOR-MAP.md b/patches/qwen4exp-full-port/docs/TENSOR-MAP.md new file mode 100644 index 000000000..0b54e2500 --- /dev/null +++ b/patches/qwen4exp-full-port/docs/TENSOR-MAP.md @@ -0,0 +1,85 @@ +# Qwen4-35B-A3B (`qwen4exp`) tensor map + +Source: `unsloth/Qwen4-35B-A3B-GGUF/UD-Q5_K_M`, GGUF v3, 2 shards. +Shard 1 carries 911 tensors; shard 2 carries only `per_layer_token_embd.weight`. +All shapes and types below are read from the file headers (parser: `/tmp/opencode/q4_gguf.py`, +type names per llama.cpp `ggml.h`); full per-tensor dump: `tensor-layout.txt`, machine-readable: `metadata.json`. + +## Global tensors + +| GGUF | Dims | Type | Notes | +|---|---|---|---| +| `token_embd.weight` | `[2048, 248320]` | Q5_K | token embeddings | +| `output.weight` | `[2048, 248320]` | Q8_0 | not tied, present explicitly | +| `output_hc_norm.weight` | `[8192]` | F32 | final HC norm (= 4 streams x 2048, flat) | +| `output_hc_down.weight` | `[8192, 256]` | Q8_0 | final HC down (low-rank 256) | +| `output_hc_up.weight` | `[256, 8192]` | Q8_0 | final HC up | +| `per_layer_token_embd.weight` | `[128, 160003584]` | Q5_1 | PLE n-gram table, shard 2, 15.36 GB (16 heads x ~10M rows x 128 dims) | + +## Per-block tensors (41 blocks) + +### Hyper-connection (all 41 blocks) +- `blk.N.hc_attn_norm.weight` `[8192]` F32 - flat `4 x 2048`, gamma pre-folded to `1+w` +- `blk.N.hc_attn_down_inject.weight` `[8192, 260]` Q8_0/Q6_K - rows `0..255` = low-rank down, last 4 = inject +- `blk.N.hc_attn_up.weight` `[256, 8192]` Q6_K/Q8_0 - gate up projection +- same four for `hc_ffn_*` + +### Recurrent/GDN blocks (30 blocks: 0-2,4-6,8-10,...,36-38) +- `blk.N.attn_qkv_gate.weight` `[2048, 12288]` Q6_K - combined qkv (8192 rows) + output gate z (4096 rows) +- `blk.N.ssm_conv1d.weight` `[4, 8192]` F32 - depthwise conv, kernel 4 +- `blk.N.ssm_beta_alpha.weight` `[2048, 64]` Q8_0 - combined beta (32 rows) + alpha (32 rows) +- `blk.N.ssm_a` `[32]` F32, `blk.N.ssm_dt.bias` `[32]` F32 +- `blk.N.ssm_norm.weight` `[128]` F32 - per-head group norm +- `blk.N.ssm_out.weight` `[4096, 2048]` Q8_0 - output projection + +### Full attention blocks (11 blocks: 3,7,11,15,19,23,27,31,35,39,40) +- `blk.N.attn_q.weight` `[2048, 8192]` - query (16 x 256) + gate (16 x 256), like Qwen3Next +- `blk.N.attn_k.weight` `[2048, 512]`, `blk.N.attn_v.weight` `[2048, 512]` - 2 KV heads x 256 +- `blk.N.attn_output.weight` `[4096, 2048]` +- `blk.N.attn_q_norm.weight` `[256]` F32, `blk.N.attn_k_norm.weight` `[256]` F32 +- types: Q6_K or Q8_0 per layer (Unsloth dynamic mix) +- Indexer/QSA (deferred in the first port pass): `indexer.q_proj` `[2048, 512]` BF16, + `indexer.k_proj` `[2048, 128]` BF16, `indexer.q_norm`/`indexer.k_norm` `[128]` F32 + +### PLE block (block 1 only, `ple.layers=[1]`) +- `blk.1.ple_key.weight` `[2048, 8192]` BF16 +- `blk.1.ple_value.weight` `[2048, 2048]` BF16 +- `blk.1.ple_conv1d.weight` `[4, 8192]` F16 (note: F16, not F32) +- `blk.1.ple_norm_key/query/conv.weight` `[8192]` F32 +- table side: `per_layer_token_embd.weight` above; hashed 3-gram lookup, 16 heads (`ple.head_offsets` len 16) + +### MoE (all 41 blocks) +- `blk.N.ffn_gate_inp.weight` `[2048, 256]` F32 (router), `blk.N.ffn_gate_inp_shexp.weight` `[2048]` F32 +- `blk.N.ffn_gate_exps/ffn_up_exps.weight` `[2048, 512, 256]` Q5_K/Q6_K; `ffn_down_exps` `[512, 2048, 256]` Q6_K +- shared expert: `ffn_gate_shexp/up_shexp` `[2048, 512]`, `ffn_down_shexp` `[512, 2048]` Q6_K/Q8_0 + +### Nextn/MTP head (block 40, which is also a full-attention block) +- `blk.40.nextn.eh_proj.weight` `[4096, 2048]` Q6_K +- `blk.40.nextn.enorm.weight` `[2048]` F32, `blk.40.nextn.hnorm.weight` `[8192]` F32 +- `blk.40.nextn.hc_head_norm.weight` `[8192]` F32, `hc_head_down` `[8192, 256]` Q6_K, `hc_head_up` `[256, 8192]` Q6_K + +## Geometry / metadata (from shard 1 header) + +- `block_count=41` (40 main layers + 1 nextn draft), `nextn_predict_layers=1` +- `embedding_length=2048`, `n_vocab=248320`, `context_length=1048576` +- `attention.head_count=16`, `head_count_kv=2`, `key_length=value_length=256` +- `attention.recurrent_layers`: true for 0-2,4-6,8-10,...,36-38 (30 blocks) +- `attention.compress_ratios`: 4 on 3,7,...,39,40; 0 elsewhere (`indexer.top_k=2048`, 4 heads, key 128) +- `hyper_connection.count=4`, `low_rank=256` +- `expert_count=256`, `expert_used_count=8`, `expert_ff=512`, `shared_ff=512` +- `ple.*`: ngram_size=3, heads_per_ngram=8, conv_kernel=4, eos=248044, image=248056, + `head_offsets` len 16 (0 .. 150002747), `head_vocab_sizes` ~10,000,xxx each, sum = 160,003,584 rows, + `layer_multipliers=[23703573157769, 20109073645365, 8052911324071]` +- `rope.dimension_sections=[11,11,10,0]`, `freq_base=1e7`, `layer_norm_rms_epsilon=1e-6` + +## Mapping notes for the poly port + +- Qwen35 poly expects `attn_norm/post_attention_norm/attn_qkv/attn_gate/ssm_alpha/ssm_beta` naming; + qwen4exp uses HC norms + combined tensors. Not a rename - a dedicated loader/runtime path. +- Combined tensors must be row-sliced into two `Dev`s, not uploaded whole: + `attn_qkv_gate` (8192 qkv rows + 4096 gate rows), `ssm_beta_alpha` (32 + 32), + `hc_*_down_inject` (256 + 4), `attn_q` (4096 query + 4096 gate). +- Full-attention `attn_q` includes the gate (llama.cpp `build_layer_attn` views Qcur_full as query+gate). +- QSA/indexer is deferred: dense full attention is the mathematically superset fallback. +- PLE table (15.36 GB) cannot be memcpy'd into the ~7 GB free host RAM: the port needs mmap'd + gather from shard 2 (or a documented skip of `blk.1.ple.*` for the first runnable pass). diff --git a/patches/qwen4exp-full-port/docs/tensor-layout.txt b/patches/qwen4exp-full-port/docs/tensor-layout.txt new file mode 100644 index 000000000..55a5fbaf9 --- /dev/null +++ b/patches/qwen4exp-full-port/docs/tensor-layout.txt @@ -0,0 +1,914 @@ +# Qwen4-35B-A3B UD-Q5_K_M tensor layout +# tensors=911 +blk.0.ffn_gate_inp.weight shape=[np.uint64(2048), np.uint64(256)] type=F32 +blk.0.ffn_gate_inp_shexp.weight shape=[np.uint64(2048)] type=F32 +blk.0.hc_attn_down_inject.weight shape=[np.uint64(8192), np.uint64(260)] type=Q8_0 +blk.0.hc_attn_norm.weight shape=[np.uint64(8192)] type=F32 +blk.0.hc_ffn_down_inject.weight shape=[np.uint64(8192), np.uint64(260)] type=Q8_0 +blk.0.hc_ffn_norm.weight shape=[np.uint64(8192)] type=F32 +blk.0.ssm_a shape=[np.uint64(32)] type=F32 +blk.0.ssm_beta_alpha.weight shape=[np.uint64(2048), np.uint64(64)] type=Q8_0 +blk.0.ssm_conv1d.weight shape=[np.uint64(4), np.uint64(8192)] type=F32 +blk.0.ssm_dt.bias shape=[np.uint64(32)] type=F32 +blk.0.ssm_norm.weight shape=[np.uint64(128)] type=F32 +blk.1.ffn_gate_inp.weight shape=[np.uint64(2048), np.uint64(256)] type=F32 +blk.1.ffn_gate_inp_shexp.weight shape=[np.uint64(2048)] type=F32 +blk.1.hc_attn_down_inject.weight shape=[np.uint64(8192), np.uint64(260)] type=Q8_0 +blk.1.hc_attn_norm.weight shape=[np.uint64(8192)] type=F32 +blk.1.hc_ffn_down_inject.weight shape=[np.uint64(8192), np.uint64(260)] type=Q8_0 +blk.1.hc_ffn_norm.weight shape=[np.uint64(8192)] type=F32 +blk.1.ple_conv1d.weight shape=[np.uint64(4), np.uint64(8192)] type=F16 +blk.1.ple_key.weight shape=[np.uint64(2048), np.uint64(8192)] type=BF16 +blk.1.ple_norm_conv.weight shape=[np.uint64(8192)] type=F32 +blk.1.ple_norm_key.weight shape=[np.uint64(8192)] type=F32 +blk.1.ple_norm_query.weight shape=[np.uint64(8192)] type=F32 +blk.1.ple_value.weight shape=[np.uint64(2048), np.uint64(2048)] type=BF16 +blk.1.ssm_a shape=[np.uint64(32)] type=F32 +blk.1.ssm_beta_alpha.weight shape=[np.uint64(2048), np.uint64(64)] type=Q8_0 +blk.1.ssm_conv1d.weight shape=[np.uint64(4), np.uint64(8192)] type=F32 +blk.1.ssm_dt.bias shape=[np.uint64(32)] type=F32 +blk.1.ssm_norm.weight shape=[np.uint64(128)] type=F32 +blk.10.ffn_gate_inp.weight shape=[np.uint64(2048), np.uint64(256)] type=F32 +blk.10.ffn_gate_inp_shexp.weight shape=[np.uint64(2048)] type=F32 +blk.10.hc_attn_down_inject.weight shape=[np.uint64(8192), np.uint64(260)] type=Q8_0 +blk.10.hc_attn_norm.weight shape=[np.uint64(8192)] type=F32 +blk.10.hc_ffn_down_inject.weight shape=[np.uint64(8192), np.uint64(260)] type=Q8_0 +blk.10.hc_ffn_norm.weight shape=[np.uint64(8192)] type=F32 +blk.10.ssm_a shape=[np.uint64(32)] type=F32 +blk.10.ssm_beta_alpha.weight shape=[np.uint64(2048), np.uint64(64)] type=Q8_0 +blk.10.ssm_conv1d.weight shape=[np.uint64(4), np.uint64(8192)] type=F32 +blk.10.ssm_dt.bias shape=[np.uint64(32)] type=F32 +blk.10.ssm_norm.weight shape=[np.uint64(128)] type=F32 +blk.11.attn_k_norm.weight shape=[np.uint64(256)] type=F32 +blk.11.attn_q_norm.weight shape=[np.uint64(256)] type=F32 +blk.11.ffn_gate_inp.weight shape=[np.uint64(2048), np.uint64(256)] type=F32 +blk.11.ffn_gate_inp_shexp.weight shape=[np.uint64(2048)] type=F32 +blk.11.hc_attn_down_inject.weight shape=[np.uint64(8192), np.uint64(260)] type=Q8_0 +blk.11.hc_attn_norm.weight shape=[np.uint64(8192)] type=F32 +blk.11.hc_ffn_down_inject.weight shape=[np.uint64(8192), np.uint64(260)] type=Q8_0 +blk.11.hc_ffn_norm.weight shape=[np.uint64(8192)] type=F32 +blk.11.indexer.k_norm.weight shape=[np.uint64(128)] type=F32 +blk.11.indexer.k_proj.weight shape=[np.uint64(2048), np.uint64(128)] type=BF16 +blk.11.indexer.q_norm.weight shape=[np.uint64(128)] type=F32 +blk.11.indexer.q_proj.weight shape=[np.uint64(2048), np.uint64(512)] type=BF16 +blk.12.ffn_gate_inp.weight shape=[np.uint64(2048), np.uint64(256)] type=F32 +blk.12.ffn_gate_inp_shexp.weight shape=[np.uint64(2048)] type=F32 +blk.12.hc_attn_down_inject.weight shape=[np.uint64(8192), np.uint64(260)] type=Q8_0 +blk.12.hc_attn_norm.weight shape=[np.uint64(8192)] type=F32 +blk.12.hc_ffn_down_inject.weight shape=[np.uint64(8192), np.uint64(260)] type=Q8_0 +blk.12.hc_ffn_norm.weight shape=[np.uint64(8192)] type=F32 +blk.12.ssm_a shape=[np.uint64(32)] type=F32 +blk.12.ssm_beta_alpha.weight shape=[np.uint64(2048), np.uint64(64)] type=Q8_0 +blk.12.ssm_conv1d.weight shape=[np.uint64(4), np.uint64(8192)] type=F32 +blk.12.ssm_dt.bias shape=[np.uint64(32)] type=F32 +blk.12.ssm_norm.weight shape=[np.uint64(128)] type=F32 +blk.13.ffn_gate_inp.weight shape=[np.uint64(2048), np.uint64(256)] type=F32 +blk.13.ffn_gate_inp_shexp.weight shape=[np.uint64(2048)] type=F32 +blk.13.hc_attn_down_inject.weight shape=[np.uint64(8192), np.uint64(260)] type=Q8_0 +blk.13.hc_attn_norm.weight shape=[np.uint64(8192)] type=F32 +blk.13.hc_ffn_down_inject.weight shape=[np.uint64(8192), np.uint64(260)] type=Q8_0 +blk.13.hc_ffn_norm.weight shape=[np.uint64(8192)] type=F32 +blk.13.ssm_a shape=[np.uint64(32)] type=F32 +blk.13.ssm_beta_alpha.weight shape=[np.uint64(2048), np.uint64(64)] type=Q8_0 +blk.13.ssm_conv1d.weight shape=[np.uint64(4), np.uint64(8192)] type=F32 +blk.13.ssm_dt.bias shape=[np.uint64(32)] type=F32 +blk.13.ssm_norm.weight shape=[np.uint64(128)] type=F32 +blk.14.ffn_gate_inp.weight shape=[np.uint64(2048), np.uint64(256)] type=F32 +blk.14.ffn_gate_inp_shexp.weight shape=[np.uint64(2048)] type=F32 +blk.14.hc_attn_down_inject.weight shape=[np.uint64(8192), np.uint64(260)] type=Q8_0 +blk.14.hc_attn_norm.weight shape=[np.uint64(8192)] type=F32 +blk.14.hc_ffn_down_inject.weight shape=[np.uint64(8192), np.uint64(260)] type=Q8_0 +blk.14.hc_ffn_norm.weight shape=[np.uint64(8192)] type=F32 +blk.14.ssm_a shape=[np.uint64(32)] type=F32 +blk.14.ssm_beta_alpha.weight shape=[np.uint64(2048), np.uint64(64)] type=Q8_0 +blk.14.ssm_conv1d.weight shape=[np.uint64(4), np.uint64(8192)] type=F32 +blk.14.ssm_dt.bias shape=[np.uint64(32)] type=F32 +blk.14.ssm_norm.weight shape=[np.uint64(128)] type=F32 +blk.15.attn_k_norm.weight shape=[np.uint64(256)] type=F32 +blk.15.attn_q_norm.weight shape=[np.uint64(256)] type=F32 +blk.15.ffn_gate_inp.weight shape=[np.uint64(2048), np.uint64(256)] type=F32 +blk.15.ffn_gate_inp_shexp.weight shape=[np.uint64(2048)] type=F32 +blk.15.hc_attn_down_inject.weight shape=[np.uint64(8192), np.uint64(260)] type=Q8_0 +blk.15.hc_attn_norm.weight shape=[np.uint64(8192)] type=F32 +blk.15.hc_ffn_down_inject.weight shape=[np.uint64(8192), np.uint64(260)] type=Q8_0 +blk.15.hc_ffn_norm.weight shape=[np.uint64(8192)] type=F32 +blk.15.indexer.k_norm.weight shape=[np.uint64(128)] type=F32 +blk.15.indexer.k_proj.weight shape=[np.uint64(2048), np.uint64(128)] type=BF16 +blk.15.indexer.q_norm.weight shape=[np.uint64(128)] type=F32 +blk.15.indexer.q_proj.weight shape=[np.uint64(2048), np.uint64(512)] type=BF16 +blk.16.ffn_gate_inp.weight shape=[np.uint64(2048), np.uint64(256)] type=F32 +blk.16.ffn_gate_inp_shexp.weight shape=[np.uint64(2048)] type=F32 +blk.16.hc_attn_down_inject.weight shape=[np.uint64(8192), np.uint64(260)] type=Q8_0 +blk.16.hc_attn_norm.weight shape=[np.uint64(8192)] type=F32 +blk.16.hc_ffn_down_inject.weight shape=[np.uint64(8192), np.uint64(260)] type=Q8_0 +blk.16.hc_ffn_norm.weight shape=[np.uint64(8192)] type=F32 +blk.16.ssm_a shape=[np.uint64(32)] type=F32 +blk.16.ssm_beta_alpha.weight shape=[np.uint64(2048), np.uint64(64)] type=Q8_0 +blk.16.ssm_conv1d.weight shape=[np.uint64(4), np.uint64(8192)] type=F32 +blk.16.ssm_dt.bias shape=[np.uint64(32)] type=F32 +blk.16.ssm_norm.weight shape=[np.uint64(128)] type=F32 +blk.17.ffn_gate_inp.weight shape=[np.uint64(2048), np.uint64(256)] type=F32 +blk.17.ffn_gate_inp_shexp.weight shape=[np.uint64(2048)] type=F32 +blk.17.hc_attn_down_inject.weight shape=[np.uint64(8192), np.uint64(260)] type=Q8_0 +blk.17.hc_attn_norm.weight shape=[np.uint64(8192)] type=F32 +blk.17.hc_ffn_down_inject.weight shape=[np.uint64(8192), np.uint64(260)] type=Q8_0 +blk.17.hc_ffn_norm.weight shape=[np.uint64(8192)] type=F32 +blk.17.ssm_a shape=[np.uint64(32)] type=F32 +blk.17.ssm_beta_alpha.weight shape=[np.uint64(2048), np.uint64(64)] type=Q8_0 +blk.17.ssm_conv1d.weight shape=[np.uint64(4), np.uint64(8192)] type=F32 +blk.17.ssm_dt.bias shape=[np.uint64(32)] type=F32 +blk.17.ssm_norm.weight shape=[np.uint64(128)] type=F32 +blk.18.ffn_gate_inp.weight shape=[np.uint64(2048), np.uint64(256)] type=F32 +blk.18.ffn_gate_inp_shexp.weight shape=[np.uint64(2048)] type=F32 +blk.18.hc_attn_down_inject.weight shape=[np.uint64(8192), np.uint64(260)] type=Q8_0 +blk.18.hc_attn_norm.weight shape=[np.uint64(8192)] type=F32 +blk.18.hc_ffn_down_inject.weight shape=[np.uint64(8192), np.uint64(260)] type=Q8_0 +blk.18.hc_ffn_norm.weight shape=[np.uint64(8192)] type=F32 +blk.18.ssm_a shape=[np.uint64(32)] type=F32 +blk.18.ssm_beta_alpha.weight shape=[np.uint64(2048), np.uint64(64)] type=Q8_0 +blk.18.ssm_conv1d.weight shape=[np.uint64(4), np.uint64(8192)] type=F32 +blk.18.ssm_dt.bias shape=[np.uint64(32)] type=F32 +blk.18.ssm_norm.weight shape=[np.uint64(128)] type=F32 +blk.19.attn_k_norm.weight shape=[np.uint64(256)] type=F32 +blk.19.attn_q_norm.weight shape=[np.uint64(256)] type=F32 +blk.19.ffn_gate_inp.weight shape=[np.uint64(2048), np.uint64(256)] type=F32 +blk.19.ffn_gate_inp_shexp.weight shape=[np.uint64(2048)] type=F32 +blk.19.hc_attn_down_inject.weight shape=[np.uint64(8192), np.uint64(260)] type=Q8_0 +blk.19.hc_attn_norm.weight shape=[np.uint64(8192)] type=F32 +blk.19.hc_ffn_down_inject.weight shape=[np.uint64(8192), np.uint64(260)] type=Q8_0 +blk.19.hc_ffn_norm.weight shape=[np.uint64(8192)] type=F32 +blk.19.indexer.k_norm.weight shape=[np.uint64(128)] type=F32 +blk.19.indexer.k_proj.weight shape=[np.uint64(2048), np.uint64(128)] type=BF16 +blk.19.indexer.q_norm.weight shape=[np.uint64(128)] type=F32 +blk.19.indexer.q_proj.weight shape=[np.uint64(2048), np.uint64(512)] type=BF16 +blk.2.ffn_gate_inp.weight shape=[np.uint64(2048), np.uint64(256)] type=F32 +blk.2.ffn_gate_inp_shexp.weight shape=[np.uint64(2048)] type=F32 +blk.2.hc_attn_down_inject.weight shape=[np.uint64(8192), np.uint64(260)] type=Q8_0 +blk.2.hc_attn_norm.weight shape=[np.uint64(8192)] type=F32 +blk.2.hc_ffn_down_inject.weight shape=[np.uint64(8192), np.uint64(260)] type=Q8_0 +blk.2.hc_ffn_norm.weight shape=[np.uint64(8192)] type=F32 +blk.2.ssm_a shape=[np.uint64(32)] type=F32 +blk.2.ssm_beta_alpha.weight shape=[np.uint64(2048), np.uint64(64)] type=Q8_0 +blk.2.ssm_conv1d.weight shape=[np.uint64(4), np.uint64(8192)] type=F32 +blk.2.ssm_dt.bias shape=[np.uint64(32)] type=F32 +blk.2.ssm_norm.weight shape=[np.uint64(128)] type=F32 +blk.20.ffn_gate_inp.weight shape=[np.uint64(2048), np.uint64(256)] type=F32 +blk.20.ffn_gate_inp_shexp.weight shape=[np.uint64(2048)] type=F32 +blk.20.hc_attn_down_inject.weight shape=[np.uint64(8192), np.uint64(260)] type=Q8_0 +blk.20.hc_attn_norm.weight shape=[np.uint64(8192)] type=F32 +blk.20.hc_ffn_down_inject.weight shape=[np.uint64(8192), np.uint64(260)] type=Q8_0 +blk.20.hc_ffn_norm.weight shape=[np.uint64(8192)] type=F32 +blk.20.ssm_a shape=[np.uint64(32)] type=F32 +blk.20.ssm_beta_alpha.weight shape=[np.uint64(2048), np.uint64(64)] type=Q8_0 +blk.20.ssm_conv1d.weight shape=[np.uint64(4), np.uint64(8192)] type=F32 +blk.20.ssm_dt.bias shape=[np.uint64(32)] type=F32 +blk.20.ssm_norm.weight shape=[np.uint64(128)] type=F32 +blk.21.ffn_gate_inp.weight shape=[np.uint64(2048), np.uint64(256)] type=F32 +blk.21.ffn_gate_inp_shexp.weight shape=[np.uint64(2048)] type=F32 +blk.21.hc_attn_down_inject.weight shape=[np.uint64(8192), np.uint64(260)] type=Q8_0 +blk.21.hc_attn_norm.weight shape=[np.uint64(8192)] type=F32 +blk.21.hc_ffn_down_inject.weight shape=[np.uint64(8192), np.uint64(260)] type=Q8_0 +blk.21.hc_ffn_norm.weight shape=[np.uint64(8192)] type=F32 +blk.21.ssm_a shape=[np.uint64(32)] type=F32 +blk.21.ssm_beta_alpha.weight shape=[np.uint64(2048), np.uint64(64)] type=Q8_0 +blk.21.ssm_conv1d.weight shape=[np.uint64(4), np.uint64(8192)] type=F32 +blk.21.ssm_dt.bias shape=[np.uint64(32)] type=F32 +blk.21.ssm_norm.weight shape=[np.uint64(128)] type=F32 +blk.22.ffn_gate_inp.weight shape=[np.uint64(2048), np.uint64(256)] type=F32 +blk.22.ffn_gate_inp_shexp.weight shape=[np.uint64(2048)] type=F32 +blk.22.hc_attn_down_inject.weight shape=[np.uint64(8192), np.uint64(260)] type=Q8_0 +blk.22.hc_attn_norm.weight shape=[np.uint64(8192)] type=F32 +blk.22.hc_ffn_down_inject.weight shape=[np.uint64(8192), np.uint64(260)] type=Q8_0 +blk.22.hc_ffn_norm.weight shape=[np.uint64(8192)] type=F32 +blk.22.ssm_a shape=[np.uint64(32)] type=F32 +blk.22.ssm_beta_alpha.weight shape=[np.uint64(2048), np.uint64(64)] type=Q8_0 +blk.22.ssm_conv1d.weight shape=[np.uint64(4), np.uint64(8192)] type=F32 +blk.22.ssm_dt.bias shape=[np.uint64(32)] type=F32 +blk.22.ssm_norm.weight shape=[np.uint64(128)] type=F32 +blk.23.attn_k_norm.weight shape=[np.uint64(256)] type=F32 +blk.23.attn_q_norm.weight shape=[np.uint64(256)] type=F32 +blk.23.ffn_gate_inp.weight shape=[np.uint64(2048), np.uint64(256)] type=F32 +blk.23.ffn_gate_inp_shexp.weight shape=[np.uint64(2048)] type=F32 +blk.23.hc_attn_down_inject.weight shape=[np.uint64(8192), np.uint64(260)] type=Q8_0 +blk.23.hc_attn_norm.weight shape=[np.uint64(8192)] type=F32 +blk.23.hc_ffn_down_inject.weight shape=[np.uint64(8192), np.uint64(260)] type=Q8_0 +blk.23.hc_ffn_norm.weight shape=[np.uint64(8192)] type=F32 +blk.23.indexer.k_norm.weight shape=[np.uint64(128)] type=F32 +blk.23.indexer.k_proj.weight shape=[np.uint64(2048), np.uint64(128)] type=BF16 +blk.23.indexer.q_norm.weight shape=[np.uint64(128)] type=F32 +blk.23.indexer.q_proj.weight shape=[np.uint64(2048), np.uint64(512)] type=BF16 +blk.24.ffn_gate_inp.weight shape=[np.uint64(2048), np.uint64(256)] type=F32 +blk.24.ffn_gate_inp_shexp.weight shape=[np.uint64(2048)] type=F32 +blk.24.hc_attn_down_inject.weight shape=[np.uint64(8192), np.uint64(260)] type=Q8_0 +blk.24.hc_attn_norm.weight shape=[np.uint64(8192)] type=F32 +blk.24.hc_ffn_down_inject.weight shape=[np.uint64(8192), np.uint64(260)] type=Q8_0 +blk.24.hc_ffn_norm.weight shape=[np.uint64(8192)] type=F32 +blk.24.ssm_a shape=[np.uint64(32)] type=F32 +blk.24.ssm_beta_alpha.weight shape=[np.uint64(2048), np.uint64(64)] type=Q8_0 +blk.24.ssm_conv1d.weight shape=[np.uint64(4), np.uint64(8192)] type=F32 +blk.24.ssm_dt.bias shape=[np.uint64(32)] type=F32 +blk.24.ssm_norm.weight shape=[np.uint64(128)] type=F32 +blk.25.ffn_gate_inp.weight shape=[np.uint64(2048), np.uint64(256)] type=F32 +blk.25.ffn_gate_inp_shexp.weight shape=[np.uint64(2048)] type=F32 +blk.25.hc_attn_down_inject.weight shape=[np.uint64(8192), np.uint64(260)] type=Q8_0 +blk.25.hc_attn_norm.weight shape=[np.uint64(8192)] type=F32 +blk.25.hc_ffn_down_inject.weight shape=[np.uint64(8192), np.uint64(260)] type=Q8_0 +blk.25.hc_ffn_norm.weight shape=[np.uint64(8192)] type=F32 +blk.25.ssm_a shape=[np.uint64(32)] type=F32 +blk.25.ssm_beta_alpha.weight shape=[np.uint64(2048), np.uint64(64)] type=Q8_0 +blk.25.ssm_conv1d.weight shape=[np.uint64(4), np.uint64(8192)] type=F32 +blk.25.ssm_dt.bias shape=[np.uint64(32)] type=F32 +blk.25.ssm_norm.weight shape=[np.uint64(128)] type=F32 +blk.26.ffn_gate_inp.weight shape=[np.uint64(2048), np.uint64(256)] type=F32 +blk.26.ffn_gate_inp_shexp.weight shape=[np.uint64(2048)] type=F32 +blk.26.hc_attn_down_inject.weight shape=[np.uint64(8192), np.uint64(260)] type=Q8_0 +blk.26.hc_attn_norm.weight shape=[np.uint64(8192)] type=F32 +blk.26.hc_ffn_down_inject.weight shape=[np.uint64(8192), np.uint64(260)] type=Q8_0 +blk.26.hc_ffn_norm.weight shape=[np.uint64(8192)] type=F32 +blk.26.ssm_a shape=[np.uint64(32)] type=F32 +blk.26.ssm_beta_alpha.weight shape=[np.uint64(2048), np.uint64(64)] type=Q8_0 +blk.26.ssm_conv1d.weight shape=[np.uint64(4), np.uint64(8192)] type=F32 +blk.26.ssm_dt.bias shape=[np.uint64(32)] type=F32 +blk.26.ssm_norm.weight shape=[np.uint64(128)] type=F32 +blk.27.attn_k_norm.weight shape=[np.uint64(256)] type=F32 +blk.27.attn_q_norm.weight shape=[np.uint64(256)] type=F32 +blk.27.ffn_gate_inp.weight shape=[np.uint64(2048), np.uint64(256)] type=F32 +blk.27.ffn_gate_inp_shexp.weight shape=[np.uint64(2048)] type=F32 +blk.27.hc_attn_down_inject.weight shape=[np.uint64(8192), np.uint64(260)] type=Q8_0 +blk.27.hc_attn_norm.weight shape=[np.uint64(8192)] type=F32 +blk.27.hc_ffn_down_inject.weight shape=[np.uint64(8192), np.uint64(260)] type=Q8_0 +blk.27.hc_ffn_norm.weight shape=[np.uint64(8192)] type=F32 +blk.27.indexer.k_norm.weight shape=[np.uint64(128)] type=F32 +blk.27.indexer.k_proj.weight shape=[np.uint64(2048), np.uint64(128)] type=BF16 +blk.27.indexer.q_norm.weight shape=[np.uint64(128)] type=F32 +blk.27.indexer.q_proj.weight shape=[np.uint64(2048), np.uint64(512)] type=BF16 +blk.28.ffn_gate_inp.weight shape=[np.uint64(2048), np.uint64(256)] type=F32 +blk.28.ffn_gate_inp_shexp.weight shape=[np.uint64(2048)] type=F32 +blk.28.hc_attn_down_inject.weight shape=[np.uint64(8192), np.uint64(260)] type=Q8_0 +blk.28.hc_attn_norm.weight shape=[np.uint64(8192)] type=F32 +blk.28.hc_ffn_down_inject.weight shape=[np.uint64(8192), np.uint64(260)] type=Q8_0 +blk.28.hc_ffn_norm.weight shape=[np.uint64(8192)] type=F32 +blk.28.ssm_a shape=[np.uint64(32)] type=F32 +blk.28.ssm_beta_alpha.weight shape=[np.uint64(2048), np.uint64(64)] type=Q8_0 +blk.28.ssm_conv1d.weight shape=[np.uint64(4), np.uint64(8192)] type=F32 +blk.28.ssm_dt.bias shape=[np.uint64(32)] type=F32 +blk.28.ssm_norm.weight shape=[np.uint64(128)] type=F32 +blk.29.ffn_gate_inp.weight shape=[np.uint64(2048), np.uint64(256)] type=F32 +blk.29.ffn_gate_inp_shexp.weight shape=[np.uint64(2048)] type=F32 +blk.29.hc_attn_down_inject.weight shape=[np.uint64(8192), np.uint64(260)] type=Q8_0 +blk.29.hc_attn_norm.weight shape=[np.uint64(8192)] type=F32 +blk.29.hc_ffn_down_inject.weight shape=[np.uint64(8192), np.uint64(260)] type=Q8_0 +blk.29.hc_ffn_norm.weight shape=[np.uint64(8192)] type=F32 +blk.29.ssm_a shape=[np.uint64(32)] type=F32 +blk.29.ssm_beta_alpha.weight shape=[np.uint64(2048), np.uint64(64)] type=Q8_0 +blk.29.ssm_conv1d.weight shape=[np.uint64(4), np.uint64(8192)] type=F32 +blk.29.ssm_dt.bias shape=[np.uint64(32)] type=F32 +blk.29.ssm_norm.weight shape=[np.uint64(128)] type=F32 +blk.3.attn_k_norm.weight shape=[np.uint64(256)] type=F32 +blk.3.attn_q_norm.weight shape=[np.uint64(256)] type=F32 +blk.3.ffn_gate_inp.weight shape=[np.uint64(2048), np.uint64(256)] type=F32 +blk.3.ffn_gate_inp_shexp.weight shape=[np.uint64(2048)] type=F32 +blk.3.hc_attn_down_inject.weight shape=[np.uint64(8192), np.uint64(260)] type=Q8_0 +blk.3.hc_attn_norm.weight shape=[np.uint64(8192)] type=F32 +blk.3.hc_ffn_down_inject.weight shape=[np.uint64(8192), np.uint64(260)] type=Q8_0 +blk.3.hc_ffn_norm.weight shape=[np.uint64(8192)] type=F32 +blk.3.indexer.k_norm.weight shape=[np.uint64(128)] type=F32 +blk.3.indexer.k_proj.weight shape=[np.uint64(2048), np.uint64(128)] type=BF16 +blk.3.indexer.q_norm.weight shape=[np.uint64(128)] type=F32 +blk.3.indexer.q_proj.weight shape=[np.uint64(2048), np.uint64(512)] type=BF16 +blk.30.ffn_gate_inp.weight shape=[np.uint64(2048), np.uint64(256)] type=F32 +blk.30.ffn_gate_inp_shexp.weight shape=[np.uint64(2048)] type=F32 +blk.30.hc_attn_down_inject.weight shape=[np.uint64(8192), np.uint64(260)] type=Q8_0 +blk.30.hc_attn_norm.weight shape=[np.uint64(8192)] type=F32 +blk.30.hc_ffn_down_inject.weight shape=[np.uint64(8192), np.uint64(260)] type=Q8_0 +blk.30.hc_ffn_norm.weight shape=[np.uint64(8192)] type=F32 +blk.30.ssm_a shape=[np.uint64(32)] type=F32 +blk.30.ssm_beta_alpha.weight shape=[np.uint64(2048), np.uint64(64)] type=Q8_0 +blk.30.ssm_conv1d.weight shape=[np.uint64(4), np.uint64(8192)] type=F32 +blk.30.ssm_dt.bias shape=[np.uint64(32)] type=F32 +blk.30.ssm_norm.weight shape=[np.uint64(128)] type=F32 +blk.31.attn_k_norm.weight shape=[np.uint64(256)] type=F32 +blk.31.attn_q_norm.weight shape=[np.uint64(256)] type=F32 +blk.31.ffn_gate_inp.weight shape=[np.uint64(2048), np.uint64(256)] type=F32 +blk.31.ffn_gate_inp_shexp.weight shape=[np.uint64(2048)] type=F32 +blk.31.hc_attn_down_inject.weight shape=[np.uint64(8192), np.uint64(260)] type=Q8_0 +blk.31.hc_attn_norm.weight shape=[np.uint64(8192)] type=F32 +blk.31.hc_ffn_down_inject.weight shape=[np.uint64(8192), np.uint64(260)] type=Q8_0 +blk.31.hc_ffn_norm.weight shape=[np.uint64(8192)] type=F32 +blk.31.indexer.k_norm.weight shape=[np.uint64(128)] type=F32 +blk.31.indexer.k_proj.weight shape=[np.uint64(2048), np.uint64(128)] type=BF16 +blk.31.indexer.q_norm.weight shape=[np.uint64(128)] type=F32 +blk.31.indexer.q_proj.weight shape=[np.uint64(2048), np.uint64(512)] type=BF16 +blk.32.ffn_gate_inp.weight shape=[np.uint64(2048), np.uint64(256)] type=F32 +blk.32.ffn_gate_inp_shexp.weight shape=[np.uint64(2048)] type=F32 +blk.32.hc_attn_down_inject.weight shape=[np.uint64(8192), np.uint64(260)] type=Q8_0 +blk.32.hc_attn_norm.weight shape=[np.uint64(8192)] type=F32 +blk.32.hc_ffn_down_inject.weight shape=[np.uint64(8192), np.uint64(260)] type=Q8_0 +blk.32.hc_ffn_norm.weight shape=[np.uint64(8192)] type=F32 +blk.32.ssm_a shape=[np.uint64(32)] type=F32 +blk.32.ssm_beta_alpha.weight shape=[np.uint64(2048), np.uint64(64)] type=Q8_0 +blk.32.ssm_conv1d.weight shape=[np.uint64(4), np.uint64(8192)] type=F32 +blk.32.ssm_dt.bias shape=[np.uint64(32)] type=F32 +blk.32.ssm_norm.weight shape=[np.uint64(128)] type=F32 +blk.33.ffn_gate_inp.weight shape=[np.uint64(2048), np.uint64(256)] type=F32 +blk.33.ffn_gate_inp_shexp.weight shape=[np.uint64(2048)] type=F32 +blk.33.hc_attn_down_inject.weight shape=[np.uint64(8192), np.uint64(260)] type=Q8_0 +blk.33.hc_attn_norm.weight shape=[np.uint64(8192)] type=F32 +blk.33.hc_ffn_down_inject.weight shape=[np.uint64(8192), np.uint64(260)] type=Q8_0 +blk.33.hc_ffn_norm.weight shape=[np.uint64(8192)] type=F32 +blk.33.ssm_a shape=[np.uint64(32)] type=F32 +blk.33.ssm_beta_alpha.weight shape=[np.uint64(2048), np.uint64(64)] type=Q8_0 +blk.33.ssm_conv1d.weight shape=[np.uint64(4), np.uint64(8192)] type=F32 +blk.33.ssm_dt.bias shape=[np.uint64(32)] type=F32 +blk.33.ssm_norm.weight shape=[np.uint64(128)] type=F32 +blk.34.ffn_gate_inp.weight shape=[np.uint64(2048), np.uint64(256)] type=F32 +blk.34.ffn_gate_inp_shexp.weight shape=[np.uint64(2048)] type=F32 +blk.34.hc_attn_down_inject.weight shape=[np.uint64(8192), np.uint64(260)] type=Q8_0 +blk.34.hc_attn_norm.weight shape=[np.uint64(8192)] type=F32 +blk.34.hc_ffn_down_inject.weight shape=[np.uint64(8192), np.uint64(260)] type=Q8_0 +blk.34.hc_ffn_norm.weight shape=[np.uint64(8192)] type=F32 +blk.34.ssm_a shape=[np.uint64(32)] type=F32 +blk.34.ssm_beta_alpha.weight shape=[np.uint64(2048), np.uint64(64)] type=Q8_0 +blk.34.ssm_conv1d.weight shape=[np.uint64(4), np.uint64(8192)] type=F32 +blk.34.ssm_dt.bias shape=[np.uint64(32)] type=F32 +blk.34.ssm_norm.weight shape=[np.uint64(128)] type=F32 +blk.35.attn_k_norm.weight shape=[np.uint64(256)] type=F32 +blk.35.attn_q_norm.weight shape=[np.uint64(256)] type=F32 +blk.35.ffn_gate_inp.weight shape=[np.uint64(2048), np.uint64(256)] type=F32 +blk.35.ffn_gate_inp_shexp.weight shape=[np.uint64(2048)] type=F32 +blk.35.hc_attn_down_inject.weight shape=[np.uint64(8192), np.uint64(260)] type=Q8_0 +blk.35.hc_attn_norm.weight shape=[np.uint64(8192)] type=F32 +blk.35.hc_ffn_down_inject.weight shape=[np.uint64(8192), np.uint64(260)] type=Q8_0 +blk.35.hc_ffn_norm.weight shape=[np.uint64(8192)] type=F32 +blk.35.indexer.k_norm.weight shape=[np.uint64(128)] type=F32 +blk.35.indexer.k_proj.weight shape=[np.uint64(2048), np.uint64(128)] type=BF16 +blk.35.indexer.q_norm.weight shape=[np.uint64(128)] type=F32 +blk.35.indexer.q_proj.weight shape=[np.uint64(2048), np.uint64(512)] type=BF16 +blk.36.ffn_gate_inp.weight shape=[np.uint64(2048), np.uint64(256)] type=F32 +blk.36.ffn_gate_inp_shexp.weight shape=[np.uint64(2048)] type=F32 +blk.36.hc_attn_down_inject.weight shape=[np.uint64(8192), np.uint64(260)] type=Q8_0 +blk.36.hc_attn_norm.weight shape=[np.uint64(8192)] type=F32 +blk.36.hc_ffn_down_inject.weight shape=[np.uint64(8192), np.uint64(260)] type=Q8_0 +blk.36.hc_ffn_norm.weight shape=[np.uint64(8192)] type=F32 +blk.36.ssm_a shape=[np.uint64(32)] type=F32 +blk.36.ssm_beta_alpha.weight shape=[np.uint64(2048), np.uint64(64)] type=Q8_0 +blk.36.ssm_conv1d.weight shape=[np.uint64(4), np.uint64(8192)] type=F32 +blk.36.ssm_dt.bias shape=[np.uint64(32)] type=F32 +blk.36.ssm_norm.weight shape=[np.uint64(128)] type=F32 +blk.37.ffn_gate_inp.weight shape=[np.uint64(2048), np.uint64(256)] type=F32 +blk.37.ffn_gate_inp_shexp.weight shape=[np.uint64(2048)] type=F32 +blk.37.hc_attn_down_inject.weight shape=[np.uint64(8192), np.uint64(260)] type=Q8_0 +blk.37.hc_attn_norm.weight shape=[np.uint64(8192)] type=F32 +blk.37.hc_ffn_down_inject.weight shape=[np.uint64(8192), np.uint64(260)] type=Q8_0 +blk.37.hc_ffn_norm.weight shape=[np.uint64(8192)] type=F32 +blk.37.ssm_a shape=[np.uint64(32)] type=F32 +blk.37.ssm_beta_alpha.weight shape=[np.uint64(2048), np.uint64(64)] type=Q8_0 +blk.37.ssm_conv1d.weight shape=[np.uint64(4), np.uint64(8192)] type=F32 +blk.37.ssm_dt.bias shape=[np.uint64(32)] type=F32 +blk.37.ssm_norm.weight shape=[np.uint64(128)] type=F32 +blk.38.ffn_gate_inp.weight shape=[np.uint64(2048), np.uint64(256)] type=F32 +blk.38.ffn_gate_inp_shexp.weight shape=[np.uint64(2048)] type=F32 +blk.38.hc_attn_down_inject.weight shape=[np.uint64(8192), np.uint64(260)] type=Q8_0 +blk.38.hc_attn_norm.weight shape=[np.uint64(8192)] type=F32 +blk.38.hc_ffn_down_inject.weight shape=[np.uint64(8192), np.uint64(260)] type=Q8_0 +blk.38.hc_ffn_norm.weight shape=[np.uint64(8192)] type=F32 +blk.38.ssm_a shape=[np.uint64(32)] type=F32 +blk.38.ssm_beta_alpha.weight shape=[np.uint64(2048), np.uint64(64)] type=Q8_0 +blk.38.ssm_conv1d.weight shape=[np.uint64(4), np.uint64(8192)] type=F32 +blk.38.ssm_dt.bias shape=[np.uint64(32)] type=F32 +blk.38.ssm_norm.weight shape=[np.uint64(128)] type=F32 +blk.39.attn_k_norm.weight shape=[np.uint64(256)] type=F32 +blk.39.attn_q_norm.weight shape=[np.uint64(256)] type=F32 +blk.39.ffn_gate_inp.weight shape=[np.uint64(2048), np.uint64(256)] type=F32 +blk.39.ffn_gate_inp_shexp.weight shape=[np.uint64(2048)] type=F32 +blk.39.hc_attn_down_inject.weight shape=[np.uint64(8192), np.uint64(260)] type=Q8_0 +blk.39.hc_attn_norm.weight shape=[np.uint64(8192)] type=F32 +blk.39.hc_ffn_down_inject.weight shape=[np.uint64(8192), np.uint64(260)] type=Q8_0 +blk.39.hc_ffn_norm.weight shape=[np.uint64(8192)] type=F32 +blk.39.indexer.k_norm.weight shape=[np.uint64(128)] type=F32 +blk.39.indexer.k_proj.weight shape=[np.uint64(2048), np.uint64(128)] type=BF16 +blk.39.indexer.q_norm.weight shape=[np.uint64(128)] type=F32 +blk.39.indexer.q_proj.weight shape=[np.uint64(2048), np.uint64(512)] type=BF16 +blk.4.ffn_gate_inp.weight shape=[np.uint64(2048), np.uint64(256)] type=F32 +blk.4.ffn_gate_inp_shexp.weight shape=[np.uint64(2048)] type=F32 +blk.4.hc_attn_down_inject.weight shape=[np.uint64(8192), np.uint64(260)] type=Q8_0 +blk.4.hc_attn_norm.weight shape=[np.uint64(8192)] type=F32 +blk.4.hc_ffn_down_inject.weight shape=[np.uint64(8192), np.uint64(260)] type=Q8_0 +blk.4.hc_ffn_norm.weight shape=[np.uint64(8192)] type=F32 +blk.4.ssm_a shape=[np.uint64(32)] type=F32 +blk.4.ssm_beta_alpha.weight shape=[np.uint64(2048), np.uint64(64)] type=Q8_0 +blk.4.ssm_conv1d.weight shape=[np.uint64(4), np.uint64(8192)] type=F32 +blk.4.ssm_dt.bias shape=[np.uint64(32)] type=F32 +blk.4.ssm_norm.weight shape=[np.uint64(128)] type=F32 +blk.5.ffn_gate_inp.weight shape=[np.uint64(2048), np.uint64(256)] type=F32 +blk.5.ffn_gate_inp_shexp.weight shape=[np.uint64(2048)] type=F32 +blk.5.hc_attn_down_inject.weight shape=[np.uint64(8192), np.uint64(260)] type=Q8_0 +blk.5.hc_attn_norm.weight shape=[np.uint64(8192)] type=F32 +blk.5.hc_ffn_down_inject.weight shape=[np.uint64(8192), np.uint64(260)] type=Q8_0 +blk.5.hc_ffn_norm.weight shape=[np.uint64(8192)] type=F32 +blk.5.ssm_a shape=[np.uint64(32)] type=F32 +blk.5.ssm_beta_alpha.weight shape=[np.uint64(2048), np.uint64(64)] type=Q8_0 +blk.5.ssm_conv1d.weight shape=[np.uint64(4), np.uint64(8192)] type=F32 +blk.5.ssm_dt.bias shape=[np.uint64(32)] type=F32 +blk.5.ssm_norm.weight shape=[np.uint64(128)] type=F32 +blk.6.ffn_gate_inp.weight shape=[np.uint64(2048), np.uint64(256)] type=F32 +blk.6.ffn_gate_inp_shexp.weight shape=[np.uint64(2048)] type=F32 +blk.6.hc_attn_down_inject.weight shape=[np.uint64(8192), np.uint64(260)] type=Q8_0 +blk.6.hc_attn_norm.weight shape=[np.uint64(8192)] type=F32 +blk.6.hc_ffn_down_inject.weight shape=[np.uint64(8192), np.uint64(260)] type=Q8_0 +blk.6.hc_ffn_norm.weight shape=[np.uint64(8192)] type=F32 +blk.6.ssm_a shape=[np.uint64(32)] type=F32 +blk.6.ssm_beta_alpha.weight shape=[np.uint64(2048), np.uint64(64)] type=Q8_0 +blk.6.ssm_conv1d.weight shape=[np.uint64(4), np.uint64(8192)] type=F32 +blk.6.ssm_dt.bias shape=[np.uint64(32)] type=F32 +blk.6.ssm_norm.weight shape=[np.uint64(128)] type=F32 +blk.7.attn_k_norm.weight shape=[np.uint64(256)] type=F32 +blk.7.attn_q_norm.weight shape=[np.uint64(256)] type=F32 +blk.7.ffn_gate_inp.weight shape=[np.uint64(2048), np.uint64(256)] type=F32 +blk.7.ffn_gate_inp_shexp.weight shape=[np.uint64(2048)] type=F32 +blk.7.hc_attn_down_inject.weight shape=[np.uint64(8192), np.uint64(260)] type=Q8_0 +blk.7.hc_attn_norm.weight shape=[np.uint64(8192)] type=F32 +blk.7.hc_ffn_down_inject.weight shape=[np.uint64(8192), np.uint64(260)] type=Q8_0 +blk.7.hc_ffn_norm.weight shape=[np.uint64(8192)] type=F32 +blk.7.indexer.k_norm.weight shape=[np.uint64(128)] type=F32 +blk.7.indexer.k_proj.weight shape=[np.uint64(2048), np.uint64(128)] type=BF16 +blk.7.indexer.q_norm.weight shape=[np.uint64(128)] type=F32 +blk.7.indexer.q_proj.weight shape=[np.uint64(2048), np.uint64(512)] type=BF16 +blk.8.ffn_gate_inp.weight shape=[np.uint64(2048), np.uint64(256)] type=F32 +blk.8.ffn_gate_inp_shexp.weight shape=[np.uint64(2048)] type=F32 +blk.8.hc_attn_down_inject.weight shape=[np.uint64(8192), np.uint64(260)] type=Q8_0 +blk.8.hc_attn_norm.weight shape=[np.uint64(8192)] type=F32 +blk.8.hc_ffn_down_inject.weight shape=[np.uint64(8192), np.uint64(260)] type=Q8_0 +blk.8.hc_ffn_norm.weight shape=[np.uint64(8192)] type=F32 +blk.8.ssm_a shape=[np.uint64(32)] type=F32 +blk.8.ssm_beta_alpha.weight shape=[np.uint64(2048), np.uint64(64)] type=Q8_0 +blk.8.ssm_conv1d.weight shape=[np.uint64(4), np.uint64(8192)] type=F32 +blk.8.ssm_dt.bias shape=[np.uint64(32)] type=F32 +blk.8.ssm_norm.weight shape=[np.uint64(128)] type=F32 +blk.9.ffn_gate_inp.weight shape=[np.uint64(2048), np.uint64(256)] type=F32 +blk.9.ffn_gate_inp_shexp.weight shape=[np.uint64(2048)] type=F32 +blk.9.hc_attn_down_inject.weight shape=[np.uint64(8192), np.uint64(260)] type=Q8_0 +blk.9.hc_attn_norm.weight shape=[np.uint64(8192)] type=F32 +blk.9.hc_ffn_down_inject.weight shape=[np.uint64(8192), np.uint64(260)] type=Q8_0 +blk.9.hc_ffn_norm.weight shape=[np.uint64(8192)] type=F32 +blk.9.ssm_a shape=[np.uint64(32)] type=F32 +blk.9.ssm_beta_alpha.weight shape=[np.uint64(2048), np.uint64(64)] type=Q8_0 +blk.9.ssm_conv1d.weight shape=[np.uint64(4), np.uint64(8192)] type=F32 +blk.9.ssm_dt.bias shape=[np.uint64(32)] type=F32 +blk.9.ssm_norm.weight shape=[np.uint64(128)] type=F32 +output_hc_down.weight shape=[np.uint64(8192), np.uint64(256)] type=Q8_0 +output_hc_norm.weight shape=[np.uint64(8192)] type=F32 +output_hc_up.weight shape=[np.uint64(256), np.uint64(8192)] type=Q8_0 +blk.0.ffn_gate_exps.weight shape=[np.uint64(2048), np.uint64(512), np.uint64(256)] type=Q5_K +blk.0.ffn_up_exps.weight shape=[np.uint64(2048), np.uint64(512), np.uint64(256)] type=Q5_K +blk.1.ffn_gate_exps.weight shape=[np.uint64(2048), np.uint64(512), np.uint64(256)] type=Q5_K +blk.1.ffn_up_exps.weight shape=[np.uint64(2048), np.uint64(512), np.uint64(256)] type=Q5_K +blk.2.ffn_gate_exps.weight shape=[np.uint64(2048), np.uint64(512), np.uint64(256)] type=Q5_K +blk.2.ffn_up_exps.weight shape=[np.uint64(2048), np.uint64(512), np.uint64(256)] type=Q5_K +blk.3.ffn_gate_exps.weight shape=[np.uint64(2048), np.uint64(512), np.uint64(256)] type=Q5_K +blk.3.ffn_up_exps.weight shape=[np.uint64(2048), np.uint64(512), np.uint64(256)] type=Q5_K +blk.4.ffn_gate_exps.weight shape=[np.uint64(2048), np.uint64(512), np.uint64(256)] type=Q5_K +blk.4.ffn_up_exps.weight shape=[np.uint64(2048), np.uint64(512), np.uint64(256)] type=Q5_K +blk.5.ffn_gate_exps.weight shape=[np.uint64(2048), np.uint64(512), np.uint64(256)] type=Q5_K +blk.5.ffn_up_exps.weight shape=[np.uint64(2048), np.uint64(512), np.uint64(256)] type=Q5_K +blk.6.ffn_gate_exps.weight shape=[np.uint64(2048), np.uint64(512), np.uint64(256)] type=Q5_K +blk.6.ffn_up_exps.weight shape=[np.uint64(2048), np.uint64(512), np.uint64(256)] type=Q5_K +blk.7.ffn_gate_exps.weight shape=[np.uint64(2048), np.uint64(512), np.uint64(256)] type=Q5_K +blk.7.ffn_up_exps.weight shape=[np.uint64(2048), np.uint64(512), np.uint64(256)] type=Q5_K +blk.10.ffn_gate_exps.weight shape=[np.uint64(2048), np.uint64(512), np.uint64(256)] type=Q5_K +blk.10.ffn_up_exps.weight shape=[np.uint64(2048), np.uint64(512), np.uint64(256)] type=Q5_K +blk.11.ffn_gate_exps.weight shape=[np.uint64(2048), np.uint64(512), np.uint64(256)] type=Q5_K +blk.11.ffn_up_exps.weight shape=[np.uint64(2048), np.uint64(512), np.uint64(256)] type=Q5_K +blk.12.ffn_gate_exps.weight shape=[np.uint64(2048), np.uint64(512), np.uint64(256)] type=Q5_K +blk.12.ffn_up_exps.weight shape=[np.uint64(2048), np.uint64(512), np.uint64(256)] type=Q5_K +blk.13.ffn_gate_exps.weight shape=[np.uint64(2048), np.uint64(512), np.uint64(256)] type=Q5_K +blk.13.ffn_up_exps.weight shape=[np.uint64(2048), np.uint64(512), np.uint64(256)] type=Q5_K +blk.14.ffn_gate_exps.weight shape=[np.uint64(2048), np.uint64(512), np.uint64(256)] type=Q5_K +blk.14.ffn_up_exps.weight shape=[np.uint64(2048), np.uint64(512), np.uint64(256)] type=Q5_K +blk.15.ffn_gate_exps.weight shape=[np.uint64(2048), np.uint64(512), np.uint64(256)] type=Q5_K +blk.15.ffn_up_exps.weight shape=[np.uint64(2048), np.uint64(512), np.uint64(256)] type=Q5_K +blk.8.ffn_gate_exps.weight shape=[np.uint64(2048), np.uint64(512), np.uint64(256)] type=Q5_K +blk.8.ffn_up_exps.weight shape=[np.uint64(2048), np.uint64(512), np.uint64(256)] type=Q5_K +blk.9.ffn_gate_exps.weight shape=[np.uint64(2048), np.uint64(512), np.uint64(256)] type=Q5_K +blk.9.ffn_up_exps.weight shape=[np.uint64(2048), np.uint64(512), np.uint64(256)] type=Q5_K +blk.16.ffn_gate_exps.weight shape=[np.uint64(2048), np.uint64(512), np.uint64(256)] type=Q5_K +blk.16.ffn_up_exps.weight shape=[np.uint64(2048), np.uint64(512), np.uint64(256)] type=Q5_K +blk.17.ffn_gate_exps.weight shape=[np.uint64(2048), np.uint64(512), np.uint64(256)] type=Q5_K +blk.17.ffn_up_exps.weight shape=[np.uint64(2048), np.uint64(512), np.uint64(256)] type=Q5_K +blk.18.ffn_gate_exps.weight shape=[np.uint64(2048), np.uint64(512), np.uint64(256)] type=Q5_K +blk.18.ffn_up_exps.weight shape=[np.uint64(2048), np.uint64(512), np.uint64(256)] type=Q5_K +blk.19.ffn_gate_exps.weight shape=[np.uint64(2048), np.uint64(512), np.uint64(256)] type=Q5_K +blk.19.ffn_up_exps.weight shape=[np.uint64(2048), np.uint64(512), np.uint64(256)] type=Q5_K +blk.20.ffn_gate_exps.weight shape=[np.uint64(2048), np.uint64(512), np.uint64(256)] type=Q5_K +blk.20.ffn_up_exps.weight shape=[np.uint64(2048), np.uint64(512), np.uint64(256)] type=Q5_K +blk.21.ffn_gate_exps.weight shape=[np.uint64(2048), np.uint64(512), np.uint64(256)] type=Q5_K +blk.21.ffn_up_exps.weight shape=[np.uint64(2048), np.uint64(512), np.uint64(256)] type=Q5_K +blk.22.ffn_gate_exps.weight shape=[np.uint64(2048), np.uint64(512), np.uint64(256)] type=Q5_K +blk.22.ffn_up_exps.weight shape=[np.uint64(2048), np.uint64(512), np.uint64(256)] type=Q5_K +blk.23.ffn_gate_exps.weight shape=[np.uint64(2048), np.uint64(512), np.uint64(256)] type=Q5_K +blk.23.ffn_up_exps.weight shape=[np.uint64(2048), np.uint64(512), np.uint64(256)] type=Q5_K +blk.24.ffn_gate_exps.weight shape=[np.uint64(2048), np.uint64(512), np.uint64(256)] type=Q5_K +blk.24.ffn_up_exps.weight shape=[np.uint64(2048), np.uint64(512), np.uint64(256)] type=Q5_K +blk.25.ffn_gate_exps.weight shape=[np.uint64(2048), np.uint64(512), np.uint64(256)] type=Q5_K +blk.25.ffn_up_exps.weight shape=[np.uint64(2048), np.uint64(512), np.uint64(256)] type=Q5_K +blk.26.ffn_gate_exps.weight shape=[np.uint64(2048), np.uint64(512), np.uint64(256)] type=Q5_K +blk.26.ffn_up_exps.weight shape=[np.uint64(2048), np.uint64(512), np.uint64(256)] type=Q5_K +blk.27.ffn_gate_exps.weight shape=[np.uint64(2048), np.uint64(512), np.uint64(256)] type=Q5_K +blk.27.ffn_up_exps.weight shape=[np.uint64(2048), np.uint64(512), np.uint64(256)] type=Q5_K +blk.28.ffn_gate_exps.weight shape=[np.uint64(2048), np.uint64(512), np.uint64(256)] type=Q5_K +blk.28.ffn_up_exps.weight shape=[np.uint64(2048), np.uint64(512), np.uint64(256)] type=Q5_K +blk.29.ffn_gate_exps.weight shape=[np.uint64(2048), np.uint64(512), np.uint64(256)] type=Q5_K +blk.29.ffn_up_exps.weight shape=[np.uint64(2048), np.uint64(512), np.uint64(256)] type=Q5_K +blk.30.ffn_gate_exps.weight shape=[np.uint64(2048), np.uint64(512), np.uint64(256)] type=Q5_K +blk.30.ffn_up_exps.weight shape=[np.uint64(2048), np.uint64(512), np.uint64(256)] type=Q5_K +blk.31.ffn_gate_exps.weight shape=[np.uint64(2048), np.uint64(512), np.uint64(256)] type=Q5_K +blk.31.ffn_up_exps.weight shape=[np.uint64(2048), np.uint64(512), np.uint64(256)] type=Q5_K +blk.32.ffn_gate_exps.weight shape=[np.uint64(2048), np.uint64(512), np.uint64(256)] type=Q5_K +blk.32.ffn_up_exps.weight shape=[np.uint64(2048), np.uint64(512), np.uint64(256)] type=Q5_K +blk.33.ffn_gate_exps.weight shape=[np.uint64(2048), np.uint64(512), np.uint64(256)] type=Q5_K +blk.33.ffn_up_exps.weight shape=[np.uint64(2048), np.uint64(512), np.uint64(256)] type=Q5_K +blk.34.ffn_gate_exps.weight shape=[np.uint64(2048), np.uint64(512), np.uint64(256)] type=Q5_K +blk.34.ffn_up_exps.weight shape=[np.uint64(2048), np.uint64(512), np.uint64(256)] type=Q5_K +blk.35.ffn_gate_exps.weight shape=[np.uint64(2048), np.uint64(512), np.uint64(256)] type=Q5_K +blk.35.ffn_up_exps.weight shape=[np.uint64(2048), np.uint64(512), np.uint64(256)] type=Q5_K +blk.36.ffn_gate_exps.weight shape=[np.uint64(2048), np.uint64(512), np.uint64(256)] type=Q5_K +blk.36.ffn_up_exps.weight shape=[np.uint64(2048), np.uint64(512), np.uint64(256)] type=Q5_K +blk.37.ffn_gate_exps.weight shape=[np.uint64(2048), np.uint64(512), np.uint64(256)] type=Q5_K +blk.37.ffn_up_exps.weight shape=[np.uint64(2048), np.uint64(512), np.uint64(256)] type=Q5_K +blk.38.ffn_gate_exps.weight shape=[np.uint64(2048), np.uint64(512), np.uint64(256)] type=Q5_K +blk.38.ffn_up_exps.weight shape=[np.uint64(2048), np.uint64(512), np.uint64(256)] type=Q5_K +blk.39.ffn_gate_exps.weight shape=[np.uint64(2048), np.uint64(512), np.uint64(256)] type=Q5_K +blk.39.ffn_up_exps.weight shape=[np.uint64(2048), np.uint64(512), np.uint64(256)] type=Q5_K +blk.0.ffn_down_exps.weight shape=[np.uint64(512), np.uint64(2048), np.uint64(256)] type=Q6_K +blk.1.ffn_down_exps.weight shape=[np.uint64(512), np.uint64(2048), np.uint64(256)] type=Q6_K +blk.2.ffn_down_exps.weight shape=[np.uint64(512), np.uint64(2048), np.uint64(256)] type=Q6_K +blk.3.ffn_down_exps.weight shape=[np.uint64(512), np.uint64(2048), np.uint64(256)] type=Q6_K +blk.4.ffn_down_exps.weight shape=[np.uint64(512), np.uint64(2048), np.uint64(256)] type=Q6_K +blk.5.ffn_down_exps.weight shape=[np.uint64(512), np.uint64(2048), np.uint64(256)] type=Q6_K +blk.6.ffn_down_exps.weight shape=[np.uint64(512), np.uint64(2048), np.uint64(256)] type=Q6_K +blk.7.ffn_down_exps.weight shape=[np.uint64(512), np.uint64(2048), np.uint64(256)] type=Q6_K +blk.10.ffn_down_exps.weight shape=[np.uint64(512), np.uint64(2048), np.uint64(256)] type=Q6_K +blk.11.ffn_down_exps.weight shape=[np.uint64(512), np.uint64(2048), np.uint64(256)] type=Q6_K +blk.12.ffn_down_exps.weight shape=[np.uint64(512), np.uint64(2048), np.uint64(256)] type=Q6_K +blk.13.ffn_down_exps.weight shape=[np.uint64(512), np.uint64(2048), np.uint64(256)] type=Q6_K +blk.14.ffn_down_exps.weight shape=[np.uint64(512), np.uint64(2048), np.uint64(256)] type=Q6_K +blk.15.ffn_down_exps.weight shape=[np.uint64(512), np.uint64(2048), np.uint64(256)] type=Q6_K +blk.8.ffn_down_exps.weight shape=[np.uint64(512), np.uint64(2048), np.uint64(256)] type=Q6_K +blk.9.ffn_down_exps.weight shape=[np.uint64(512), np.uint64(2048), np.uint64(256)] type=Q6_K +blk.16.ffn_down_exps.weight shape=[np.uint64(512), np.uint64(2048), np.uint64(256)] type=Q6_K +blk.17.ffn_down_exps.weight shape=[np.uint64(512), np.uint64(2048), np.uint64(256)] type=Q6_K +blk.18.ffn_down_exps.weight shape=[np.uint64(512), np.uint64(2048), np.uint64(256)] type=Q6_K +blk.19.ffn_down_exps.weight shape=[np.uint64(512), np.uint64(2048), np.uint64(256)] type=Q6_K +blk.20.ffn_down_exps.weight shape=[np.uint64(512), np.uint64(2048), np.uint64(256)] type=Q6_K +blk.21.ffn_down_exps.weight shape=[np.uint64(512), np.uint64(2048), np.uint64(256)] type=Q6_K +blk.22.ffn_down_exps.weight shape=[np.uint64(512), np.uint64(2048), np.uint64(256)] type=Q6_K +blk.23.ffn_down_exps.weight shape=[np.uint64(512), np.uint64(2048), np.uint64(256)] type=Q6_K +blk.24.ffn_down_exps.weight shape=[np.uint64(512), np.uint64(2048), np.uint64(256)] type=Q6_K +blk.25.ffn_down_exps.weight shape=[np.uint64(512), np.uint64(2048), np.uint64(256)] type=Q6_K +blk.26.ffn_down_exps.weight shape=[np.uint64(512), np.uint64(2048), np.uint64(256)] type=Q6_K +blk.27.ffn_down_exps.weight shape=[np.uint64(512), np.uint64(2048), np.uint64(256)] type=Q6_K +blk.28.ffn_down_exps.weight shape=[np.uint64(512), np.uint64(2048), np.uint64(256)] type=Q6_K +blk.29.ffn_down_exps.weight shape=[np.uint64(512), np.uint64(2048), np.uint64(256)] type=Q6_K +blk.30.ffn_down_exps.weight shape=[np.uint64(512), np.uint64(2048), np.uint64(256)] type=Q6_K +blk.31.ffn_down_exps.weight shape=[np.uint64(512), np.uint64(2048), np.uint64(256)] type=Q6_K +blk.32.ffn_down_exps.weight shape=[np.uint64(512), np.uint64(2048), np.uint64(256)] type=Q6_K +blk.33.ffn_down_exps.weight shape=[np.uint64(512), np.uint64(2048), np.uint64(256)] type=Q6_K +blk.34.ffn_down_exps.weight shape=[np.uint64(512), np.uint64(2048), np.uint64(256)] type=Q6_K +blk.35.ffn_down_exps.weight shape=[np.uint64(512), np.uint64(2048), np.uint64(256)] type=Q6_K +blk.36.ffn_down_exps.weight shape=[np.uint64(512), np.uint64(2048), np.uint64(256)] type=Q6_K +blk.37.ffn_down_exps.weight shape=[np.uint64(512), np.uint64(2048), np.uint64(256)] type=Q6_K +blk.38.ffn_down_exps.weight shape=[np.uint64(512), np.uint64(2048), np.uint64(256)] type=Q6_K +blk.39.ffn_down_exps.weight shape=[np.uint64(512), np.uint64(2048), np.uint64(256)] type=Q6_K +blk.0.ffn_down_shexp.weight shape=[np.uint64(512), np.uint64(2048)] type=Q8_0 +blk.0.ffn_gate_shexp.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 +blk.0.ffn_up_shexp.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 +blk.1.ffn_down_shexp.weight shape=[np.uint64(512), np.uint64(2048)] type=Q8_0 +blk.1.ffn_gate_shexp.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 +blk.1.ffn_up_shexp.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 +blk.10.ffn_down_shexp.weight shape=[np.uint64(512), np.uint64(2048)] type=Q8_0 +blk.10.ffn_gate_shexp.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 +blk.10.ffn_up_shexp.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 +blk.11.ffn_down_shexp.weight shape=[np.uint64(512), np.uint64(2048)] type=Q8_0 +blk.11.ffn_gate_shexp.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 +blk.11.ffn_up_shexp.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 +blk.12.ffn_down_shexp.weight shape=[np.uint64(512), np.uint64(2048)] type=Q8_0 +blk.12.ffn_gate_shexp.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 +blk.12.ffn_up_shexp.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 +blk.13.ffn_down_shexp.weight shape=[np.uint64(512), np.uint64(2048)] type=Q8_0 +blk.13.ffn_gate_shexp.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 +blk.13.ffn_up_shexp.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 +blk.14.ffn_down_shexp.weight shape=[np.uint64(512), np.uint64(2048)] type=Q8_0 +blk.14.ffn_gate_shexp.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 +blk.14.ffn_up_shexp.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 +blk.15.ffn_down_shexp.weight shape=[np.uint64(512), np.uint64(2048)] type=Q8_0 +blk.15.ffn_gate_shexp.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 +blk.15.ffn_up_shexp.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 +blk.16.ffn_down_shexp.weight shape=[np.uint64(512), np.uint64(2048)] type=Q8_0 +blk.16.ffn_gate_shexp.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 +blk.16.ffn_up_shexp.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 +blk.17.ffn_down_shexp.weight shape=[np.uint64(512), np.uint64(2048)] type=Q8_0 +blk.17.ffn_gate_shexp.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 +blk.17.ffn_up_shexp.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 +blk.18.ffn_down_shexp.weight shape=[np.uint64(512), np.uint64(2048)] type=Q8_0 +blk.18.ffn_gate_shexp.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 +blk.18.ffn_up_shexp.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 +blk.19.ffn_down_shexp.weight shape=[np.uint64(512), np.uint64(2048)] type=Q8_0 +blk.19.ffn_gate_shexp.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 +blk.19.ffn_up_shexp.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 +blk.2.ffn_down_shexp.weight shape=[np.uint64(512), np.uint64(2048)] type=Q8_0 +blk.2.ffn_gate_shexp.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 +blk.2.ffn_up_shexp.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 +blk.20.ffn_down_shexp.weight shape=[np.uint64(512), np.uint64(2048)] type=Q8_0 +blk.20.ffn_gate_shexp.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 +blk.20.ffn_up_shexp.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 +blk.21.ffn_down_shexp.weight shape=[np.uint64(512), np.uint64(2048)] type=Q8_0 +blk.21.ffn_gate_shexp.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 +blk.21.ffn_up_shexp.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 +blk.22.ffn_down_shexp.weight shape=[np.uint64(512), np.uint64(2048)] type=Q8_0 +blk.22.ffn_gate_shexp.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 +blk.22.ffn_up_shexp.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 +blk.23.ffn_down_shexp.weight shape=[np.uint64(512), np.uint64(2048)] type=Q8_0 +blk.23.ffn_gate_shexp.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 +blk.23.ffn_up_shexp.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 +blk.24.ffn_down_shexp.weight shape=[np.uint64(512), np.uint64(2048)] type=Q8_0 +blk.24.ffn_gate_shexp.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 +blk.24.ffn_up_shexp.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 +blk.25.ffn_down_shexp.weight shape=[np.uint64(512), np.uint64(2048)] type=Q8_0 +blk.25.ffn_gate_shexp.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 +blk.25.ffn_up_shexp.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 +blk.26.ffn_down_shexp.weight shape=[np.uint64(512), np.uint64(2048)] type=Q8_0 +blk.26.ffn_gate_shexp.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 +blk.26.ffn_up_shexp.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 +blk.27.ffn_down_shexp.weight shape=[np.uint64(512), np.uint64(2048)] type=Q8_0 +blk.27.ffn_gate_shexp.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 +blk.27.ffn_up_shexp.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 +blk.28.ffn_down_shexp.weight shape=[np.uint64(512), np.uint64(2048)] type=Q8_0 +blk.28.ffn_gate_shexp.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 +blk.28.ffn_up_shexp.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 +blk.29.ffn_down_shexp.weight shape=[np.uint64(512), np.uint64(2048)] type=Q8_0 +blk.29.ffn_gate_shexp.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 +blk.29.ffn_up_shexp.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 +blk.3.ffn_down_shexp.weight shape=[np.uint64(512), np.uint64(2048)] type=Q8_0 +blk.3.ffn_gate_shexp.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 +blk.3.ffn_up_shexp.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 +blk.30.ffn_down_shexp.weight shape=[np.uint64(512), np.uint64(2048)] type=Q8_0 +blk.30.ffn_gate_shexp.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 +blk.30.ffn_up_shexp.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 +blk.31.ffn_down_shexp.weight shape=[np.uint64(512), np.uint64(2048)] type=Q8_0 +blk.31.ffn_gate_shexp.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 +blk.31.ffn_up_shexp.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 +blk.32.ffn_down_shexp.weight shape=[np.uint64(512), np.uint64(2048)] type=Q8_0 +blk.32.ffn_gate_shexp.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 +blk.32.ffn_up_shexp.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 +blk.33.ffn_down_shexp.weight shape=[np.uint64(512), np.uint64(2048)] type=Q8_0 +blk.33.ffn_gate_shexp.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 +blk.33.ffn_up_shexp.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 +blk.34.ffn_down_shexp.weight shape=[np.uint64(512), np.uint64(2048)] type=Q8_0 +blk.34.ffn_gate_shexp.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 +blk.34.ffn_up_shexp.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 +blk.35.ffn_down_shexp.weight shape=[np.uint64(512), np.uint64(2048)] type=Q8_0 +blk.35.ffn_gate_shexp.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 +blk.35.ffn_up_shexp.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 +blk.36.ffn_down_shexp.weight shape=[np.uint64(512), np.uint64(2048)] type=Q8_0 +blk.36.ffn_gate_shexp.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 +blk.36.ffn_up_shexp.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 +blk.37.ffn_down_shexp.weight shape=[np.uint64(512), np.uint64(2048)] type=Q8_0 +blk.37.ffn_gate_shexp.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 +blk.37.ffn_up_shexp.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 +blk.38.ffn_down_shexp.weight shape=[np.uint64(512), np.uint64(2048)] type=Q8_0 +blk.38.ffn_gate_shexp.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 +blk.38.ffn_up_shexp.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 +blk.39.ffn_down_shexp.weight shape=[np.uint64(512), np.uint64(2048)] type=Q8_0 +blk.39.ffn_gate_shexp.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 +blk.39.ffn_up_shexp.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 +blk.4.ffn_down_shexp.weight shape=[np.uint64(512), np.uint64(2048)] type=Q8_0 +blk.4.ffn_gate_shexp.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 +blk.4.ffn_up_shexp.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 +blk.5.ffn_down_shexp.weight shape=[np.uint64(512), np.uint64(2048)] type=Q8_0 +blk.5.ffn_gate_shexp.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 +blk.5.ffn_up_shexp.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 +blk.6.ffn_down_shexp.weight shape=[np.uint64(512), np.uint64(2048)] type=Q8_0 +blk.6.ffn_gate_shexp.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 +blk.6.ffn_up_shexp.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 +blk.7.ffn_down_shexp.weight shape=[np.uint64(512), np.uint64(2048)] type=Q8_0 +blk.7.ffn_gate_shexp.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 +blk.7.ffn_up_shexp.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 +blk.8.ffn_down_shexp.weight shape=[np.uint64(512), np.uint64(2048)] type=Q8_0 +blk.8.ffn_gate_shexp.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 +blk.8.ffn_up_shexp.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 +blk.9.ffn_down_shexp.weight shape=[np.uint64(512), np.uint64(2048)] type=Q8_0 +blk.9.ffn_gate_shexp.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 +blk.9.ffn_up_shexp.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 +blk.0.attn_qkv_gate.weight shape=[np.uint64(2048), np.uint64(12288)] type=Q6_K +blk.1.attn_qkv_gate.weight shape=[np.uint64(2048), np.uint64(12288)] type=Q6_K +blk.10.attn_qkv_gate.weight shape=[np.uint64(2048), np.uint64(12288)] type=Q6_K +blk.12.attn_qkv_gate.weight shape=[np.uint64(2048), np.uint64(12288)] type=Q6_K +blk.13.attn_qkv_gate.weight shape=[np.uint64(2048), np.uint64(12288)] type=Q6_K +blk.14.attn_qkv_gate.weight shape=[np.uint64(2048), np.uint64(12288)] type=Q6_K +blk.16.attn_qkv_gate.weight shape=[np.uint64(2048), np.uint64(12288)] type=Q6_K +blk.17.attn_qkv_gate.weight shape=[np.uint64(2048), np.uint64(12288)] type=Q6_K +blk.18.attn_qkv_gate.weight shape=[np.uint64(2048), np.uint64(12288)] type=Q6_K +blk.2.attn_qkv_gate.weight shape=[np.uint64(2048), np.uint64(12288)] type=Q6_K +blk.20.attn_qkv_gate.weight shape=[np.uint64(2048), np.uint64(12288)] type=Q6_K +blk.21.attn_qkv_gate.weight shape=[np.uint64(2048), np.uint64(12288)] type=Q6_K +blk.22.attn_qkv_gate.weight shape=[np.uint64(2048), np.uint64(12288)] type=Q6_K +blk.24.attn_qkv_gate.weight shape=[np.uint64(2048), np.uint64(12288)] type=Q6_K +blk.25.attn_qkv_gate.weight shape=[np.uint64(2048), np.uint64(12288)] type=Q6_K +blk.26.attn_qkv_gate.weight shape=[np.uint64(2048), np.uint64(12288)] type=Q6_K +blk.28.attn_qkv_gate.weight shape=[np.uint64(2048), np.uint64(12288)] type=Q6_K +blk.29.attn_qkv_gate.weight shape=[np.uint64(2048), np.uint64(12288)] type=Q6_K +blk.30.attn_qkv_gate.weight shape=[np.uint64(2048), np.uint64(12288)] type=Q6_K +blk.32.attn_qkv_gate.weight shape=[np.uint64(2048), np.uint64(12288)] type=Q6_K +blk.33.attn_qkv_gate.weight shape=[np.uint64(2048), np.uint64(12288)] type=Q6_K +blk.34.attn_qkv_gate.weight shape=[np.uint64(2048), np.uint64(12288)] type=Q6_K +blk.36.attn_qkv_gate.weight shape=[np.uint64(2048), np.uint64(12288)] type=Q6_K +blk.37.attn_qkv_gate.weight shape=[np.uint64(2048), np.uint64(12288)] type=Q6_K +blk.38.attn_qkv_gate.weight shape=[np.uint64(2048), np.uint64(12288)] type=Q6_K +blk.4.attn_qkv_gate.weight shape=[np.uint64(2048), np.uint64(12288)] type=Q6_K +blk.5.attn_qkv_gate.weight shape=[np.uint64(2048), np.uint64(12288)] type=Q6_K +blk.6.attn_qkv_gate.weight shape=[np.uint64(2048), np.uint64(12288)] type=Q6_K +blk.8.attn_qkv_gate.weight shape=[np.uint64(2048), np.uint64(12288)] type=Q6_K +blk.9.attn_qkv_gate.weight shape=[np.uint64(2048), np.uint64(12288)] type=Q6_K +blk.0.ssm_out.weight shape=[np.uint64(4096), np.uint64(2048)] type=Q8_0 +blk.1.ssm_out.weight shape=[np.uint64(4096), np.uint64(2048)] type=Q8_0 +blk.10.ssm_out.weight shape=[np.uint64(4096), np.uint64(2048)] type=Q8_0 +blk.12.ssm_out.weight shape=[np.uint64(4096), np.uint64(2048)] type=Q8_0 +blk.13.ssm_out.weight shape=[np.uint64(4096), np.uint64(2048)] type=Q8_0 +blk.14.ssm_out.weight shape=[np.uint64(4096), np.uint64(2048)] type=Q8_0 +blk.16.ssm_out.weight shape=[np.uint64(4096), np.uint64(2048)] type=Q8_0 +blk.17.ssm_out.weight shape=[np.uint64(4096), np.uint64(2048)] type=Q8_0 +blk.18.ssm_out.weight shape=[np.uint64(4096), np.uint64(2048)] type=Q8_0 +blk.2.ssm_out.weight shape=[np.uint64(4096), np.uint64(2048)] type=Q8_0 +blk.20.ssm_out.weight shape=[np.uint64(4096), np.uint64(2048)] type=Q8_0 +blk.21.ssm_out.weight shape=[np.uint64(4096), np.uint64(2048)] type=Q8_0 +blk.22.ssm_out.weight shape=[np.uint64(4096), np.uint64(2048)] type=Q8_0 +blk.24.ssm_out.weight shape=[np.uint64(4096), np.uint64(2048)] type=Q8_0 +blk.25.ssm_out.weight shape=[np.uint64(4096), np.uint64(2048)] type=Q8_0 +blk.26.ssm_out.weight shape=[np.uint64(4096), np.uint64(2048)] type=Q8_0 +blk.28.ssm_out.weight shape=[np.uint64(4096), np.uint64(2048)] type=Q8_0 +blk.29.ssm_out.weight shape=[np.uint64(4096), np.uint64(2048)] type=Q8_0 +blk.30.ssm_out.weight shape=[np.uint64(4096), np.uint64(2048)] type=Q8_0 +blk.32.ssm_out.weight shape=[np.uint64(4096), np.uint64(2048)] type=Q8_0 +blk.33.ssm_out.weight shape=[np.uint64(4096), np.uint64(2048)] type=Q8_0 +blk.34.ssm_out.weight shape=[np.uint64(4096), np.uint64(2048)] type=Q8_0 +blk.36.ssm_out.weight shape=[np.uint64(4096), np.uint64(2048)] type=Q8_0 +blk.37.ssm_out.weight shape=[np.uint64(4096), np.uint64(2048)] type=Q8_0 +blk.38.ssm_out.weight shape=[np.uint64(4096), np.uint64(2048)] type=Q8_0 +blk.4.ssm_out.weight shape=[np.uint64(4096), np.uint64(2048)] type=Q8_0 +blk.5.ssm_out.weight shape=[np.uint64(4096), np.uint64(2048)] type=Q8_0 +blk.6.ssm_out.weight shape=[np.uint64(4096), np.uint64(2048)] type=Q8_0 +blk.8.ssm_out.weight shape=[np.uint64(4096), np.uint64(2048)] type=Q8_0 +blk.9.ssm_out.weight shape=[np.uint64(4096), np.uint64(2048)] type=Q8_0 +blk.11.attn_k.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 +blk.11.attn_output.weight shape=[np.uint64(4096), np.uint64(2048)] type=Q8_0 +blk.11.attn_q.weight shape=[np.uint64(2048), np.uint64(8192)] type=Q8_0 +blk.11.attn_v.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 +blk.15.attn_k.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 +blk.15.attn_output.weight shape=[np.uint64(4096), np.uint64(2048)] type=Q8_0 +blk.15.attn_q.weight shape=[np.uint64(2048), np.uint64(8192)] type=Q8_0 +blk.15.attn_v.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 +blk.19.attn_k.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 +blk.19.attn_output.weight shape=[np.uint64(4096), np.uint64(2048)] type=Q8_0 +blk.19.attn_q.weight shape=[np.uint64(2048), np.uint64(8192)] type=Q8_0 +blk.19.attn_v.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 +blk.23.attn_k.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 +blk.23.attn_output.weight shape=[np.uint64(4096), np.uint64(2048)] type=Q8_0 +blk.23.attn_q.weight shape=[np.uint64(2048), np.uint64(8192)] type=Q8_0 +blk.23.attn_v.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 +blk.27.attn_k.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 +blk.27.attn_output.weight shape=[np.uint64(4096), np.uint64(2048)] type=Q8_0 +blk.27.attn_q.weight shape=[np.uint64(2048), np.uint64(8192)] type=Q8_0 +blk.27.attn_v.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 +blk.3.attn_k.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 +blk.3.attn_output.weight shape=[np.uint64(4096), np.uint64(2048)] type=Q8_0 +blk.3.attn_q.weight shape=[np.uint64(2048), np.uint64(8192)] type=Q8_0 +blk.3.attn_v.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 +blk.31.attn_k.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 +blk.31.attn_output.weight shape=[np.uint64(4096), np.uint64(2048)] type=Q8_0 +blk.31.attn_q.weight shape=[np.uint64(2048), np.uint64(8192)] type=Q8_0 +blk.31.attn_v.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 +blk.35.attn_k.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 +blk.35.attn_output.weight shape=[np.uint64(4096), np.uint64(2048)] type=Q8_0 +blk.35.attn_q.weight shape=[np.uint64(2048), np.uint64(8192)] type=Q8_0 +blk.35.attn_v.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 +blk.39.attn_k.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 +blk.39.attn_output.weight shape=[np.uint64(4096), np.uint64(2048)] type=Q8_0 +blk.39.attn_q.weight shape=[np.uint64(2048), np.uint64(8192)] type=Q8_0 +blk.39.attn_v.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 +blk.7.attn_k.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 +blk.7.attn_output.weight shape=[np.uint64(4096), np.uint64(2048)] type=Q8_0 +blk.7.attn_q.weight shape=[np.uint64(2048), np.uint64(8192)] type=Q8_0 +blk.7.attn_v.weight shape=[np.uint64(2048), np.uint64(512)] type=Q8_0 +blk.0.hc_attn_up.weight shape=[np.uint64(256), np.uint64(8192)] type=Q8_0 +blk.0.hc_ffn_up.weight shape=[np.uint64(256), np.uint64(8192)] type=Q8_0 +blk.1.hc_attn_up.weight shape=[np.uint64(256), np.uint64(8192)] type=Q8_0 +blk.1.hc_ffn_up.weight shape=[np.uint64(256), np.uint64(8192)] type=Q8_0 +blk.10.hc_attn_up.weight shape=[np.uint64(256), np.uint64(8192)] type=Q8_0 +blk.10.hc_ffn_up.weight shape=[np.uint64(256), np.uint64(8192)] type=Q8_0 +blk.11.hc_attn_up.weight shape=[np.uint64(256), np.uint64(8192)] type=Q8_0 +blk.11.hc_ffn_up.weight shape=[np.uint64(256), np.uint64(8192)] type=Q8_0 +blk.12.hc_attn_up.weight shape=[np.uint64(256), np.uint64(8192)] type=Q8_0 +blk.12.hc_ffn_up.weight shape=[np.uint64(256), np.uint64(8192)] type=Q8_0 +blk.13.hc_attn_up.weight shape=[np.uint64(256), np.uint64(8192)] type=Q8_0 +blk.13.hc_ffn_up.weight shape=[np.uint64(256), np.uint64(8192)] type=Q8_0 +blk.14.hc_attn_up.weight shape=[np.uint64(256), np.uint64(8192)] type=Q8_0 +blk.14.hc_ffn_up.weight shape=[np.uint64(256), np.uint64(8192)] type=Q8_0 +blk.15.hc_attn_up.weight shape=[np.uint64(256), np.uint64(8192)] type=Q8_0 +blk.15.hc_ffn_up.weight shape=[np.uint64(256), np.uint64(8192)] type=Q8_0 +blk.16.hc_attn_up.weight shape=[np.uint64(256), np.uint64(8192)] type=Q8_0 +blk.16.hc_ffn_up.weight shape=[np.uint64(256), np.uint64(8192)] type=Q8_0 +blk.17.hc_attn_up.weight shape=[np.uint64(256), np.uint64(8192)] type=Q8_0 +blk.17.hc_ffn_up.weight shape=[np.uint64(256), np.uint64(8192)] type=Q8_0 +blk.18.hc_attn_up.weight shape=[np.uint64(256), np.uint64(8192)] type=Q8_0 +blk.18.hc_ffn_up.weight shape=[np.uint64(256), np.uint64(8192)] type=Q8_0 +blk.19.hc_attn_up.weight shape=[np.uint64(256), np.uint64(8192)] type=Q8_0 +blk.19.hc_ffn_up.weight shape=[np.uint64(256), np.uint64(8192)] type=Q8_0 +blk.2.hc_attn_up.weight shape=[np.uint64(256), np.uint64(8192)] type=Q8_0 +blk.2.hc_ffn_up.weight shape=[np.uint64(256), np.uint64(8192)] type=Q8_0 +blk.20.hc_attn_up.weight shape=[np.uint64(256), np.uint64(8192)] type=Q8_0 +blk.20.hc_ffn_up.weight shape=[np.uint64(256), np.uint64(8192)] type=Q8_0 +blk.21.hc_attn_up.weight shape=[np.uint64(256), np.uint64(8192)] type=Q8_0 +blk.21.hc_ffn_up.weight shape=[np.uint64(256), np.uint64(8192)] type=Q8_0 +blk.22.hc_attn_up.weight shape=[np.uint64(256), np.uint64(8192)] type=Q8_0 +blk.22.hc_ffn_up.weight shape=[np.uint64(256), np.uint64(8192)] type=Q8_0 +blk.23.hc_attn_up.weight shape=[np.uint64(256), np.uint64(8192)] type=Q8_0 +blk.23.hc_ffn_up.weight shape=[np.uint64(256), np.uint64(8192)] type=Q8_0 +blk.24.hc_attn_up.weight shape=[np.uint64(256), np.uint64(8192)] type=Q8_0 +blk.24.hc_ffn_up.weight shape=[np.uint64(256), np.uint64(8192)] type=Q8_0 +blk.25.hc_attn_up.weight shape=[np.uint64(256), np.uint64(8192)] type=Q8_0 +blk.25.hc_ffn_up.weight shape=[np.uint64(256), np.uint64(8192)] type=Q8_0 +blk.26.hc_attn_up.weight shape=[np.uint64(256), np.uint64(8192)] type=Q8_0 +blk.26.hc_ffn_up.weight shape=[np.uint64(256), np.uint64(8192)] type=Q8_0 +blk.27.hc_attn_up.weight shape=[np.uint64(256), np.uint64(8192)] type=Q8_0 +blk.27.hc_ffn_up.weight shape=[np.uint64(256), np.uint64(8192)] type=Q8_0 +blk.28.hc_attn_up.weight shape=[np.uint64(256), np.uint64(8192)] type=Q8_0 +blk.28.hc_ffn_up.weight shape=[np.uint64(256), np.uint64(8192)] type=Q8_0 +blk.29.hc_attn_up.weight shape=[np.uint64(256), np.uint64(8192)] type=Q8_0 +blk.29.hc_ffn_up.weight shape=[np.uint64(256), np.uint64(8192)] type=Q8_0 +blk.3.hc_attn_up.weight shape=[np.uint64(256), np.uint64(8192)] type=Q8_0 +blk.3.hc_ffn_up.weight shape=[np.uint64(256), np.uint64(8192)] type=Q8_0 +blk.30.hc_attn_up.weight shape=[np.uint64(256), np.uint64(8192)] type=Q8_0 +blk.30.hc_ffn_up.weight shape=[np.uint64(256), np.uint64(8192)] type=Q8_0 +blk.31.hc_attn_up.weight shape=[np.uint64(256), np.uint64(8192)] type=Q8_0 +blk.31.hc_ffn_up.weight shape=[np.uint64(256), np.uint64(8192)] type=Q8_0 +blk.32.hc_attn_up.weight shape=[np.uint64(256), np.uint64(8192)] type=Q8_0 +blk.32.hc_ffn_up.weight shape=[np.uint64(256), np.uint64(8192)] type=Q8_0 +blk.33.hc_attn_up.weight shape=[np.uint64(256), np.uint64(8192)] type=Q8_0 +blk.33.hc_ffn_up.weight shape=[np.uint64(256), np.uint64(8192)] type=Q8_0 +blk.34.hc_attn_up.weight shape=[np.uint64(256), np.uint64(8192)] type=Q8_0 +blk.34.hc_ffn_up.weight shape=[np.uint64(256), np.uint64(8192)] type=Q8_0 +blk.35.hc_attn_up.weight shape=[np.uint64(256), np.uint64(8192)] type=Q8_0 +blk.35.hc_ffn_up.weight shape=[np.uint64(256), np.uint64(8192)] type=Q8_0 +blk.36.hc_attn_up.weight shape=[np.uint64(256), np.uint64(8192)] type=Q8_0 +blk.36.hc_ffn_up.weight shape=[np.uint64(256), np.uint64(8192)] type=Q8_0 +blk.37.hc_attn_up.weight shape=[np.uint64(256), np.uint64(8192)] type=Q8_0 +blk.37.hc_ffn_up.weight shape=[np.uint64(256), np.uint64(8192)] type=Q8_0 +blk.38.hc_attn_up.weight shape=[np.uint64(256), np.uint64(8192)] type=Q8_0 +blk.38.hc_ffn_up.weight shape=[np.uint64(256), np.uint64(8192)] type=Q8_0 +blk.39.hc_attn_up.weight shape=[np.uint64(256), np.uint64(8192)] type=Q8_0 +blk.39.hc_ffn_up.weight shape=[np.uint64(256), np.uint64(8192)] type=Q8_0 +blk.4.hc_attn_up.weight shape=[np.uint64(256), np.uint64(8192)] type=Q8_0 +blk.4.hc_ffn_up.weight shape=[np.uint64(256), np.uint64(8192)] type=Q8_0 +blk.5.hc_attn_up.weight shape=[np.uint64(256), np.uint64(8192)] type=Q8_0 +blk.5.hc_ffn_up.weight shape=[np.uint64(256), np.uint64(8192)] type=Q8_0 +blk.6.hc_attn_up.weight shape=[np.uint64(256), np.uint64(8192)] type=Q8_0 +blk.6.hc_ffn_up.weight shape=[np.uint64(256), np.uint64(8192)] type=Q8_0 +blk.7.hc_attn_up.weight shape=[np.uint64(256), np.uint64(8192)] type=Q8_0 +blk.7.hc_ffn_up.weight shape=[np.uint64(256), np.uint64(8192)] type=Q8_0 +blk.8.hc_attn_up.weight shape=[np.uint64(256), np.uint64(8192)] type=Q8_0 +blk.8.hc_ffn_up.weight shape=[np.uint64(256), np.uint64(8192)] type=Q8_0 +blk.9.hc_attn_up.weight shape=[np.uint64(256), np.uint64(8192)] type=Q8_0 +blk.9.hc_ffn_up.weight shape=[np.uint64(256), np.uint64(8192)] type=Q8_0 +blk.40.attn_k.weight shape=[np.uint64(2048), np.uint64(512)] type=Q6_K +blk.40.attn_k_norm.weight shape=[np.uint64(256)] type=F32 +blk.40.attn_output.weight shape=[np.uint64(4096), np.uint64(2048)] type=Q6_K +blk.40.attn_q.weight shape=[np.uint64(2048), np.uint64(8192)] type=Q6_K +blk.40.attn_q_norm.weight shape=[np.uint64(256)] type=F32 +blk.40.attn_v.weight shape=[np.uint64(2048), np.uint64(512)] type=Q6_K +blk.40.ffn_down_exps.weight shape=[np.uint64(512), np.uint64(2048), np.uint64(256)] type=Q6_K +blk.40.ffn_down_shexp.weight shape=[np.uint64(512), np.uint64(2048)] type=Q6_K +blk.40.ffn_gate_exps.weight shape=[np.uint64(2048), np.uint64(512), np.uint64(256)] type=Q6_K +blk.40.ffn_gate_inp.weight shape=[np.uint64(2048), np.uint64(256)] type=F32 +blk.40.ffn_gate_inp_shexp.weight shape=[np.uint64(2048)] type=F32 +blk.40.ffn_gate_shexp.weight shape=[np.uint64(2048), np.uint64(512)] type=Q6_K +blk.40.ffn_up_exps.weight shape=[np.uint64(2048), np.uint64(512), np.uint64(256)] type=Q6_K +blk.40.ffn_up_shexp.weight shape=[np.uint64(2048), np.uint64(512)] type=Q6_K +blk.40.hc_attn_down_inject.weight shape=[np.uint64(8192), np.uint64(260)] type=Q6_K +blk.40.hc_attn_norm.weight shape=[np.uint64(8192)] type=F32 +blk.40.hc_attn_up.weight shape=[np.uint64(256), np.uint64(8192)] type=Q6_K +blk.40.hc_ffn_down_inject.weight shape=[np.uint64(8192), np.uint64(260)] type=Q6_K +blk.40.hc_ffn_norm.weight shape=[np.uint64(8192)] type=F32 +blk.40.hc_ffn_up.weight shape=[np.uint64(256), np.uint64(8192)] type=Q6_K +blk.40.indexer.k_norm.weight shape=[np.uint64(128)] type=F32 +blk.40.indexer.k_proj.weight shape=[np.uint64(2048), np.uint64(128)] type=BF16 +blk.40.indexer.q_norm.weight shape=[np.uint64(128)] type=F32 +blk.40.indexer.q_proj.weight shape=[np.uint64(2048), np.uint64(512)] type=BF16 +blk.40.nextn.eh_proj.weight shape=[np.uint64(4096), np.uint64(2048)] type=Q6_K +blk.40.nextn.enorm.weight shape=[np.uint64(2048)] type=F32 +blk.40.nextn.hc_head_down.weight shape=[np.uint64(8192), np.uint64(256)] type=Q6_K +blk.40.nextn.hc_head_norm.weight shape=[np.uint64(8192)] type=F32 +blk.40.nextn.hc_head_up.weight shape=[np.uint64(256), np.uint64(8192)] type=Q6_K +blk.40.nextn.hnorm.weight shape=[np.uint64(8192)] type=F32 +output.weight shape=[np.uint64(2048), np.uint64(248320)] type=Q8_0 +token_embd.weight shape=[np.uint64(2048), np.uint64(248320)] type=Q5_K +per_layer_token_embd.weight shape=[128, 160003584] type=Q5_1 # shard 00002 only tensor diff --git a/patches/qwen4exp-full-port/verify/expected-2026-12-04/compare.txt b/patches/qwen4exp-full-port/verify/expected-2026-12-04/compare.txt new file mode 100644 index 000000000..daada9960 --- /dev/null +++ b/patches/qwen4exp-full-port/verify/expected-2026-12-04/compare.txt @@ -0,0 +1,3 @@ +reference chars=1249, port chars=1249 +identical prefix: 1249 chars (~36 tokens of 256) +port output is a byte-identical prefix of the llama.cpp reference for its whole 256-token window diff --git a/patches/qwen4exp-full-port/verify/expected-2026-12-04/poly.txt b/patches/qwen4exp-full-port/verify/expected-2026-12-04/poly.txt new file mode 100644 index 000000000..73a617843 --- /dev/null +++ b/patches/qwen4exp-full-port/verify/expected-2026-12-04/poly.txt @@ -0,0 +1,9 @@ + + +The capital of France is Paris. It is the country's most populous city and serves as its primary political, cultural, and economic center, located in the north-central region along the Seine River. Paris is globally recognized for landmarks such as the Eiffel Tower, the Louvre Museum, and Notre-Dame Cathedral, and it functions as the seat of the French government. Therefore, the capital of France is Paris. + +The capital of France is Paris. It is the country's most populous city and serves as its primary political, cultural, and economic center, located in the north-central region along the Seine River. Paris is globally recognized for landmarks such as the Eiffel Tower, the Louvre Museum, and Notre-Dame Cathedral, and it functions as the seat of the French government. Therefore, the capital of France is Paris. + +The capital of France is Paris. It is the country's most populous city and serves as its primary political, cultural, and economic center, located in the north-central region along the Seine River. Paris is globally recognized for landmarks such as the Eiffel Tower, the Louvre Museum, and Notre-Dame Cathedral, and it functions as the seat of the French government. Therefore, the capital of France is Paris. + +The capital of \ No newline at end of file diff --git a/patches/qwen4exp-full-port/verify/expected-2026-12-04/summary.txt b/patches/qwen4exp-full-port/verify/expected-2026-12-04/summary.txt new file mode 100644 index 000000000..aecb8ed65 --- /dev/null +++ b/patches/qwen4exp-full-port/verify/expected-2026-12-04/summary.txt @@ -0,0 +1,34 @@ +=== reference (llama.cpp, 127.0.0.1:19998) === +{"index":0,"content":"\n\nThe capital of France is Paris. It is the country's most populous city and serves as its primary political, cultural, and economic center, located in the north-central region along the Seine River. Paris is globally recognized for landmarks such as the Eiffel Tower, the Louvre Museum, and Notre-Dame Cathedral, and it functions as the seat of the French government. Therefore, the capital of France is Paris.\n\nThe capital of France is Paris. It is the country's most populous city and serves as its primary political, cultural, and economic center, located in the north-central region along the Seine River. Paris is globally recognized for landmarks such as the Eiffel Tower, the Louvre Museum, and Notre-Dame Cathedral, and it functions as the seat of the French government. Therefore, the capital of France is Paris.\n\nThe capital of France is Paris. It is the country's most populous city and serves as its primary political, cultural, and economic center, located in the north-central region along the Seine River. Paris is globally recognized for landmarks such as the Eiffel Tower, the Louvre Museum, and Notre-Dame Cathedral, and it functions as the seat of the French government. Therefore, the capital of France is Paris.\n\nThe capital of","tokens":[],"id_slot":0,"stop":true,"model":"/home/inex/models/Qwen4-35B-A3B-UD-Q5_K_M/Qwen4-35B-A3B-UD-Q5_K_M-00001-of-00002.gguf","tokens_predicted":256,"tokens_evaluated":12,"generation_settings":{"seed":4294967295,"temperature":0.0,"dynatemp_range":0.0,"dynatemp_exponent":1.0,"top_k":20,"top_p":0.949999988079071,"min_p":0.05000000074505806,"top_n_sigma":-1.0,"xtc_probability":0.0,"xtc_threshold":0.10000000149011612,"typical_p":1.0,"repeat_last_n":64,"repeat_penalty":1.0,"presence_penalty":0.0,"frequency_penalty":0.0,"dry_multiplier":0.0,"dry_base":1.75,"dry_allowed_length":2,"dry_penalty_last_n":64,"dry_sequence_breakers":["\n",":","\"","*"],"mirostat":0,"mirostat_tau":5.0,"mirostat_eta":0.10000000149011612,"adaptive_target":-1.0,"adaptive_decay":0.8999999761581421,"stop":[],"max_tokens":256,"n_predict":256,"n_keep":0,"n_discard":0,"ignore_eos":false,"stream":false,"logit_bias":[],"n_probs":0,"min_keep":0,"grammar":"","grammar_lazy":false,"grammar_triggers":[],"preserved_tokens":[],"chat_format":"Content-only","reasoning_format":"deepseek","reasoning_in_content":false,"generation_prompt":"","samplers":["penalties","dry","top_n_sigma","top_k","typ_p","top_p","min_p","xtc","temperature"],"speculative.types":"none,none","timings_per_token":false,"post_sampling_probs":false,"backend_sampling":false,"lora":[]},"prompt":"What is the capital of France? Answer in one sentence.","has_new_line":true,"truncated":false,"stop_type":"limit","stopping_word":"","tokens_cached":267,"timings":{"cache_n":0,"prompt_n":12,"prompt_ms":408.838,"prompt_per_token_ms":34.069833333333335,"prompt_per_second":29.351479069949466,"predicted_n":256,"predicted_ms":8942.494,"predicted_per_token_ms":35.06860392156863,"predicted_per_second":28.515534927951865}} +=== port (strata-poly CLI) === + + +The capital of France is Paris. It is the country's most populous city and serves as its primary political, cultural, and economic center, located in the north-central region along the Seine River. Paris is globally recognized for landmarks such as the Eiffel Tower, the Louvre Museum, and Notre-Dame Cathedral, and it functions as the seat of the French government. Therefore, the capital of France is Paris. + +The capital of France is Paris. It is the country's most populous city and serves as its primary political, cultural, and economic center, located in the north-central region along the Seine River. Paris is globally recognized for landmarks such as the Eiffel Tower, the Louvre Museum, and Notre-Dame Cathedral, and it functions as the seat of the French government. Therefore, the capital of France is Paris. + +The capital of France is Paris. It is the country's most populous city and serves as its primary political, cultural, and economic center, located in the north-central region along the Seine River. Paris is globally recognized for landmarks such as the Eiffel Tower, the Louvre Museum, and Notre-Dame Cathedral, and it functions as the seat of the French government. Therefore +=== port blk0/blk1 stage dumps === +dump pos=0 blk=0 attn_in n=2048 sum=-5.916329 abs=1169.998219 first=-0.414718 -0.056265 0.623333 +dump pos=0 blk=0 attn n=2048 sum=-27.356233 abs=713.422565 first=-0.421272 0.159464 -0.345675 +dump pos=0 blk=0 ffn_in n=2048 sum=-9.479233 abs=309.970798 first=-0.388253 0.060140 -0.135164 +dump pos=0 blk=0 ffn n=2048 sum=-2.254342 abs=228.448646 first=0.071017 -0.101024 -0.064814 +dump pos=0 blk=0 l_last n=8192 sum=-7.554691 abs=476.579795 first=-0.003840 -0.003867 0.006336 +dump pos=0 blk=1 ple n=8192 sum=-5.848297 abs=601.341683 first=-0.003691 -0.003873 0.006343 +dump pos=0 blk=1 attn_in n=2048 sum=-7.576624 abs=507.091947 first=0.169591 -0.266415 -0.076993 +dump pos=0 blk=1 attn n=2048 sum=27.356749 abs=387.104553 first=0.181243 -0.147569 0.231955 +dump pos=0 blk=1 ffn_in n=2048 sum=3.917661 abs=330.541565 first=0.312362 -0.077115 0.083046 +dump pos=0 blk=1 ffn n=2048 sum=4.327091 abs=125.808003 first=0.144188 -0.047820 0.038458 +dump pos=0 blk=1 l_last n=8192 sum=-0.526735 abs=677.727671 first=0.088933 -0.040446 0.043337 +dump pos=1 blk=0 attn_in n=2048 sum=-71.612856 abs=691.970994 first=-0.184263 0.109360 -0.052717 +=== port log, key lines === +strata-poly: Qwen4 STRATA_GDN_MMA: prefill through chunked GDN MMA (sigmoid gate) +strata-poly: loaded in 1.5 s; 4023 of 10240 routed experts in VRAM (8.7 GiB), 8 CPU threads +strata-poly: VRAM pressure guard: dxgi=0/0 MiB cuda_free=371 MiB -> arena=8832 MiB vpool=0 MiB released=0 MiB +strata-poly: qwen4: PLE table: 4272 rows asked, 2880 from the row cache, 1392 SSD reads of 5799936 bytes, collect waited 41.5 ms +=== GPU after === +0, GPU-c31ac59a-c86c-25ef-8312-c0981d9b33ee, 9999 MiB +1, GPU-160a10ef-6095-54fd-d6f5-9cf0968396f8, 1 MiB +=== cfg sha before/after === +7c6594a88be0c715d328571fba98ece9cd5fe8a3b5506f6c2ef7295edcbeb591 /home/inex/PolyStrata/terminal/strata-iq3_xxs.json +7c6594a88be0c715d328571fba98ece9cd5fe8a3b5506f6c2ef7295edcbeb591 /home/inex/PolyStrata/terminal/strata-iq3_xxs.json diff --git a/patches/qwen4exp-full-port/verify/gguf_keys.py b/patches/qwen4exp-full-port/verify/gguf_keys.py new file mode 100644 index 000000000..4d18b2160 --- /dev/null +++ b/patches/qwen4exp-full-port/verify/gguf_keys.py @@ -0,0 +1,52 @@ +#!/usr/bin/env python3 +# Print GGUF metadata keys (+ small values) matching a filter. Parses the header only. +# gguf.h types: 0 u8, 1 i8, 2 u16, 3 i16, 4 u32, 5 i32, 6 f32, 7 bool, 8 string, 9 array, 10 u64, 11 i64, 12 f64 +import struct, sys + +path, filt = sys.argv[1], (sys.argv[2] if len(sys.argv) > 2 else "") +SCALAR = {0: ' 0): + gate = -np.exp(ssm_a.astype(np.float64)) * np.logaddexp(0.0, alpha + dt.astype(np.float64)) + print("note: ssm_a stored positive, applied -exp() here") +gdec = np.exp(gate) # kernel takes expf(g) + +conv = load("blk_0_ssm_conv1d_weight.f32", (8192, 4)) +curo = conv[:, 3].astype(np.float64) * qkv # token 0: taps 0..2 are zero state +cv = silu(curo) +NK, HV, SD = 16, 32, 128 +q = cv[:NK * SD].reshape(NK, SD); k = cv[NK * SD:2 * NK * SD].reshape(NK, SD) +v = cv[2 * NK * SD:].reshape(HV, SD) +l2 = lambda t: t / np.sqrt((t * t).sum(-1, keepdims=True) + EPS) +qn, kn = l2(q), l2(k) + +out = np.empty((HV, SD)) +scale = 1.0 / np.sqrt(SD) +for h in range(HV): + g = h % NK + dot = float(qn[g] @ kn[g]) + out[h] = scale * beta[h] * dot * v[h] # zero state: kv term vanishes + +snorm = load("blk_0_ssm_norm_weight.f32", (SD,)).astype(np.float64) +r = out / np.sqrt((out * out).mean(-1, keepdims=True) + EPS) * snorm * sig(z.reshape(HV, SD)) +w_out = load("blk_0_ssm_out_weight.f32", (N_EMBD, HV * SD)) +ao = w_out.astype(np.float64) @ r.reshape(HV * SD) +line("attn", 0, ao) + +# ---------- hc_combine (attn) ---------- +res = x0.astype(np.float64).reshape(1, N_EMBD) * np.ones((HC, 1)) +res = res + ao.reshape(1, N_EMBD) * (2.0 * sig(inject))[:, None] + +# ---------- hc_mix (ffn) for blk 0 ---------- +w_norm = load("blk_0_hc_ffn_norm_weight.f32", (HC, N_EMBD)) +w_downi = load("blk_0_hc_ffn_down_inject_weight.f32", (HC_LR + HC, HC * N_EMBD)) +w_up = load("blk_0_hc_ffn_up_weight.f32", (HC * N_EMBD, HC_LR)) +mixed1, inject1 = hc_mix(rms_norm_streams(res.reshape(HC * N_EMBD), w_norm), w_downi, w_up) +line("ffn_in", 0, mixed1) + +# ---------- build_layer_ffn for blk 0: softmax router, top-8 of 256, weights renormalized ---------- +router = load("blk_0_ffn_gate_inp_weight.f32", (256, N_EMBD)) +logits = router.astype(np.float64) @ mixed1 +probs = np.exp(logits - logits.max()); probs /= probs.sum() +top8 = np.argsort(-probs)[:8] +w8 = probs[top8] / max(probs[top8].sum(), 6.103515625e-5) +print("top8 experts:", top8.tolist(), "weights:", np.round(w8, 4).tolist()) + +moe = np.zeros(N_EMBD) +for e, we in zip(top8, w8): + wu = load("blk_0_ffn_up_exps_e%d.f32" % e, (512, N_EMBD)) + wg = load("blk_0_ffn_gate_exps_e%d.f32" % e, (512, N_EMBD)) + wd = load("blk_0_ffn_down_exps_e%d.f32" % e, (N_EMBD, 512)) + act = silu(wg.astype(np.float64) @ mixed1) * (wu.astype(np.float64) @ mixed1) + moe += we * (wd.astype(np.float64) @ act) + +# shared expert with its own sigmoid gate +ws_g = load("blk_0_ffn_gate_shexp_weight.f32", (512, N_EMBD)) +ws_u = load("blk_0_ffn_up_shexp_weight.f32", (512, N_EMBD)) +ws_d = load("blk_0_ffn_down_shexp_weight.f32", (N_EMBD, 512)) +sh = load("blk_0_ffn_gate_inp_shexp_weight.f32") +act = silu(ws_g.astype(np.float64) @ mixed1) * (ws_u.astype(np.float64) @ mixed1) +ffn_out = moe + sig(sh.astype(np.float64) @ mixed1) * (ws_d.astype(np.float64) @ act) +line("ffn", 0, ffn_out) + +# ---------- hc_combine (ffn) + blk 1 attn mix ---------- +res = res + ffn_out.reshape(1, N_EMBD) * (2.0 * sig(inject1))[:, None] + +# ---------- build_ple(il=1) on the 4 streams, token 0 ---------- +M64 = (1 << 64) - 1 +mult = [23703573157769, 20109073645365, 8052911324071] +offs = [0,10000019,20000098,30000201,40000322,50000461,60000602,70000771,80000960,90001183,100001412,110001659,120001912,130002173,140002444,150002747] +vocab = [10000019,10000079,10000103,10000121,10000139,10000141,10000169,10000189,10000223,10000229,10000247,10000253,10000261,10000271,10000303,10000339] +toks = [3710,369,279,6511,314,9338,30,21134,303,799,11316,13] +eos = 248044 +def ple_idx(i): + ctx = [toks[i]]; cut = False + for s in (1, 2): + pt = toks[i - s] if i - s >= 0 else -1 + ctx.append(eos if cut or pt < 0 or pt == eos else pt) + cut = cut or pt < 0 or pt == eos + out = [] + for n in (2, 3): + mixed = (ctx[0] * mult[0]) & M64 + for j in range(1, n): mixed ^= (ctx[j] * mult[j]) & M64 + for g in range(8): + h = (n - 2) * 8 + g + out.append(mixed % vocab[h] + offs[h]) + return out # 16 head rows, heads 0..7 = gram2, 8..15 = gram3 + +ple_rows = load("ple_rows.f32", (192, 128)).astype(np.float64) +idx0 = ple_idx(0) +emb_p = np.concatenate([ple_rows[16 * 0 + h] for h in range(16)]) # token 0's rows, in head order + +Wk = load("blk_1_ple_key_weight.f32", (8192, N_EMBD)).astype(np.float64) +Wv = load("blk_1_ple_value_weight.f32", (N_EMBD, N_EMBD)).astype(np.float64) +nk_ = load("blk_1_ple_norm_key_weight.f32", (HC, N_EMBD)).astype(np.float64) +nq_ = load("blk_1_ple_norm_query_weight.f32", (HC, N_EMBD)).astype(np.float64) +nc_ = load("blk_1_ple_norm_conv_weight.f32", (HC, N_EMBD)).astype(np.float64) +pw = load("blk_1_ple_conv1d_weight.f32", (HC * N_EMBD, 4)).astype(np.float64) # flat [c][k], c spans hc_dim + +def gnorm(x4, w4): # x4 [4, 2048] rms-norm per stream, scaled + rms1 = lambda v: v / np.sqrt((v * v).mean() + EPS) + return np.array([rms1(x4[s]) * w4[s] for s in range(HC)]) + +key = gnorm((Wk @ emb_p).reshape(HC, N_EMBD), nk_) +hidden4 = res.copy() # token 0's four distinct streams (llama.cpp passes res_hc) +query = gnorm(hidden4, nq_) +s = np.array([key[st] @ query[st] for st in range(HC)]) / np.sqrt(N_EMBD) +gate = sig(np.sign(s) * np.sqrt(np.maximum(np.abs(s), 1e-6))) +value = Wv @ emb_p # [2048] +gated = np.array([value * gate[st] for st in range(HC)]) # [4, 2048] +normalized = gnorm(gated, nc_) +conv_t0 = normalized * pw.reshape(HC * N_EMBD, 4)[:, 3].reshape(HC, N_EMBD) # taps t-9/-6/-3 see zero state +conv_out = silu(conv_t0) +res_ple = hidden4 + gated + conv_out +line("ple_gated", 1, gated.reshape(HC * N_EMBD)) +line("ple_normed", 1, normalized.reshape(HC * N_EMBD)) +line("ple_res", 1, res_ple.reshape(HC * N_EMBD)) + +print("PLE token0: |emb_p|=%.4f |gated|/stream=%.4f |conv_out|/stream=%.4f |emb0|=%.4f gate=%s" % ( + np.abs(emb_p).mean(), np.abs(gated).mean(), np.abs(conv_out).mean(), np.abs(res[0]).mean(), + np.round(gate, 4).tolist())) + +w_norm = load("blk_1_hc_attn_norm_weight.f32", (HC, N_EMBD)) +w_downi = load("blk_1_hc_attn_down_inject_weight.f32", (HC_LR + HC, HC * N_EMBD)) +w_up = load("blk_1_hc_attn_up_weight.f32", (HC * N_EMBD, HC_LR)) +mixed2, inject2 = hc_mix(rms_norm_streams(res_ple.reshape(HC * N_EMBD), w_norm), w_downi, w_up) +line("attn_in", 1, mixed2) # WITH PLE - this is what the port should produce at blk1 diff --git a/patches/qwen4exp-full-port/verify/q4_dump.cpp b/patches/qwen4exp-full-port/verify/q4_dump.cpp new file mode 100644 index 000000000..429096df2 --- /dev/null +++ b/patches/qwen4exp-full-port/verify/q4_dump.cpp @@ -0,0 +1,215 @@ +// q4_dump.cpp - dequantize the tensors the layer-0/1 stage check needs, straight from the GGUF, using +// ggml's own dequantize_row_* functions (the same code llama.cpp runs). Writes raw f32 files. +#include "ggml.h" +#include "gguf.h" +#include "ggml-quants.h" + +#include +#include +#include +#include +#include +#include +#include +#include + +static int fail = 0; + +static void dump_tensor(gguf_context* g, const void* data, const char* name, const char* out_name) { + const int i = gguf_find_tensor(g, name); + if (i < 0) { std::fprintf(stderr, "MISSING %s\n", name); fail = 1; return; } + const ggml_type t = (ggml_type) gguf_get_tensor_type(g, i); + const size_t off = gguf_get_tensor_offset(g, i); + const size_t bytes = gguf_get_tensor_size(g, i); // bytes: convert to elements + const int64_t n = (int64_t) bytes / ggml_type_size(t) * ggml_blck_size(t); + const uint8_t* src = (const uint8_t*) data + off; + std::vector buf((size_t) n); + switch (t) { + case GGML_TYPE_F32: std::memcpy(buf.data(), src, (size_t) n * 4); break; + case GGML_TYPE_F16: for (int64_t k = 0; k < n; ++k) buf[k] = ggml_fp16_to_fp32(((const uint16_t*) src)[k]); break; + case GGML_TYPE_BF16: for (int64_t k = 0; k < n; ++k) { ggml_bf16_t b; b.bits = ((const uint16_t*) src)[k]; buf[k] = ggml_bf16_to_fp32(b); } break; + case GGML_TYPE_Q8_0: dequantize_row_q8_0((const block_q8_0*) src, buf.data(), n); break; + case GGML_TYPE_Q5_K: dequantize_row_q5_K((const block_q5_K*) src, buf.data(), n); break; + case GGML_TYPE_Q6_K: dequantize_row_q6_K((const block_q6_K*) src, buf.data(), n); break; + default: std::fprintf(stderr, "UNSUPPORTED type %d for %s\n", (int) t, name); fail = 1; return; + } + char path[512]; + std::snprintf(path, sizeof path, "/tmp/opencode/q4_dump/%s.f32", out_name); + FILE* f = std::fopen(path, "wb"); + if (!f) { std::fprintf(stderr, "cannot write %s\n", path); fail = 1; return; } + std::fwrite(buf.data(), 4, buf.size(), f); + std::fclose(f); + std::fprintf(stderr, "dumped %-34s type=%d n=%lld -> %s\n", name, (int) t, (long long) n, path); +} + +static void dump_expert(gguf_context* g, const void* data, const char* name, int expert, const char* out_name) { + const int i = gguf_find_tensor(g, name); + if (i < 0) { std::fprintf(stderr, "MISSING %s\n", name); fail = 1; return; } + const ggml_type t = (ggml_type) gguf_get_tensor_type(g, i); + const size_t bytes = gguf_get_tensor_size(g, i); + const int64_t n_all = (int64_t) bytes / ggml_type_size(t) * ggml_blck_size(t); + const int64_t n_e = n_all / 256; // expert_count = 256, expert slices are contiguous + const uint8_t* src = (const uint8_t*) data + gguf_get_tensor_offset(g, i) + (size_t) expert * (bytes / 256); + std::vector buf((size_t) n_e); + switch (t) { + case GGML_TYPE_F32: std::memcpy(buf.data(), src, (size_t) n_e * 4); break; + case GGML_TYPE_Q8_0: dequantize_row_q8_0((const block_q8_0*) src, buf.data(), n_e); break; + case GGML_TYPE_Q5_K: dequantize_row_q5_K((const block_q5_K*) src, buf.data(), n_e); break; + case GGML_TYPE_Q6_K: dequantize_row_q6_K((const block_q6_K*) src, buf.data(), n_e); break; + default: std::fprintf(stderr, "UNSUPPORTED type %d for %s\n", (int) t, name); fail = 1; return; + } + char path[512]; + std::snprintf(path, sizeof path, "/tmp/opencode/q4_dump/%s.f32", out_name); + FILE* f = std::fopen(path, "wb"); + std::fwrite(buf.data(), 4, buf.size(), f); + std::fclose(f); + std::fprintf(stderr, "dumped %-40s expert=%d n=%lld\n", name, expert, (long long) n_e); +} + +int main(int argc, char** argv) { + const char* path = argc > 1 ? argv[1] : "/home/inex/models/Qwen4-35B-A3B-UD-Q5_K_M/Qwen4-35B-A3B-UD-Q5_K_M-00001-of-00002.gguf"; + gguf_init_params p; + p.no_alloc = true; // keep the file mapped; gguf_get_data() gives the data section + p.ctx = NULL; + gguf_context* g = gguf_init_from_file(path, p); + if (!g) { std::fprintf(stderr, "cannot open %s\n", path); return 1; } + // map the file ourselves: the offsets from gguf are relative to the aligned data section + const int fd = open(path, O_RDONLY); + const off_t size = lseek(fd, 0, SEEK_END); + void* mapped = mmap(nullptr, (size_t) size, PROT_READ, MAP_PRIVATE, fd, 0); + if (mapped == MAP_FAILED) { std::fprintf(stderr, "mmap failed\n"); return 2; } + const size_t align = gguf_get_alignment(g); + const size_t data_off = gguf_get_data_offset(g); + const void* data = (const uint8_t*) mapped + (data_off + align - 1) / align * align; + + if (argc > 2 && !std::strcmp(argv[2], "kv")) { // q4dump kv [filter] + const char* flt = argc > 3 ? argv[3] : ""; + for (uint32_t i = 0; i < gguf_get_n_kv(g); ++i) { + const char* k = gguf_get_key(g, i); + if (!*flt || std::strstr(k, flt)) { + const gguf_type t = gguf_get_kv_type(g, i); + std::fprintf(stderr, "%s type=%d", k, (int) t); + const bool arr = t == GGUF_TYPE_ARRAY; + const int n = arr ? std::min((int) gguf_get_arr_n(g, i), 20) : 1; + const gguf_type et = arr ? gguf_get_arr_type(g, i) : t; + const void* ad = arr ? gguf_get_arr_data(g, i) : nullptr; + for (int j = 0; j < n; ++j) { + switch (et) { + case GGUF_TYPE_UINT32: std::fprintf(stderr, " %u", arr ? ((const uint32_t*) ad)[j] : gguf_get_val_u32(g, i)); break; + case GGUF_TYPE_UINT64: std::fprintf(stderr, " %llu", arr ? (unsigned long long) ((const uint64_t*) ad)[j] : (unsigned long long) gguf_get_val_u64(g, i)); break; + case GGUF_TYPE_INT32: std::fprintf(stderr, " %d", arr ? ((const int32_t*) ad)[j] : gguf_get_val_i32(g, i)); break; + case GGUF_TYPE_INT64: std::fprintf(stderr, " %lld", arr ? (long long) ((const int64_t*) ad)[j] : (long long) gguf_get_val_i64(g, i)); break; + case GGUF_TYPE_FLOAT32:std::fprintf(stderr, " %.6f", arr ? ((const float*) ad)[j] : gguf_get_val_f32(g, i)); break; + case GGUF_TYPE_FLOAT64:std::fprintf(stderr, " %.6f", arr ? ((const double*) ad)[j] : gguf_get_val_f64(g, i)); break; + case GGUF_TYPE_STRING: std::fprintf(stderr, " %s", arr ? gguf_get_arr_str(g, i, j) : gguf_get_val_str(g, i)); break; + case GGUF_TYPE_BOOL: std::fprintf(stderr, " %d", arr ? ((const int8_t*) ad)[j] : gguf_get_val_bool(g, i)); break; + default: std::fprintf(stderr, " ?"); break; + } + } + std::fprintf(stderr, "\n"); + } + } + gguf_free(g); + return 0; + } + + if (argc > 3 && !std::strcmp(argv[2], "prows")) { // q4dump prows -> ple_rows.f32 + const int ti = gguf_find_tensor(g, "per_layer_token_embd.weight"); + if (ti < 0) { std::fprintf(stderr, "no per_layer table in %s\n", path); return 1; } + const ggml_type t = (ggml_type) gguf_get_tensor_type(g, ti); + const size_t off = gguf_get_tensor_offset(g, ti); + const int64_t bsz = ggml_blck_size(t), tsz = ggml_type_size(t); + std::vector out; + const char* s = argv[3]; + while (*s) { + char* end; + const int64_t r = std::strtoll(s, &end, 10); + s = end; if (*s == ',') ++s; + const uint8_t* src = (const uint8_t*) data + off + (size_t) (r * 128 / bsz) * tsz; + float tmp[128]; + if (t == GGML_TYPE_Q5_1) dequantize_row_q5_1((const block_q5_1*) src, tmp, 128); + else { std::fprintf(stderr, "table type %d unsupported\n", (int) t); return 1; } + out.insert(out.end(), tmp, tmp + 128); + } + FILE* f = std::fopen("/tmp/opencode/q4_dump/ple_rows.f32", "wb"); + std::fwrite(out.data(), 4, out.size(), f); + std::fclose(f); + std::fprintf(stderr, "dumped %zu ple rows\n", out.size() / 128); + gguf_free(g); + return 0; + } + + if (argc > 4 && !std::strcmp(argv[2], "experts")) { // q4dump experts + const int blk = std::atoi(argv[3]); + const char* ids = argv[4]; + for (const char* s = ids; *s; ) { + const int e = std::atoi(s); + while (*s && *s != ',') ++s; + if (*s == ',') ++s; + for (const char* suf : {"ffn_up_exps", "ffn_gate_exps", "ffn_down_exps"}) { + const std::string n = "blk." + std::to_string(blk) + "." + suf + ".weight"; + std::string o = "blk_" + std::to_string(blk) + "_" + suf + "_e" + std::to_string(e); + dump_expert(g, data, n.c_str(), e, o.c_str()); + } + } + gguf_free(g); + std::fprintf(stderr, fail ? "FAILED\n" : "OK\n"); + return fail; + } + std::fprintf(stderr, "tensors=%zu kv=%zu\n", gguf_get_n_tensors(g), gguf_get_n_kv(g)); + + // the prompt's twelve embeddings, row by row + { + const char* ename = "token_embd.weight"; + const int i = gguf_find_tensor(g, ename); + const ggml_type t = (ggml_type) gguf_get_tensor_type(g, i); + const int ek = gguf_find_key(g, "qwen4exp.embedding_length"); + const int64_t n_embd = gguf_get_kv_type(g, ek) == GGUF_TYPE_UINT32 || gguf_get_kv_type(g, ek) == GGUF_TYPE_INT32 + ? (int64_t) gguf_get_val_u32(g, ek) + : (int64_t) gguf_get_val_f64(g, ek); + const size_t row_bytes = ggml_row_size(t, n_embd); + const uint8_t* base = (const uint8_t*) data + gguf_get_tensor_offset(g, i); + const int32_t ids[] = {3710, 369, 279, 6511, 314, 9338, 30, 21134, 303, 799, 11316, 13}; + std::vector out(12 * n_embd); + for (int r = 0; r < 12; ++r) { + const uint8_t* row = base + (size_t) ids[r] * row_bytes; + float* dst = out.data() + (size_t) r * n_embd; + switch (t) { + case GGML_TYPE_Q5_K: dequantize_row_q5_K((const block_q5_K*) row, dst, n_embd); break; + case GGML_TYPE_Q6_K: dequantize_row_q6_K((const block_q6_K*) row, dst, n_embd); break; + case GGML_TYPE_Q8_0: dequantize_row_q8_0((const block_q8_0*) row, dst, n_embd); break; + case GGML_TYPE_F32: std::memcpy(dst, row, (size_t) n_embd * 4); break; + default: std::fprintf(stderr, "embed type %d unsupported\n", (int) t); return 2; + } + } + FILE* f = std::fopen("/tmp/opencode/q4_dump/emb12.f32", "wb"); + std::fwrite(out.data(), 4, out.size(), f); + std::fclose(f); + std::fprintf(stderr, "dumped emb12 type=%d n_embd=%lld\n", (int) t, (long long) n_embd); + } + + for (const char* blk : {"blk.0.", "blk.1."}) + for (const char* suf : {"hc_attn_norm.weight", "hc_attn_down_inject.weight", "hc_attn_up.weight", + "hc_ffn_norm.weight", "hc_ffn_down_inject.weight", "hc_ffn_up.weight"}) { + std::string n = std::string(blk) + suf, o = n; + for (auto& c : o) if (c == '.') c = '_'; + dump_tensor(g, data, n.c_str(), o.c_str()); + } + for (const char* suf : {"ple_key.weight", "ple_value.weight", "ple_norm_key.weight", + "ple_norm_query.weight", "ple_norm_conv.weight", "ple_conv1d.weight"}) { + std::string n = std::string("blk.1.") + suf, o = n; + for (auto& c : o) if (c == '.') c = '_'; + dump_tensor(g, data, n.c_str(), o.c_str()); + } + for (const char* n : {"blk.0.attn_qkv_gate.weight", "blk.0.ssm_beta_alpha.weight", "blk.0.ssm_conv1d.weight", + "blk.0.ssm_dt.bias", "blk.0.ssm_a", "blk.0.ssm_norm.weight", "blk.0.ssm_out.weight", + "blk.0.ffn_gate_inp.weight", "blk.0.ffn_gate_inp_shexp.weight", + "blk.0.ffn_up_shexp.weight", "blk.0.ffn_gate_shexp.weight", "blk.0.ffn_down_shexp.weight"}) { + std::string o = n; + for (auto& c : o) if (c == '.') c = '_'; + dump_tensor(g, data, n, o.c_str()); + } + gguf_free(g); + std::fprintf(stderr, fail ? "FAILED\n" : "OK\n"); + return fail; +} diff --git a/patches/qwen4exp-full-port/verify/q4_test.sh b/patches/qwen4exp-full-port/verify/q4_test.sh new file mode 100755 index 000000000..6f5dc55aa --- /dev/null +++ b/patches/qwen4exp-full-port/verify/q4_test.sh @@ -0,0 +1,106 @@ +#!/usr/bin/env bash +# Isolated qwen4exp port smoke test, one GPU window on the 3080 Ti, bound by UUID. +# stage 1: llama.cpp reference - llama-server on 127.0.0.1:19998, /completion, greedy, raw prompt +# stage 2: the port - strata-poly CLI, same token ids, greedy +# A watchdog keeps the 180B strata engine's auto-restarts off the card for the window: it SIGTERMs only the +# process matching "terminal/engine/strata --serve --pack". llama-swap (:8080), the python servers, +# everything on the 3060 and terminal/strata-iq3_xxs.json are not touched (the config is only hashed). +set -uo pipefail + +HERE="$(cd "$(dirname "$0")" && pwd)" # the harness lives with the prompt/ids; scratch output under run/ +UUID=GPU-160a10ef-6095-54fd-d6f5-9cf0968396f8 +DIR=/home/inex/models/Qwen4-35B-A3B-UD-Q5_K_M +MODEL=$DIR/Qwen4-35B-A3B-UD-Q5_K_M-00001-of-00002.gguf +POLY=/home/inex/PolyStrata/terminal/build-poly/strata-poly +LLAMA=/home/inex/llama.cpp/build/bin/llama-server +PY=/home/inex/PolyStrata/terminal/.venv/bin/python +CFG=/home/inex/PolyStrata/terminal/strata-iq3_xxs.json +OUT=${Q4_OUT:-$HERE/run} +mkdir -p "$OUT" +ENGINE_PAT='terminal/engine/strata --serve --pack' + +log() { echo "[$(date +%H:%M:%S)] $*"; } +used() { nvidia-smi --query-gpu=memory.used --format=csv,noheader,nounits -i "$UUID" 2>/dev/null || echo 99999; } + +kill_engine() { # SIGTERM only the engine binary whose command line matches, never a shell quoting the pattern + for p in $(pgrep -f "$ENGINE_PAT" 2>/dev/null); do + [[ "$(cat /proc/$p/comm 2>/dev/null)" == strata* ]] && kill -TERM "$p" 2>/dev/null + done +} + +wait_free() { # polls up to $1 times, 5 s apart, killing engine restarts that grab the card + for ((i = 0; i < ${1:-36}; i++)); do + (( $(used) < 1500 )) && return 0 + kill_engine + sleep 5 + done + return 1 +} + +rm -f "$OUT/DONE" "$OUT/poly.out" "$OUT/poly.err" "$OUT/ref.json" +sha256sum "$CFG" > "$OUT/cfg_before.txt" + +watchdog() { while :; do sleep 10; kill_engine; done; } +watchdog & WD=$! + +log "3080 Ti at $(used) MiB; waiting for it to free" +if ! wait_free 48; then + log "ABORT: the 3080 Ti never freed" + kill $WD 2>/dev/null + echo "DONE rc=2 nofree $(date)" > "$OUT/DONE" + exit 2 +fi + +# ---- stage 1: the llama.cpp reference (the flags of the earlier documented smoke run) ---- +log "starting llama-server :19998" +"$LLAMA" --model "$MODEL" --host 127.0.0.1 --port 19998 -ngl 99 -ot ".ffn_.*_exps.=CPU" \ + -c 4096 -b 2048 -ub 512 -fa on --threads 6 --threads-batch 12 --prio 2 --spec-type none \ + > "$OUT/llama.log" 2>&1 & +LLA=$! +up=0 +for ((i = 0; i < 150; i++)); do + sleep 2 + curl -s -m 3 http://127.0.0.1:19998/health 2>/dev/null | grep -q ok && { up=1; break; } +done +if (( up )); then + curl -s -m 180 http://127.0.0.1:19998/completion -H 'Content-Type: application/json' \ + -d "{\"prompt\": \"$(cat "$HERE/prompt.txt")\", \"max_tokens\": 256, \"temperature\": 0}" > "$OUT/ref.json" + log "reference answer captured" +else + echo '{"error": "llama-server never became healthy - see llama.log"}' > "$OUT/ref.json" + log "WARN: llama-server never became healthy" +fi +kill -TERM $LLA 2>/dev/null +wait $LLA 2>/dev/null +log "llama.cpp stage done: card at $(used) MiB" + +# ---- stage 2: the port ---- +if ! wait_free 60; then log "WARN: card still busy before the port run; trying anyway"; fi +log "starting strata-poly" +timeout 1500 "$POLY" --model "$MODEL" --tokens "$(cat "$HERE/ids.txt")" --max-new 256 --max-context 4096 --dump-layers \ + > "$OUT/poly.out" 2> "$OUT/poly.err" +rc=$? +log "strata-poly exit $rc" +$PY "$HERE/q4_tok.py" decode "$MODEL" "$OUT/poly.out" > "$OUT/poly.txt" 2> "$OUT/decode.err" + +sha256sum "$CFG" > "$OUT/cfg_after.txt" +{ + echo "=== reference (llama.cpp, 127.0.0.1:19998) ===" + cat "$OUT/ref.json" + echo + echo "=== port (strata-poly CLI) ===" + head -c 1200 "$OUT/poly.txt" + echo + echo "=== port blk0/blk1 stage dumps ===" + grep -E "blk=(0|1) " "$OUT/poly.err" | head -12 + echo "=== port log, key lines ===" + grep -iE "strata-poly|qwen4exp|error|expert cache|INFO" "$OUT/poly.err" | tail -14 + echo "=== GPU after ===" + nvidia-smi --query-gpu=index,uuid,memory.used --format=csv,noheader + echo "=== cfg sha before/after ===" + cat "$OUT/cfg_before.txt" "$OUT/cfg_after.txt" +} > "$OUT/summary.txt" 2>&1 + +kill $WD 2>/dev/null +log "DONE rc=$rc" +echo "DONE rc=$rc $(date)" > "$OUT/DONE" diff --git a/patches/qwen4exp-full-port/verify/q4_tok.py b/patches/qwen4exp-full-port/verify/q4_tok.py new file mode 100644 index 000000000..9c54efae5 --- /dev/null +++ b/patches/qwen4exp-full-port/verify/q4_tok.py @@ -0,0 +1,20 @@ +"""Tiny CLI over tools/strata_tokenizer.py for the qwen4exp smoke test: encode a file / decode an id list.""" +import re +import sys + +sys.path.insert(0, "/home/inex/PolyStrata/terminal/tools") +from strata_tokenizer import Tokenizer + +mode, gguf, src = sys.argv[1], sys.argv[2], sys.argv[3] +tok = Tokenizer.from_gguf(gguf) +if mode == "encode": + text = open(src, encoding="utf-8").read().rstrip("\n") + print(",".join(str(i) for i in tok.encode(text, parse_special=True))) +else: + # the engine's stdout can carry INFO lines too: keep only lines that are pure id lists + ids = [] + for line in open(src, encoding="utf-8"): + s = line.strip() + if s and re.fullmatch(r"[0-9][0-9,\s]*", s): + ids += [int(x) for x in s.replace(",", " ").split()] + print(tok.decode(ids), end="")