Skip to content

vllm.models.nemotron_shortcut.nvidia.moe.config

The MoE config of Nemotron Shortcut's clamped ReLU² experts.

Classes:

Functions:

  • activation_clamp –

    The clamp of a Nemotron Shortcut MoE config, refusing any other config.

NemotronShortcutMoEConfig dataclass

Bases: FusedMoEConfig

FusedMoEConfig plus the soft clamp of the experts' ReLU².

Source code in vllm/models/nemotron_shortcut/nvidia/moe/config.py
@dataclass
class NemotronShortcutMoEConfig(FusedMoEConfig):
    """`FusedMoEConfig` plus the soft clamp of the experts' ReLU²."""

    # c in relu2(c * tanh(x / c)); None is the plain ReLU².
    activation_clamp_value: float | None = None

activation_clamp(moe_config)

The clamp of a Nemotron Shortcut MoE config, refusing any other config.

Source code in vllm/models/nemotron_shortcut/nvidia/moe/config.py
def activation_clamp(moe_config: FusedMoEConfig) -> float | None:
    """The clamp of a Nemotron Shortcut MoE config, refusing any other config."""
    if not isinstance(moe_config, NemotronShortcutMoEConfig):
        raise TypeError(
            "Nemotron Shortcut experts need a NemotronShortcutMoEConfig, got "
            f"{type(moe_config).__name__}"
        )
    return moe_config.activation_clamp_value