mcsamaster's picture
download
raw
782 Bytes
# SPDX-License-Identifier: Apache-2.0
# Module helpers for the MiniMax H3 visual VAE (inference-only bundle).
def apply_spatial_parallel(module, enabled, chunk_dim=-1):
from .conv import SpatialParallelConv3d
from .norm import FusedGroupNorm3D, SpatialParallelGroupNorm
if hasattr(module, "set_spatial_parallel"):
module.set_spatial_parallel(enabled)
for m in module.modules():
if enabled and isinstance(m, FusedGroupNorm3D):
raise NotImplementedError("FusedGroupNorm3D is incompatible with SP")
if isinstance(m, SpatialParallelGroupNorm):
m.spatial_parallel = enabled
elif isinstance(m, SpatialParallelConv3d):
m.spatial_parallel = enabled
m.chunk_dim = chunk_dim

Xet Storage Details

Size:
782 Bytes
·
Xet hash:
cba5fe7a0487fd8653d3d2b99e1811944ed6d95376fed72c9a1d76e47595afc4

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.