-
Notifications
You must be signed in to change notification settings - Fork 925
[WIP] refactor template #6085
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
[WIP] refactor template #6085
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -214,7 +214,7 @@ Other important parameters: | |
| - train_dataloader_shuffle: Whether to shuffle the dataloader in CPT/SFT training. Default is `True`. Not effective for `IterableDataset`, which uses sequential loading. | ||
| - 🔥neftune_noise_alpha: Noise magnitude for NEFTune. Default is 0. Common values: 5, 10, 15. | ||
| - 🔥use_liger_kernel: Whether to enable the [Liger](https://github.com/linkedin/Liger-Kernel) kernel to accelerate training and reduce GPU memory consumption. Defaults to False. Example shell script can be found [here](https://github.com/modelscope/ms-swift/blob/main/examples/train/liger). | ||
| - Note: Liger kernel does not support `device_map`. Use DDP or DeepSpeed for multi-GPU training. | ||
| - Note: Liger kernel does not support `device_map`. Use DDP or DeepSpeed for multi-GPU training. Currently, liger_kernel only supports `task_type='causal_lm'`. | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This documentation update is helpful. To make the implementation more robust and prevent misuse, consider adding a check in the argument parsing logic to enforce this constraint. For example, in if getattr(self, 'use_liger_kernel', False) and self.task_type != 'causal_lm':
raise ValueError("`use_liger_kernel` only supports `task_type='causal_lm'`.")This would provide immediate feedback to users who try to use |
||
| - average_tokens_across_devices: Whether to average token counts across devices. If `True`, `num_tokens_in_batch` is synchronized via `all_reduce` for accurate loss computation. Default is `False`. | ||
| - max_grad_norm: Gradient clipping. Default is 1. | ||
| - Note: The logged `grad_norm` reflects the value **before** clipping. | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This documentation update is helpful. To make the implementation more robust and prevent misuse, consider adding a check in the argument parsing logic to enforce this constraint. For example, in
swift/llm/argument/train_args.py, within theTrainArguments.__post_init__method, you could add:This would provide immediate feedback to users who try to use
liger_kernelwith an unsupported task type.