[Bugfix] Fix six quantization exception messages split across positional args (#50479)

Signed-off-by: ErenAta16 <erena6466@gmail.com>
This commit is contained in:
ErenAta16
2026-08-21 09:06:56 -07:00
committed by GitHub
parent 18aa245a99
commit fbb17e780b
3 changed files with 17 additions and 17 deletions
@@ -384,17 +384,17 @@ class CompressedTensorsConfig(QuantizationConfig):
supported = capability == min_capability
if error and not supported:
raise RuntimeError(
"Quantization scheme is not supported for ",
"the current GPU. Required capability: ",
f"{min_capability}. Current capability: {capability}.",
"Quantization scheme is not supported for the current GPU. "
f"Required capability: {min_capability}. "
f"Current capability: {capability}."
)
else:
supported = capability >= min_capability
if error and not supported:
raise RuntimeError(
"Quantization scheme is not supported for ",
f"the current GPU. Min capability: {min_capability}. ",
f"Current capability: {capability}.",
"Quantization scheme is not supported for the current GPU. "
f"Min capability: {min_capability}. "
f"Current capability: {capability}."
)
return supported
else:
@@ -737,8 +737,8 @@ class CompressedTensorsConfig(QuantizationConfig):
if not self._is_nvfp4_format(input_quant):
raise ValueError(
"For NVFP4 weights, input quantization must also be NVFP4 format, ",
"None for NVFP4A16",
"For NVFP4 weights, input quantization must also be NVFP4 "
"format, None for NVFP4A16"
)
return CompressedTensorsW4A4Fp4()
@@ -81,11 +81,11 @@ class CompressedTensorsMoEMethod(FusedMoEMethodBase):
if not valid_format_and_bits:
raise ValueError(
"For Fused MoE layers, only format: ",
f"{CompressionFormat.pack_quantized.value} ",
f" and bits: {WNA16_SUPPORTED_BITS} is supported ",
"For Fused MoE layers, only format: "
f"{CompressionFormat.pack_quantized.value} "
f"and bits: {WNA16_SUPPORTED_BITS} is supported "
f"but got format: {CompressionFormat.pack_quantized.value} "
f" and bits: {weight_quant.num_bits}",
f"and bits: {weight_quant.num_bits}"
)
# Native ROCm HIP kernels (RDNA3, etc.)
@@ -145,8 +145,8 @@ class CompressedTensorsMoEMethod(FusedMoEMethodBase):
)
if not _is_valid_nvfp4_activations:
raise ValueError(
"For NVFP4 weights, input quantization must also be NVFP4 format ",
f"or None for NVFP4A16, found {input_quant}",
"For NVFP4 weights, input quantization must also be NVFP4 "
f"format or None for NVFP4A16, found {input_quant}"
)
return CompressedTensorsW4A4Nvfp4MoEMethod(
layer.moe_config, layer_name, use_a16=(input_quant is None)
@@ -280,9 +280,9 @@ class QuarkConfig(QuantizationConfig):
supported = capability >= min_capability
if error and not supported:
raise RuntimeError(
"Quantization scheme is not supported for ",
f"the current GPU. Min capability: {min_capability}. ",
f"Current capability: {capability}.",
"Quantization scheme is not supported for the current GPU. "
f"Min capability: {min_capability}. "
f"Current capability: {capability}."
)
return supported
else: