mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #3806] [Engine] Gyro-L: TQP5/TQP6/TQP7 (ggml 147-149) pack, CPU, CUDA and MMQ prompt path #4789
Labels
No labels
needs-format
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Niko1221/Strata#4789
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Niko1221/Strata/pull/3806
Author: @unverbraucht
Created: 10/23/2026
Status: 🔄 Open
Base:
main← Head:stock-tqp📝 Commits (3)
bbd666bGyro-L: TQP5/TQP6/TQP7 (ggml 147-149) pack, CPU and GPU support on 0.1.479f0ed96Gyro-L: TQP5/6/TQP7 in the trellis MMQ overlay (builds on the pinned upstream llama.cpp)5406dddGyro-L: the perf fixes, the pinned-build test tooling, and the docs📊 Changes
14 files changed (+471 additions, -33 deletions)
View changed files
📝
CMakeLists.txt(+5 -1)📝
cmake/strata_ggml_tq_overlay.cmake(+10 -7)📝
docs/GYRO.md(+10 -3)📝
include/strata/artifact/gguf_reader.hpp(+19 -0)📝
include/strata/kernels/cpu/tq_cpu.hpp(+10 -1)📝
src/kernels/cpu/tq_avx2.cpp(+71 -0)📝
src/kernels/cpu/tq_cpu.cpp(+66 -4)📝
src/kernels/cpu/tq_states.hpp(+20 -0)📝
src/kernels/cuda/iq_kernels.cu(+131 -7)📝
src/kernels/native_expert_parity.cpp(+27 -0)📝
src/prefill/moe_mmq.cu(+11 -3)📝
third_party/ggml-tq/tq.cuh(+67 -7)📝
third_party/ggml/ggml-common-tq.h(+20 -0)📝
tools/gguf_reader.py(+4 -0)📄 Description
Problem and result
Gyro-L (agentionai's 50 GiB file, 2026-10-12) is the one Gyro file the engine refuses today:
docs/GYRO.mdsays"not supported: it uses another trellis family (types 147-149) that the engine does not have" (issue #3473).
Before: the load check and
iq_packrejectper_layer_token_embd/expert tensors of types 147-149, and the promptand decode kernels have no instance for them. After: the published file packs, loads and serves like Gyro-S/M —
on the CMP 170HX (all 24,576 experts in VRAM, 262144 context, int8 KV, MTP): 32K prompt 1955.5 tok/s, decode
71.2 tok/s, coherent answers.
Related discussion
Issue #3473 ("Hope to have Gyro-L support soon"). This is a new expert type family, so it needs the scope agreed; it
changes no default and no existing file's answers.
Approach
The pair trellis is the same 128-value block and 8-lane × 16-value geometry as TQ2_T/TQK6/TQK7, but with 64 steps of
two weights: step t's 16-bit state (stream bit
(63 - t)*K, circular) picks the first pair of the TQ2_Tcodebook entry the same hash selects. So it reuses the existing infrastructure: the state tables, the int8 codebook,
the grouped-expert kernels, the MMQ tile loader (routed as IQ2_XS, the same Q8_0_16 layout) and the overlay.
tools/gguf_reader.py,include/strata/artifact/gguf_reader.hpp: type names and geometry (42/50/58 B).include/strata/kernels/cpu/tq_cpu.hpp:tq_block_bytesfor the pair layout (2 + 8K, not2 + 4K).src/kernels/cpu/tq_states.hpp,tq_cpu.cpp:tq_state_tqp/tq_states_tqp, the scalar pair row kernel, the147-149 routing, and
tq_rows_avx2_tqp(8 states per YMM of 16 int16 weights, one VPMADDWD sum per 32-valuegroup; bitwise equal to the scalar kernel).
src/kernels/cuda/iq_kernels.cu:TqInfo<147..149>,tqp_states8,tq_load_tqp,vec_dot_tqp_q8_1,Fmt<147..149>,dq_tqp/tqp_pair,dq_dispatch,iq_row_bytes,is_iq, theSTRATA_*_FMTSlists and thedecode-once
SplitTqp/kSplit.src/prefill/moe_mmq.cucases and, incmake/strata_ggml_tq_overlay.cmake+third_party/ggml-tq/tq.cuh,the enumerators, traits,
tqp_states8, thetq_lane_to_q8pair branch, themmq.cuhrouting and the threeinstances. A build with
-DSTRATA_GGML_DIR=<the agention llama.cpp>uses that tree's own instances instead.GGML_TYPE_COUNT:native_expert_paritynames tqp5/6/7 andskips the synthetic check with a message when ggml has no traits for them, and
moe_mmq.cu'sis_tq/type_bytes/type_labelcover 147-149 (without that the pinned build askedggml_blck_sizeabout anunknown type at startup and died with SIGFPE).
docs/GYRO.md: how Gyro-L runs and what it measures.Validation
Passed:
native_expert_parity --load-check <pack> <the Gyro-L GGUF>— revision5406dddd, CMP 170HX sm_80, CUDA 13.3:0 failures(48 layers tqp6/tqp6, 45.12 GiB,hadamard block 128, 48 layers folded, PLE Q8_0 320,001,536 rows).native_expert_parity --synthetic-hadamard tqp6/tqp6 tqp7/tqp7 tqp5/tqp5on a build with-DSTRATA_GGML_DIR=<the agention llama.cpp>:0 failures— GPU dequant bit-identical to ggml'sto_float(0 of 4,915,200 values differ in any bit), AVX2 bitwise equal to the scalar kernel, decode-once vs per-entry
bitwise equal.
build-overlay/strata), the same 32K prompt used for theGyro-S/M numbers: prompt 1955.5 tok/s, decode 71.2 tok/s, coherent answer. The port before the decode fixes
measured 1806.8 / 61.3 on the same box.
-DSTRATA_GGML_DIR=<the agention llama.cpp>.Failed: none observed.
Not run:
Mac/Intel Arc/HIP build the file loads (the CPU path) but the prompt falls back to the FP16 path.
1864/70.3 with the same pack.
--mmap-experts).Limits
other ggml gets the FP16 prompt path, exactly as the other trellis types do.
(
tools/ple_fp8_pack.py) is picked up with--ple-ggufand is already format-generic.halo-box/strix-llama.cpp#195implements the same types independently; itstqp_stateandblock layout are the same reading as this one.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.