feat(minimax-h3): enable 2x RTX 4090/5090 with DLO (#5764)
Signed-off-by: lishunyang12 <lishunyang03@gmail.com> Signed-off-by: lishunyang12 <lishunyang12@163.com> Co-authored-by: lishunyang12 <lishunyang03@gmail.com>
This commit is contained in:
1 parent
b4581b293b
commit
1c2a81f6d8
28 files changed
+1658
-162
No files matched your search
@@ -35,10 +35,21 @@ class OffloadPlan:
|
||||
for large non-DiT submodules within a DiT that should be
|
||||
independently offloaded with their own hooks.
|
||||
e.g. ``{"context_encoder": "layers"}``
|
||||
resident_dit_paths: DiT paths whose leading blocks may be kept on the
|
||||
device when ``dlo_resident_layers`` is nonzero. Keeping this
|
||||
model-declared avoids applying a consumer-GPU tuning knob to
|
||||
auxiliary or dual DiTs unintentionally.
|
||||
encoder_block_attrs: Maps encoder paths to rank-local block-list paths.
|
||||
These blocks are streamed with ordinary layerwise hooks, never
|
||||
with the DiT AllGather group.
|
||||
"""
|
||||
|
||||
on_demand_component_paths: frozenset[str] = field(default_factory=frozenset)
|
||||
|
||||
block_attrs: dict[str, tuple[str, ...]] = field(default_factory=dict)
|
||||
offload_submodules: dict[str, str] = field(default_factory=dict)
|
||||
resident_dit_paths: frozenset[str] = field(default_factory=frozenset)
|
||||
encoder_block_attrs: dict[str, tuple[str, ...]] = field(default_factory=dict)
|
||||
|
||||
|
||||
def get_offload_plan(pipeline: nn.Module) -> OffloadPlan | None:
|
||||
@@ -58,4 +69,6 @@ def supports_mmap_loading(pipeline: nn.Module) -> bool:
|
||||
(to decide whether to call ``_load_weights_via_mmap``), ensuring both
|
||||
paths use the same gate condition.
|
||||
"""
|
||||
return any(callable(getattr(type(m), "_remap_ckpt_key", None)) for m in pipeline.modules())
|
||||
return bool(getattr(pipeline, "_supports_mmap_loading", True)) and any(
|
||||
callable(getattr(type(m), "_remap_ckpt_key", None)) for m in pipeline.modules()
|
||||
)
|
||||
Reference in new issue
Block a user