mlx-examples  by ml-explore

Examples using the MLX framework

created 1 year ago
7,686 stars

Top 6.9% on sourcepulse

GitHubView on GitHub
Project Summary

This repository provides a collection of standalone examples demonstrating the capabilities of the MLX framework, targeting developers and researchers interested in efficient machine learning on Apple Silicon. It showcases various model architectures and tasks, enabling users to quickly implement and experiment with cutting-edge AI models.

How It Works

The examples leverage the MLX framework, which is designed for efficient computation on Apple's unified memory architecture. This approach allows for seamless data transfer between CPU and GPU, reducing overhead and improving performance for machine learning workloads. The examples cover a broad spectrum of tasks, including text generation, image classification, speech recognition, and multimodal applications, utilizing popular architectures like LLaMA, Mistral, BERT, and Stable Diffusion.

Quick Start & Requirements

  • Install MLX via pip: pip install mlx
  • Requires macOS 13.0+ and Apple Silicon (M1/M2/M3).
  • Examples can be run directly from the repository after cloning.
  • Official MLX documentation: https://github.com/ml-explore/mlx

Highlighted Details

  • Comprehensive examples for large language models (LLaMA, Mistral, Mixtral) including parameter-efficient fine-tuning (LoRA, QLoRA).
  • Includes implementations for image generation (Stable Diffusion, SDXL), classification (ResNets), and audio tasks (Whisper, EnCodec, MusicGen).
  • Demonstrates multimodal capabilities with CLIP and LLaVA, as well as graph neural networks (GCN).
  • Supports direct use of converted checkpoints from the MLX Community on Hugging Face.

Maintenance & Community

The MLX project was initially developed by Awni Hannun, Jagrit Digani, Angelos Katharopoulos, and Ronan Collobert. The repository encourages community contributions and provides a citation for academic use.

Licensing & Compatibility

The repository does not explicitly state a license. However, the MLX framework itself is typically distributed under a permissive license, allowing for commercial use and integration into closed-source projects.

Limitations & Caveats

The examples are specifically designed for Apple Silicon hardware and macOS, limiting their use on other platforms. Some advanced examples or larger models may require significant memory resources.

Health Check
Last commit

1 month ago

Responsiveness

1 day

Pull Requests (30d)
3
Issues (30d)
6
Star History
361 stars in the last 90 days

Explore Similar Projects

Starred by George Hotz George Hotz(Author of tinygrad; Founder of the tiny corp, comma.ai), Andrej Karpathy Andrej Karpathy(Founder of Eureka Labs; Formerly at Tesla, OpenAI; Author of CS 231n), and
21 more.

mlx by ml-explore

0.5%
22k
Array framework for machine learning on Apple silicon
created 1 year ago
updated 15 hours ago
Feedback? Help us improve.