Trainium and Inferentia examples using the Neuron SDK. This is more a place for me to store reminders and collections of useful code.
- isaac05-vllm-omni-neuron: Serve PerceptronAI Isaac-0.5 (36B hybrid-MoE vision-language-action robot policy with a DiT flow expert) on one Trainium2 device (trn2.3xlarge): robot actions behind vLLM-Omni's OpenPI websocket with request batching, plus text / image serving with vLLM, on the public Neuron SDK 2.33 DLAMI with our vllm-neuron branch and a job-list MoE prefill NKI kernel. 222 ms per action plan, 11.5 plans/s per device with concurrent clients; up to 2,296 output tok/s text, 700 tok/s with images, BF16.
- PhyloGPN: Genome-scale scoring with PhyloGPN (
songlab/PhyloGPN, 83M-parameter genomic language model: F81 log-rates and embeddings for every DNA site) on one Trainium2 device (trn2.3xlarge) with TorchNeuron and a fused NKI block kernel, on the public Neuron SDK 2.33 torch-neuronx 2.14.0 DLAMI. 1.73 M sites/s per device end to end (a human genome on both strands in about an hour), 11 ms per 4,096-position window at batch 1, loads the Hugging Face checkpoint directly, BF16. - ministral3-8b-vllm-neuron: Serve Ministral-3-8B-Instruct-2512 (text + Pixtral vision, BF16 or FP8) with vLLM on one Trainium2 device (trn2.3xlarge), on the public Neuron SDK 2.33 DLAMI with our vllm-neuron and NKI Library branches (no NxD Inference): YaRN RoPE, Llama-4 query scaling to 32k on the fused decode kernel, packed FP8 KV cache. 109 tok/s single-stream (126 ms to first token), 2,583 output tok/s at 64 concurrent (1k/1k), up to 5,151 with TP=2 x DP=2, GSM8K 88.9 %. Optional public EAGLE-3 draft: 196 tok/s single-stream (4.6 ms per token).
- mistral-7b-vllm-neuron: Serve Mistral-7B-Instruct-v0.3 with vLLM on one Trainium2 device (trn2.3xlarge) at the full 32k context, on the public Neuron SDK 2.33 DLAMI with our vllm-neuron branch (no NxD Inference): Mistral registration on the plugin's Llama code, GQA decode on the fused kernel, packed prefill and real-peak KV admission. 113 tok/s and 62 ms to first token single-stream, 2,048 output tok/s at 32 concurrent (1k/1k), up to 3,164 at 10k context, needle retrieval to 30k tokens, GSM8K at Hugging Face parity, BF16. Optional open EAGLE3 draft: 1.7-2.2x lower single-stream latency.
- gemma3-12b-vllm-neuron: Serve Gemma 3 12B (
google/gemma-3-12b-it, text) with vLLM on one Trainium2 device (trn2.3xlarge), on the public Neuron SDK 2.33 DLAMI with our vllm-neuron and NKI Library branches: sliding-window-aware KV admission and ring,head_dim256 decode kernels. 1,838 output tok/s with 2,048-token prompts (83 at once), 1,418 with 4,096-token prompts, BF16. - gpt-oss: Serve GPT-OSS-20B with vLLM on Trainium2 (trn2.3xlarge) on the public Neuron SDK 2.33 DLAMI, with our vllm-neuron and NKI Library branches: FP8 expert weights, 5.5x lower time to first token and up to 2x faster decode than the stock plugin.
- RT-DETR_R101: Real-time object detection with RT-DETR R101 (
PekingU/rtdetr_r101vd_coco_o365, 76M parameters, FP32) on Trainium2 (trn2.3xlarge) and Inferentia2 (inf2.8xlarge) with TorchNeuron (torch.compile), on the public Neuron SDK 2.33 DLAMI. A 30-linetorch.gatherrewrite ofF.grid_samplereplaces the earlier custom NKI kernel (kept as a comparison). 136.6 img/s per trn2.3xlarge, 36.9 per inf2.8xlarge. - boltz-neuron (separate repo): Boltz-2 protein structure prediction on Inferentia2 (inf2.xlarge) with TorchNeuron, on the public Neuron SDK 2.33 torch-neuronx 2.14.0 DLAMI. Drop-in
boltz predictCLI plus a prebuilt compile cache. - mellum2.1-vllm-neuron: Serve JetBrains Mellum2.1 12B-A2.5B Thinking (64-expert MoE reasoning model with sliding-window + YaRN full attention) with vLLM on one Trainium2 device (trn2.3xlarge), on the public Neuron SDK 2.33 DLAMI with our vllm-neuron branch. up to 6,209 output tok/s online at 512 concurrent (FP8 experts), 80 / 207 ms to first token for 1k / 4k prompts, reasoning and tool-call parsers, fp32-gated accuracy (GSM8K-100 97 %), BF16.
- flint-moe-nki-kernels: Training a fine-grained Mixture-of-Experts model (256 experts, top-6) on Trainium2 (SDK 2.33, PyTorch Native + TorchTitan): expert parallelism for the NKI MoE (3.3x over the TP-on-experts fallback), an EP-aware block bound (+21% at EP=16), an on-device MoE routing scan, and a per-expert weight pre-transpose for the MoE backward (1.18x, bit-exact). Includes a full reproduction guide with the MFU-accounting fix, an interval-merged time breakdown, and the things that did NOT work. Hardware-measured on trn2.48xlarge.
- moshi-vllm-omni-neuron: Serve kyutai Moshi and NVIDIA PersonaPlex (full-duplex speech-to-speech, 7.7B) on Trainium2 (trn2.3xlarge) behind vLLM-Omni's realtime duplex WebSocket API, on the public Neuron SDK 2.33 DLAMI with our vllm-omni-neuron workers. 40 real-time PersonaPlex conversations per instance (4-minute sessions, p99 112 ms), 72 with upcoming vLLM-Omni; 15 Moshi conversations at ~54 ms per-frame latency.
- qwen3-tts-vllm-omni-neuron: Serve Qwen3-TTS 12Hz 1.7B (VoiceDesign, CustomVoice and Base voice cloning) on Trainium2 (trn2.3xlarge) behind vLLM-Omni's OpenAI
/v1/audio/speechAPI, on the public Neuron SDK 2.33 DLAMI with our vllm-omni-neuron Qwen3-TTS workers and NKI codec-decoder kernels. 186x real time on one server, 367x with two LNC=1 servers; 0.58 s single-utterance latency. - muse-glimmer-vllm-neuron: Serve Muse-Glimmer-30B (dense 30B vision-language model: text, image and video in) with vLLM on Trainium2 (trn2.3xlarge), on the public Neuron SDK 2.33 DLAMI with our vllm-neuron branch (and optional NKI Library branch). FP8 MLP + FP8 KV: up to 1,061 output tok/s per device, 21 ms/token single-stream; DFlash speculative decoding 133 tok/s single-stream.
- whisper-vllm-neuron: Serve Whisper large-v3 (
openai/whisper-large-v3) with vLLM on Trainium2 (trn2.3xlarge), on the public Neuron SDK 2.33 DLAMI with our vllm-neuron branch: NKI cross- and self-attention decode kernels, per-request KV cache, and draft-model speculative decoding with distil-large-v3. 1,239 RTFx on 30 s clips (8 replicas), 98.6 ms single-request latency with speculative decoding, WER 8.56 / 1.49 / 3.14 (Earnings22 / LibriSpeech clean / other). - voxtral-dflash-vllm-neuron: Serve Voxtral-Mini-3B with vLLM on Trainium2 (trn2.3xlarge), with optional DFlash speculative decoding (2.3x lower latency on short clips with the public draft). Public Neuron SDK 2.33 DLAMI plus the open vllm-neuron Voxtral PR.
- qwen3-asr-dflash-vllm-neuron: Serve Qwen3-ASR-1.7B (and 0.6B) with vLLM on Trainium2 (trn2.3xlarge), with optional DFlash speculative decoding (1.75x lower single-stream latency on in-domain clips with the public draft). Public Neuron SDK 2.33 DLAMI plus a public vllm-neuron fork branch with the Qwen3-ASR perf fixes and DFlash hooks.
- evo2: Batched decode for the Evo 2 7B DNA language model on Trainium2 (trn2.3xlarge) with TorchNeuron and fused NKI kernels, on the public Neuron SDK 2.33 torch-neuronx 2.14.0 DLAMI. TP=4: 2,333 tok/s at an 8K context (B=88); DP=4: 3,356 tok/s at 256.
- stripedhyena: StripedHyena-Hessian-7B (hybrid Hyena / attention LM, 32K context) decode on Trainium2 (trn2.3xlarge) with TorchNeuron, on the public Neuron SDK 2.33 torch-neuronx 2.14.0 DLAMI. TP=4: 5,774 tok/s at 2K, 1,992 at 8K, 645 at 32K; 12.8 ms/token at B=1.
- qwen3-lora-sft-torchneuron: LoRA fine-tuning of Qwen3 (0.6B and 8B) on Trainium2 with TorchNeuron and Hugging Face TRL
SFTTrainer+ PEFT, on the public Neuron SDK 2.33 torch-neuronx 2.14.0 DLAMI. Data parallel or FSDP2 withtorchrun. - disaggregated-trainium-nvidia: Disaggregated inference between Trainium2 and NVIDIA GPUs. The KV cache moves device to device over NIXL/EFA, in both directions, with vllm-neuron 0.24 and vLLM 0.24.