flashinfer.cake_kda_det_train.cake_kda_det_train_workspace

flashinfer.cake_kda_det_train.cake_kda_det_train_workspace(S: int, num_docs: int, H: int, device: device | str, *, backward: bool = True, save_mode: str = 'light', arena: Any | None = None, doc_lengths: Sequence[int] | None = None, use_gate_in_kernel: bool = False, use_qk_l2norm_in_kernel: bool = False) → Any

A caller-owned CakeKDADetWorkspace (one arena of internal intermediates) for S tokens in num_docs documents with H heads on device, reused by every call that receives it: the forward layout only with backward=False; save_mode is the default of the calls on it and sizes the arena for that mode; arena (cake_kda_det_train_arena()) is the lower-memory arena option, off when None; under a batched option doc_lengths (the documents’ token counts) sizes the arena for the exact document groups instead of the bound of every group; use_gate_in_kernel / use_qk_l2norm_in_kernel are the gate and Q/K L2 norm modes of the calls it serves (a call in another mode is refused).