M4: levels 2-4 - cd_mul op, hypercomplex linears, converter + parity #6
Labels
No labels
NaNs
area/android
area/backup
area/build
area/docs
area/dsh
area/forgejo
area/gguf
area/host
area/kernel
area/runtime
area/security
bootcamp
needs-operator
note
priority/later
priority/next
priority/now
type/bug
type/experiment
type/task
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
ml-lab/llama.cpp#6
Loading…
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?
Extend the port from level 1 (complex) to Cayley-Dickson levels 2-4 (quaternion, octonion, sedenion).
ggml_cd_mul(elementwise, level in op params, CPU f32) +cd_conjugate; level 4 is non-alternative, no scan shortcuts.HyperLinearlevel >= 2: real spread matrix from the CD table at load -> stock MUL_MAT (4x/16x/64x memory), or a later cd_mul_mat kernel.ggml_tardits_scanis level-1-only today - extend with a level/CD table or add a separate op; keep level-1 byte-identical.Start with converter + cd_mul on standalone tensor fixtures, then RAT level 2, then 3-4. Reference: devops/tardits.md, devops/runtime.md, devops/research/tardits-inventory.md.
M4a landed (
869c8ed7f): llama.cpp now speaks hypercomplex - HyperFormer at levels 2, 3 and 4 runs, not just complex.ggml_cd_mulop (CPU f32, levels 1-4, elementwise Cayley-Dickson product) - the kernel that unlocks CD levels anywhere in the graph.tardits-hyperarch string.n*Cwide),{n,C,T}activations, GyRoPE rotor viaggml_cos/ggml_sin+cd_mul, attention overn*hsreal channels withwo=nullptrthen spread out_proj, generalised HyperRMSNorm.tools/make_random_fixtures.py) + committed goldens;check_parity.shnow runs 10 checks - 10/10 PASS:Level-1 RAT and hyper regression unchanged; all five GGUFs generate via stock
llama-completion. Docs:devops/runtime.mdM4a section,devops/gguf-bridge.mdlevel>=2 tensor table.Remaining for this issue (M4b): RAT levels 2-4 - hypercomplex state (
gamma), ingest (v (x) conj(k)) and recall are bilinear, so this needs an outer-product CD op plus a level-aware scan; the level-1ggml_tardits_scanstays byte-identical. Plus the true CTest fixture (generates a tiny GGUF in the build tree). Keeping the issue open for that.M4 is complete for both families (
44411d817+8703c4965):M4b - RAT levels 2-4 (
44411d817)ggml_tardits_scan_cd: one fused node per layer/token-block doingS_t = cd_mul(S,gamma) + cd_mul(v,conj(k)),out = scale*sum_k cd_mul(S,q). Ingest/recall are bilinear, so an elementwise expansion would blow up the graph; level is in op params, gamma[n,hs_v,hs_k,H], state[n*hs*hs*H]. Level-1ggml_tardits_scanuntouched.convert_hc.pyfor both arch strings.RAT.step): quaternion 1.587e-06 / 1.311e-06, octonion 8.345e-07 / 8.941e-07, sedenion 5.513e-07 / 5.215e-07 (single-step / prefill-44), greedy chains exact.check_parity.shnow runs 16 checks, 16/16 PASS.M4c - SmolLM2 BPE tokenizer (
8703c4965)--tokenizer-dirwrites a GPT-2-style BPE (pre=smollm), verified against HF on 95/95 encode + 95/95 detok + special probes; char GGUFs byte-identical. This is what the trained Colab checkpoint will use so llama.cpp speaks words instead of characters.Remaining follow-up (not blocking): a true CTest parity fixture that generates a tiny GGUF in the build tree - moving that to a fresh issue. Closing this one.