vllm-project/vllm · error · ValueError

invalid method {method!r}, must be 'quest' or 'abs_max'

Error message

invalid method {method!r}, must be 'quest' or 'abs_max'

What it means

fusedQuantizeMx() accepts exactly two methods: 'quest' (quantize for quest sparse-attention index) and 'abs_max' (plain MX absmax quantization). Any other string falls through both branches and raises ValueError listing the valid options. The parameter is keyword-only and typed Literal['quest','abs_max'].

Source

Thrown at vllm/_custom_ops.py:4127

    padded_rows = n_row_blocks * 128
    padded_cols = n_col_blocks * 4

    xh_e8m0 = torch.empty(
        padded_rows, padded_cols, dtype=torch.float8_e8m0fnu, device=a.device
    )

    if not hasattr(torch.ops, "_qutlass_C"):
        raise RuntimeError(
            "The `_qutlass_C` extension is not loaded. "
            "Make sure your custom op library is imported before calling fusedQuantizeMx."
        )

    if method == "quest":
        return torch.ops._qutlass_C.fusedQuantizeMxQuest(a, b, xh_e2m1, xh_e8m0)
    elif method == "abs_max":
        return torch.ops._qutlass_C.fusedQuantizeMxAbsMax(a, b, xh_e2m1, xh_e8m0)
    else:
        raise ValueError(f"invalid method {method!r}, must be 'quest' or 'abs_max'")


if hasattr(torch.ops._qutlass_C, "fusedQuantizeNvAbsMax"):

    @register_fake("_qutlass_C::fusedQuantizeNvAbsMax")
    def _fake_fused_quantize_nv_absmax(
        a: torch.Tensor,
        b: torch.Tensor,
        xh_e2m1: torch.Tensor,
        xh_e4m3: torch.Tensor,
        global_scale: torch.Tensor,
    ):
        return xh_e2m1, xh_e4m3


def fusedQuantizeNv(
    a: torch.Tensor, b: torch.Tensor, global_scale: torch.Tensor
) -> tuple[torch.Tensor, torch.Tensor]:

View on GitHub (pinned to c794754062)

Solutions

  1. Use exactly 'quest' or 'abs_max' (snake_case, lowercase)
  2. Validate the value before the call if it comes from config/user input

Example fix

# before
q, s = ops.fusedQuantizeMx(a, b, method="absmax")
# after
q, s = ops.fusedQuantizeMx(a, b, method="abs_max")
Defensive patterns

Strategy: validation

Validate before calling

assert method in ("quest", "abs_max"), f"bad method {method!r}"

Type guard

def valid_mx_method(method: str) -> bool:
    return method in ("quest", "abs_max")

Prevention

When it happens

Trigger: Calling ops.fusedQuantizeMx(a, b, method='max') or 'amax', 'absmax', 'Quest' (wrong case) — the else branch triggers with the offending value in the message.

Common situations: Typos or naming drift ('absmax' vs 'abs_max'); old code written against a previous API spelling; dynamically-built method strings not validated.

Related errors


AI-assisted analysis of vllm-project/vllm@c794754062 (2026-08-14). Data as JSON: /api/errors/8e2ee9d357faaeeb. Report an issue: GitHub.