flashinfer.cake_causal_conv1d_train.cake_causal_conv1d_train_backward_workspace_bytes

flashinfer.cake_causal_conv1d_train.cake_causal_conv1d_train_backward_workspace_bytes(S: int, C: int, device: device) → int

Bytes of the caller-owned backward workspace for C channels on device.

The workspace holds the FP32 [rows, C, 4] dweight partials (and, for the bias routes, a [rows, C] dbias slab after them) of the backward’s main program, one row per n_ch_tiles CTAs of a program’s launch grid (rows = ceil(grid / n_ch_tiles), grid = grid_mult x ctas_per_sm x SM count: the bytes grow with the program’s over-decomposition factor grid_mult; a call whose grid drops CTAs to whole channel-tile ranks, cake_jit.main_grid, writes fewer rows), sized by the largest such buffer over every backward program of every backward route of the architecture: the call’s arguments select the route and the channel count the program, every program writes the leading rows of its own grid inside this buffer, and its reduce program sums exactly those. So one buffer serves every route (the bias routes’ fifth slab makes it 25 % larger than the dweight partials alone, for every caller) and, as it depends on C and the device only, every token count; the main program fully writes the rows the reduce program sums, so the buffer needs no zeroing between launches or CUDA Graph replays.