Skip to content

Commit ec6345d

Browse files
dsikkakylesayrs
andauthored
Remove oneshot_device (#1568)
Summary - Not used and annoying to see everywhere --------- Signed-off-by: Kyle Sayers <kylesayrs@gmail.com> Co-authored-by: Kyle Sayers <kylesayrs@gmail.com>
1 parent c4b6365 commit ec6345d

13 files changed

+3
-42
lines changed

src/llmcompressor/args/model_arguments.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -80,13 +80,6 @@ class ModelArguments:
8080
default=True,
8181
metadata={"help": "Whether to compress sparse models during save"},
8282
)
83-
oneshot_device: Optional[str] = field(
84-
default="cuda",
85-
metadata={
86-
"help": "This argument is deprecated and nonfunctional "
87-
"and will be removed in future release"
88-
},
89-
)
9083
model_revision: str = field(
9184
default="main",
9285
metadata={

src/llmcompressor/entrypoints/oneshot.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,6 @@ def oneshot(
208208
tie_word_embeddings: bool = False,
209209
trust_remote_code_model: bool = False,
210210
save_compressed: bool = True,
211-
oneshot_device: str = "cuda:0",
212211
model_revision: str = "main",
213212
# Recipe arguments
214213
recipe: Optional[Union[str, List[str]]] = None,
@@ -259,7 +258,6 @@ def oneshot(
259258
:param trust_remote_code_model: Whether to allow for custom models to execute
260259
their own modeling files.
261260
:param save_compressed: Whether to compress sparse models during save.
262-
:param oneshot_device: Device to run oneshot calibration on.
263261
:param model_revision: The specific model version to use (can be branch name,
264262
tag, or commit id).
265263

tests/llmcompressor/transformers/finetune/test_finetune_no_recipe_custom_dataset.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ def preprocessing_func(example):
4040
recipe=None,
4141
num_train_epochs=self.num_train_epochs,
4242
concatenate_data=concatenate_data,
43-
oneshot_device=self.device,
4443
text_column="text",
4544
dataset_path=dataset_path,
4645
preprocessing_func=preprocessing_func,

tests/llmcompressor/transformers/finetune/test_finetune_without_recipe.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ def test_finetune_without_recipe(self):
2424
from llmcompressor import train
2525

2626
recipe_str = None
27-
device = "cuda:0"
2827

2928
concatenate_data = False
3029
max_steps = 50
@@ -38,7 +37,6 @@ def test_finetune_without_recipe(self):
3837
max_steps=max_steps,
3938
concatenate_data=concatenate_data,
4039
splits=splits,
41-
oneshot_device=device,
4240
)
4341

4442
def tearDown(self):

tests/llmcompressor/transformers/finetune/test_oneshot_and_finetune.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ def _test_oneshot_and_finetune(self):
3131
splits=splits,
3232
recipe=self.recipe,
3333
num_calibration_samples=64,
34-
oneshot_device=self.device,
3534
dataset_config_name=self.dataset_config_name,
3635
concatenate_data=self.concat_txt,
3736
output_dir=self.output,

tests/llmcompressor/transformers/finetune/test_safetensors.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ def setUp(self):
2424
def test_safetensors(self):
2525
from llmcompressor import train
2626

27-
device = "cuda:0"
2827
output_dir = self.output / "output1"
2928
max_steps = 10
3029
splits = {"train": "train[:10%]"}
@@ -35,7 +34,6 @@ def test_safetensors(self):
3534
output_dir=output_dir,
3635
max_steps=max_steps,
3736
splits=splits,
38-
oneshot_device=device,
3937
)
4038

4139
assert os.path.exists(output_dir / "model.safetensors")
@@ -49,7 +47,6 @@ def test_safetensors(self):
4947
output_dir=new_output_dir,
5048
max_steps=max_steps,
5149
splits=splits,
52-
oneshot_device=device,
5350
)
5451

5552
def tearDown(self):

tests/llmcompressor/transformers/gptq/test_oneshot.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,6 @@ def test_oneshot_application(self):
7777
dataset=self.dataset,
7878
output_dir=self.output,
7979
recipe=self.recipe,
80-
oneshot_device=self.device,
8180
num_calibration_samples=9,
8281
)
8382
model_loaded = AutoModelForCausalLM.from_pretrained(

tests/llmcompressor/transformers/obcq/test_consecutive_runs.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ def _test_consecutive_runs(
3939
num_calibration_samples=num_calibration_samples,
4040
recipe=self.first_recipe,
4141
output_dir=self.output_first,
42-
oneshot_device=self.device,
4342
)
4443

4544
first_model = AutoModelForCausalLM.from_pretrained(
@@ -67,7 +66,6 @@ def _test_consecutive_runs(
6766
num_calibration_samples=num_calibration_samples,
6867
recipe=self.second_recipe,
6968
output_dir=self.output_second,
70-
oneshot_device=self.device,
7169
)
7270

7371
second_model = AutoModelForCausalLM.from_pretrained(

tests/llmcompressor/transformers/obcq/test_mask_structure_preservation.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ def test_mask_structure_preserved(self):
6060
num_calibration_samples=num_calibration_samples,
6161
recipe=self.initial_pruning_only_recipe,
6262
output_dir=self.output_first,
63-
oneshot_device=self.device,
6463
save_compressed=False,
6564
)
6665
targetted_layer = first_tiny_model.model.layers[0].self_attn.k_proj
@@ -82,7 +81,6 @@ def test_mask_structure_preserved(self):
8281
num_calibration_samples=num_calibration_samples,
8382
recipe=self.subsequent_prune_and_quant_recipe,
8483
output_dir=self.output_second,
85-
oneshot_device=self.device,
8684
save_compressed=False,
8785
)
8886

tests/llmcompressor/transformers/obcq/test_obcq_completion.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ def _test_oneshot_completion(self, model_name: str = None):
5959
model=self.model,
6060
dataset=self.dataset,
6161
splits={"calibration": f"train[:{self.num_samples}]"},
62-
oneshot_device=self.device,
6362
recipe=self.recipe,
6463
max_seq_length=512,
6564
num_calibration_samples=self.num_samples,

0 commit comments

Comments
 (0)