nemo_automodel.components.models.ergo.parallelization
nemo_automodel.components.models.ergo.parallelization
Ergo precision policy over the shared FSDP sharding implementation.
Module Contents
Classes
API
Bases: ModelParallelizer
Isolate FP32 scale/router/embedding owners under BF16 branch compute.
Keep explicit compute views on singleton FSDP groups, including PP stages.
Generic unsharded autocast does not round the FP32-logit head’s master weight to branch compute dtype. Size-one FSDP uses the same model-owned precision policy as larger groups and preserves FP32 optimizer leaves.
Preserve model-owned FP32 computation through shared dtype grouping.
Parameters:
Owner of matrices [output, input], expert projections [experts, input, output], expert scales [experts, hidden], and normalization/residual vectors [hidden]. Modified in place.
FSDP data-shard mesh, preserving existing expert placements.
Branch compute policy; explicit model casts own inputs and outputs, including the FP32 residual stream.
Shared parameter offload policy.
Shared FSDP resharding setting.
Arbitrary-shaped parameters already owned by other sharding units; their placements remain unchanged.
Returns: nn.Module
The same module with global-shaped DTensor parameters and dtype
Bind attention and MoE to the stage’s CP group before FSDP owns weights.
Checkpoint stateless residual blocks without wrapping the read-only MLP alias.
The shared submodule fallback discovers mlp first. Ergo exposes that
name only for MoE discovery; execution and checkpoint keys belong to
feed_forward. Whole-block replay preserves that single owner and
also recomputes the FP32 normalization/residual operations.