Skip to content

Add MiniMax H3 integration - #457

Open
yamada-sexta wants to merge 8 commits into
NVIDIA:mainfrom
yamada-sexta:minimax-h3
Open

Add MiniMax H3 integration#457
yamada-sexta wants to merge 8 commits into
NVIDIA:mainfrom
yamada-sexta:minimax-h3

Conversation

@yamada-sexta

Copy link
Copy Markdown

As mentioned here: #443

This commit adds MiniMax H3 integration to flashdreams.

Signed-off-by: Ang Li <angl5@illinois.edu>
@copy-pr-bot

copy-pr-bot Bot commented Aug 13, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@greptile-apps

greptile-apps Bot commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR adds a separately packaged MiniMax H3 integration supporting text-to-video-with-audio, first/last-frame conditioning, reference conditioning, native denoising, LoRA conversion, checkpoint recovery, and plugin registration.

  • Adds MiniMax H3 pipeline, transformer, scheduler, model, runner, reference, and LoRA implementations.
  • Registers three runner workflows and adds CPU/CUDA integration tests.
  • Updates workspace dependencies and adds RoPE prefix-view coverage.

Confidence Score: 3/5

The PR is not yet safe to merge because the maximum advertised duration is rejected and exceptional runner exits still fail to close the MP4 output target.

A 15-second request deterministically aligns to 362 frames and fails validation, while exceptions during generation, finalization, or output processing propagate past the sole output-target close call; both previously reported blocking failures remain in the current code.

Files Needing Attention: integrations/minimax_h3/minimax_h3/constants.py; integrations/minimax_h3/minimax_h3/runner.py

Important Files Changed

Filename Overview
integrations/minimax_h3/minimax_h3/constants.py Defines geometry and duration validation, but the advertised 15-second boundary remains unreachable because frame alignment advances it beyond the maximum.
integrations/minimax_h3/minimax_h3/runner.py Implements the three workflow runners, but exceptional exits after opening the MP4 target still bypass target cleanup.
integrations/minimax_h3/minimax_h3/pipeline.py Implements staged conditioning, checkpoint recovery, native denoising, and decoding for all MiniMax H3 workflows.
integrations/minimax_h3/minimax_h3/model.py Adds paired video/audio scheduler execution and reconstruction of denoised video latents.
integrations/minimax_h3/minimax_h3/transformer.py Adds the native MiniMax H3 transformer implementation and checkpoint configuration.
integrations/minimax_h3/minimax_h3/lora.py Adds validation, conversion, caching, and merging of Musubi-format MiniMax H3 LoRA adapters.
integrations/minimax_h3/pyproject.toml Packages and registers the three MiniMax H3 runner configurations as FlashDreams entry points.
integrations/minimax_h3/tests/test_smoke.py Adds CPU smoke coverage for plugin registration, configuration, LoRA conversion, pipeline behavior, and recovery helpers.
flashdreams/tests/test_rope_kernel.py Adds coverage proving in-place RoPE operation on a sliced rotary prefix without changing trailing channels.
uv.lock Incorporates the new workspace package and its resolved dependency graph.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  CLI[flashdreams-run] --> Registry[Runner plugin registry]
  Registry --> Runner[MiniMax H3 runner]
  Runner --> Condition[Text, keyframe, or reference conditioning]
  Condition --> Checkpoint[Conditioning checkpoint]
  Checkpoint --> Denoise[Native joint video/audio denoising]
  Denoise --> Latents[Latent checkpoint]
  Latents --> Decode[Video decode]
  Decode --> Output[MP4 output target]
  Output --> Complete[Completion status]
Loading

Reviews (8): Last reviewed commit: "Merge remote-tracking branch 'upstream/m..." | Re-trigger Greptile

Comment on lines +40 to +41
if frames / FPS > MAX_DURATION:
raise ValueError("duration aligns beyond MiniMax H3's 15-second maximum")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Maximum duration fails alignment

When duration is 15 seconds, alignment advances 360 frames to the next decodable count of 362 and then rejects the request, causing the advertised maximum duration to fail before generation starts.

Suggested change
if frames / FPS > MAX_DURATION:
raise ValueError("duration aligns beyond MiniMax H3's 15-second maximum")

Comment on lines +158 to +159
frames = self.pipeline.generate(0, cache)
metrics = self.pipeline.finalize(0, cache)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Exceptional exits leak output target

When generation, finalization, processing, or writing raises after output_target.open(), the runner exits without closing the target, leaking encoder and file resources and leaving a partial MP4 that can interfere with retries.

Knowledge Base Used: Integrations

@yamada-sexta

yamada-sexta commented Aug 13, 2026

Copy link
Copy Markdown
Author

Tested with both the regular MiniMax H3 and the the Looping-Sketch LoRA on A100.

No audio support yet.

@ArielG-NV ArielG-NV left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

questions/suggestions

Comment thread integrations/minimax_h3/minimax_h3/model.py Outdated
Comment thread integrations/minimax_h3/minimax_h3/model.py Outdated
Comment thread integrations/minimax_h3/minimax_h3/pipeline.py Outdated
Comment thread integrations/minimax_h3/minimax_h3/pipeline.py Outdated
@yamada-sexta

yamada-sexta commented Aug 15, 2026

Copy link
Copy Markdown
Author

I tried to use the built in RoPE, but H3 precomputes cos and sin once, shaped [S, 96], then reuses them across its transformer blocks.

H3 rotates only the first 96 channels of each 128-channel attention head; the final 32 channels pass through unchanged.

Therefore, I cannot use the current RoPE effectively. I wonder if you guys are open to changes in the RoPE kernel?

@ArielG-NV

Copy link
Copy Markdown
Collaborator

Making changes like adding to the core of flashdreams so that future development of world models is easier for future devleopers is very much encouraged.

This would include changes like adding functionality (knobs for performance) or making alternative implementations of RoPE.

@yamada-sexta

Copy link
Copy Markdown
Author

I tested my integration and it seems that the RoPE changes were not really needed.

@yamada-sexta
yamada-sexta requested a review from ArielG-NV August 20, 2026 01:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants