bridge.models.nemotron_omni.nemotron_omni_builder#

Model builder for Nemotron Omni and Nemotron 3.5 Super VL.

The media config helpers derive the RADIO vision, projector and sound configs from the language transformer config. NemotronOmniModelProvider uses the same helpers.

Module Contents#

Classes#

NemotronOmniModelBuilder

Combine the Nemotron-H hybrid language model with the RADIO vision and Parakeet sound encoders.

Functions#

_get_transformer_engine_projection_submodules

Build the standard dense TE MLP submodules used by media projectors.

_make_radio_vision_config

Build the RADIO ViT-H vision encoder config from a copy of the language config.

_make_radio_projection_config

Build the vision projection MLP config from a copy of the language config.

_make_omni_vision_config

Build the RADIO config, pinned to PP=1 (Omni training uses PP>1 on the LLM).

_make_omni_vision_projection_config

Build the vision projection MLP config.

_make_sound_projection_config

Build the sound projection config (mirrors the vision projection config).

_make_sound_encoder

Build the Parakeet sound encoder from the sound_config dict.

Data#

API#

bridge.models.nemotron_omni.nemotron_omni_builder._get_transformer_engine_projection_submodules()#

Build the standard dense TE MLP submodules used by media projectors.

bridge.models.nemotron_omni.nemotron_omni_builder._make_radio_vision_config(
settings: Any,
language_cfg: megatron.core.transformer.transformer_config.TransformerConfig,
) → megatron.core.transformer.transformer_config.TransformerConfig#

Build the RADIO ViT-H vision encoder config from a copy of the language config.

Parameters:
  • settings – Nemotron Omni model config or provider carrying the vision settings.

  • language_cfg – Finalized language transformer config; it is not modified.

Returns:

The vision encoder config.

Raises:

ValueError – If the vision recompute settings are inconsistent.

bridge.models.nemotron_omni.nemotron_omni_builder._make_radio_projection_config(
settings: Any,
language_cfg: megatron.core.transformer.transformer_config.TransformerConfig,
) → megatron.core.transformer.transformer_config.TransformerConfig#

Build the vision projection MLP config from a copy of the language config.

Parameters:
  • settings – Nemotron Omni model config or provider carrying the projector width.

  • language_cfg – Finalized language transformer config; it is not modified.

Returns:

The vision projection config.

bridge.models.nemotron_omni.nemotron_omni_builder._make_omni_vision_config(
settings: Any,
language_cfg: megatron.core.transformer.transformer_config.TransformerConfig,
) → megatron.core.transformer.transformer_config.TransformerConfig#

Build the RADIO config, pinned to PP=1 (Omni training uses PP>1 on the LLM).

The vision encoder is always co-located with the first pipeline stage.

Parameters:
  • settings – Nemotron Omni model config or provider carrying the vision settings.

  • language_cfg – Finalized language transformer config; it is not modified.

Returns:

The vision encoder config.

bridge.models.nemotron_omni.nemotron_omni_builder._make_omni_vision_projection_config(
settings: Any,
language_cfg: megatron.core.transformer.transformer_config.TransformerConfig,
) → megatron.core.transformer.transformer_config.TransformerConfig#

Build the vision projection MLP config.

Nemotron Omni applies squared ReLU in the vision projection MLP, matching the HF checkpoint and vLLM implementation. The projector is pinned to PP=1 (see :func:_make_omni_vision_config).

Parameters:
  • settings – Nemotron Omni model config or provider carrying the projector width.

  • language_cfg – Finalized language transformer config; it is not modified.

Returns:

The vision projection config.

bridge.models.nemotron_omni.nemotron_omni_builder._make_sound_projection_config(
settings: Any,
language_cfg: megatron.core.transformer.transformer_config.TransformerConfig,
) → megatron.core.transformer.transformer_config.TransformerConfig#

Build the sound projection config (mirrors the vision projection config).

Parameters:
  • settings – Nemotron Omni model config or provider carrying the projector width.

  • language_cfg – Finalized language transformer config; it is not modified.

Returns:

The sound projection config.

bridge.models.nemotron_omni.nemotron_omni_builder._make_sound_encoder(settings: Any)#

Build the Parakeet sound encoder from the sound_config dict.

Parameters:

settings – Nemotron Omni model config or provider carrying the sound settings.

Returns:

The BridgeSoundEncoder.

class bridge.models.nemotron_omni.nemotron_omni_builder.NemotronOmniModelBuilder#

Bases: megatron.bridge.models.hybrid.hybrid_builder.BridgeHybridModelBuilder

Combine the Nemotron-H hybrid language model with the RADIO vision and Parakeet sound encoders.

build_model(
pg_collection: megatron.core.process_groups_config.ProcessGroupCollection,
pre_process: bool | None = None,
post_process: bool | None = None,
vp_stage: int | None = None,
) → megatron.bridge.models.nemotron_omni.modeling_nemotron_omni.NemotronOmniModel#

Build one Nemotron Omni pipeline stage.

Parameters:
  • pg_collection – Process groups used for distributed construction.

  • pre_process – Whether this stage owns the embeddings.

  • post_process – Whether this stage owns the language-model output layer.

  • vp_stage – Optional virtual pipeline stage index.

Returns:

A Nemotron Omni model stage. The media encoders and projectors live on the first pipeline stage.

Raises:

TypeError – If the builder was given another model config.

bridge.models.nemotron_omni.nemotron_omni_builder.__all__#

[‘NemotronOmniModelBuilder’]