Skip to content

Commit 4f5d396

Browse files
authored
Small param fixes (#1854)
SUMMARY: Two small fixes: 1. `splits` isn't included in the `oneshot` function signature even though it is used that way in multiple tests. There are also a few other args that are missing (which aren't used by tests currently), opened #1850 to track. 2. `sequential_update` is deprecated but was still listed in a test and a couple examples. Removed. --------- Signed-off-by: Fynn Schmitt-Ulms <[email protected]>
1 parent 19ac115 commit 4f5d396

File tree

6 files changed

+4
-31
lines changed

6 files changed

+4
-31
lines changed

examples/sparse_2of4_quantization_fp8/README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ recipe = [
5757
SparseGPTModifier(
5858
sparsity=0.5,
5959
mask_structure="2:4",
60-
sequential_update=True,
6160
targets=[r"re:model.layers.\d*$"],
6261
)
6362
]

examples/sparse_2of4_quantization_fp8/llama3_8b_2of4.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ def get_recipe(fp8_enabled):
4545
SparseGPTModifier(
4646
sparsity=0.5,
4747
mask_structure="2:4",
48-
sequential_update=True,
4948
targets=[r"re:model.layers.\d*$"],
5049
)
5150
]

src/llmcompressor/entrypoints/oneshot.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
import os
1111
from datetime import datetime
12-
from typing import TYPE_CHECKING, List, Optional, Union
12+
from typing import TYPE_CHECKING, Dict, List, Optional, Union
1313

1414
from loguru import logger
1515
from torch.utils.data import DataLoader
@@ -230,6 +230,7 @@ def oneshot(
230230
dataset: Optional[Union[str, "Dataset", "DatasetDict"]] = None,
231231
dataset_config_name: Optional[str] = None,
232232
dataset_path: Optional[str] = None,
233+
splits: Optional[Union[str, List, Dict]] = None,
233234
num_calibration_samples: int = 512,
234235
shuffle_calibration_samples: bool = True,
235236
max_seq_length: int = 384,
@@ -288,6 +289,7 @@ def oneshot(
288289
:param dataset_config_name: The configuration name of the dataset
289290
to use.
290291
:param dataset_path: Path to a custom dataset. Supports json, csv, dvc.
292+
:param splits: Optional percentages of each split to download.
291293
:param num_calibration_samples: Number of samples to use for one-shot
292294
calibration.
293295
:param shuffle_calibration_samples: Whether to shuffle the dataset before

src/llmcompressor/modifiers/obcq/sgpt_base.py

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import warnings
21
from abc import abstractmethod
32
from collections import defaultdict
43
from functools import partial
@@ -34,7 +33,6 @@ class SparsityModifierBase(Modifier):
3433
owl_lmbda: Optional[float] = None
3534

3635
# data pipeline arguments
37-
sequential_update: Optional[bool] = False # deprecated
3836
sequential_targets: Union[str, List[str], None] = None
3937
targets: Union[str, List[str]] = ["Linear"]
4038
ignore: List[str] = Field(default_factory=list)
@@ -46,17 +44,6 @@ class SparsityModifierBase(Modifier):
4644
_target_layers: Dict[str, torch.nn.Module] = PrivateAttr(default_factory=dict)
4745
_module_sparsities: Dict[torch.nn.Module, str] = PrivateAttr(default_factory=dict)
4846

49-
@field_validator("sequential_update", mode="before")
50-
def validate_sequential_update(cls, value: bool) -> bool:
51-
if not value:
52-
warnings.warn(
53-
"`sequential_update=False` is no longer supported, setting "
54-
"sequential_update=True",
55-
DeprecationWarning,
56-
)
57-
58-
return True
59-
6047
@field_validator("sparsity_profile", mode="before")
6148
def validate_sparsity_profile(cls, value: Optional[str]) -> bool:
6249
if value is None:

src/llmcompressor/modifiers/quantization/gptq/base.py

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import contextlib
2-
import warnings
32
from typing import Dict, List, Optional, Tuple, Union
43

54
import torch
@@ -17,7 +16,7 @@
1716
update_offload_parameter,
1817
)
1918
from loguru import logger
20-
from pydantic import PrivateAttr, field_validator
19+
from pydantic import PrivateAttr
2120

2221
from llmcompressor.core import Event, EventType, State
2322
from llmcompressor.modifiers import Modifier
@@ -108,7 +107,6 @@ class GPTQModifier(Modifier, QuantizationMixin):
108107
"""
109108

110109
# gptq modifier arguments
111-
sequential_update: bool = True # DEPRECATED
112110
sequential_targets: Union[str, List[str], None] = None
113111
block_size: int = 128
114112
dampening_frac: Optional[float] = 0.01
@@ -310,14 +308,3 @@ def _maybe_onload_hessian(self, module: torch.nn.Module):
310308
if self.offload_hessians:
311309
if module in self._hessians: # may have been deleted in context
312310
self._hessians[module] = self._hessians[module].to(device="cpu")
313-
314-
@field_validator("sequential_update", mode="before")
315-
def validate_sequential_update(cls, value: bool) -> bool:
316-
if not value:
317-
warnings.warn(
318-
"`sequential_update=False` is no longer supported, setting "
319-
"sequential_update=True",
320-
DeprecationWarning,
321-
)
322-
323-
return True

tests/e2e/vLLM/recipes/kv_cache/gptq.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
quant_stage:
22
quant_modifiers:
33
GPTQModifier:
4-
sequential_update: false
54
ignore: ["lm_head"]
65
actorder: null
76
config_groups:

0 commit comments

Comments
 (0)