nemo_automodel.shared.multimodal_fsdp
nemo_automodel.shared.multimodal_fsdp
Shared helpers for FSDP treatment of multimodal submodules.
Module Contents
Functions
Data
VALID_FROZEN_MULTIMODAL_SHARDING
API
Return ignored parameters that are owned by an FSDP root.
Parameters:
Module that will become the FSDP root.
Parameters of arbitrary shapes that should remain replicated rather than becoming part of the FSDP root.
Returns: set[nn.Parameter] | None
The subset of ignored_params owned by root, preserving each
Return True when name identifies a known multimodal tower/projector.
Yield maximal multimodal submodules by qualified name.
named_modules is depth-first pre-order, so a parent is always seen
before its descendants; already-selected prefixes are skipped to keep each
tower/projector maximal (e.g. vision_tower rather than the
vision_tower.vision_model nested inside it).
The attribute-scan fallback only serves tests/unit_tests/moe model
doubles, which are plain classes rather than nn.Module subclasses. It
uses different (non-maximal, top-two-levels-only) selection than the real
path, so tests that exercise it are not testing production behavior.
Removing it requires converting ~30 doubles across that file to real
modules; tracked separately rather than widening this change.
Return whether module owns parameters and none require gradients.
Return the module’s recursive parameters.
Validate and normalize the frozen multimodal FSDP policy.
Shard a multimodal module at layer-container granularity when possible.