Skip to content

Commit

Permalink
move fsdp config path (#662)
Browse files Browse the repository at this point in the history
  • Loading branch information
tastelikefeet committed Apr 5, 2024
1 parent cb45fad commit 242086b
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 9 deletions.
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
File renamed without changes.
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

0 comments on commit 242086b

Please sign in to comment.