[SFT] feat: Add LoRA support for SFT (#127)
This PR adds support for LoRA (Low-Rank Adaptation) for efficient model fine-tuning. ### Changes 1. Added LoRA configuration support in trainer config 2. Modified FSDP wrapping policy to handle LoRA modules 3. Integrated with existing FSDP training infrastructure 4. Added peft dependency 5. Removed unused ring_attn_utils.py ### Features - Configurable LoRA rank and alpha parameters - Target module specification for selective adaptation - Compatible with FSDP sharding strategy ### Testing Tested with Qwen2.5-0.5B-Instruct model on GSM8K dataset using the provided example script. ### Dependencies - Added `peft` package to requirements.txt This PR is based on commit 902ddbe6 and has been merged with the latest upstream main branch. --------- Co-authored-by: Jiayi Pan <i@jiayipan.me> Co-authored-by: openhands <openhands@all-hands.dev>
Showing
.github/workflows/e2e_lora.yml
0 → 100644
examples/sft/gsm8k/run_qwen_05_peft.sh
0 → 100755
... | ... | @@ -6,6 +6,7 @@ flash-attn |
hydra-core | ||
numpy | ||
pandas | ||
peft | ||
pybind11 | ||
ray | ||
tensordict<0.6 | ||
... | ... |
Please
register
or
sign in
to comment