flashinfer.cake_kda_det_train.cake_kda_det_train_arena¶
- flashinfer.cake_kda_det_train.cake_kda_det_train_arena(*, lean: bool = False, tail_passes: int = 1, batch_tokens: int | None = None, max_docs_per_batch: int | None = None) Any¶
The lower-memory arena option (a
CakeKDADetArena; the default,lean=False, tail_passes=1, no batching, is the full layout).lean=Trueselects the lean backward layouts (4108 B per internal token-head with one tail pass instead of the default’s 4488, tape 3720; no checkpoint replay on such a workspace);tail_passes >= 2(implieslean) runs the backward’s tail, the fused gradient / GLM intra / gate epilogue, once per range ofceil(NC_pad / tail_passes)chunks over per-range buffers: 2820 B per internal token-head plus three state blocks on the floor, the same gradients bitwise, some speed cost (see the package README).batch_tokensruns the forward and the backward over groups of whole, contiguous documents of at most that many tokens (and at mostmax_docs_per_batchdocuments, which needsbatch_tokens) in an arena sized for the largest group (attail_passes; each group runs its tail in the fewest passes up to that which fit the arena); the calls then takedoc_lengths. Bitwise the same results, except that an exactly-zerou/wentry of a chunk whose pair partner changed may change sign; refused on the rows with at most four (document, head) chains on the segmented route.