flashinfer.cake_gdn_det_train_kcp.cake_gdn_det_train_kcp_workspace_bytes

flashinfer.cake_gdn_det_train_kcp.cake_gdn_det_train_kcp_workspace_bytes(ctx: Any, *, H_qk: int, HV: int, save_mode: str = 'light', 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_gdn_det_train_kcp_workspace_layout of the package). use_qk_l2norm_in_kernel=True adds the transient normalized rows qn / kn (2 x 256 T_r H_qk bytes) to the forward and every backward phase, and the 8 T_r H_qk-byte FP32 r where the backward re-runs the prep program.

Parameters:
  • ctx – This rank’s context from cake_gdn_det_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.