Add support for Accelerate CP, ND examples, and fix for parallel config w fsdp (#3019)

* fix for parallelism config from trainer

* fix handling of parallelism_config w accelerate

* add todo for removal

* update to latest axolotl-contribs-mit for optimizer fix too

* synchronize training after checkpoint save

* dir spelling

* use latest accelerate main

* fix to not use partial state parallelism_config

* more fixeS

* use most recent accelerate fix

* fix cpu_ram_efficient_loading to meta devices from rank 0 to prevent CPU RAM oom

* improve handling of broadcasting fsdp2 state dict

* support for openai chat template with thinking key as the reasoning trace

* address PR feedback

* refactor to remove dependency on PartialState for parallelism config

* bump accelerate, gptoss fixes

* limit meta fixes to fsdp2 for now

* fixes for gpt oss

* fixup examples, don't use cpu-ram-efficient-loading for now

* remove problematic barrier

* patch parallelism config

* reorder comparison

* device mesh fixes

* make pure CP work

* lint
This commit is contained in:
Wing Lian
2025-08-07 21:22:15 -04:00
committed by GitHub
parent ca796fb56e
commit 9d5c95db6f
26 changed files with 534 additions and 148 deletions

View File

@@ -10,9 +10,10 @@ plugins:
experimental_skip_move_to_device: true # prevent OOM by not putting model to GPU before sharding
datasets:
- path: winglian/pirate-ultrachat-10k
- path: HuggingFaceH4/Multilingual-Thinking
type: chat_template
split: train
field_thinking: thinking
template_thinking_key: thinking
dataset_prepared_path: last_run_prepared
val_set_size: 0
@@ -26,11 +27,13 @@ lora_r: 8
lora_alpha: 16
lora_dropout: 0.0 # dropout not supported when using LoRA over expert parameters
lora_target_linear: true
lora_target_parameters: # target the experts in the last two layers
- "22._checkpoint_wrapped_module.mlp.experts.gate_up_proj"
- "22._checkpoint_wrapped_module.mlp.experts.down_proj"
- "23._checkpoint_wrapped_module.mlp.experts.gate_up_proj"
- "23._checkpoint_wrapped_module.mlp.experts.down_proj"
# TODO: not supported for now, see peft#2710
#lora_target_parameters: # target the experts in the last two layers
# - "22._checkpoint_wrapped_module.mlp.experts.gate_up_proj"
# - "22._checkpoint_wrapped_module.mlp.experts.down_proj"
# - "23._checkpoint_wrapped_module.mlp.experts.gate_up_proj"
# - "23._checkpoint_wrapped_module.mlp.experts.down_proj"
wandb_project:
wandb_entity:
@@ -62,3 +65,4 @@ warmup_ratio: 0.1
special_tokens:
eot_tokens:
- "<|end|>"
- "<|return|>"