An easy to use, open-source LLM finetuning library that handles all the complexities of the process for you.
Project description
🌟 Simplifine 🌟
The easiest, fully open-source LLM finetuning library!
Simplifine lets you invoke LLM finetuning with just one line of code using any Hugging Face dataset or model.
Updates
🔄 Updates
v0.0.71 (2024-07-25)
- Bug Fixes: Resolved issues that prevented the library from loading on certain configurations.
- New Feature: Added support for installing directly from git. Added support for Hugging Face API Tokens to access restricted models.
- Documentation: Updated examples.
🚀 Features
- Supervised Fine Tuning 🧑🏫
- Question-Answer Finetuning ❓➕
- Contrastive Loss for Embedding Tasks 🌌
- Multi-label Classification Finetuning 🏷️
- WandB Logging 📊
- In-built Evaluation Tools 📈
- Automated Finetuning Parameters 🤖
- State-of-the-art Optimization Techniques (DeepSpeed, FDSP) 🏎️
📦 Installation
pip install simplifine-alpha
Or you can install the package from source. To do so, simply download the content of this repository and navigate to the installation folder and run the following command:
pip install .
You can also directly install from github using the following command:
pip install git+https://github.com/simplifine-llm/Simplifine.git
🏁 Quickstart
For a more comprehensive example, see this notebook in the examples folder:
Further examples on how to use train engine are also located in the examples folder.
🤝 Contributing
We are looking for contributors! Please send an email to founders@simplifine.com to get onboarded, or add your name to the waitlist on www.simplifine.com.
📄 License
Simplifine is licensed under the GNU General Public License Version 3. See the LICENSE file for more details.
📚 Documentation
Find our full documentation at docs.simplifine.com.
💬 Support
Please raise issues for any new features you would like to see implemented—we will work hard to make it happen ASAP! For any other questions, contact us at founders@simplifine.com.
⛮ General comput considerations
We currently support DistributedDataParallel (DDP) and ZeRO from DeepSpeed. TL;DR DDP is usefull when a model can fit on GPU memory (this includes gradients and activation states), and ZeRO is usefull when model requires sharding across multiple GPUs.
Longer Version: DDP creates a replica on each processor (GPU). Imagine 8 GPUs, each being fed with a single data point. This would make a batch size of 8. The model replicas are then updated on each device. DDP speeds up training via parallelising the data-feeding process. DDP fails if the replica cannot fit in the GPU memory. Note that the memory does not only host parameters, but gradients and optizmier states.
ZeRO is a powerfull optimization developed by DeepSpeed. It comes in different stages (1,2 and 3). Each stage shards the different parts of the training process (params, grads, activation states). This is really usefull if a model cannot fit on the GPU memory. ZeRO also supports offloading to the CPU, which makes even more room for training larger models.
Here are some examples and the appropriate optimization method:
- A llama-3-8b model with 16 bit percision: ZeRO stage 3 on 8 A100s.
- A llama-3-8b model with LoRA adapters: Usually fine with DDP on A100s.
- A GPT-2 with 16 bit percision: DDP
🪲 FAQs and bugs
RuntimeError: Error building extension 'cpu_adam' python dev: This happens when python-dev is not installed and offload is being used by ZeRO. simple try
sudo apt-get install python-dev # for python2.x installs
sudo apt-get install python3-dev # for python3.x installs
See this link
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file simplifine_alpha-0.0.73.tar.gz
.
File metadata
- Download URL: simplifine_alpha-0.0.73.tar.gz
- Upload date:
- Size: 64.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.0 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3e152db5313150529d82bf56a84d710c764941555d933bcb1183e49fece904b2 |
|
MD5 | 969943294a4f4a5c05fe153d2fe98a30 |
|
BLAKE2b-256 | da361504d207340062b0fcae8801493fc5b04e7d98264c4763e2bb7e4f1df30e |
File details
Details for the file simplifine_alpha-0.0.73-py3-none-any.whl
.
File metadata
- Download URL: simplifine_alpha-0.0.73-py3-none-any.whl
- Upload date:
- Size: 50.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.0 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 25c1b127aac319e1461a480148bb328b6f39c1f6b995e22be18c22f186614841 |
|
MD5 | c7c1b844b08f3886f8778b41426fb4b0 |
|
BLAKE2b-256 | 217ddf4090e1d80b74b710559a6d960a9c7cbf870873634302a8f9027e32f6e1 |