[HIP] SiTU activation + MoE reduce kernels — full MoE primitive set verified
- k_situ: SiTU double-softcapped MoE activation, exact strata situ_f32 — g_act = beta*tanh(g/beta)*sigmoid(g), u_act = lb*tanh(u/lb), act = g_act*u_act (beta=4, lb=25). gu=[gate;up] from w13 -> act[inter]. - k_moe_reduce: out[d] = sum_e tk_w[e]*y_part[e,d] (weighted expert sum). - C ABI + safe wrappers (situ, moe_reduce) + CPU-oracle parity tests. With nvfp4_gemv (w13/w2) + moe_router_topk, the full MoE compute primitive set is now verified on gfx1150: router -> per-expert nvfp4 GEMV -> SiTU -> nvfp4 GEMV -> weighted reduce. Parity: SiTU ~4e-7 (inter 1152/64/256), moe_reduce ~3e-6 (top-8, hidden 2304). Ten GPU kernels verified. Verified: RUSTFLAGS="-D warnings" cargo test --workspace = 97/97 PASS; lean proofs (4 files, 42 theorems) green; GPU parity 10/10 (--features hip).
This commit is contained in:
1 parent
bd49da5636
commit
529709cc64
3 files changed
+123
No files matched your search
@@ -70,6 +70,14 @@ int vetta_nvfp4_gemv(const uint8_t* packed, const uint8_t* scales,
|
||||
float outer_scale, const float* x, float* y,
|
||||
int N, int K, vetta_stream_t stream);
|
||||
|
||||
// k_situ: SiTU double-softcapped MoE activation. gu=[gate;up] (2*inter) -> act.
|
||||
int vetta_situ(const float* gu, float* act, int inter, float beta, float lb,
|
||||
vetta_stream_t stream);
|
||||
|
||||
// k_moe_reduce: out[d] = sum_e tk_w[e]*y_part[e,d] (weighted expert sum).
|
||||
int vetta_moe_reduce(const float* y_part, const float* tk_w, float* out,
|
||||
int top_k, int hidden, vetta_stream_t stream);
|
||||
|
||||
// Core <15 microkernel entry points (implemented progressively in M1 & M2):
|
||||
// 1. k_embed_bf16
|
||||
// 2. k_rms_norm
|
||||
|
||||
Reference in new issue
Block a user