Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def get_min_capability(cls) -> int:
return 75

def _build_input_quant_config(self) -> dict | None:
"""Build the config dict that BaseInputSchema.from_config expects."""
"""Build the config dict that HummingInputSchema.from_config expects."""
if self.input_quant is None:
return None
iq = self.input_quant
Expand All @@ -112,7 +112,7 @@ def _build_input_quant_config(self) -> dict | None:
"dynamic": iq.dynamic,
"group_size": iq.group_size or 0,
"quant_method": "compressed-tensors",
"format": "int-quantized",
"format": self.quant_format,
}

def create_weights(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def get_min_capability(cls) -> int:
return 75

def _build_input_quant_config(self) -> dict | None:
"""Build the config dict that BaseInputSchema.from_config expects."""
"""Build the config dict that HummingInputSchema.from_config expects."""
if self.input_quant is None:
return None
iq = self.input_quant
Expand All @@ -112,7 +112,7 @@ def _build_input_quant_config(self) -> dict | None:
"dynamic": iq.dynamic,
"group_size": iq.group_size or 0,
"quant_method": "compressed-tensors",
"format": "int-quantized",
"format": self.quant_format,
}

def create_weights(
Expand Down
11 changes: 2 additions & 9 deletions vllm/model_executor/layers/quantization/utils/humming_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -441,15 +441,14 @@ def prepare_humming_layer(
input_quant_config: dict | None = None,
):
from vllm.utils.humming import (
BaseInputSchema,
BaseWeightSchema,
HummingInputSchema,
HummingMethod,
)

weight_schema = BaseWeightSchema.from_config(quant_config)
if input_quant_config is not None:
input_schema = BaseInputSchema.from_config(input_quant_config)
input_schema = HummingInputSchema.from_config(input_quant_config)
else:
input_schema = HummingInputSchema()

Expand All @@ -464,19 +463,13 @@ def prepare_humming_layer(
shape_k_stacks = [input_size_per_partition]
shape_n_stacks = layer.output_partition_sizes

# Step 1: convert weight and input schemas to humming standard format
# Step 1: convert weight to humming standard format
weight_schema, tensors = weight_schema.convert_humming(
tensors=dict(layer.named_parameters()),
shape_n_stacks=shape_n_stacks,
shape_k_stacks=shape_k_stacks,
param_dtype=layer.params_dtype,
)
input_schema, _ = input_schema.convert_humming(
tensors={},
shape_n_stacks=shape_n_stacks,
shape_k_stacks=shape_k_stacks,
param_dtype=layer.params_dtype,
)

layer.weight_schema = weight_schema

Expand Down
Loading