[Bugfix][MiniMax-H3] Use Hopper-safe modulation precision

Signed-off-by: david6666666 <530634352@qq.com>
This commit is contained in:
david6666666 committed 2026-09-18 02:08:23 +00:00
1 parent 3b84cc4a7f
commit 49fa488951
6 files changed
+101 -57

No files matched your search

+2 -7
View File
@@ -602,13 +602,8 @@ class MiniMaxH3VideoVAE(nn.Module, DistributedVaeMixin):
if getattr(self, "decode_only", False):
raise RuntimeError("MiniMax H3 decode-only video VAE cannot encode images")
previous_parallel = self.model.parallel_tiling
parallel_size = int(getattr(self, "parallel_size", 1))
if parallel_size <= 1:
if int(getattr(self, "parallel_size", 1)) <= 1:
self.model.parallel_tiling = False
# Keyframe conditioning follows the official single-image contract.
# Do not let it enter the tiled VAE collective even when reference
# videos use the same VAE instance with patch parallelism enabled.
tiling_context = self._rank_local_tiling() if parallel_size > 1 else nullcontext()
parameter = next(self.parameters())
previous_dtype = parameter.dtype
if previous_dtype != torch.float32:
@@ -616,7 +611,7 @@ class MiniMaxH3VideoVAE(nn.Module, DistributedVaeMixin):
devices = [parameter.device] if parameter.device.type != "cpu" else []
try:
with (
tiling_context,
self._encoder_tiling_context(image.height, image.width),
torch.random.fork_rng(
devices=devices,
device_type=parameter.device.type,