magnetron  by MarioSieg

Minimalist PyTorch alternative for research/production

Created 8 months ago
638 stars

Top 52.0% on SourcePulse

GitHubView on GitHub
Project Summary

Magnetron is a minimalistic, C99 and Python-based deep learning framework designed for learning and research, offering a PyTorch-like API with automatic differentiation and multithreaded CPU compute. It targets developers and researchers seeking a transparent and modifiable alternative to larger frameworks.

How It Works

Magnetron leverages a C99 core for performance-critical operations, including SIMD-optimized tensor computations (SSE4, AVX2, AVX512, ARM NEON), and provides a modern Python API for ease of use. Its design emphasizes a dynamic computation graph for eager evaluation and includes features like broadcasting, in-place operations, and high-level neural network building blocks.

Quick Start & Requirements

  • Install: Clone the repo, cd magnetron/python, pip install -r requirements.txt (for examples), then cd magnetron_framework && bash install_wheel_local.sh.
  • Prerequisites: Linux, macOS, or Windows; C99 compiler (gcc, clang, msvc); Python 3.6+.
  • Dependencies: CFFI (for Python bindings). Matplotlib and NumPy are optional for examples.
  • Demo: python examples/simple/xor.py
  • Docs: Explore the docs »

Highlighted Details

  • Multithreaded CPU backend with dynamic scaling and thread pooling.
  • SIMD optimized operators (SSE4, AVX2, AVX512, ARM NEON).
  • Modern Python API with broadcasting and in-place variants.
  • Dynamic computation graph (eager evaluation).

Maintenance & Community

Developed by a single person in their free time; currently a Work in Progress (WIP). No community links (Discord/Slack) or roadmap details are provided in the README.

Licensing & Compatibility

Distributed under the Apache 2 License. Permissive for commercial use and closed-source linking.

Limitations & Caveats

The project is in its early stages (WIP) with many features missing and is not yet fully optimized. GPU compute (CUDA), low-precision datatypes, and distributed training are planned but not yet implemented.

Health Check
Last Commit

1 week ago

Responsiveness

Inactive

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

Explore Similar Projects

Starred by Victor Taelin Victor Taelin(Author of Bend, Kind, HVM), Sebastian Raschka Sebastian Raschka(Author of "Build a Large Language Model (From Scratch)"), and
2 more.

nanoT5 by PiotrNawrot

0.2%
1k
PyTorch code for T5 pre-training and fine-tuning on a single GPU
Created 2 years ago
Updated 1 year ago
Starred by Yineng Zhang Yineng Zhang(Inference Lead at SGLang; Research Scientist at Together AI), Lewis Tunstall Lewis Tunstall(Research Engineer at Hugging Face), and
15 more.

torchtune by pytorch

0.2%
5k
PyTorch library for LLM post-training and experimentation
Created 1 year ago
Updated 1 day ago
Starred by Bojan Tunguz Bojan Tunguz(AI Scientist; Formerly at NVIDIA), Alex Chen Alex Chen(Cofounder of Nexa AI), and
19 more.

ggml by ggml-org

0.3%
13k
Tensor library for machine learning
Created 3 years ago
Updated 2 days ago
Starred by Peter Norvig Peter Norvig(Author of "Artificial Intelligence: A Modern Approach"; Research Director at Google), Alexey Milovidov Alexey Milovidov(Cofounder of Clickhouse), and
29 more.

llm.c by karpathy

0.2%
28k
LLM training in pure C/CUDA, no PyTorch needed
Created 1 year ago
Updated 2 months ago
Feedback? Help us improve.