Skip to content
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

move fsdp config path #662

Merged
merged 1 commit into from
Apr 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/source/LLM/命令行参数.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@
### FSDP参数

- `--fsdp`: 默认值`''`, fsdp类型, 详情可以查看该参数[原始文档](https://huggingface.co/docs/transformers/v4.39.3/en/main_classes/trainer#transformers.TrainingArguments.fsdp).
- `--fsdp_config`: 默认值`None`, fsdp配置文件的路径, 支持传入`fsdp_offload`, 该文件为SWIFT提供的默认配置, 具体可以查看[这里](https://github.com/modelscope/swift/tree/main/swift/llm/fsdp_config/fsdp_offload.json).
- `--fsdp_config`: 默认值`None`, fsdp配置文件的路径.

### LoRA+微调参数

Expand Down
4 changes: 2 additions & 2 deletions docs/source_en/LLM/Command-line-parameters.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,9 @@

### FSDP Parameters

- `--fsdp`: Default value`''`, the FSDP type, please check[this documentation](https://huggingface.co/docs/transformers/v4.39.3/en/main_classes/trainer#transformers.TrainingArguments.fsdp) for details.
- `--fsdp`: Default value `''`, the FSDP type, please check [this documentation](https://huggingface.co/docs/transformers/v4.39.3/en/main_classes/trainer#transformers.TrainingArguments.fsdp) for details.

- `--fsdp_config`: Default value`None`, the FSDP config file path, `fsdp_offload` is a special value, check [here](https://github.com/modelscope/swift/tree/main/swift/llm/fsdp_config/fsdp_offload.json) for details.
- `--fsdp_config`: Default value `None`, the FSDP config file path.

### LoRA+ Fine-tuning Parameters

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ nproc_per_node=2

PYTHONPATH=../../.. \
CUDA_VISIBLE_DEVICES=0,1 \
accelerate launch --config_file "../../../swift/llm/fsdp_config/fsdp_offload.json" \
accelerate launch --config_file "./scripts/llama2_70b_chat/qlora_fsdp/fsdp_offload.json" \
llm_sft.py \
--model_type llama2-70b-chat \
--model_revision master \
Expand Down
5 changes: 0 additions & 5 deletions swift/llm/utils/argument.py
Original file line number Diff line number Diff line change
Expand Up @@ -290,11 +290,6 @@ def __post_init__(self) -> None:
self.deepspeed = os.path.abspath(
os.path.join(ds_config_folder, 'zero3.json'))

fsdp_config_folder = os.path.join(__file__, '..', '..', 'fsdp_config')
if self.fsdp_config == 'fsdp_offload':
self.fsdp_config = os.path.abspath(
os.path.join(fsdp_config_folder, 'fsdp_offload.json'))

handle_path(self)
set_model_type(self)
if isinstance(self.dataset, str):
Expand Down
Loading