Skip to content
Merged
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
4 changes: 3 additions & 1 deletion src/llmcompressor/modifiers/awq/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,10 @@ class AWQModifier(Modifier, QuantizationMixin):
default_factory=dict
)

# NOTE: different name chosen to avoid collision with
# QuantizationMixin.validate_model_after, which must be called first
@model_validator(mode="after")
def validate_model_after(model: "AWQModifier") -> "AWQModifier":
def validate_awq_after(model: "AWQModifier") -> "AWQModifier":
"""
Confirm only one configuration for group_size, symmetric, and num_bits,
as AWQ algorithm depends on it
Expand Down
6 changes: 3 additions & 3 deletions tests/e2e/vLLM/configs/w4a16_grouped_quant_asym_awq.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
cadence: "nightly"
test_type: "regression"
model: TinyLlama/TinyLlama-1.1B-Chat-v1.0
recipe: tests/e2e/vLLM/recipes/WNA16/recipe_w4a16_group_quant_asym_awq.yaml
dataset_id: "mit-han-lab/pile-val-backup"
dataset_split: validation
recipe: tests/e2e/vLLM/recipes/WNA16/recipe_w4a16_awq_asym.yaml
dataset_id: HuggingFaceH4/ultrachat_200k
dataset_split: train_sft
scheme: W4A16_weight_asym_awq
save_dir: TinyLlama-1.1B-Chat-v1.0-w4a16-asym-awq
4 changes: 2 additions & 2 deletions tests/e2e/vLLM/configs/w4a16_grouped_quant_sym_awq.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ cadence: "nightly"
test_type: "regression"
model: TinyLlama/TinyLlama-1.1B-Chat-v1.0
recipe: tests/e2e/vLLM/recipes/WNA16/recipe_w4a16_awq_sym.yaml
dataset_id: "mit-han-lab/pile-val-backup"
dataset_split: validation
dataset_id: HuggingFaceH4/ultrachat_200k
dataset_split: train_sft
scheme: W4A16_weight_sym_awq
save_dir: TinyLlama-1.1B-Chat-v1.0-w4a16-sym-awq
12 changes: 0 additions & 12 deletions tests/testing_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -285,18 +285,6 @@ def process(sample):
"images": sample["image"],
}

elif ds_name == "pile-val-backup":

def preprocess(example):
return {
"input_ids": processor.encode(example["text"].strip())[:max_seq_length]
}

ds = ds.map(preprocess, remove_columns=ds.column_names)
# Note: potentially swap filtering to pad for AWQ
ds = ds.filter(lambda example: len(example["input_ids"]) >= max_seq_length)
return ds

else:
raise NotImplementedError(f"Cannot preprocess dataset {ds.info.dataset_name}")

Expand Down