From 01c826233bba58387a71d90472d93bd05b4612cf Mon Sep 17 00:00:00 2001 From: Kyle Sayers Date: Mon, 8 Sep 2025 19:02:10 -0400 Subject: [PATCH 1/3] allow-group-dynamic-quantization Signed-off-by: Kyle Sayers --- src/compressed_tensors/quantization/quant_scheme.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/compressed_tensors/quantization/quant_scheme.py b/src/compressed_tensors/quantization/quant_scheme.py index fedd84e5a..ffb96848b 100644 --- a/src/compressed_tensors/quantization/quant_scheme.py +++ b/src/compressed_tensors/quantization/quant_scheme.py @@ -63,9 +63,18 @@ def validate_model_after(model: "QuantizationScheme") -> "QuantizationScheme": if inputs.strategy not in ( QuantizationStrategy.TOKEN, QuantizationStrategy.TENSOR, + QuantizationStrategy.GROUP, QuantizationStrategy.TENSOR_GROUP, ): - raise ValueError( + if ( + inputs.strategy == QuantizationStrategy.GROUP + and inputs.dynamic != True + ): + raise NotImplementedError( + "Static and local group-wise quantization is not supported" + ) + + raise NotImplementedError( f"Using {inputs.strategy} strategy is not supported for " "activation quantization" ) From 904a4b0a77e22058bec08807095eccca742b58ed Mon Sep 17 00:00:00 2001 From: Kyle Sayers Date: Mon, 8 Sep 2025 19:08:11 -0400 Subject: [PATCH 2/3] satisfy quality checker Signed-off-by: Kyle Sayers --- src/compressed_tensors/quantization/quant_scheme.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/compressed_tensors/quantization/quant_scheme.py b/src/compressed_tensors/quantization/quant_scheme.py index ffb96848b..1b64a5357 100644 --- a/src/compressed_tensors/quantization/quant_scheme.py +++ b/src/compressed_tensors/quantization/quant_scheme.py @@ -68,7 +68,7 @@ def validate_model_after(model: "QuantizationScheme") -> "QuantizationScheme": ): if ( inputs.strategy == QuantizationStrategy.GROUP - and inputs.dynamic != True + and inputs.dynamic is True ): raise NotImplementedError( "Static and local group-wise quantization is not supported" From a21d7f950c341450c83af5a6fab3b4f7f0e08ff3 Mon Sep 17 00:00:00 2001 From: Kyle Sayers Date: Mon, 8 Sep 2025 19:08:57 -0400 Subject: [PATCH 3/3] more clear Signed-off-by: Kyle Sayers --- src/compressed_tensors/quantization/quant_scheme.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/compressed_tensors/quantization/quant_scheme.py b/src/compressed_tensors/quantization/quant_scheme.py index 1b64a5357..b11e3c0c0 100644 --- a/src/compressed_tensors/quantization/quant_scheme.py +++ b/src/compressed_tensors/quantization/quant_scheme.py @@ -71,7 +71,8 @@ def validate_model_after(model: "QuantizationScheme") -> "QuantizationScheme": and inputs.dynamic is True ): raise NotImplementedError( - "Static and local group-wise quantization is not supported" + "Static and local group-wise activation " + "quantization is not supported" ) raise NotImplementedError(