Skip to content

feat(minimax_h3): add MPS support, Turbo config and VAE fixes - #1497

Open
q6y6y6 wants to merge 36 commits into
ModelTC:mainfrom
q6y6y6:feat/mps-support
Open

feat(minimax_h3): add MPS support, Turbo config and VAE fixes#1497
q6y6y6 wants to merge 36 commits into
ModelTC:mainfrom
q6y6y6:feat/mps-support

Conversation

@q6y6y6

@q6y6y6 q6y6y6 commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Summary

This PR adds MPS support for MiniMax-H3 inference in LightX2V and fixes several compatibility issues found during validation on Apple Silicon.

Main changes

  • Add MiniMax H3 MPS inference support
  • Add Turbo 4-step inference configuration
  • Add disk-streamed LoRA loading support for H3
  • Add MPS SDPA query chunking to reduce memory usage
  • Fix MiniMax H3 Video VAE QKV weight mapping
  • Fix MPS temporal padding issue in H3 Video VAE
  • Align RoPE precision behavior with reference implementation

Validation

Tested on MacBook with Apple Silicon:

  • MiniMax H3 Turbo 4-step T2AV inference
  • 768×768, 124 frames
  • 4/4 denoising evaluations completed
  • Video/audio decoding verified
  • Severe 16px VAE mosaic artifact removed

All related tests pass.

Notes

The changes mainly target Apple Silicon / MPS compatibility while preserving existing CUDA behavior.

q6y6y6 and others added 30 commits September 8, 2026 09:46
Preserve upstream persistent AdaLN cache and lazy runner construction while
retaining MPS query chunking, short clips, and clone-free disk streaming.
Adapt cache device selection for MPS and refresh merge regression tests.

Validation: 169 tests passed on host MPS; CLI help smoke passed.
The uncommitted target-bytes patch remains separately saved in stash.
Preserve SM120 FP8-F16 accumulation alongside MPS streaming and official VAE loading. Defer Triton import until FP8 execution and adapt isolated test fixtures for the new FP8 helpers.
q6y6y6 and others added 6 commits September 10, 2026 14:15
统一使用 Diffusers 权重布局,移除分支中的 raw 格式适配,保留 MPS 低内存推理所需的按需加载。

- 删除 raw DiT/VAE 参数映射、QKV/FFN 转换及配置别名兼容
- 沿用上游 safetensors 文件发现方式,移除固定索引名和参数名前缀白名单
- 将 AdaLN 缓存构建器恢复为 ModelTC 上游实现
- 在 MPS 清理缓存前同步 GPU,调整 VAE 按阶段加载与释放
- 更新模型路径、采样步数和缓存配置,新增 512×512、22 帧、4 步配置及使用说明
- 删除 tests/models/minimax_h3 下的测试文件

BREAKING CHANGE: MiniMax-H3 不再支持 raw 权重布局,请使用 Diffusers 版本。
- 复用现有 block offload 架构,重叠后台权重预读与 GPU 计算
- 通过 MPS 共享视图直接读取 safetensors,省去中间 CPU 权重副本
- 保持 diffusers 权重发现规则及原有计算逻辑
- 完善 buffer 同步、异常处理、释放及重新初始化流程
- 默认启用 dit_mps_shared_buffer,并补充使用说明
Resolve PR ModelTC#1497 conflicts while retaining MPS temporal padding and
upstream Video VAE FP8 Conv3D support.

Adapt MPS inference and AdaLN cache scripts to --model-variant fl2av,
and migrate output settings to size, num_frames and fps. Use the model
variant for streaming initialization and low-memory residency now that
upstream keeps task selection in requests. Advertise only t2av when
text-encoder disk streaming is enabled.

Validation: all pre-commit hooks and 30 focused/regression tests passed.
Full MPS 512x512 / 22-frame / 4-step inference completed; the output
MP4, decoded video and audio are bitwise identical to the pre-merge run.
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