flashinfer.cake_mhc_nondet_train.cake_mhc_nondet_train_forward_stats¶
- flashinfer.cake_mhc_nondet_train.cake_mhc_nondet_train_forward_stats(X: Tensor, fn: Tensor, scale: Tensor, base: Tensor, *, rms_eps: float = 1e-05, hc_eps: float = 1e-06, sinkhorn_iters: int = 20, stats_out: Tensor | None = None, workspace: Tensor | None = None) Tensor¶
Recompute the per-token statistics of
forward_prepare(checkpoint replay).The arguments and output are those of
cake_mhc_det_train_forward_stats(); the call runs the backend package (the deterministic package’s bits).- Parameters:
X (torch.Tensor) – As in
cake_mhc_nondet_train_forward_prepare().fn (torch.Tensor) – As in
cake_mhc_nondet_train_forward_prepare().scale (torch.Tensor) – As in
cake_mhc_nondet_train_forward_prepare().base (torch.Tensor) – As in
cake_mhc_nondet_train_forward_prepare().rms_eps (float, float, int) – As in
cake_mhc_nondet_train_forward_prepare().hc_eps (float, float, int) – As in
cake_mhc_nondet_train_forward_prepare().sinkhorn_iters (float, float, int) – As in
cake_mhc_nondet_train_forward_prepare().stats_out (torch.Tensor, optional) – Preallocated FP32
[T, 64]contiguous statistics record.workspace (torch.Tensor, optional) – Caller-owned forward workspace (
hidden=X.shape[2]); a per-device default when omitted.
- Returns:
FP32
[T, 64]stats, bitwise the record ofcake_mhc_nondet_train_forward_prepare()for the same inputs.- Return type:
torch.Tensor