Skip to content

Commit 2427825

Browse files
Update lm-eval set-up to address regression (#2142)
SUMMARY: - Seems like setting the collator from tuncation to default + shuffling addresses the regression we're seeing in lm-eval - Given the recovery values you see in these tests were determined using these settings, I think they should be how we evaluate our lm-eval tests for the time being --------- Signed-off-by: Dipika Sikka <ds3822@columbia.edu> Co-authored-by: Brian Dellabetta <brian-dellabetta@users.noreply.github.com>
1 parent 5f6c8db commit 2427825

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

tests/e2e/e2e_utils.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1+
from typing import Callable
2+
13
import torch
24
import transformers
35
from datasets import load_dataset
46
from loguru import logger
5-
from transformers import AutoProcessor
7+
from transformers import AutoProcessor, DefaultDataCollator
68

79
from llmcompressor import oneshot
810
from llmcompressor.modifiers.quantization import GPTQModifier, QuantizationModifier
@@ -34,9 +36,12 @@ def run_oneshot_for_e2e_testing(
3436
dataset_config: str,
3537
scheme: str,
3638
quant_type: str,
39+
shuffle_calibration_samples: bool = True,
40+
data_collator: str | Callable = DefaultDataCollator(),
3741
):
3842
# Load model.
3943
oneshot_kwargs = {}
44+
oneshot_kwargs["data_collator"] = data_collator
4045

4146
loaded_model = load_model(model=model, model_class=model_class)
4247
processor = AutoProcessor.from_pretrained(model)
@@ -74,6 +79,7 @@ def data_collator(batch):
7479
oneshot_kwargs["data_collator"] = data_collator
7580

7681
oneshot_kwargs["model"] = loaded_model
82+
oneshot_kwargs["shuffle_calibration_samples"] = shuffle_calibration_samples
7783
if recipe:
7884
oneshot_kwargs["recipe"] = recipe
7985
else:

0 commit comments

Comments
 (0)