antirez’s Pure‑C MiniMax‑H3 Engine Generates 512×512 Video in 3.5 s on M5 Max

The article details how antirez rebuilt a zero‑dependency, high‑throughput MiniMax‑H3 video/audio inference engine entirely in C for Apple Silicon, achieving 22‑frame 512×512 video rendering in about 3.5 seconds on an M5 Max, and explains the engineering tricks, benchmark results, adjustable quality settings, terminal UI, community feedback, and upcoming sparse‑attention support.

21CTO
21CTO
21CTO
antirez’s Pure‑C MiniMax‑H3 Engine Generates 512×512 Video in 3.5 s on M5 Max

Overview

Redis creator antirez released a new MiniMax‑H3 engine written purely in C for Apple Silicon Macs. The engine is a zero‑dependency, high‑throughput video/audio inference pipeline that moves generative‑video inference from the cloud to the local device.

Vertical‑Slice Architecture

The project is organized as a series of working vertical slices, ranging from deterministic unit tests and Metal block‑level correctness checks to prompt encoding, Prompt‑to‑Video/Audio, and first/last‑frame anchoring. The entire end‑to‑end pipeline runs in clean C code.

M5 Max Production Benchmarks

Fast Rendering Mode : 512×512 resolution, 22‑frame video, 4 denoising steps in ~3.5 seconds.

Reference‑Quality Mode : 29 denoising steps in ~26.4 seconds.

Token Reduction Optimization : With a 45‑layer + reuse‑2 denoise configuration, latency drops from 16.69 seconds to 12.60 seconds.

INT8 Deep Quantization (MLP + QKV + Attention Output) : For a 50‑layer, 19‑transition‑frame, 512‑resolution render, time falls from 36.30 seconds (BF16) to ~19.32 seconds, nearly a 100 % speed‑up.

Engineering Self‑Containment and Memory Control

Eliminates Xcode dependency; Metal shaders are compiled and loaded at runtime.

Supports file‑backed mmap zero‑copy for 37 GiB models, with INT8 compression reducing peak tensor storage to ~25.9 GiB.

Uses buffer alias reuse, fused kernels, and graph data caching to keep physical memory on a 128 GB M5 Max at ~40 GB, achieving true zero‑swap operation.

Adjustable Speed/Quality Dial and Iris‑Style TUI

The engine exposes fine‑grained control over parameters such as denoising steps, DiT layers, speed reuse, core reuse, token reduction, and canvas resolution. An Iris‑style terminal UI lets developers interact directly: !seed random – randomize sampling seed. !show – live preview rendering. !save output.mp4 – export video. !first / !last – set first/last frame anchors.

Native support for Kitty, Ghostty, iTerm2, WezTerm, Konsole protocols to display video frames directly in the terminal.

Community Feedback and Future Sparse‑Attention Evolution

Developers have begun testing the engine in real scenarios. Meleagris reports impressive results on an M5 Pro (64 GB) using the Q5_K_M quantized build, while noting that the Q8_0 (34 GB) version runs stably on a 64 GB unified memory system. linzhangrun observed that generating a 15‑second 480p video with traditional frameworks on an M4 Max (128 GB) takes 1.5 hours, prompting a switch to h3.c for orders‑of‑magnitude speed gains.

Antirez also hinted at a major future direction: native sparse‑attention support in the H3 architecture, which he expects to bring huge speed improvements. He is currently testing an optional --sparse-attention mode.

Conclusion

Twenty years after writing Redis in pure C, antirez demonstrates that the same minimalist, high‑performance philosophy can break the Python‑centric AI stack, delivering desktop‑level generative video inference with unprecedented speed and memory efficiency.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

PerformanceCINT8 quantizationvideo inferenceApple Siliconsparse attentionToken ReductionMiniMax-H3
21CTO
Written by

21CTO

21CTO (21CTO.com) offers developers community, training, and services, making it your go‑to learning and service platform.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.