flashinfer.cake_gdn_nondet_train_kcp.cake_gdn_nondet_train_kcp_workspace_bytes

flashinfer.cake_gdn_nondet_train_kcp.cake_gdn_nondet_train_kcp_workspace_bytes(ctx: Any, *, H_qk: int, HV: int, save_mode: str | None = None, boundary_mode: str = 'saved', save_transfer: bool = True, backward: bool = True, with_conv: bool = True, C: int | None = None, P: int | None = None, group_reduce: str = 'fused', reuse_recompute_tapes: bool | str | None = None, use_qk_l2norm_in_kernel: bool = False, fused_walks: int = 1, graph: str = 'off', save_for_backward: bool = True) → int

Caller-held workspace bytes of one rank for (ctx, H_qk, HV) (exchange pools, staging, tapes): the most the workspace binds in the forward or the backward of the given options (reuse_recompute_tapes as a keyword; the per-phase terms are cake_bytes.cake_gdn_nondet_train_kcp_workspace_layout of the package). save_mode="light_akk" gives the figure of a call outside a checkpoint: under torch.utils.checkpoint(use_reentrant=False) that call runs as "light" and binds the save_mode="light" figure, so a checkpointed "light_akk" layer is sized with save_mode="light".

Parameters:
  • ctx – This rank’s context from cake_gdn_nondet_train_kcp_build_context().

  • H_qk (int) – Number of query and key heads.

  • HV (int) – Number of value heads.

  • **kw – Backend options for this query, including the call’s save and boundary settings.