Skip to content

[perf] Sequential MiniMax H3 start with GPU-direct DiT load - #1793

Merged
SolitaryThinker merged 3 commits into
hao-ai-lab:mainfrom
aryan5v:aryan/h3-sequential-start
Aug 31, 2026
Merged

[perf] Sequential MiniMax H3 start with GPU-direct DiT load#1793
SolitaryThinker merged 3 commits into
hao-ai-lab:mainfrom
aryan5v:aryan/h3-sequential-start

Conversation

@aryan5v

@aryan5v aryan5v commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Purpose

MiniMax H3 CUDA cannot keep Qwen3-VL resident with the DiT and VAEs on GB10 unified memory. Host offload is already disabled there.

This PR encodes first, releases the encoder, then loads DiT and VAEs when sequential load is on. DiT safetensors go onto the accelerator when cpu_offload is off (no CPU-then-copy).

Changes

  • Add h3_sequential_load (--h3-sequential-load / --no-h3-sequential-load). Default auto: on unified-memory devices, off on discrete GPUs.
  • Defer vae, audio_vae, and transformer until after conditioning when sequential load is on.
  • Read DiT weights with to_cpu=cpu_offload instead of always to_cpu=True.
  • Document both in offloading and Spark GB10 docs.

A second generate() on a sequential-load worker still needs a new process. Training load order and LoRA wiring are unchanged.

Test Plan

python -m pytest fastvideo/tests/stages/test_minimax_h3_sequential_start.py \
  fastvideo/tests/inference/test_basic_fasth3_profile.py \
  fastvideo/tests/loader/test_fsdp_load_releases_checkpoint.py -q

Spark GB10, FastH3 4-step Preview VSA-DataFree, basic_fasth3.py --num-gpus 1 --vsa-kernel triton --no-fa4 --no-warmup --repeats 1, 768×1344×124, seed 2026, n=1.

Test Results

CPU: 17 passed for sequential-load + FastH3 profile tests. pre-commit on changed files: passed.

Same Spark box, sequential alpine. Before = CPU-then-copy DiT load. After = GPU-direct DiT load.

Before After
DiT weight load 445 s 39 s
Denoise 164.1 s 139.1 s
Video VAE decode 76.6 s 68.0 s
Generate 768.5 s 333.1 s
E2E 771.9 s 336.1 s

VAE load stays ~75–80 s (different loader). Denoise/decode are n=1 and include first-run Triton. Both runs wrote a 4.4 MiB MP4. SSIM not run.

Checklist

  • I ran pre-commit run --all-files and fixed all issues
  • I added or updated tests for my changes
  • I updated documentation if needed
  • I considered GPU memory impact of my changes

For model/pipeline changes, also check:

  • I verified SSIM regression tests pass
  • I updated the support matrix if adding a new model

GB10 unified memory disables host offload, so MiniMax H3 CUDA used
to load Qwen3-VL together with the DiT and VAEs and get killed by
earlyoom. Encode first, drop the encoder, then load denoise weights.
Input-prep geometry comes from the VAE arch configs until those
modules exist.

A later generate() on the same worker still needs a new process;
prompt-cache reload is not in this change.
@mergify mergify Bot added type: perf Performance improvement scope: inference Inference pipeline, serving, CLI scope: infra CI, tests, Docker, build scope: docs Documentation labels Aug 31, 2026
@mergify

mergify Bot commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Merge Protections

🔴 1 of 1 protections blocking · waiting on 👀 reviews and 🤖 CI

Protection Waiting on
🔴 PR merge requirements 👀 reviews and 🤖 CI

🔴 PR merge requirements

Waiting for

  • #approved-reviews-by>=1
  • check-success=full-suite-passed
This rule is failing.
  • #approved-reviews-by>=1
  • check-success=full-suite-passed
  • check-success=fastcheck-passed
  • check-success~=pre-commit
  • title~=(?i)^\[(feat|feature|bugfix|fix|refactor|perf|ci|doc|docs|misc|chore|kernel|new.?model|skill|skills|infra)\]

@aryan5v
aryan5v marked this pull request as ready for review August 31, 2026 03:31
GB10 unified memory made the CPU-then-copy path take minutes for
the 35B FastH3 transformer. When host offload is off, read
safetensors onto the accelerator.
@aryan5v aryan5v changed the title [perf] Release MiniMax H3 text encoder before DiT/VAE load [perf] Sequential MiniMax H3 start with GPU-direct DiT load Aug 31, 2026
@mergify mergify Bot added the scope: model Model architecture (DiTs, encoders, VAEs) label Aug 31, 2026
Always-on sequential load breaks a second generate() on discrete
GPUs. Default auto: on unified memory, off otherwise.
@SolitaryThinker
SolitaryThinker merged commit f82d8be into hao-ai-lab:main Aug 31, 2026
12 of 13 checks passed
KyleNeverGivesUp added a commit to KyleNeverGivesUp/FastVideo that referenced this pull request Aug 31, 2026
Resolves the one conflict, in spark_performance.md. hao-ai-lab#1793 appended an H3
sequential-load bullet to the same Running safely list that this branch appends
its earlyoom diagnostics bullet to. Both bullets are kept, H3 first. This
branch's bullet drops its opening sentence about earlyoom preferring Python
because the H3 bullet now states that.
KyleNeverGivesUp added a commit to KyleNeverGivesUp/FastVideo that referenced this pull request Aug 31, 2026
Resolves the one conflict, in fsdp_load.py. hao-ai-lab#1771 added _summarize_param_names
at the same position where this branch adds _has_fp8_convertible_layers. Both
are new and unrelated, so both are kept. The to_cpu=cpu_offload change from
hao-ai-lab#1793 comes in from main unchanged.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope: docs Documentation scope: inference Inference pipeline, serving, CLI scope: infra CI, tests, Docker, build scope: model Model architecture (DiTs, encoders, VAEs) type: perf Performance improvement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants