Skip to content

Commit 4c8c0a7

Browse files
[tests] remove pile-val-backup dataset from tests (#1879)
SUMMARY: This PR - [x] Removes `pile-val-dataset` from e2e tests, as it is no longer used in examples and the processing logic was flawed - [x] Fixes a model validation error introduced in #1772 that was preventing AWQModifier from running one of the validations, causing it to be in an invalid state (`AWQModifier.validate_model_after` was preventing `QuantizationMixin.validate_model_after` from running). With these changes, tests pass and the compressed model generates meaningful responses. It was previously generating all 0s TEST PLAN: `CADENCE=nightly TEST_DATA_FILE=tests/e2e/vLLM/configs/w4a16_grouped_quant_sym_awq.yaml pytest -s tests/e2e/vLLM/test_vllm.py` and `CADENCE=nightly TEST_DATA_FILE=tests/e2e/vLLM/configs/w4a16_grouped_quant_asym_awq.yaml pytest -s tests/e2e/vLLM/test_vllm.py` both pass with output like ``` PROMPT: The capital of France is GENERATED TEXT: Paris, which is also the country's largest city. PROMPT: The president of the US is GENERATED TEXT: named, but the name of the Vice President is not given. In the case PROMPT: My name is GENERATED TEXT: Emily and I am from Canada. I have always been fascinated with ``` --------- Signed-off-by: Brian Dellabetta <[email protected]>
1 parent 09cca73 commit 4c8c0a7

File tree

5 files changed

+8
-18
lines changed

5 files changed

+8
-18
lines changed

src/llmcompressor/modifiers/awq/base.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,8 +139,10 @@ class AWQModifier(Modifier, QuantizationMixin):
139139
default_factory=dict
140140
)
141141

142+
# NOTE: different name chosen to avoid collision with
143+
# QuantizationMixin.validate_model_after, which must be called first
142144
@model_validator(mode="after")
143-
def validate_model_after(model: "AWQModifier") -> "AWQModifier":
145+
def validate_awq_after(model: "AWQModifier") -> "AWQModifier":
144146
"""
145147
Confirm only one configuration for group_size, symmetric, and num_bits,
146148
as AWQ algorithm depends on it
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
cadence: "nightly"
22
test_type: "regression"
33
model: TinyLlama/TinyLlama-1.1B-Chat-v1.0
4-
recipe: tests/e2e/vLLM/recipes/WNA16/recipe_w4a16_group_quant_asym_awq.yaml
5-
dataset_id: "mit-han-lab/pile-val-backup"
6-
dataset_split: validation
4+
recipe: tests/e2e/vLLM/recipes/WNA16/recipe_w4a16_awq_asym.yaml
5+
dataset_id: HuggingFaceH4/ultrachat_200k
6+
dataset_split: train_sft
77
scheme: W4A16_weight_asym_awq
88
save_dir: TinyLlama-1.1B-Chat-v1.0-w4a16-asym-awq

tests/e2e/vLLM/configs/w4a16_grouped_quant_sym_awq.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ cadence: "nightly"
22
test_type: "regression"
33
model: TinyLlama/TinyLlama-1.1B-Chat-v1.0
44
recipe: tests/e2e/vLLM/recipes/WNA16/recipe_w4a16_awq_sym.yaml
5-
dataset_id: "mit-han-lab/pile-val-backup"
6-
dataset_split: validation
5+
dataset_id: HuggingFaceH4/ultrachat_200k
6+
dataset_split: train_sft
77
scheme: W4A16_weight_sym_awq
88
save_dir: TinyLlama-1.1B-Chat-v1.0-w4a16-sym-awq
File renamed without changes.

tests/testing_utils.py

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -285,18 +285,6 @@ def process(sample):
285285
"images": sample["image"],
286286
}
287287

288-
elif ds_name == "pile-val-backup":
289-
290-
def preprocess(example):
291-
return {
292-
"input_ids": processor.encode(example["text"].strip())[:max_seq_length]
293-
}
294-
295-
ds = ds.map(preprocess, remove_columns=ds.column_names)
296-
# Note: potentially swap filtering to pad for AWQ
297-
ds = ds.filter(lambda example: len(example["input_ids"]) >= max_seq_length)
298-
return ds
299-
300288
else:
301289
raise NotImplementedError(f"Cannot preprocess dataset {ds.info.dataset_name}")
302290

0 commit comments

Comments
 (0)