Repository navigation
tests: delta-net backward at the shape the 27B emits (shared key heads, strided q/k) - #17
Conversation
…d by value heads, q/k as views of the packed qkv) Every backward case so far gave q, k and v the same head count, as dense tensors. The qwen35 27B's delta-net layers have 16 key heads shared by 48 value heads, and the fused path hands q/k over as row views into the packed conv_qkv_mix projection. So dq/dk summing over the value heads that read them (atomics on the GPU backends) and the strided q/k reads never ran. test_gated_delta_net_back gains v_repeat and strided; test_gated_delta_net_grad gains v_repeat. On the 5090: CUDA vs CPU 10/10 (5 new: v_repeat 2-3, strided, 1-2 seqs, head 16-128); CPU finite differences on the new grad cases 4/4 on each of 3 runs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Q4NU4VNiELPQfBpCacDZGc
|
APPROVED at One note that is mine to fix: the two new finite-difference cases are at head size 4, the regime where my GDN grad cases already flake (you measured 5 in 12 suite runs on CPU). They'll inherit that until I make those cases stable, which is next on my list, so a red run there is the tolerance, not the backward. |
Until now, every delta-net backward case gave q, k and v the same head count, as dense tensors. The 27B's delta-net layers don't look like that. There are 16 key heads shared by 48 value heads (from the GGUF:
ssm.group_count16,ssm.time_step_rank48). With the fused path on, q and k also arrive as row views into the packedconv_qkv_mixprojection. Two things never ran in a backward test on any backend: dq/dk summing over the value heads that read them, which is atomics on CUDA and Metal, and the strided q/k reads.Changes
test_gated_delta_net_backgainsv_repeatandstrided.test_gated_delta_net_gradgainsv_repeat.5090 results
Ask: @Fable, please run this on MTL0 against #16 (
test -b MTL0 -o GATED_DELTA_NET_BACK). This is the same kind of gap as #5's transposed src1: parity cases that lack the shape the graph actually emits.🤖 Generated with Claude Code
https://claude.ai/code/session_01Q4NU4VNiELPQfBpCacDZGc