{"record":{"id":"8e2ee9d357faaeeb","repo":"vllm-project/vllm","slug":"invalid-method-method-r-must-be-quest-or-abs","errorCode":null,"errorMessage":"invalid method {method!r}, must be 'quest' or 'abs_max'","messagePattern":"invalid method (.+?), must be 'quest' or 'abs_max'","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"vllm/_custom_ops.py","lineNumber":4127,"sourceCode":"    padded_rows = n_row_blocks * 128\n    padded_cols = n_col_blocks * 4\n\n    xh_e8m0 = torch.empty(\n        padded_rows, padded_cols, dtype=torch.float8_e8m0fnu, device=a.device\n    )\n\n    if not hasattr(torch.ops, \"_qutlass_C\"):\n        raise RuntimeError(\n            \"The `_qutlass_C` extension is not loaded. \"\n            \"Make sure your custom op library is imported before calling fusedQuantizeMx.\"\n        )\n\n    if method == \"quest\":\n        return torch.ops._qutlass_C.fusedQuantizeMxQuest(a, b, xh_e2m1, xh_e8m0)\n    elif method == \"abs_max\":\n        return torch.ops._qutlass_C.fusedQuantizeMxAbsMax(a, b, xh_e2m1, xh_e8m0)\n    else:\n        raise ValueError(f\"invalid method {method!r}, must be 'quest' or 'abs_max'\")\n\n\nif hasattr(torch.ops._qutlass_C, \"fusedQuantizeNvAbsMax\"):\n\n    @register_fake(\"_qutlass_C::fusedQuantizeNvAbsMax\")\n    def _fake_fused_quantize_nv_absmax(\n        a: torch.Tensor,\n        b: torch.Tensor,\n        xh_e2m1: torch.Tensor,\n        xh_e4m3: torch.Tensor,\n        global_scale: torch.Tensor,\n    ):\n        return xh_e2m1, xh_e4m3\n\n\ndef fusedQuantizeNv(\n    a: torch.Tensor, b: torch.Tensor, global_scale: torch.Tensor\n) -> tuple[torch.Tensor, torch.Tensor]:","sourceCodeStart":4109,"sourceCodeEnd":4145,"githubUrl":"https://github.com/vllm-project/vllm/blob/c794754062d49a8fdb63ab3c5215b488b865030c/vllm/_custom_ops.py#L4109-L4145","documentation":"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'].","triggerScenarios":"Calling ops.fusedQuantizeMx(a, b, method='max') or 'amax', 'absmax', 'Quest' (wrong case) — the else branch triggers with the offending value in the message.","commonSituations":"Typos or naming drift ('absmax' vs 'abs_max'); old code written against a previous API spelling; dynamically-built method strings not validated.","solutions":["Use exactly 'quest' or 'abs_max' (snake_case, lowercase)","Validate the value before the call if it comes from config/user input"],"exampleFix":"# before\nq, s = ops.fusedQuantizeMx(a, b, method=\"absmax\")\n# after\nq, s = ops.fusedQuantizeMx(a, b, method=\"abs_max\")","handlingStrategy":"validation","validationCode":"assert method in (\"quest\", \"abs_max\"), f\"bad method {method!r}\"","typeGuard":"def valid_mx_method(method: str) -> bool:\n    return method in (\"quest\", \"abs_max\")","tryCatchPattern":null,"preventionTips":["Type the parameter as Literal['quest','abs_max'] in caller code so mypy catches typos","Validate config-sourced strings before passing through"],"tags":["quantization","mx-format","validation","api-misuse"],"backgroundTag":null,"analyzedSha":"c794754062d49a8fdb63ab3c5215b488b865030c","analyzedAt":"2026-08-14T21:17:39.825Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}