bridge.models.sarvam.sarvam_config#
Builder-backed model config for Sarvam MoE.
Module Contents#
Classes#
GPT model config that keeps Sarvam MoE’s supported uneven pipeline layouts. |
Functions#
Return supported pipeline layouts for Sarvam MoE’s 19 decoder layers. |
|
Select a supported pipeline layout when the decoder layers do not divide evenly across PP. |
Data#
API#
- bridge.models.sarvam.sarvam_config._get_sarvam_moe_pipeline_layout(pp_size: int)#
Return supported pipeline layouts for Sarvam MoE’s 19 decoder layers.
- bridge.models.sarvam.sarvam_config.apply_sarvam_moe_pipeline_layout(
- config: GPTModelProvider | BridgeGPTModelConfig,
Select a supported pipeline layout when the decoder layers do not divide evenly across PP.
Sarvam MoE has 19 transformer layers, so uneven PP requires an explicit layout rather than a generic first-stage override. Use known-good layouts for PP=2/4/8 unless the caller has already configured a custom flexible pipeline split.
- Parameters:
config – Sarvam MoE provider or builder-backed model config, updated in place.
- class bridge.models.sarvam.sarvam_config.SarvamMoEModelConfig#
Bases:
megatron.bridge.models.gpt.model_config.BridgeGPTModelConfigGPT model config that keeps Sarvam MoE’s supported uneven pipeline layouts.
Sarvam MoE builds with the standard GPT builder. The only addition over
BridgeGPTModelConfigis the pipeline layoutfinalize()selects when the pipeline size does not divide the decoder layer count, matching the legacySarvamMoEModelProvider.- finalize() None#
Apply a supported layout for uneven pipeline parallelism, then finalize.
- bridge.models.sarvam.sarvam_config.__all__#
[‘SarvamMoEModelConfig’, ‘apply_sarvam_moe_pipeline_layout’]