[HIP] ShortConv4 decode kernel (Inkling causal depthwise conv + history ring) verified

- k_shortconv4_decode / vetta_shortconv4_decode: exact strata
  k2_shortconv4_batched static (no-dyn) semantics — per channel
  y = x0 + sw0*h0 + sw1*h1 + sw2*h2 + sw3*x0, scaled by 1/sqrt(5); the 3-tap
  history ring (t-3,t-2,t-1) shifts h0<-h1<-h2<-x0 in place. This is a defining
  Inkling mechanism (applied to k/v/attn/mlp). f32 history here; the BF16 ring
  for bit-exact CPU match is a later parity refinement.
- Multi-step parity test: 6-token recurrence vs a CPU oracle, per-step output
  match (<1e-5) AND device history ring == host history ring after all steps
  (exact). The stateful short-conv evolves correctly across tokens.

Verified: RUSTFLAGS="-D warnings" cargo test --workspace = 97/97 PASS;
lean proofs (4 files, 42 theorems) green; GPU 11/11 (--features hip).
This commit is contained in:
adm committed 2026-12-01 14:26:14 +01:00
1 parent 00a6993c50
commit e060862660
3 files changed
+96

No files matched your search

+6
View File
@@ -78,6 +78,12 @@ int vetta_situ(const float* gu, float* act, int inter, float beta, float lb,
int vetta_moe_reduce(const float* y_part, const float* tk_w, float* out,
int top_k, int hidden, vetta_stream_t stream);
// k_shortconv4_decode: Inkling causal depthwise ShortConv4 (static), history
// ring [slots,3,C] shifted in place. cur/out [M,C], static_w [C,4].
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);
// Core <15 microkernel entry points (implemented progressively in M1 & M2):
// 1. k_embed_bf16
// 2. k_rms_norm