gemma-4-moe-nano

A tiny, randomly-initialized stand-in for the gemma-4 MoE architecture (google/gemma-4-26B-A4B-it), built for per-architecture correctness testing of the spyre-inference backend on IBM Spyre accelerators. It is not a usable language model β€” the weights are random with only a brief conditioning pass, so its outputs are gibberish.

Why this exists

spyre-inference validates its Spyre lowering per model architecture. The real gemma-4 MoE checkpoints are 26B+ parameters and dominate CI wall-clock, yet no small public gemma-4 MoE checkpoint satisfies Spyre's head-size-multiple-of-64 rule (every public tiny-random one uses head_dim 16/32). This model fills that gap: it carries the exact gemma-4 architecture at a few-hundred-MB size, so the architecture can be exercised on every PR while the full product models run in an opt-in suite.

What is preserved from the real architecture

  • Gemma4ForConditionalGeneration / model_type: gemma4, text + vision tower
  • Dual local/global head dim (256 / 512, both multiples of 64) and the 2-KV-head global-attention layers
  • The 128-expert, top-8 MoE block
  • The sliding/full layer_types mix (with a full_attention layer retained)
  • The full 262144-token vocabulary and the real tokenizer

Shrunk (size only): hidden size, FFN / MoE intermediate sizes, text layer count (β†’ 6, keeping one full-attention layer), and vision layer count.

How it was generated

Reproducibly, by tests/data/generate_micro_gemma4_moe.py in spyre-inference: it loads the real config, overrides only the size fields, applies controlled init plus a short language-modeling conditioning pass (so the output distribution is non-flat and numerically well-behaved), and verifies a finite fp16 forward.

Validation

Loaded and run compiled on a Spyre card via the text-backbone path (hf_overrides={"architectures": ["Gemma4ForCausalLM"]}), with no CPU fallback β€” the shrunk config lowers through the same SpyreGemma4ForCausalLM per-block compile as the full model.

Downloads last month
21
Safetensors
Model size
0.1B params
Tensor type
F16
Β·
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support