This document is relevant for: Trn2, Trn3

Tutorial: Deploy MiniMax-H3 with vLLM Omni Neuron#

This tutorial walks through deploying the MiniMax-H3 diffusion video model with the vLLM Omni Neuron plugin. It covers environment setup, model download, stage configuration, and offline video generation. MiniMax-H3 is served by this plugin:

MiniMax-H3 is guidance-distilled: each step is one DiT forward, with no guidance scale or negative prompt. It generates a video with a soundtrack for 5-second clips at 24fps; this tutorial generates 124 frames at 768P. Generation runs offline through the vLLM Omni Neuron entrypoint. BF16 is the default precision throughout.

Task

Entry script

Default resolution

Cores (recommended)

t2va

examples/minimax_h3/run.py

1344x768

64 (TP8 × CP8)

fl2va

examples/minimax_h3/run_fl2va.py

1344x768

64 (TP8 × CP8)

Prerequisites:

  • One SSH-accessible trn2.48xlarge instance. Step 1 prepares it.

Step 1: Set up your environment#

Complete the setup guide, choosing manual or DLC installation. It configures the dependencies, device access, and persistent caches, then verifies the environment. For MiniMax-H3, start the DLC container with --shm-size=16g instead of the setup guide’s --shm-size=2g.

Run these commands in an SSH session on the instance host, using its DLC container vllm-omni-neuron. For manual installation, run the Python commands in the activated environment, omit sudo docker exec vllm-omni-neuron, and replace /workspace with $VLLM_OMNI_HOME.

Step 2: Download the model (optional)#

sudo docker exec vllm-omni-neuron hf download \
    MiniMaxAI/MiniMax-H3 \
    --local-dir /workspace/huggingface/MiniMax-H3

Note

This step is optional. You can pass the Hugging Face model ID (e.g. MiniMaxAI/MiniMax-H3) directly via --model-path, and the weights are downloaded automatically on first run into the mounted cache.

Step 3: Review the stage configuration#

The parallelism layout and diffusion settings live in a stage-config YAML, not on the command line. Both entry scripts default to examples/minimax_h3/minimax_h3_stage.yaml; override with --stage-config. The default 64-core config is:

# engine_args in the stage config
model_class_name: MiniMaxH3ModularPipeline  # resolved to NeuronMiniMaxH3Pipeline by the plugin
dtype: bfloat16
vae_use_tiling: true           # tile the VAE decode
parallel_config:
  tensor_parallel_size: 8      # TP — shards the model
  ring_degree: 8               # CP degree — sets sequence_parallel_size = 1 * 8 = 8
  cfg_parallel_size: 1         # guidance-distilled: no guidance pass to run in parallel
  vae_patch_parallel_size: 64  # decode the VAE tiles over all 64 ranks
model_config:
  adaln_cache: true            # compute the AdaLN projections once per schedule
  tp_sequence_parallel: true   # Megatron sequence parallelism
  • ring_degree (not sequence_parallel_size) sets the context-parallel degree; vLLM Omni derives sequence_parallel_size = ulysses_degree(1) * ring_degree. CP self-attention runs ring attention. See the context parallelism design doc.

  • cfg_parallel_size should be 1 — the checkpoint is guidance-distilled, so each step runs one DiT forward.

Step 4: Run inference#

Text-to-audio-video (t2va)#

Quick smoke test (22 frames, 6 steps) to validate the setup:

sudo docker exec vllm-omni-neuron python /workspace/plugin/examples/minimax_h3/run.py \
  --num-frames 22 --num-inference-steps 6

Full 768P generation (124 frames, 1344x768, 50 steps):

sudo docker exec vllm-omni-neuron python /workspace/plugin/examples/minimax_h3/run.py \
  --num-frames 124 --height 768 --width 1344 --num-inference-steps 50 \
  --prompt "A sun conure parrot springs off a pale perch, opens its orange and green wings and flies toward a glass office tower, sunlight flashing off the windows" \
  --output 768P.mp4

First/last-keyframe-to-audio-video (fl2va)#

fl2va conditions the video on a first keyframe passed with --image, and optionally a last keyframe passed with --last-image. The default prompt is examples/minimax_h3/fl2va_prompt.txt:

sudo docker exec vllm-omni-neuron python /workspace/plugin/examples/minimax_h3/run_fl2va.py \
  --image /workspace/plugin/examples/minimax_h3/fl2va_input.png \
  --num-frames 124 --height 768 --width 1344 --num-inference-steps 50 \
  --output fl2va_768P.mp4

vLLM Omni Neuron compiles the model on the first run. With the DLC flow, copy the output with docker cp vllm-omni-neuron:/workspace/768P.mp4 .; with manual installation, it is in your working directory.

Troubleshooting#

Symptom

Likely cause

Fix

NRT_FAILURE in nrt_init() / “Logical Neuron Core(s) not available”

Driver/runtime incompatibility or unavailable devices

Follow the host prerequisites and device checks in the setup guide.

Silent crash / SIGBUS on output

/dev/shm too small for the returned video

Start the container with --shm-size=16g.

Very long first-run latency

Compiler generating NEFFs on first inference

Wait for the first compilation to complete.

Conclusion#

You have deployed MiniMax-H3 on Trainium — text-to-audio-video and first/last-keyframe-to-audio-video, at 768P, in BF16. Generation runs offline through the vLLM Omni Neuron entrypoint.

Next steps#

This document is relevant for: Trn2, Trn3