Nemotron-Labs-Image-30B-A3B for Apple Silicon, MLX 5-bit

Renders from this port at seed 42

An MLX port of NVIDIA's Nemotron-Labs-Image-30B-A3B, an autoregressive image generator (hybrid Mamba2 / attention / 128-expert MoE, 30B total, 3B active) that writes an image as a grid of discrete visual tokens, decoded to pixels by its bundled L24SQ ViT. Unofficial; not affiliated with or endorsed by NVIDIA. Non-commercial use only (research and evaluation), per the NVIDIA License included here.

This tier: routed experts 5-bit (affine, group 64); everything else bf16. 27 GB on disk; for Macs with 36 GB. The highest-fidelity tier that fits a 36 GB Mac. 6-bit experts score better (1.19x) but do not fit 36 GB with the dense layers in bf16; 4-bit tiers lose text accuracy (3.1-3.5x).

Other tiers: 8bit for 48 GB+ Macs (1.05x); 6bit, ~22% faster at 1.7x.

Quick start

hf download VisualInference/Nemotron-Labs-Image-30B-A3B-MLX-5bit --local-dir nemotron-image-5bit
pip install ./nemotron-image-5bit/code
nemotron-image "A risograph concert poster in pink and teal with the headline LOW TIDE ORCHESTRA" \
  --model nemotron-image-5bit --size 880x1184 --seed 42 --out poster.png

Sizes: any multiple of 16; recommended 1024x1024, 1184x880, 1248x832, 880x1184. --seeds 1,2,3,4 renders several candidates in one batch (more images per minute). Each PNG gets a JSON sidecar with settings and timings.

Speed and memory

61-63 tok/s, about 67 s per 1024² image on an M5 Max (36 GB), peak 27.9 GB. The decode step is one compiled, fixed-shape MLX graph per token (Mamba states, preallocated KV cache, sampling noise as a Metal kernel) at ~85-88% of the measured memory-bandwidth roofline. The 1.76 GB embedding table is memory-mapped (or kept on the GPU when there is room); the pixel decoder runs in fp32 after generation (<1 s).

Fidelity

Measured on 24 real sequences (99,564 generated image tokens: 8 official gallery prompts at 4 resolutions, 8 visual test prompts x 2 seeds), teacher-forced, against the model run exactly in fp32 (which matches the upstream PyTorch module to ~1e-6 per layer):

KL vs fp32 (nats/token) x bf16 floor sampled tokens that differ from fp32 NLL vs fp32
bf16 (the official vLLM precision) 0.0176 1.00 9.65% +0.003
this tier 0.0282 1.60 11.9% +0.017

On seeds. The sampler reproduces vLLM's seeded sampler, including the CUDA Philox noise stream for a given seed, and the math follows vLLM's bf16 rounding. But token-for-token identity with the official outputs is not achievable by any implementation: bf16 rounding alone changes ~10% of sampled image tokens relative to the exact model, the first one typically within the first row of the grid, and every later token depends on it. The same seed gives a picture from the same prompt family, not the same pixels, on any other GPU, parallelism setting or port. This holds for this port too: the same tier and seed on an M4 Pro and an M5 Max first differ at token 18 and token 61 in two tests, because the two GPUs round bf16 matrix products differently.

Valid images by default (and an upstream bug)

At the recommended size 880x1184 the original model, run exactly, writes the wrong size header (width=884 with probability 1.0), so the official infer.py rejects the image. This port enforces the image grammar after <|img_start|> (fixed header and row markers, visual codes inside rows). Masking only rescales the allowed probabilities, so every run the official pipeline would accept is reproduced token for token (verified: 4,175 of 4,175 tokens identical on real weights), and the rejected ones become valid images. --unconstrained samples exactly like the reference, failures included.

Details

  • Numerics: residual stream bf16; RMSNorm rounded once; MoE router bf16 x bf16 -> fp32 logits (as vLLM on H100; the generic mlx-lm nemotron_h rounds router logits to bf16); Mamba conv, softplus, decay and SSM state in fp32.
  • On M5 GPUs MLX runs float32 GEMMs in TF32 by default; the package disables that before the first GEMM.
  • Tested: M5 Max 36 GB (real weights). Expected to work on any Apple Silicon Mac with enough memory (M1 is slower: no native bf16). Python 3.11+, MLX 0.32.5.
  • Full write-up, methods and raw numbers: code/docs/FINDINGS.md, code/docs/RESULTS.md.

License

The weights are a modified distribution of NVIDIA's Nemotron-Labs-Image-30B-A3B under the NVIDIA License (LICENSE, non-commercial: research or evaluation only); upstream notices are retained in NOTICE. The runner in code/ is distributed under the same license (it contains a port of NVIDIA's L24SQ decoder); parts derived from Apache-2.0 files keep those notices.

Downloads last month
61
MLX
Hardware compatibility
Log In to add your hardware

Quantized

Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for VisualInference/Nemotron-Labs-Image-30B-A3B-MLX-5bit

Quantized
(11)
this model

Collection including VisualInference/Nemotron-Labs-Image-30B-A3B-MLX-5bit