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
Follow-up to #45 (PR #49), which fixed the serialization (30.77 → 3.66 ms, block-per-pair). Two known levers remain, both measured against the sub-1 ms bandwidth floor:
float4-vectorize the row copy in moe_scatter_dy (D=3072 is 16B-aligned; lanes currently move one f32 per iteration).
Fold backward.router.zero_dy_bins (3.74 ms full E·C·D fill) into dead-slot zeroing: the routing acts hold assignment_counts, so a block-per-slot pass can zero only unassigned capacity slots instead of pre-filling the whole bin buffer, removing the separate fill_zero launch. PR perf: block-per-pair moe_scatter_dy (30.8 -> 3.7 ms, closes #45) #49 left this out to keep the parity-critical diff minimal (different index space: dead capacity slots per expert vs. (token, slot) pairs).
Combined these target ≈ 7.4 ms → ≈ 1–2 ms of step time at B=12.
Landed on main (64e74a4, merge 6f0d6ea). Both levers: (1) vectorized row copies in moe_scatter_dy — carried as u128, not an align(16) [f32;4] aggregate, because codegen SROAs aggregate loads back to scalar ld.global.b32; the u128 form survives as ld/st.global.v2.b64, verified in the PTX. (2) moe_zero_dead_bins replaces the full E·C·D pre-fill: block-per-(expert,slot), early-out on assigned slots — sound because bin assignment is dense, so assigned slots are exactly the prefix 0..min(count,C) and the two kernels partition the buffer. Measured (B200, same-container A/B, B=12): zero_dy_bins 3.80 ms → zero_dead_bins 0.50 ms (7.6×); scatter_dy 3.69 → 2.81 ms (1.31×); pair 7.49 → 3.31 ms (2.27×). Short of the 1–2 ms target: scatter_dy is bound by its 3-rows-per-pair traffic, noted in SPEC. Note for future readers: the gate-gradient dot changed summation order (deterministic, but not bit-identical to pre-#55). SPEC §13.9.
Activity
perf(moe): float4 scatter_dy rows + dead-slot bin zeroing (#55)
perf(moe): carry vector row copies through u128, not an f32x4 aggrega…
docs: SPEC 13.9 measured A/B for #55 (pair 7.49 -> 3.31 ms)
Merge branch 'perf/issue-55-scatter-dy-phase2': vectorized scatter_dy…
feitreim commentedon Jul 25, 2026
Landed on main (64e74a4, merge 6f0d6ea). Both levers: (1) vectorized row copies in moe_scatter_dy — carried as u128, not an align(16) [f32;4] aggregate, because codegen SROAs aggregate loads back to scalar ld.global.b32; the u128 form survives as ld/st.global.v2.b64, verified in the PTX. (2) moe_zero_dead_bins replaces the full E·C·D pre-fill: block-per-(expert,slot), early-out on assigned slots — sound because bin assignment is dense, so assigned slots are exactly the prefix 0..min(count,C) and the two kernels partition the buffer. Measured (B200, same-container A/B, B=12): zero_dy_bins 3.80 ms → zero_dead_bins 0.50 ms (7.6×); scatter_dy 3.69 → 2.81 ms (1.31×); pair 7.49 → 3.31 ms (2.27×). Short of the 1–2 ms target: scatter_dy is bound by its 3-rows-per-pair traffic, noted in SPEC. Note for future readers: the gate-gradient dot changed summation order (deterministic, but not bit-identical to pre-#55). SPEC §13.9.
Merge branch 'main' into chore/issue-56-cuda-oxide-b099f64