flashinfer.cake_moe_grouped_gemm_nondet_train.cake_moe_grouped_gemm_nondet_train_prepare_dgrad¶
- flashinfer.cake_moe_grouped_gemm_nondet_train.cake_moe_grouped_gemm_nondet_train_prepare_dgrad(g: torch.Tensor, w: torch.Tensor, offs: torch.Tensor, out: torch.Tensor | None = None) CakeMoEGroupedGemmNondetLaunch¶
Prepare
dX[sum_m, K] = grouped G @ W[e](W read in place; bf16 in, bf16 out).g:[sum_m, N]bf16;w:[E, N, K]bf16;offs: int32[E]device end offsets;K % 256 == 0,N % 64 == 0(the 512-column tile whenK % 512 == 0on the architectures ofwide_dgrad_archs, its L2 evict-first twin wheredgrad_evict_firstholds forK,sum_mandE, its 3 / 3 head / tail twin wheredgrad_wide_ts33holds). The programs are copies of the deterministic package’s and give its bits.- Parameters:
g (torch.Tensor) – BF16
[sum_m, N]packed output-gradient rows.w (torch.Tensor) – BF16
[E, N, K]expert weights, read in place.offs (torch.Tensor) – int32 device cumulative end offsets
[E], or leading-zerom_indptr [E + 1].out (torch.Tensor, optional) – Caller-owned BF16
[sum_m, K]output; allocated when omitted.