Skip to content

Commit 33eec02

Browse files
Rename GPTQArgs and FP8Args
Signed-off-by: Thara Palanivel <[email protected]>
1 parent cea5bc7 commit 33eec02

File tree

5 files changed

+18
-17
lines changed

5 files changed

+18
-17
lines changed

.spellcheck-en-custom.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,11 @@ eval
2626
fms
2727
fp
2828
FP
29+
FP8Arguments
2930
frac
3031
gptq
3132
GPTQ
32-
GPTQArgs
33+
GPTQArguments
3334
graphviz
3435
GPTQ
3536
hyperparameters

examples/FP8_QUANT/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ This is an example of mature FP8, which under the hood leverages some functional
2727
## QuickStart
2828
This end-to-end example utilizes the common set of interfaces provided by `fms_mo` for easily applying multiple quantization algorithms with FP8 being the focus of this example. The steps involved are:
2929
30-
1. **FP8 quantization through CLI**. Other arguments could be found here [FP8Args](../../fms_mo/training_args.py#L84).
30+
1. **FP8 quantization through CLI**. Other arguments could be found here [FP8Arguments](../../fms_mo/training_args.py#L84).
3131
3232
```bash
3333
python -m fms_mo.run_quant \
@@ -100,7 +100,7 @@ This end-to-end example utilizes the common set of interfaces provided by `fms_m
100100
tokenizer = AutoTokenizer.from_pretrained(model_args.model_name_or_path)
101101
```
102102

103-
2. Quantization setting is provided using `QuantizationModifier`, additional settings can be found in [FP8Args](../../fms_mo/training_args.py#L84).
103+
2. Quantization setting is provided using `QuantizationModifier`, additional settings can be found in [FP8Arguments](../../fms_mo/training_args.py#L84).
104104

105105
```python
106106
recipe = QuantizationModifier(

examples/GPTQ/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ This end-to-end example utilizes the common set of interfaces provided by `fms_m
3232
> - Tokenized data will be saved in `<path_to_save>_train` and `<path_to_save>_test`
3333
> - If you have trouble downloading Llama family of models from Hugging Face ([LLama models require access](https://www.llama.com/docs/getting-the-models/hugging-face/)), you can use `ibm-granite/granite-8b-code` instead
3434
35-
2. **Quantize the model** using the data generated above, the following command will kick off the quantization job (by invoking `auto_gptq` under the hood.) Additional acceptable arguments can be found here in [GPTQArgs](../../fms_mo/training_args.py#L127).
35+
2. **Quantize the model** using the data generated above, the following command will kick off the quantization job (by invoking `auto_gptq` under the hood.) Additional acceptable arguments can be found here in [GPTQArguments](../../fms_mo/training_args.py#L127).
3636
3737
```bash
3838
python -m fms_mo.run_quant \

fms_mo/run_quant.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@
3939
from fms_mo.training_args import (
4040
DataArguments,
4141
FMSMOArguments,
42-
FP8Args,
43-
GPTQArgs,
42+
FP8Arguments,
43+
GPTQArguments,
4444
ModelArguments,
4545
)
4646
from fms_mo.utils.import_utils import available_packages
@@ -52,8 +52,8 @@ def quantize(
5252
model_args: ModelArguments,
5353
data_args: DataArguments,
5454
fms_mo_args: FMSMOArguments,
55-
gptq_args: GPTQArgs,
56-
fp8_args: FP8Args,
55+
gptq_args: GPTQArguments,
56+
fp8_args: FP8Arguments,
5757
quant_method: str,
5858
output_dir: str,
5959
):
@@ -65,9 +65,9 @@ def quantize(
6565
data_args (fms_mo.training_args.DataArguments): Data arguments to be used when loading the
6666
tokenized dataset
6767
fms_mo_args (fms_mo.training_args.FMSMOArguments): Parameters to use for PTQ quantization
68-
gptq_args (fms_mo.training_args.GPTQArgs): Parameters to use for GPTQ quantization
69-
fp8_args (fms_mo.training_args.FP8Args): Parameters to use for FP8 quantization
70-
quant_method (str): Quantization technique, options are gptq and fp8
68+
gptq_args (fms_mo.training_args.GPTQArguments): Parameters to use for GPTQ quantization
69+
fp8_args (fms_mo.training_args.FP8Arguments): Parameters to use for FP8 quantization
70+
quant_method (str): Quantization technique, options are gptq, fp8 and dq
7171
output_dir (str) Output directory to write to
7272
"""
7373

@@ -106,7 +106,7 @@ def run_gptq(model_args, data_args, gptq_args, output_dir):
106106
the model
107107
data_args (fms_mo.training_args.DataArguments): Data arguments to be used when loading the
108108
tokenized dataset
109-
gptq_args (fms_mo.training_args.GPTQArgs): Parameters to use for GPTQ quantization
109+
gptq_args (fms_mo.training_args.GPTQArguments): Parameters to use for GPTQ quantization
110110
output_dir (str) Output directory to write to
111111
"""
112112

@@ -167,7 +167,7 @@ def run_fp8(model_args, data_args, fp8_args, output_dir):
167167
the model
168168
data_args (fms_mo.training_args.DataArguments): Data arguments to be used when loading the
169169
tokenized dataset
170-
fp8_args (fms_mo.training_args.FP8Args): Parameters to use for FP8 quantization
170+
fp8_args (fms_mo.training_args.FP8Arguments): Parameters to use for FP8 quantization
171171
output_dir (str) Output directory to write to
172172
"""
173173

@@ -207,8 +207,8 @@ def main():
207207
ModelArguments,
208208
DataArguments,
209209
FMSMOArguments,
210-
GPTQArgs,
211-
FP8Args,
210+
GPTQArguments,
211+
FP8Arguments,
212212
)
213213
)
214214

fms_mo/training_args.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ class FMSMOArguments:
115115

116116

117117
@dataclass
118-
class GPTQArgs:
118+
class GPTQArguments:
119119
"""Dataclass for GPTQ related arguments that will be used by auto-gptq."""
120120

121121
bits: int = field(default=4, metadata={"choices": [2, 3, 4, 8]})
@@ -133,7 +133,7 @@ class GPTQArgs:
133133

134134

135135
@dataclass
136-
class FP8Args:
136+
class FP8Arguments:
137137
"""Dataclass for FP8 related arguments that will be used by llm-compressor."""
138138

139139
targets: str = field(default="Linear")

0 commit comments

Comments
 (0)