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) forStokens innum_docsdocuments withHheads ondevice, reused by every call that receives it: the forward layout only withbackward=False;save_modeis 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 whenNone; under a batched optiondoc_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_kernelare the gate and Q/K L2 norm modes of the calls it serves (a call in another mode is refused).