Skip to content

Add MiniMax H3 integration - #457

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

Add MiniMax H3 integration#457
yamada-sexta wants to merge 10 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

RetriggerView in GreptileConfidence Score: 4/5

The PR is not yet safe to merge because the existing maximum-duration failure remains unresolved.

Summary

  • Adds MiniMax H3 conditioning, transformer, scheduler, codec, checkpoint, LoRA, and pipeline implementations.
  • Adds shared cacheless attention, synchronized sampling, selective checkpoint loading, and T2V request-input support.
  • Migrates the integration to the v2 application/session runtime and adds CPU-focused tests.
  • Updates licensing and third-party attribution for adapted MiniMax and Hugging Face code.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  CLI["MiniMax H3 T2V adapter"] --> Request["Validated prompt, duration, keyframes or references"]
  Request --> Condition["Text, image, video, and audio conditioning"]
  Condition --> Joint["Joint video/audio denoising"]
  Joint --> Decode["Video VAE decode"]
  Decode --> Runtime["T2V v2 session output"]
Loading

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
Signed-off-by: Ang Li <angl5@illinois.edu>

# Conflicts:
#	pyproject.toml
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