Skip to content

vllm.model_executor.kernels.linear.mixed_precision.conch

_conch_padded_width(N)

Columns added to reach conch's block_n tile width (0 when aligned).

Source code in vllm/model_executor/kernels/linear/mixed_precision/conch.py
def _conch_padded_width(N: int) -> int:
    """Columns added to reach conch's block_n tile width (0 when aligned)."""
    block_n, _ = _conch_tile_sizes()
    return (-N) % block_n

_conch_tile_sizes()

Returns conch's (block_n, block_k), falling back to (64, 64).

Imported lazily (conch is optional) and must match what conch passes to _gemm_kernel; the tuning helper is private, hence the fallback.

Source code in vllm/model_executor/kernels/linear/mixed_precision/conch.py
def _conch_tile_sizes() -> tuple[int, int]:
    """Returns conch's (block_n, block_k), falling back to (64, 64).

    Imported lazily (conch is optional) and must match what conch passes to
    _gemm_kernel; the tuning helper is private, hence the fallback.
    """
    try:
        from conch.kernels.quantization.gemm import _get_tuning_parameters

        tuning = _get_tuning_parameters()
        return int(tuning["cxpr_block_size_n"]), int(tuning["cxpr_block_size_k"])
    except Exception:
        return 64, 64