Skip to content
apple-aiml-researchPublic

About

No description, website, or topics provided.

Resources

Security policy

Stars

40 stars

Watchers

0 watching

Forks

Repository files navigation

Memory-Efficient Backpropagation for Fine-Tuning LLMs on Resource-Constrained Mobile Devices

This is a demo implementation for Memory-Efficient Backpropagation for Fine-Tuning LLMs on Resource-Constrained Mobile Devices .

The implementation is based on MLX and includes:

  1. Exporting Qwen3 model to MLX graphs for fine-tuning with QLoRA.
  2. On-device Memory-Efficient Backpropagation (MeBP) runtime implementation.
  3. Example iOS App for running MeBP on Qwen3.

Getting Started: End-to-End Example of Fine-tuning Qwen3

Step 1: Export Qwen3 model

  1. Run notebook in examples/export_qwen3.ipynb to export Qwen3 model.
  2. The notebook will generate model assets at output directory specified (default to data/qwen3)

Step 2: Build MLXMeBPExample App in Xcode on the iPhone

  1. Connect your iPhone to your MacBook
  2. Open MLXMeBPExample/MLXMeBPExample.xcodeproj in Xcode
  3. Build the App on your iPhone

Step 3: Copy Qwen3 Assets to MLXMeBPExample's Directory on the iPhone

  1. Open Finder App on your MacBook and find your connected iPhone on the left
  2. Click Files in Finder which shows a list of Apps installed on your iPhone
  3. Find MLXMeBPExample App and drag the Qwen3 directory to the Apps' directory

Step 4: Run Training on iPhone

  1. Open MLXMeBPExample App on your iPhone
  2. Click Initialize Model
  3. Click Start Training
Alt text Alt text Alt text

About

No description, website, or topics provided.

Resources

Security policy

Stars

40 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages