{"record":{"id":"79a403568f8c9808","repo":"sgl-project/sglang","slug":"currently-desc-act-true-is-not-supported-by-gpt","errorCode":null,"errorMessage":"Currently, desc_act (True) is not supported by GPTQ quantization on npu.","messagePattern":"Currently, desc_act \\(True\\) is not supported by GPTQ quantization on npu\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/sglang/srt/layers/quantization/gptq/schemes/gptq_linear.py","lineNumber":164,"sourceCode":"        self.kernel.process_weights_after_loading(layer)\n\n    def apply_weights(\n        self, layer: torch.nn.Module, x: torch.Tensor, bias: Optional[torch.Tensor]\n    ):\n        return self.kernel.apply(layer, x, bias)\n\n\nclass GPTQAscendLinearScheme(GPTQLinearScheme):\n    def _init_kernel(self, quant_config: GPTQConfig):\n        from sglang.srt.hardware_backend.npu.quantization.gptq_kernels import (\n            GPTQLinearAscendKernel,\n        )\n\n        return GPTQLinearAscendKernel(quant_config)\n\n    def create_weights(self, layer: torch.nn.Module, **kwargs):\n        if self.quant_config.desc_act:\n            raise ValueError(\n                \"Currently, desc_act (True) is not supported by GPTQ \"\n                \"quantization on npu.\"\n            )\n\n        super().create_weights(layer=layer, **kwargs)\n        set_weight_attrs(layer.qzeros, {\"pack_factor\": self.quant_config.pack_factor})\n        set_weight_attrs(layer.qweight, {\"pack_factor\": self.quant_config.pack_factor})\n\n\nclass GPTQXPULinearScheme(GPTQLinearScheme):\n    def _init_kernel(self, quant_config: GPTQConfig):\n        from sglang.srt.hardware_backend.xpu.quantization.gptq_kernels import (\n            GPTQXPULinearKernel,\n        )\n\n        return GPTQXPULinearKernel(quant_config)\n","sourceCodeStart":146,"sourceCodeEnd":181,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/srt/layers/quantization/gptq/schemes/gptq_linear.py#L146-L181","documentation":"The Ascend NPU GPTQ kernel (GPTQLinearAscendKernel.create_weights) rejects desc_act=True (activation-order-aware GPTQ, also called act-order) because the NPU kernel cannot reorder groups according to the g_idx permutation.","triggerScenarios":"Loading a GPTQ checkpoint whose quantization_config sets desc_act: true (act-order) on an npu backend; create_weights of the Ascend scheme raises before delegating to the base scheme.","commonSituations":"Most modern GPTQ exports (GPTQModel/auto-gptq) enable desc_act by default; deploying one of those checkpoints on Huawei Ascend NPU hits this at model load.","solutions":["Use a GPTQ checkpoint quantized with desc_act=false / act_order disabled","Edit quantization_config.json to set desc_act: false only if the checkpoint truly has no g_idx permutation (otherwise quality/correctness breaks)","Run on GPU/CPU where desc_act is supported"],"exampleFix":"# quantization_config.json before\n{\"desc_act\": true}\n# after\n{\"desc_act\": false}  # requires a checkpoint quantized without act-order","handlingStrategy":"validation","validationCode":"cfg = json.load(open(f\"{model_path}/quantization_config.json\"))\nif cfg.get(\"quant_method\") == \"gptq\" and cfg.get(\"desc_act\", False):\n    raise SystemExit(\"NPU GPTQ requires desc_act=false; requantize without act-order\")","typeGuard":"def npu_gptq_ok(cfg: dict) -> bool:\n    return cfg.get(\"quant_method\") != \"gptq\" or cfg.get(\"desc_act\", False) is False","tryCatchPattern":"try:\n    load_model(model_path)\nexcept ValueError as e:\n    if \"desc_act\" in str(e) and \"npu\" in str(e):\n        raise SystemExit(\"Use a non-act-order GPTQ checkpoint for Ascend NPU\")\n    raise","preventionTips":["Pin a set of NPU-approved GPTQ checkpoints with desc_act=false","Never just flip desc_act in JSON for act-order checkpoints — the g_idx ordering is baked into the weights"],"tags":["gptq","npu","ascend","desc-act","act-order"],"backgroundTag":"unsupported-quantization-config","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}