Skip to content

Commit b2bae31

Browse files
committed
rename use_liger to use_liger_kernel
1 parent fc05ba6 commit b2bae31

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

docs/source/en/trainer.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,7 @@ First make sure to install Liger official repository:
395395
pip install liger-kernel
396396
```
397397

398-
You should pass `use_liger=True` to apply liger kernel on your model, for example:
398+
You should pass `use_liger_kernel=True` to apply liger kernel on your model, for example:
399399

400400
```py
401401
from transformers import TrainingArguments
@@ -411,11 +411,11 @@ training_args = TrainingArguments(
411411
save_strategy="epoch",
412412
load_best_model_at_end=True,
413413
push_to_hub=True,
414-
use_liger=True
414+
use_liger_kernel=True
415415
)
416416
```
417417

418-
The kernel supports the Llama, Gemma, Mistral, and Mixtral model architectures. The most up-to-date list of supported models can be found [here](https://github.com/linkedin/Liger-Kernel). When `use_liger` is set to `True`, the corresponding layers in the original model will be patched with Liger's efficient implementation, so you don't need to do anything extra other than setting the argument value.
418+
The kernel supports the Llama, Gemma, Mistral, and Mixtral model architectures. The most up-to-date list of supported models can be found [here](https://github.com/linkedin/Liger-Kernel). When `use_liger_kernel` is set to `True`, the corresponding layers in the original model will be patched with Liger's efficient implementation, so you don't need to do anything extra other than setting the argument value.
419419

420420
## LOMO optimizer
421421

src/transformers/trainer.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -464,7 +464,7 @@ def __init__(
464464
" to `True` to avoid any unexpected behavior such as device placement mismatching."
465465
)
466466

467-
if self.args.use_liger:
467+
if self.args.use_liger_kernel:
468468
if is_liger_kernel_available():
469469
from liger_kernel.transformers.trainer_integration import _apply_liger_kernel
470470

@@ -478,7 +478,7 @@ def __init__(
478478
)
479479
else:
480480
raise ImportError(
481-
"You have set `use_liger` to `True` but liger-kernel >= 0.1.0 is not available. "
481+
"You have set `use_liger_kernel` to `True` but liger-kernel >= 0.1.0 is not available. "
482482
"Please install it with `pip install liger-kernel`"
483483
)
484484

src/transformers/training_args.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -792,7 +792,7 @@ class TrainingArguments:
792792
eval_use_gather_object (`bool`, *optional*, defaults to `False`):
793793
Whether to run recursively gather object in a nested list/tuple/dictionary of objects from all devices. This should only be enabled if users are not just returning tensors, and this is actively discouraged by PyTorch.
794794
795-
use_liger (`bool`, *optional*, defaults to `False`):
795+
use_liger_kernel (`bool`, *optional*, defaults to `False`):
796796
Whether enable [Liger](https://github.com/linkedin/Liger-Kernel) Kernel for LLM model training.
797797
It can effectively increase multi-GPU training throughput by ~20% and reduces memory usage by ~60%, works out of the box with
798798
flash attention, PyTorch FSDP, and Microsoft DeepSpeed. Currently, it supports llama, mistral, mixtral and gemma models.
@@ -1496,7 +1496,7 @@ class TrainingArguments:
14961496
},
14971497
)
14981498

1499-
use_liger: Optional[bool] = field(
1499+
use_liger_kernel: Optional[bool] = field(
15001500
default=False,
15011501
metadata={"help": "Whether or not to enable the Liger Kernel for model training."},
15021502
)

tests/trainer/test_trainer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1337,7 +1337,7 @@ def test_apply_liger_kernel(self):
13371337

13381338
args = TrainingArguments(
13391339
"./test",
1340-
use_liger=True,
1340+
use_liger_kernel=True,
13411341
)
13421342
Trainer(tiny_model, args)
13431343

0 commit comments

Comments
 (0)