Axolotl是一个专门设计用于简化各种AI模型后训练过程的开源工具。后训练是指对预训练模型进行的任何修改或额外训练,包括全模型微调、参数高效调优(如LoRA和QLoRA)、监督微调(SFT)、指令调优和对齐技术。该工具支持多种模型架构和训练配置,让用户能够轻松开始使用这些先进的训练技术。
pip3 install -U packaging==23.2 setuptools==75.8.0 wheel ninja
pip3 install --no-build-isolation axolotl[flash-attn,deepspeed]
# 下载示例配置文件
axolotl fetch examples
axolotl fetch deepspeed_configs # 可选
git clone https://github.com/axolotl-ai-cloud/axolotl.git
cd axolotl
pip3 install -U packaging setuptools wheel ninja
pip3 install --no-build-isolation -e '.[flash-attn,deepspeed]'
docker run --gpus '"all"' --rm -it axolotlai/axolotl:main-latest
获取示例配置:
axolotl fetch examples
训练模型:
axolotl train examples/llama-3/lora-1b.yml
自定义配置: 根据需要修改YAML配置文件中的参数
Axolotl使用YAML配置文件来控制整个训练流程,包括:
模型 | fp16/fp32 | LoRA | QLoRA | GPTQ | Flash Attn | xformers |
---|---|---|---|---|---|---|
LLaMA | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
Mistral | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
Mixtral-MoE | ✅ | ✅ | ✅ | ❓ | ❓ | ❓ |
Pythia | ✅ | ✅ | ✅ | ❌ | ❌ | ❌ |
Falcon | ✅ | ✅ | ✅ | ❌ | ❌ | ❌ |
Qwen | ✅ | ✅ | ✅ | ❓ | ❓ | ❓ |
Gemma | ✅ | ✅ | ✅ | ❓ | ❓ | ✅ |
✅: 支持 ❌: 不支持 ❓: 未测试