For the complete documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /get-started.md).
Mojo function
ws_p_ceiling
def ws_p_ceiling[sm_count: Int, oversubscribe: Bool](raw_grid: UInt32) -> UInt32
Capture-invariant partition-count ceiling for the split-K crossover: follows one GPC wave's SM-fill, holds the plateau through WS_SWEEP_MAX_RAW_GRID, then decays toward one partition.
raw_grid is capture-invariant (see _bucket_ws), so this is a single
fixed value per CUDA-graph capture.
WS_RAW_GRID_CLAMP clamps raw_grid instead of multiplying the wave-fill:
a flat multiple reproduces the moderate-batch optimum but also scales the
already-good small-raw_grid case into a measured regression, so clamping
leaves small grids untouched while lifting a small one-wave toward the
plateau. Beyond the sweep, the inverse target keeps the split grid near a
fixed wave budget rather than growing with raw_grid.
oversubscribe targets oversub CTAs per SM rather than one. The factor
comes from the ragged (roughly exponential) cache-length distributions the
constants were swept on, where most CTAs early-return with no work and
over-splitting is what fills the SMs. A sliding-window mask caps the cache
length, so its distribution is near-uniform, every CTA gets work, and the
ceiling should target sm_count directly -- pass False there. Measured
2026-10-07 and 2026-10-09 on B200 (sm_count 148) over eleven shapes of a
12-head sliding-window-4096 model, the best P x raw_grid is about
sm_count: raw_grid 24 wants 6, 48 wants 2 to 3, and 96 and above want
1.
Returns: