You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Router fp32 kernels run ~30x off bandwidth-bound at D=3072 #44
Combined ≈ 29 ms of the ~410 ms non-attention step (7%) for GEMMs that are, by FLOPs, a rounding error ([N,3072]×[3072,8]).
The routing-stays-fp32 rule (8b) is correct and not in question — the problem is kernel shape:
router_logits launches grid=(N,1,1), block=(E,1,1) — eight threads per CTA, each striding the full D=3072 row. Occupancy and coalescing are both wrecked; the cost is pure launch geometry, not precision.
router_backward_input is one thread per (token, d) doing an E-wide dot; same per-thread serial-stride pattern over router[D,E].
router_backward_weight_tiled was already rescued once (8d follow-up, 4.89 → 0.92 ms/block at D=1536) but its fixed 2×8-tile/16-partition geometry hasn't been re-sized for D=3072; it's back to ~0.94 ms/block.
Sketch
router_logits: warp (or CTA tile) per token — coalesced D-row loads, warp-reduce the 8 dots; or simply route it through the existing fp32 register-tiled GEMM (gemm_into) which already handles skinny-N shapes far better than 8-thread blocks.
router_backward_input: vectorized thread-per-(token,d) with the E=8dlogits row staged in shared/registers per CTA (it's 32 bytes — broadcast, don't re-read).
router_backward_weight_tiled: re-derive tile/partition constants for D=3072 (SWEEP harness), or fold into the same skinny-GEMM path as logits.
All three stay fp32 end-to-end.
Gates
Router parity in the MoE model gate (exact fp32 comparisons on logits/top-k unchanged — routing decisions must not move).
§10.1 same-container profile: the three spans combined from ≈ 29 ms to low single digits.
Activity
perf: register-tiled weight reuse for the router backward passes