[HIP] dynamic-tap ShortConv4 kernel (full-attn layers) verified

- k_shortconv4_dyn_decode / vetta_shortconv4_dyn_decode: exact strata
  k2_shortconv4 dyn semantics for the full-attention layers — y = x0 +
  sw0*h0+sw1*h1+sw2*h2+sw3*x0, then y += dt0*x0+dt1*h2+dt2*h1+dt3*h0, scaled
  by 1/3 (vs 1/sqrt(5) for the static SWA variant). dyn_taps [M,n_heads,4],
  head = c/(C/n_heads); static_w [C,4]; history ring shifted in place.
- Multi-step parity test: 5-token recurrence vs CPU oracle, per-step match
  (<1e-5) AND device history ring == host history ring (exact). The dynamic
  short-conv (driven by k/v_sconv.weight_proj taps) evolves correctly.

This is the last shortconv variant needed for the full-attn layers {5,11,17,23}
(3-query mix split + separate q/k/v norms + dyn shortconv + tau + global attn).

Verified: RUSTFLAGS="-D warnings" cargo test --workspace = 97/97 PASS;
lean proofs (5 files incl. inkling_loop) green; GPU 16/16 (--features hip).
This commit is contained in:
adm committed 2026-12-01 15:00:00 +01:00
1 parent 04aae6db9d
commit 38a983ce80
3 files changed
+97

No files matched your search

+5
View File
@@ -93,6 +93,11 @@ int vetta_shortconv4_decode(const float* cur, const float* static_w, float* hist
float* out, const int32_t* slot_ids, int M, int C,
vetta_stream_t stream);
// k_shortconv4_dyn_decode: full-attn ShortConv4 with dynamic taps [M,n_heads,4].
int vetta_shortconv4_dyn_decode(const float* cur, const float* static_w, const float* dyn_taps,
float* hist, float* out, const int32_t* slot_ids,
int M, int C, int n_heads, vetta_stream_t stream);
// k_attn_res_mix: Inkling AttnRes deep-residual block-mix. blocks [n_blocks,M,D]
// snapshots + cur [M,D] -> out [M,n_queries,D] (RMS-normalized depth mix).
int vetta_attn_res_mix(const float* blocks, const float* cur, const float* queries,