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 #43 (PR #50), which landed the fused quantize+transpose fallback (spans −10…−22%). The full win — forward-parity efficiency on the weight-grad spans — still requires eliminating the transpose materialization entirely: a dW += Aᵀ·B tcgen05 variant that reads both operands in native row-major layout via the Tcgen05InstructionDescriptortranspose_a/transpose_b bits (and matching TMA box/swizzle/smem-descriptor LBO/SBO geometry).
PR #50 deferred this deliberately: no example in cuda-oxide v0.2.1 exercises the transpose bits, and the only iteration loop for MN-major swizzle geometry is full Modal cycles with swizzle_probe. Suggested approach: first build a minimal standalone probe kernel (à la swizzle_probe / the #47score_mma probe) that validates a descriptor-transposed MMA against a CPU oracle on one tile, then port the weight-grad path.
Also in scope once the descriptor route exists: the lm-head backward.lm_head.transpose_input/transpose_dlogits (already-bf16 movement with no quantize to fold — untouched by #50).
Landed on main (64e74a4). The probe-first approach paid off: gpu/gemm transpose_probe sweeps descriptor geometries as launch parameters (one Modal run, many candidates). Settled geometry for a transposed M128 operand under SWIZZLE_128B: two stacked 64-wide subtiles, LBO=8192 (subtile jump, not the 16-byte core-matrix step), SBO=1024, 2048 B per K=16 chunk; the operand stays fully swizzled. M64 fails identically for K-major and MN-major A — the 7e15 dead end is a property of the shape, not the layout. The port landed: gemm_tcgen05_bf16_optimized transposed=1 (both descriptor bits + swapped TMA coords), weight grads consume native row-major operands, the #50 fused quantize+transpose kernels became plain quantizes, rhs_t and the lm-head transpose passes are deleted. BUT the perf premise didn't hold: all four weight-gemm spans are flat within noise — they're DRAM-bound re-reading the K=E·C=49152 operand slice, so operand orientation was never the lever; weight reuse is the only one left there (SPEC updated). The real win is memory: workspace 167.9 → 164.3 GiB (+35% free headroom), two kernels and three scratch buffers gone. SPEC §13.9.
Activity
probe: tcgen05 descriptor transpose_a/transpose_b geometry sweep (#53)
gemm: descriptor-transposed operand path for the pair-UMMA GEMM (#53)
perf: weight gradients consume native row-major operands (#53)
docs: SPEC 13.9 descriptor-transpose weight gradients (#53)
Merge branch 'perf/issue-53-wgrad-descriptor-transpose': descriptor-t…
feitreim commentedon Jul 25, 2026
Landed on main (64e74a4). The probe-first approach paid off: gpu/gemm transpose_probe sweeps descriptor geometries as launch parameters (one Modal run, many candidates). Settled geometry for a transposed M128 operand under SWIZZLE_128B: two stacked 64-wide subtiles, LBO=8192 (subtile jump, not the 16-byte core-matrix step), SBO=1024, 2048 B per K=16 chunk; the operand stays fully swizzled. M64 fails identically for K-major and MN-major A — the 7e15 dead end is a property of the shape, not the layout. The port landed: gemm_tcgen05_bf16_optimized transposed=1 (both descriptor bits + swapped TMA coords), weight grads consume native row-major operands, the #50 fused quantize+transpose kernels became plain quantizes, rhs_t and the lm-head transpose passes are deleted. BUT the perf premise didn't hold: all four weight-gemm spans are flat within noise — they're DRAM-bound re-reading the K=E·C=49152 operand slice, so operand orientation was never the lever; weight reuse is the only one left there (SPEC updated). The real win is memory: workspace 167.9 → 164.3 GiB (+35% free headroom), two kernels and three scratch buffers gone. SPEC §13.9.
Merge branch 'main' into chore/issue-56-cuda-oxide-b099f64
docs: SPEC 13.9 for #58 — step 1 landed, step 2 measured and reverted