flashinfer.cake_mhc_nondet_train.cake_mhc_nondet_train_prepare

flashinfer.cake_mhc_nondet_train.cake_mhc_nondet_train_prepare(X: Tensor, fn: Tensor, scale: Tensor, base: Tensor, *, rms_eps: float = 1e-05, hc_eps: float = 1e-06, sinkhorn_iters: int = 20, save_stats: bool = True, workspace: Tensor | None = None, backward_workspace: Tensor | None = None)

Autograd-enabled forward_prepare: (U, handle); pass handle to cake_mhc_nondet_train_finish().

The arguments and outputs are those of cake_mhc_det_train_prepare(); the call makes the backend package’s prepare node. Its forward and its checkpoint replay are the deterministic package’s bits; its backward runs backward_finish (see cake_mhc_nondet_train_backward_finish()).

Parameters:
Returns:

(U, handle): BF16 U of shape [T, H] and the handle of this prepare node for one cake_mhc_nondet_train_finish().

Return type:

tuple