flashinfer.cake_rmsnorm_silu_gate_train.cake_rmsnorm_silu_gate_train_backward_workspace

flashinfer.cake_rmsnorm_silu_gate_train.cake_rmsnorm_silu_gate_train_backward_workspace(rows: int, device: device, *, deterministic: bool = True) → Tensor

A caller-owned backward workspace for rows rows (T * H).

True: the deterministic package’s uninitialized FP32 partial buffer (flashinfer.cake_rmsnorm_silu_gate_det_train.cake_rmsnorm_silu_gate_det_train_backward_workspace()). False: a zero-filled FP64 tensor of cake_rmsnorm_silu_gate_train_backward_workspace_bytes() bytes. The non-deterministic backward leaves it zero after every call, so it serves every later call on its stream (any T and H, BF16 or FP32 weight gradient) and every CUDA Graph replay without a reset. A backward that may run at the same time on another stream needs its own workspace. The two kinds do not substitute for one another: the deterministic buffer holds nonzero partials after a call, and the non-deterministic backward refuses a buffer that is not FP64.

Parameters:
  • rows (int) – Number of rows of the backward call, T * H.

  • device (torch.device) – The CUDA device the backward runs on.

  • deterministic (bool) – The deterministic flag of the backward call the workspace is for.

Returns:

The workspace on device: FP32 for True, zero-filled FP64 for False.

Return type:

torch.Tensor