Skip to main content

🌟 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.8 (2024-08-08)

  • Bug Fixes: Code clean up and trainer fixes.
  • New Feature: Ability to define more complex configuration files for the trainer.
  • Documentation: -New examples on training cloud and training a fake news detector.
  • COMPREHENSIVE UPDATE of DOCUMENTATIONS on docs.simplifine.com.

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

If you have any suggestions for new features you'd like to see implemented, please raise an issue—we will work hard to make it happen ASAP! For any other questions, feel free to contact us at founders@simplifine.com.

⛮ General Compute Considerations

We currently support both DistributedDataParallel (DDP) and ZeRO from DeepSpeed.

TL;DR:

  • DDP is useful when a model can fit in GPU memory (this includes gradients and activation states).
  • ZeRO is useful when a model requires sharding across multiple GPUs.

Longer Version:

  • DDP: Distributed Data Parallel (DDP) creates a replica of the model on each processor (GPU). For example, imagine 8 GPUs, each being fed 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 by parallelizing the data-feeding process. However, DDP fails if the replica cannot fit in GPU memory. Remember, the memory not only hosts parameters but also gradients and optimizer states.

  • ZeRO: ZeRO is a powerful optimization developed by DeepSpeed and comes in different stages (1, 2, and 3). Each stage shards different parts of the training process (parameters, gradients, and activation states). This is really useful if a model cannot fit in GPU memory. ZeRO also supports offloading to the CPU, making even more room for training larger models.

Example Scenarios and Appropriate Optimization Methods:

  1. LLaMA-3-8b model with 16-bit precision: Use ZeRO Stage 3 on 8 A100s.
  2. LLaMA-3-8b model with LoRA adapters: Usually fine with DDP on A100s.
  3. GPT-2 with 16-bit precision: Use DDP.

🪲 FAQs and Bugs

Issue: RuntimeError: Error building extension 'cpu_adam' python dev

This error occurs when python-dev is not installed, and ZeRO is using offload. To resolve this, try:

# Try sudo apt-get install python3-dev if the following fails.
apt-get install python-dev   # for Python 2.x installs
apt-get install python3-dev  # for Python 3.x installs

See this link

Metadata

Release files for simplifine-alpha 0.0.81

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for simplifine-alpha 0.0.81
File Size Uploaded
simplifine_alpha-0.0.81.tar.gz 89.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for simplifine-alpha 0.0.81
File Interpreter ABI Platform
simplifine_alpha-0.0.81-py3-none-any.whl Python 3 none any Details

Total release size: 142.0 kB

Release files / simplifine_alpha-0.0.81.tar.gz

Download URL simplifine_alpha-0.0.81.tar.gz
Size 89.8 kB
Tags Source
SHA-256 checksum
How to use checksums
10b6d8c053139394a5878a7e6c7b880a896258711f7703ea2d0bb96cb2614dc0
BLAKE2b-256 checksum
How to use checksums
b64c36bfb886d21b0e3e92e3e3a42f0de5eca56734ed29401fbc32bdeac0b594
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.1.0 CPython/3.12.5

Release files / simplifine_alpha-0.0.81-py3-none-any.whl

Download URL simplifine_alpha-0.0.81-py3-none-any.whl
Size 52.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c84e785d5c18b0ad9ad650870f8e181b1f50eaf9f61e1cfed091b9daa9e9706d
BLAKE2b-256 checksum
How to use checksums
4a9869156633a5ecee6f9399cdbf6e6d6e9df26cf7038e37132ac359ea4dc0f8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.1.0 CPython/3.12.5

Release history Release notifications | RSS feed

This release

0.0.81 This release

2 release files

0.0.71

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page