mamba-minimal  by johnma2006

Minimal Mamba SSM implementation in one PyTorch file

Created 1 year ago
2,854 stars

Top 16.7% on SourcePulse

GitHubView on GitHub
Project Summary

This repository provides a simplified, single-file PyTorch implementation of the Mamba selective state space model architecture. It is intended for researchers and developers who want to understand Mamba's core mechanics without the complexities of the highly optimized official implementation. The primary benefit is enhanced code readability and educational value.

How It Works

The implementation focuses on clarity, replicating the numerical output of the official Mamba model for both forward and backward passes. It prioritizes straightforward PyTorch operations over performance optimizations, making the underlying algorithms more accessible for study.

Quick Start & Requirements

  • Install via pip install torch transformers.
  • Requires PyTorch and Hugging Face Transformers.
  • Demo notebook demo.ipynb showcases prompt completion.

Highlighted Details

  • Numerically equivalent to the official Mamba implementation.
  • Single-file, annotated PyTorch code for readability.
  • Does not include performance optimizations from the official release.

Maintenance & Community

This is a personal project by johnma2006, focused on educational purposes. There is no explicit mention of community channels or ongoing maintenance plans.

Licensing & Compatibility

The repository does not explicitly state a license. Given its nature as a minimal implementation derived from the official Mamba project, users should consult the license of the original Mamba repository for usage and compatibility guidelines, especially for commercial applications.

Limitations & Caveats

This implementation is explicitly not optimized for speed and is intended for educational purposes rather than production deployment. It may lack features or robustness found in the official, highly optimized Mamba codebase.

Health Check
Last Commit

1 year ago

Responsiveness

Inactive

Pull Requests (30d)
0
Issues (30d)
0
Star History
15 stars in the last 30 days

Explore Similar Projects

Starred by Vincent Weisser Vincent Weisser(Cofounder of Prime Intellect), Chip Huyen Chip Huyen(Author of "AI Engineering", "Designing Machine Learning Systems"), and
18 more.

WizardLM by nlpxucan

0.0%
9k
LLMs built using Evol-Instruct for complex instruction following
Created 2 years ago
Updated 3 months ago
Starred by Chip Huyen Chip Huyen(Author of "AI Engineering", "Designing Machine Learning Systems"), Vincent Weisser Vincent Weisser(Cofounder of Prime Intellect), and
15 more.

codellama by meta-llama

0.0%
16k
Inference code for CodeLlama models
Created 2 years ago
Updated 1 year ago
Feedback? Help us improve.