Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
85 commits
Select commit Hold shift + click to select a range
3b91d96
feat(minimax-h3): port the MiniMax-H3 omni-modal video+audio DiT (W0-W2)
mudler Aug 3, 2026
ad6adc2
feat(minimax-h3): bf16 production stream, request planning, GGUF arm
mudler Aug 3, 2026
55a9ed4
feat(minimax-h3): reimplement the audio VAE decoder (W5)
mudler Aug 3, 2026
f46c9e8
feat(minimax-h3): ground the NVFP4 arm and re-scope the video VAE fro…
mudler Aug 3, 2026
06953d3
feat(minimax-h3): port the video-VAE decoder TransformerBlock (W4, pa…
mudler Aug 3, 2026
24fb523
feat(minimax-h3): complete the video-VAE ViT3D decoder (W4)
mudler Aug 3, 2026
778629b
feat(minimax-h3): port the encoder text tower (W3, partial)
mudler Aug 3, 2026
b549a4b
feat(minimax-h3): assemble the t2va pipeline -- the whole path compos…
mudler Aug 3, 2026
c46b7b8
feat(minimax-h3): complete the GGUF arm -- load into a runnable DiT (W9)
mudler Aug 3, 2026
172a072
feat(minimax-h3): NVFP4 loader -- both quantized arms now load (W10)
mudler Aug 3, 2026
9d8ad9b
feat(minimax-h3): port the encoder vision block -- both tower cores d…
mudler Aug 3, 2026
6d167a7
feat(minimax-h3): complete the encoder -- full vision tower (W3)
mudler Aug 3, 2026
c58b112
feat(minimax-h3): condition-noise augmentation for fl2va/ref2va anchors
mudler Aug 3, 2026
0564251
feat(minimax-h3): reference-video geometry + frame schedule
mudler Aug 3, 2026
798d3d8
feat(minimax-h3): video-VAE spatial tiling plan and seam blend
mudler Aug 3, 2026
a00bd40
feat(minimax-h3): presentation token tags (the fl2va vision-span over…
mudler Aug 3, 2026
eb7b6bd
feat(minimax-h3): video-VAE 3D-CNN encoder primitives (causal Conv3d,…
mudler Aug 3, 2026
f8c578b
feat(minimax-h3): video-VAE Downsample3D + stride in the causal Conv3d
mudler Aug 3, 2026
af7d541
feat(minimax-h3): complete the video VAE -- 3D-CNN encoder level loop
mudler Aug 3, 2026
34986b3
feat(minimax-h3): MM processor as Qwen3-VL reuse -- all portable work…
mudler Aug 3, 2026
4fd3cac
feat(minimax-h3): WAV audio output; pause all GPU-requiring work per …
mudler Aug 3, 2026
6a301a1
feat(minimax-h3): video output -- PPM frames + MP4 mux argv (ffmpeg s…
mudler Aug 3, 2026
9c15650
feat(minimax-h3): /v1/videos request contract + async job store
mudler Aug 3, 2026
76f41c4
feat(minimax-h3): register /v1/videos routes + the ffmpeg example — W…
mudler Aug 3, 2026
f0bd96d
feat(minimax-h3): device-resident DiT forward (brick H3-2b), GPU-veri…
mudler Aug 3, 2026
2435b2e
feat(minimax-h3): bf16 production stream on the device forward
mudler Aug 3, 2026
8016331
perf(minimax-h3): fold the bf16 cast into the AdaLN modulate kernels
mudler Aug 3, 2026
8baa709
perf(minimax-h3): true bf16 storage — halves activation bytes AND is …
mudler Aug 3, 2026
5458ec4
feat(minimax-h3): keep-quant GGUF arm — runs natively where FP4 tenso…
mudler Aug 3, 2026
5cb9268
test(minimax-h3): exercise the keep-quant arm on CUDA, not just the C…
mudler Aug 3, 2026
e2cccf7
feat(minimax-h3): audio-VAE checkpoint loader — path 2 begins
mudler Aug 3, 2026
d0b5eaf
feat(minimax-h3): video-VAE loader — and closes a step nothing was ap…
mudler Aug 3, 2026
39399c8
fix(minimax-h3): wire post_quant_conv into the t2va pipeline
mudler Aug 3, 2026
ef504f8
feat(minimax-h3): accept a THIRD weight-norm spelling in the audio-VA…
mudler Aug 3, 2026
5c87342
feat(minimax-h3): encoder checkpoint loader — path 2's loaders are co…
mudler Aug 3, 2026
cfc28ca
feat(minimax-h3): assembly driver + shipped VAE config parsing
mudler Aug 3, 2026
25a8932
fix(minimax-h3): run the denoise loop DEVICE-RESIDENT, not on the CPU…
mudler Aug 3, 2026
53dc4ab
feat(minimax-h3): wire /v1/videos into examples/server
mudler Aug 3, 2026
70d2107
chore(minimax-h3): VT_H3_PROGRESS phase trace for the denoise loop
mudler Aug 3, 2026
2a1dd43
docs(minimax-h3): record the first real-checkpoint run on Thor
mudler Aug 4, 2026
8feedbe
docs(minimax-h3): record the first real-checkpoint run on Thor
mudler Aug 4, 2026
1d978db
docs(minimax-h3): END-TO-END video on real weights (Thor)
mudler Aug 4, 2026
0baa85e
docs(minimax-h3): /v1/videos served end-to-end from examples/server o…
mudler Aug 4, 2026
fcdce67
feat(minimax-h3): keep-quant GGUF loader for the H3-Encoder
mudler Aug 4, 2026
fc6c14d
feat(minimax-h3): --encoder probe in the gen driver
mudler Aug 4, 2026
fb31eec
fix(minimax-h3): keep mixed-encoding projection groups SEPARATE
mudler Aug 4, 2026
5dd9fc1
docs(minimax-h3): the real 32B encoder loads keep-quant on Thor
mudler Aug 4, 2026
c29c410
feat(minimax-h3): device keep-quant encoder forward — the conditionin…
mudler Aug 4, 2026
497c45e
feat(minimax-h3): tokenizer + embedding gather — real text conditioning
mudler Aug 4, 2026
0d0af1b
fix(minimax-h3): take an explicit --tokenizer; the encoder GGUF is we…
mudler Aug 4, 2026
14c5332
docs(minimax-h3): prompt-conditioned video, end to end on real weights
mudler Aug 4, 2026
e71849a
feat(minimax-h3): /v1/videos conditions on the request PROMPT
mudler Aug 4, 2026
f0ef3ad
perf(minimax-h3): pre-staged weights + a bf16-dequant staging path
mudler Aug 4, 2026
658a979
perf(minimax-h3): load the DiT straight to bf16 for the GEMM path
mudler Aug 4, 2026
8683f40
perf(minimax-h3): stream the DiT GGUF straight to device bf16
mudler Aug 4, 2026
9a64ce4
chore(minimax-h3): trace the streaming stager; gate page-release behi…
mudler Aug 4, 2026
5808253
fix(minimax-h3): keep rope.inv_freq HOST-resident in the streaming st…
mudler Aug 4, 2026
bde9adf
fix(minimax-h3): preserve the fp32 ISLANDS when streaming to device
mudler Aug 4, 2026
14f999b
perf(vt): warp-per-query fast path for DFlashBlockAttention
mudler Aug 4, 2026
d47b8dc
fix(vt): put the warp attention fast path in the RIGHT launcher
mudler Aug 4, 2026
9e0b3f3
feat(minimax-h3): --denoise-only, so the DiT step loop can be measure…
mudler Aug 4, 2026
215809f
perf(minimax-h3): device-resident video VAE decoder, 1.19e-7 vs upstream
mudler Aug 4, 2026
59df3ff
feat(minimax-h3): route the t2va video decode to the device VAE
mudler Aug 4, 2026
21e88fa
docs(minimax-h3): record the sm_110 attention win and the device vide…
mudler Aug 4, 2026
5ea5460
fix(minimax-h3): wire VAE spatial tiling — the cause of the "squared …
mudler Aug 4, 2026
5137e48
feat(minimax-h3): --save-embeds, so a checkpoint A/B is controlled
mudler Aug 4, 2026
d697011
fix(minimax-h3): stream NVFP4 to device, instead of 132 GB of host f32
mudler Aug 4, 2026
2e875f5
feat(minimax-h3): --dump-params, manifest-only geometry dump
mudler Aug 4, 2026
f46dc76
fix(minimax-h3): --dump-params needs only --dit
mudler Aug 4, 2026
c5e1c74
fix(minimax-h3): temporal chunking in the video VAE decode (decode_te…
mudler Aug 4, 2026
f8df045
fix(minimax-h3): compose temporal chunking WITH spatial tiling
mudler Aug 5, 2026
99c5623
perf(vt): shared-memory K/V tiling for long non-causal attention
mudler Aug 5, 2026
7ef3c76
fix(minimax-h3): degenerate chunk case + a gate that actually reaches…
mudler Aug 5, 2026
d19b062
fix(vt): tiled attention never ran on H3 — guard assumed one document
mudler Aug 5, 2026
7e75a1d
perf(vt): revert shared-memory K/V tiling — measured 23% SLOWER
mudler Aug 5, 2026
136f5e4
feat(minimax-h3): wire fl2va reference conditioning end to end
mudler Aug 5, 2026
28ec2c4
feat(minimax-h3): wire ref2va image references
mudler Aug 5, 2026
6b0c7f3
feat(minimax-h3): wire ref2va video references (silent)
mudler Aug 5, 2026
cec678a
wip(vt): Q-blocked attention kernel (not yet dispatched)
mudler Aug 5, 2026
bf6638a
feat(minimax-h3): port the audio-VAE ENCODER, wire ref2va audio + vid…
mudler Aug 5, 2026
c7003fe
perf(vt): Q-blocked attention MEASURED NEGATIVE — reverted, and the d…
mudler Aug 5, 2026
ae84f5b
fix(minimax-h3): the VAE works in IMAGENET pixel space — we skipped b…
mudler Aug 5, 2026
48470a6
perf(vt): chunked warp reduce-scatter attention — 1.76x on the H3 ste…
mudler Aug 5, 2026
4835f8f
perf(vt): bf16 TENSOR-CORE attention — 9.82x on the H3 step (sm_110)
mudler Aug 6, 2026
31118da
docs(minimax-h3): Q4_K_M is the default — Q3_K_M is known-bad for thi…
mudler Aug 6, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions .agents/model-matrix.md

Large diffs are not rendered by default.

24 changes: 24 additions & 0 deletions .agents/parity-ledger.md

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions .agents/roadmap_v1.md

Large diffs are not rendered by default.

315 changes: 315 additions & 0 deletions .agents/specs/minimax-h3.md

Large diffs are not rendered by default.

1,494 changes: 1,494 additions & 0 deletions .agents/state.md

Large diffs are not rendered by default.

23 changes: 22 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -463,6 +463,25 @@ add_library(vllm STATIC
src/vllm/model_executor/models/kimi_k3_registry.cpp
src/vllm/model_executor/models/kimi_k3_weights.cpp
src/vllm/model_executor/models/kimi_k3.cpp
src/vllm/model_executor/models/minimax_h3.cpp
src/vllm/model_executor/models/minimax_h3_packing.cpp
src/vllm/model_executor/models/minimax_h3_planner.cpp
src/vllm/model_executor/models/minimax_h3_gguf.cpp
src/vllm/model_executor/models/minimax_h3_nvfp4.cpp
src/vllm/model_executor/models/minimax_h3_audio_vae.cpp
src/vllm/model_executor/models/minimax_h3_video_vae.cpp
src/vllm/model_executor/models/minimax_h3_video_vae_device.cpp
src/vllm/model_executor/models/minimax_h3_vae_cnn.cpp
src/vllm/model_executor/models/minimax_h3_encoder.cpp
src/vllm/model_executor/models/minimax_h3_pipeline.cpp
src/vllm/model_executor/models/minimax_h3_wav.cpp
src/vllm/model_executor/models/minimax_h3_mux.cpp
src/vllm/model_executor/models/minimax_h3_device_resolve.cpp
src/vllm/model_executor/models/minimax_h3_device.cpp
src/vllm/model_executor/models/minimax_h3_vae_loader.cpp
src/vllm/model_executor/models/minimax_h3_encoder_gguf.cpp
src/vllm/model_executor/models/minimax_h3_encoder_device.cpp
src/vllm/entrypoints/openai/video_api.cpp
src/vllm/model_executor/models/kimi_kda.cpp
src/vllm/model_executor/models/glm4_registry.cpp
src/vllm/model_executor/models/glm4_weights.cpp
Expand Down Expand Up @@ -716,6 +735,7 @@ add_library(vllm STATIC
src/vt/cpu/cpu_backend.cpp
src/vt/cpu/cpu_threadpool.cpp
src/vt/cpu/cpu_ops.cpp
src/vt/cpu/cpu_minimax_h3.cpp
src/vt/cpu/cpu_matmul_elem.cpp
src/vt/cpu/cpu_quant_dequant.cpp
src/vt/cpu/cpu_quant_act.cpp
Expand Down Expand Up @@ -888,7 +908,8 @@ if(VLLM_CPP_CUDA)
src/vt/cuda/cuda_combine_tokens.cu
src/vt/cuda/cuda_sample.cu
src/vt/cuda/cuda_deepseek_v4.cu
src/vt/cuda/cuda_laguna.cu)
src/vt/cuda/cuda_laguna.cu
src/vt/cuda/cuda_minimax_h3.cu)
find_package(CUDAToolkit REQUIRED)
# cublasLt is linked now so the Task 4 matmul lands without a build change.
target_link_libraries(vllm PUBLIC CUDA::cudart CUDA::cublasLt)
Expand Down
119 changes: 119 additions & 0 deletions docs/BENCHMARKS.md

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions docs/ENVIRONMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ Read-only observability; none change output.
| `VT_OP_PROVIDER_DISABLE` | (none) | Comma-separated provider names to disable, forcing fallback (diagnostic) |
| `VT_GDN_VALIDATE` | off | Run the GDN validation/cross-check path (slower; for kernel debugging) |
| `VT_FP4_AUTOTUNE_VERBOSE` | off | Log the NVFP4 GEMM autotuner's tactic selection |
| `VT_H3_PROGRESS` | unset | Trace the MiniMax-H3 denoise loop's phases to stderr: which forward path was taken (device vs the CPU reference), how long the ONE-TIME device weight staging took, and per-step forward seconds with the sequence length. A real-checkpoint run spends its minutes in exactly one of those phases, and this says which without guessing — it was added after GPU-utilization counters proved unreliable on Tegra-class boards |
| `VT_POOL_BYPASS` | off | `=1` makes every device-scratch pool allocation an exact-size driver `Alloc` and every release a real `Free`, so `compute-sanitizer` can see tensor boundaries and use-after-free that the caching, size-class-rounding pool hides. DEBUGGING ONLY: it reinstates the per-op `cudaMalloc`/`cudaFree` device-sync storm the pool exists to remove, so it is never a timing configuration |

## Kernel-internal knobs (deferred)
Expand Down
1 change: 1 addition & 0 deletions docs/STATUS.md

Large diffs are not rendered by default.

14 changes: 14 additions & 0 deletions examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,17 @@ if(VLLM_CPP_SERVER)
PASS_REGULAR_EXPRESSION "--max-num-seqs N.*--max-num-batched-tokens N.*--cuda-profile-graph-replays N.*--cuda-profile-graph-batch N.*--benchmark-shutdown-fifo F.*--enable-force-include-usage.*--\\[no-\\]enable-prefix-caching")
endif()
endif()

# minimax-h3-mux: muxes MiniMax-H3 PPM frames + WAV into an MP4 by invoking
# ffmpeg. This is the RATIFIED home of that process spawn (developer decision
# 2026-08-03): the library builds the artifacts and the argv, examples/ runs it.
add_executable(minimax-h3-mux minimax_h3_mux/main.cpp)
target_link_libraries(minimax-h3-mux PRIVATE vllm::vllm)
vllm_cpp_set_warnings(minimax-h3-mux)

# minimax-h3-gen: the ASSEMBLY driver — opens the real checkpoints, runs the whole
# t2va path and writes an MP4. Lives here because it invokes ffmpeg (the ratified
# boundary) and because it is a driver, not library surface.
add_executable(minimax-h3-gen minimax_h3_gen/main.cpp)
target_link_libraries(minimax-h3-gen PRIVATE vllm::vllm)
vllm_cpp_set_warnings(minimax-h3-gen)
732 changes: 732 additions & 0 deletions examples/minimax_h3_gen/main.cpp

Large diffs are not rendered by default.

135 changes: 135 additions & 0 deletions examples/minimax_h3_mux/main.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
// minimax-h3-mux: muxes a MiniMax-H3 clip (PPM frames + WAV) into an MP4 by
// INVOKING ffmpeg.
//
// THIS FILE IS THE RATIFIED HOME OF THE PROCESS SPAWN. The developer's decision
// (2026-08-03): "re: ffmpeg invocation, correct - let's keep in the examples
// only". So the split is deliberate and load-bearing:
//
// src/vllm/ builds the ARTIFACTS (MiniMaxH3WritePpmFrame, MiniMaxH3WriteWav)
// and the ARGV (MiniMaxH3BuildMp4MuxArgs) -- and spawns NOTHING.
// examples/ (here) performs the invocation.
//
// That is also why `/v1/videos` takes a caller-supplied `VideoRunner` callback
// rather than muxing itself: RunFfmpeg below is precisely the piece a server
// embedder plugs into ApiServer::set_video_runner, and it lives outside the
// library on purpose. Keep it that way -- do not move fork/exec into src/vllm/.
//
// Usage:
// minimax-h3-mux --frames <pattern> --out <out.mp4> [--audio <in.wav>]
// [--fps N] [--crf N] [--ffmpeg <path>] [--print-only]
//
// --frames printf-style pattern the library's PPM writer filled in,
// e.g. /tmp/h3/frame_%06d.ppm
// --audio omitted => a silent clip
// --print-only print the argv and exit WITHOUT spawning (lets the argv be
// inspected, diffed or run by hand on a box with no ffmpeg).
#include <sys/wait.h>
#include <unistd.h>

#include <cstdint>
#include <cstdlib>
#include <exception>
#include <iostream>
#include <stdexcept>
#include <string>
#include <vector>

#include "vllm/model_executor/models/minimax_h3.h"

namespace {

// Run argv to completion and return its exit status. The ONLY process spawn in
// the MiniMax-H3 path, and it is in examples/ by project decision.
int RunFfmpeg(const std::vector<std::string>& args) {
std::vector<char*> c_args;
c_args.reserve(args.size() + 1);
for (const std::string& arg : args) {
c_args.push_back(const_cast<char*>(arg.c_str()));
}
c_args.push_back(nullptr);

const pid_t pid = fork();
if (pid < 0) throw std::runtime_error("fork failed");
if (pid == 0) {
execvp(c_args[0], c_args.data());
// Only reached if exec failed; _exit (not exit) so the child never runs the
// parent's atexit handlers or flushes its buffers a second time.
_exit(127);
}
int status = 0;
if (waitpid(pid, &status, 0) < 0) throw std::runtime_error("waitpid failed");
if (WIFSIGNALED(status)) {
throw std::runtime_error("ffmpeg died on signal " +
std::to_string(WTERMSIG(status)));
}
return WIFEXITED(status) ? WEXITSTATUS(status) : -1;
}

std::string Need(int argc, char** argv, int i, const std::string& flag) {
if (i >= argc) throw std::runtime_error("missing value for " + flag);
return argv[i];
}

} // namespace

int main(int argc, char** argv) {
vllm::MiniMaxH3MuxRequest request;
std::string ffmpeg = "ffmpeg";
bool print_only = false;

try {
for (int i = 1; i < argc; ++i) {
const std::string flag = argv[i];
if (flag == "--frames") {
request.frame_pattern = Need(argc, argv, ++i, flag);
} else if (flag == "--audio") {
request.audio_path = Need(argc, argv, ++i, flag);
} else if (flag == "--out") {
request.output_path = Need(argc, argv, ++i, flag);
} else if (flag == "--fps") {
request.fps = std::stoll(Need(argc, argv, ++i, flag));
} else if (flag == "--crf") {
request.crf = std::stoll(Need(argc, argv, ++i, flag));
} else if (flag == "--ffmpeg") {
ffmpeg = Need(argc, argv, ++i, flag);
} else if (flag == "--print-only") {
print_only = true;
} else {
throw std::runtime_error("unknown argument: " + flag);
}
}
if (request.frame_pattern.empty() || request.output_path.empty()) {
std::cerr << "usage: minimax-h3-mux --frames <pattern> --out <out.mp4> "
"[--audio <in.wav>] [--fps N] [--crf N] [--ffmpeg <path>] "
"[--print-only]\n";
return 2;
}

// The LIBRARY decides the encoding contract (h264/yuv420p + AAC, -shortest,
// +faststart); this file only runs it.
std::vector<std::string> args = vllm::MiniMaxH3BuildMp4MuxArgs(request);
if (!args.empty()) args[0] = ffmpeg;

for (size_t i = 0; i < args.size(); ++i) {
std::cout << (i == 0 ? "" : " ") << args[i];
}
std::cout << "\n";
if (print_only) return 0;

const int status = RunFfmpeg(args);
if (status == 127) {
std::cerr << "failed to exec '" << ffmpeg
<< "' — is ffmpeg installed and on PATH?\n";
return 127;
}
if (status != 0) {
std::cerr << "ffmpeg exited " << status << "\n";
return status;
}
std::cout << "wrote " << request.output_path << "\n";
return 0;
} catch (const std::exception& e) {
std::cerr << "error: " << e.what() << "\n";
return 1;
}
}
Loading