[Quantization] Select linear backends per quantization (#51204)

Signed-off-by: Netanel Haber <58652339+netanel-haber@users.noreply.github.com>
This commit is contained in:
Netanel Haber
2026-09-14 16:24:18 -04:00
committed by GitHub
parent 995e8581f4
commit d4ee7fe7a9
6 changed files with 154 additions and 17 deletions
+9
View File
@@ -326,6 +326,13 @@ class KernelConfig:
- "xpu_woq": Use XPU kernels for weight-only quantization (e.g. W8A16)
"""
linear_backend_per_quant: dict[str, LinearBackend] | None = Field(
default=None, min_length=1
)
"""Backend overrides keyed by linear quantization scheme. Overrides take
precedence over ``linear_backend``; for example,
``{"nvfp4_w4a16": "humming"}``."""
@field_validator("moe_backend", mode="before")
@classmethod
def _normalize_moe_backend(cls, value: Any) -> Any:
@@ -359,6 +366,8 @@ class KernelConfig:
"enable_flashinfer_autotune",
"ir_op_priority", # handled separately below
}
if self.linear_backend_per_quant is None:
ignored_factors.add("linear_backend_per_quant")
factors = get_hash_factors(self, ignored_factors)
factors["ir_op_priority"] = self.ir_op_priority.compute_hash()
return hash_factors(factors)