[Bugfix][MiniMax-H3] Keep keyframe VAE encoding rank-local

Signed-off-by: david6666666 <530634352@qq.com>
This commit is contained in:
david6666666 committed 2026-09-18 01:20:13 +00:00
1 parent f9253ae1ad
commit 3b84cc4a7f
5 files changed
+95 -45

No files matched your search

@@ -43,7 +43,7 @@ def _collective_worker(rank, rendezvous, backend):
assert value.item() == 2
def encode_image(self, image):
self.collective()
assert rank == 0
assert image.size == (32, 32)
return torch.ones(1, 96)
@@ -115,6 +115,23 @@ def _collective_worker(rank, rendezvous, backend):
torch.testing.assert_close(conditioning.audio_condition.cpu(), torch.full((160, 32), 3.0))
assert conditioning.audio_condition_lengths == (80,)
image_media = (
MiniMaxH3EncoderMediaInput(
task="fl2va",
height=32,
width=32,
num_frames=96,
latent_t=29,
audio_t=160,
images=(torch.zeros(32, 32, 3, dtype=torch.uint8),),
)
if rank == 0
else None
)
image_conditioning = model._encode_local_media(image_media)
torch.testing.assert_close(image_conditioning.visual_condition.cpu(), torch.ones(1, 96))
assert image_conditioning.visual_condition_shapes == ((1, 2, 2),)
model.video_vae.fail = True
with pytest.raises(OmniClientError, match="codec failed on rank 1"):
model._encode_local_media(media)