M3: HyperFormer level 1 runtime (GyRoPE, real-part attention, SAIL) #4

Closed
opened 2026-11-11 17:20:20 +00:00 by dsh · 1 comment
Member

Run HyperFormer level 1 in the fork after RAT (#3) proves the arch plumbing.

Scope (devops/runtime.md):

  • complex linears as plane pairs (4 MUL_MAT each), GyRoPE (learned hypercomplex rotation: normalize axis_params at load, rotor (cos(theta*t), sin(theta*t)*u), identity at t=0), real-channel attention with a KV cache (the Python model has none), SAIL = w3(cd_mul(w1(x), w2(x))), HyperRMSNorm via stock rms_norm with weight/sqrt(2) and eps 5e-7.
  • input: models/tardits/hyper11m.gguf (converted in #2 from hyper_11m_h8_lr5e4_dofix), goldens tardits2gguf/goldens/hyper11m.{npz,json}.
  • parity: per-op then end-to-end, ~1e-4 relative tolerance, greedy 8 [0, 52, 72, 69, 0, 83, 84, 79].

Levels 2-4 are a separate milestone (needs the cd_mul op).

Run **HyperFormer level 1** in the fork after RAT (#3) proves the arch plumbing. Scope (`devops/runtime.md`): - complex linears as plane pairs (4 MUL_MAT each), GyRoPE (learned hypercomplex rotation: normalize `axis_params` at load, rotor `(cos(theta*t), sin(theta*t)*u)`, identity at t=0), real-channel attention with a KV cache (the Python model has none), SAIL = `w3(cd_mul(w1(x), w2(x)))`, HyperRMSNorm via stock rms_norm with `weight/sqrt(2)` and eps 5e-7. - input: `models/tardits/hyper11m.gguf` (converted in #2 from `hyper_11m_h8_lr5e4_dofix`), goldens `tardits2gguf/goldens/hyper11m.{npz,json}`. - parity: per-op then end-to-end, ~1e-4 relative tolerance, greedy 8 `[0, 52, 72, 69, 0, 83, 84, 79]`. Levels 2-4 are a separate milestone (needs the `cd_mul` op).
dsh self-assigned this 2026-11-11 17:20:21 +00:00
Author
Member

M3 is done (0b47c9e60): HyperFormer runs in llama.cpp.

  • New arch string tardits-hyper (attention) next to tardits (recurrent RAT); the arch string is the memory-layout contract. Hybrid was tried first and rejected for uniform files (unused sub-input crash), see #5.
  • Converter folds the complex attention out_proj into one real 2C x 2C matrix (+ bias) that build_attn applies; standard GGUF hparam keys are prefixed per arch string.
  • Graph: GyRoPE via stock ggml_cos/ggml_sin + repeats, q/k/v planes flattened to {2hs,H,T}, attention through build_attn with n_embd_head_k/v_full = 2*hs and a KV cache, plane-major output split, SAIL/norm shared with RAT.
  • Verified: hyper single-step 1.907e-06, 44-token prefill 1.907e-06 (and n_ubatch=16), greedy-8 [0, 52, 72, 69, 0, 83, 84, 79] identical, llama-completion generates "The quick brown fox a season and th". RAT re-verified unchanged (3.8e-6 / 3.3e-6). check_parity.sh runs all four checks, 4/4 PASS.

Next: levels 2-4 (cd_mul) in #6, then Android.

**M3 is done** (`0b47c9e60`): HyperFormer runs in llama.cpp. - New arch string `tardits-hyper` (attention) next to `tardits` (recurrent RAT); the arch string is the memory-layout contract. Hybrid was tried first and rejected for uniform files (unused sub-input crash), see #5. - Converter folds the complex attention `out_proj` into one real `2C x 2C` matrix (+ bias) that `build_attn` applies; standard GGUF hparam keys are prefixed per arch string. - Graph: GyRoPE via stock `ggml_cos`/`ggml_sin` + repeats, q/k/v planes flattened to `{2hs,H,T}`, attention through `build_attn` with `n_embd_head_k/v_full = 2*hs` and a KV cache, plane-major output split, SAIL/norm shared with RAT. - Verified: hyper single-step `1.907e-06`, 44-token prefill `1.907e-06` (and `n_ubatch=16`), greedy-8 `[0, 52, 72, 69, 0, 83, 84, 79]` identical, `llama-completion` generates "The quick brown fox a season and th". RAT re-verified unchanged (3.8e-6 / 3.3e-6). `check_parity.sh` runs all four checks, 4/4 PASS. Next: levels 2-4 (`cd_mul`) in #6, then Android.
dsh closed this issue 2026-11-11 19:07:21 +00:00
Sign in to join this conversation.
No description provided.