[Bugfix] Fix six quantization exception messages split across positional args (#50479)
Signed-off-by: ErenAta16 <erena6466@gmail.com>
This commit is contained in:
@@ -384,17 +384,17 @@ class CompressedTensorsConfig(QuantizationConfig):
|
|||||||
supported = capability == min_capability
|
supported = capability == min_capability
|
||||||
if error and not supported:
|
if error and not supported:
|
||||||
raise RuntimeError(
|
raise RuntimeError(
|
||||||
"Quantization scheme is not supported for ",
|
"Quantization scheme is not supported for the current GPU. "
|
||||||
"the current GPU. Required capability: ",
|
f"Required capability: {min_capability}. "
|
||||||
f"{min_capability}. Current capability: {capability}.",
|
f"Current capability: {capability}."
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
supported = capability >= min_capability
|
supported = capability >= min_capability
|
||||||
if error and not supported:
|
if error and not supported:
|
||||||
raise RuntimeError(
|
raise RuntimeError(
|
||||||
"Quantization scheme is not supported for ",
|
"Quantization scheme is not supported for the current GPU. "
|
||||||
f"the current GPU. Min capability: {min_capability}. ",
|
f"Min capability: {min_capability}. "
|
||||||
f"Current capability: {capability}.",
|
f"Current capability: {capability}."
|
||||||
)
|
)
|
||||||
return supported
|
return supported
|
||||||
else:
|
else:
|
||||||
@@ -737,8 +737,8 @@ class CompressedTensorsConfig(QuantizationConfig):
|
|||||||
|
|
||||||
if not self._is_nvfp4_format(input_quant):
|
if not self._is_nvfp4_format(input_quant):
|
||||||
raise ValueError(
|
raise ValueError(
|
||||||
"For NVFP4 weights, input quantization must also be NVFP4 format, ",
|
"For NVFP4 weights, input quantization must also be NVFP4 "
|
||||||
"None for NVFP4A16",
|
"format, None for NVFP4A16"
|
||||||
)
|
)
|
||||||
return CompressedTensorsW4A4Fp4()
|
return CompressedTensorsW4A4Fp4()
|
||||||
|
|
||||||
|
|||||||
+6
-6
@@ -81,11 +81,11 @@ class CompressedTensorsMoEMethod(FusedMoEMethodBase):
|
|||||||
|
|
||||||
if not valid_format_and_bits:
|
if not valid_format_and_bits:
|
||||||
raise ValueError(
|
raise ValueError(
|
||||||
"For Fused MoE layers, only format: ",
|
"For Fused MoE layers, only format: "
|
||||||
f"{CompressionFormat.pack_quantized.value} ",
|
f"{CompressionFormat.pack_quantized.value} "
|
||||||
f" and bits: {WNA16_SUPPORTED_BITS} is supported ",
|
f"and bits: {WNA16_SUPPORTED_BITS} is supported "
|
||||||
f"but got format: {CompressionFormat.pack_quantized.value} "
|
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.)
|
# Native ROCm HIP kernels (RDNA3, etc.)
|
||||||
@@ -145,8 +145,8 @@ class CompressedTensorsMoEMethod(FusedMoEMethodBase):
|
|||||||
)
|
)
|
||||||
if not _is_valid_nvfp4_activations:
|
if not _is_valid_nvfp4_activations:
|
||||||
raise ValueError(
|
raise ValueError(
|
||||||
"For NVFP4 weights, input quantization must also be NVFP4 format ",
|
"For NVFP4 weights, input quantization must also be NVFP4 "
|
||||||
f"or None for NVFP4A16, found {input_quant}",
|
f"format or None for NVFP4A16, found {input_quant}"
|
||||||
)
|
)
|
||||||
return CompressedTensorsW4A4Nvfp4MoEMethod(
|
return CompressedTensorsW4A4Nvfp4MoEMethod(
|
||||||
layer.moe_config, layer_name, use_a16=(input_quant is None)
|
layer.moe_config, layer_name, use_a16=(input_quant is None)
|
||||||
|
|||||||
@@ -280,9 +280,9 @@ class QuarkConfig(QuantizationConfig):
|
|||||||
supported = capability >= min_capability
|
supported = capability >= min_capability
|
||||||
if error and not supported:
|
if error and not supported:
|
||||||
raise RuntimeError(
|
raise RuntimeError(
|
||||||
"Quantization scheme is not supported for ",
|
"Quantization scheme is not supported for the current GPU. "
|
||||||
f"the current GPU. Min capability: {min_capability}. ",
|
f"Min capability: {min_capability}. "
|
||||||
f"Current capability: {capability}.",
|
f"Current capability: {capability}."
|
||||||
)
|
)
|
||||||
return supported
|
return supported
|
||||||
else:
|
else:
|
||||||
|
|||||||
Reference in New Issue
Block a user