[Bugfix] Fix activation quantization dispatch for WNA4Int/WNA8Int (#48785)
Signed-off-by: HDCharles <charlesdavidhernandez@gmail.com>
HDCharles committed
Jul 16, 2026 at 17:13 UTC
ab3c1aedf3b9677c1e43b391478554a4b110419e
3 files changed
+13
-6
vllm/model_executor/layers/quantization/compressed_tensors/schemes/compressed_tensors_wNa4.py
+2
-2
@@ -96,7 +96,7 @@ class CompressedTensorsWNA4Int(CompressedTensorsScheme):
96
return 75
97
98
def _build_input_quant_config(self) -> dict | None:
99
- """Build the config dict that HummingInputSchema.from_config expects."""
99
+ """Build the config dict that BaseInputSchema.from_config expects."""
100
if self.input_quant is None:
101
return None
102
iq = self.input_quant
@@ -112,7 +112,7 @@ class CompressedTensorsWNA4Int(CompressedTensorsScheme):
112
"dynamic": iq.dynamic,
113
"group_size": iq.group_size or 0,
114
"quant_method": "compressed-tensors",
115
- "format": self.quant_format,
115
+ "format": "int-quantized",
116
}
117
118
def create_weights(
vllm/model_executor/layers/quantization/compressed_tensors/schemes/compressed_tensors_wNa8.py
+2
-2
@@ -96,7 +96,7 @@ class CompressedTensorsWNA8Int(CompressedTensorsScheme):
96
return 75
97
98
def _build_input_quant_config(self) -> dict | None:
99
- """Build the config dict that HummingInputSchema.from_config expects."""
99
+ """Build the config dict that BaseInputSchema.from_config expects."""
100
if self.input_quant is None:
101
return None
102
iq = self.input_quant
@@ -112,7 +112,7 @@ class CompressedTensorsWNA8Int(CompressedTensorsScheme):
112
"dynamic": iq.dynamic,
113
"group_size": iq.group_size or 0,
114
"quant_method": "compressed-tensors",
115
- "format": self.quant_format,
115
+ "format": "int-quantized",
116
}
117
118
def create_weights(
vllm/model_executor/layers/quantization/utils/humming_utils.py
+9
-2
@@ -441,6 +441,7 @@ def prepare_humming_layer(
441
input_quant_config: dict | None = None,
442
):
443
from vllm.utils.humming import (
444
+ BaseInputSchema,
445
BaseWeightSchema,
446
HummingInputSchema,
447
HummingMethod,
@@ -448,7 +449,7 @@ def prepare_humming_layer(
449
450
weight_schema = BaseWeightSchema.from_config(quant_config)
451
if input_quant_config is not None:
451
- input_schema = HummingInputSchema.from_config(input_quant_config)
452
+ input_schema = BaseInputSchema.from_config(input_quant_config)
453
else:
454
input_schema = HummingInputSchema()
455
@@ -463,13 +464,19 @@ def prepare_humming_layer(
464
shape_k_stacks = [input_size_per_partition]
465
shape_n_stacks = layer.output_partition_sizes
466
466
- # Step 1: convert weight to humming standard format
467
+ # Step 1: convert weight and input schemas to humming standard format
468
weight_schema, tensors = weight_schema.convert_humming(
469
tensors=dict(layer.named_parameters()),
470
shape_n_stacks=shape_n_stacks,
471
shape_k_stacks=shape_k_stacks,
472
param_dtype=layer.params_dtype,
473
)
474
+ input_schema, _ = input_schema.convert_humming(
475
+ tensors={},
476
+ shape_n_stacks=shape_n_stacks,
477
+ shape_k_stacks=shape_k_stacks,
478
+ param_dtype=layer.params_dtype,
479
+ )
480
481
layer.weight_schema = weight_schema
482