# vLLM runtime patch (ships with this MXFP4 checkpoint) ## Why This checkpoint quantizes the routed experts to **MXFP4** (the rest stays native MXFP8). MiniMax-M3 uses the clamped **SwiGLU-OAI** activation (`swiglu_limit: 7.0` in `text_config`). The stock `vllm/vllm-openai:minimax-m3` image has a bug in the compressed-tensors MXFP4 MoE method: `get_fused_moe_quant_config()` builds the kernel quant config **without forwarding the SwiGLU clamp params**, so `gemm1_clamp_limit` stays `None` and loading fails with: ``` AssertionError: SWIGLUOAI_UNINTERLEAVE requires clamp_limit ``` This is purely a runtime bug — the checkpoint and its `config.json` are correct (`swiglu_limit=7.0` is reachable via `hf_text_config`). ## The fix `compressed_tensors_moe_w4a4_mxfp4.py` here is the patched file. It forwards `swiglu_limit / swiglu_alpha / swiglu_beta` (read from the already-populated MoE config) into the kernel quant config: - **W4A16 (weight-only, this checkpoint's path):** pass `gemm1_alpha`, `gemm1_beta`, `swiglu_limit` to `make_mxfp4_moe_quant_config` — which maps `gemm1_clamp_limit = swiglu_limit` per backend. - **W4A4 (cutlass):** set the fields on the returned config directly (that builder doesn't expose them). Send the same change upstream to the fork. ## How to apply (no image rebuild) Bind-mount the file over the buggy one. Path is for the image's Python 3.12: ```bash docker run --gpus all --privileged --ipc=host -p 8000:8000 \ -v /mnt/storage:/root/.cache/huggingface \ -v /mnt/storage/M3-MXFP4/vllm_patch/compressed_tensors_moe_w4a4_mxfp4.py:/usr/local/lib/python3.12/dist-packages/vllm/model_executor/layers/quantization/compressed_tensors/compressed_tensors_moe/compressed_tensors_moe_w4a4_mxfp4.py \ vllm/vllm-openai:minimax-m3 /root/.cache/huggingface/M3-MXFP4 \ --block-size 128 \ --tool-call-parser minimax_m3 --enable-auto-tool-choice \ --reasoning-parser minimax_m3 \ --load-format fastsafetensors ``` Verify after startup: the model loads past the activation assertion. If you bump the VRAM ceiling, add `--gpu-memory-utilization 0.85` and a smaller `--max-model-len` (the 1M default makes the KV cache huge). Patched against image `vllm/vllm-openai:minimax-m3` (vllm 0.1.dev17492+g454b47db8).