Skip to content

Commit

Permalink
stop silently failing when input_act args are incorrect
Browse files Browse the repository at this point in the history
  • Loading branch information
dsikka committed Oct 15, 2024
1 parent f710090 commit 8e2c5d1
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -97,11 +97,12 @@ def from_config(cls, config: Dict[str, Any]) -> "CompressedTensorsConfig":
target_scheme_map[target][
"weights"] = QuantizationArgs.parse_obj(
quant_config.get("weights"))
try:

if is_activation_quantization_format(quant_format):
target_scheme_map[target][
"input_activations"] = QuantizationArgs.parse_obj(
quant_config.get("input_activations"))
except Exception:
else:
target_scheme_map[target]["input_activations"] = None

return cls(target_scheme_map=target_scheme_map,
Expand Down Expand Up @@ -241,9 +242,8 @@ def _get_scheme_from_parts(
group_size=weight_quant.group_size,
actorder=weight_quant.actorder)

# Detect If Activation Quantization.
# TODO @dsikka: clean-up conditions
if is_activation_quantization_format(self.quant_format):
# Will only be not None if is_activation_quantization_format is True
if input_quant:
if self._is_fp8_w8a8(weight_quant, input_quant):
is_fp8_w8a8_supported = self._check_scheme_supported(
CompressedTensorsW8A8Fp8.get_min_capability(), error=False)
Expand Down

0 comments on commit 8e2c5d1

Please sign in to comment.