Top AI Repos — open-source AI, indexed and scored
Top AI Repos tracks AI repositories on GitHub and answers two different questions about each one: is it moving right now, and would you bet a product on it.
Top AI Repos tracks AI repositories on GitHub and answers two different questions about each one: is it moving right now, and would you bet a product on it.
A zero-dependency ML framework in C with a modern Python API for full control over execution and memory.
| Date | Stars |
|---|---|
| 2026-07-24 | 693 |
| 2026-07-25 | 694 |
| 2026-07-28 | 694 |
| 2026-07-30 | 694 |
| 2026-08-06 | 694 |
Today
— stars today
This week
— stars this week
This month
— stars this month
Momentum
5.0
growth rate 0.00%/day
[![Stargazers][stars-shield]][stars-url]
[![Forks][forks-shield]][forks-url]
[![Issues][issues-shield]][issues-url]
![GitHub Actions Workflow Status][ci-shield]
<br />
<div align="center">
<a href="https://github.com/MarioSieg/magnetron">
<img src="https://raw.githubusercontent.com/MarioSieg/magnetron/develop/media/logo.png" alt="Magnetron Logo" width="200" height="200">
</a>
<h3 align="center">magnetron</h3>
<p align="center">
A compact machine learning runtime for developers who want to understand, control, and optimize the full stack.
<br />
Native C core, modern Python API, no runtime dependencies, no bloat.
<br /><br />
<a href="https://github.com/MarioSieg/magnetron/blob/master/docs/Magnetron-Cheatsheet.md"><strong>Documentation »</strong></a>
<br /><br />
<a href="https://github.com/MarioSieg/magnetron/blob/master/examples/qwen3">Qwen3 Inference Example</a>
·
<a href="https://github.com/MarioSieg/magnetron/blob/master/examples/ae">Autoencoder Training Example</a>
·
<a href="https://github.com/MarioSieg/magnetron/blob/master/examples/gpt2">GPT-2 Inference Example</a>
</p>
</div>
---
## About
**Magnetron** is a machine learning runtime built from scratch in C, with a small modern Python interface for usability.
It implements its own tensor system, operator set, autograd engine, and execution model - without relying on large external frameworks.
The goal is simple:
> Keep the stack small enough to understand and be hackable, but powerful enough to run real models.
This makes Magnetron useful in two situations:
- when you want **full control over execution and memory**
- when you want a **clean base for experimentation or new ideas**
---
## Why Magnetron?
Magnetron is not trying to compete with PyTorch on ecosystem or feature count.
Instead, it optimizes for a different axis:
| Magnetron | PyTorch |
|--------|------|
| Small, inspectable core | Large, layered system |
| Explicit execution | Implicit / abstracted |
| Minimal dependencies | Heavy runtime |
| Easy to modify kernels | Harder to reason about backend |
| Good for research & systems work | Good for production & scale |
If you want to:
- understand how your model actually runs
- experiment with kernels, memory layouts, or execution
- port ML workloads to unusual hardware
Magnetron gives you a much shorter path.
---
## Architecture Overview
Magnetron is built as a **single, cohesive runtime**, not a collection of loosely coupled libraries.
- **Tensor system**
Owns dtype, shape, strides, and memory – supports a full **view system with a view solver**, enabling complex slicing, reshaping, and broadcasting semantics similar to PyTorch while remaining explicit and predictable.
- **Execution model**
Eager execution with a dynamic autograd graph (reverse-mode), constructed per forward pass and traversed during backward.
- **Operator backend**
Central dispatch layer mapping high-level operations to architecture-specific kernel implementations.
- **CPU backend**
Multi-dispatch design with **compile-time optimized kernels** for a wide range of microarchitectures (Intel, AMD Zen1–Zen5, ARM).
At runtime, **CPUID-based detection** selects the most optimal kernel path automatically.
Supports multiple SIMD ISAs and extensions, including SSE (1–4), AVX, AVX2, FMA, AVX-512, AVX-512-BF16, AVX-512-FP16, F16C and ARM NEON, combined with multithreaded execution.
- **CUDA backend (in progress)**
Kernel layer is implemented - Memory management, execution pipeline, and integration are actively being completed.
- **Serialization**
Native `.mag` format designed for **zero-copy, memory-mapped loading**, enabling fast startup and efficient large model handling.
Conversion tools are provided to import weights from external formats.
- **Backend extensibility**
The architecture is intentionally **clean and modular**, making it straightforward to introduce new backends or tarExcerpt of 9,828 characters
Read on GitHub1.1k
Would you bet a product on this? Bounded 0–100 and slow moving.
matched fp:3896f7ab27a6de53, topic:pytorch, topic:tensorflow, readme:autograd
matched fp:3896f7ab27a6de53, topic:cuda