Skip to content

vllm.model_executor.kernels.linear.cute_dsl.ll_fp32w

_default_config(M, N)

(bs, token_groups, epb) for any (K, N) without a tuned entry.

_DEFAULT_DOTPROD_CONFIG runs up to 1.9x slower than the best config above M=4 on B300 and H200 (K in [2048, 8192], N in [96, 296]). There, even M splits the tokens into two groups to cut accumulator registers, and once N > 128 keeps half the grid busy each block takes two experts.

Source code in vllm/model_executor/kernels/linear/cute_dsl/ll_fp32w.py
def _default_config(M: int, N: int) -> tuple[int, int, int]:
    """`(bs, token_groups, epb)` for any `(K, N)` without a tuned entry.

    `_DEFAULT_DOTPROD_CONFIG` runs up to 1.9x slower than the best config
    above M=4 on B300 and H200 (K in [2048, 8192], N in [96, 296]). There,
    even M splits the tokens into two groups to cut accumulator registers,
    and once N > 128 keeps half the grid busy each block takes two experts.
    """
    even = M % 2 == 0
    if M <= 4:
        return _DEFAULT_DOTPROD_CONFIG
    if N <= 128 and even and M >= 12:
        return _DEFAULT_DOTPROD_GROUPED_CONFIG
    wide_grid = N > 128
    if M <= 8:
        return 256, 2 if even and not wide_grid else 1, 1
    # The kernel loads both experts of a pair unguarded, so pairs need even N.
    epb = 2 if wide_grid and N % 2 == 0 else 1
    return (128, 2, epb) if even else (256, 1, epb)