Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ def set_nemotron_3_nano_common_configs(cfg: ConfigContainer) -> None:
cfg.ddp.grad_reduce_in_fp32 = False


def nemotron_3_nano_pretrain_config_gb300(precision: str = "bf16", config_variant: str = "v1") -> ConfigContainer:
def nemotron_3_nano_pretrain_config_gb300(
precision: str = "bf16", mock: bool = True, config_variant: str = "v1"
) -> ConfigContainer:
Comment on lines +34 to +36
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Remove the unused mock parameter from all five function signatures.

The mock: bool = True argument is added to every pretrain config factory but is never read inside any of them. The PR title "remove mock arg" directly contradicts leaving it in, and ruff flags it as ARG001 in all five locations. This will fail linting/CI.

🔧 Proposed fix (shown for one function; apply the same diff to all five)
-def nemotron_3_nano_pretrain_config_gb300(
-    precision: str = "bf16", mock: bool = True, config_variant: str = "v1"
-) -> ConfigContainer:
+def nemotron_3_nano_pretrain_config_gb300(
+    precision: str = "bf16", config_variant: str = "v1"
+) -> ConfigContainer:

Also applies to: 58-60, 82-84, 106-108, 130-132

🧰 Tools
🪛 Ruff (0.15.2)

[warning] 35-35: Unused function argument: mock

(ARG001)

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@scripts/performance/configs/nemotronh/nemotron_3_nano_llm_pretrain.py` around
lines 34 - 36, Remove the unused mock parameter from the five pretrain config
factory signatures: e.g., remove "mock: bool = True" from
nemotron_3_nano_pretrain_config_gb300 and the four other
nemotron_3_nano_*_pretrain_config_* functions in this file; update each function
signature to drop the mock parameter and ensure no internal references remain
(ruff ARG001 will be resolved). Also update any local references or tests that
call these factories with the mock positional/kwarg so callers pass only the
remaining parameters (precision and config_variant).

"""GB300, baseline config."""
base_cfg = get_workload_base_config(
model_family_name="nemotronh",
Expand All @@ -47,11 +49,15 @@ def nemotron_3_nano_pretrain_config_gb300(precision: str = "bf16", config_varian
cfg.mixed_precision = precision_config
set_nemotron_3_nano_common_configs(cfg)
set_workload_base_configs(cfg, base_cfg)
if base_cfg.moe_flex_dispatcher_backend is not None:
cfg.model.moe_flex_dispatcher_backend = base_cfg.moe_flex_dispatcher_backend

return cfg


def nemotron_3_nano_pretrain_config_gb200(precision: str = "bf16", config_variant: str = "v1") -> ConfigContainer:
def nemotron_3_nano_pretrain_config_gb200(
precision: str = "bf16", mock: bool = True, config_variant: str = "v1"
) -> ConfigContainer:
"""GB200, baseline config."""
base_cfg = get_workload_base_config(
model_family_name="nemotronh",
Expand All @@ -67,11 +73,15 @@ def nemotron_3_nano_pretrain_config_gb200(precision: str = "bf16", config_varian
cfg.mixed_precision = precision_config
set_nemotron_3_nano_common_configs(cfg)
set_workload_base_configs(cfg, base_cfg)
if base_cfg.moe_flex_dispatcher_backend is not None:
cfg.model.moe_flex_dispatcher_backend = base_cfg.moe_flex_dispatcher_backend

return cfg


def nemotron_3_nano_pretrain_config_b300(precision: str = "bf16", config_variant: str = "v1") -> ConfigContainer:
def nemotron_3_nano_pretrain_config_b300(
precision: str = "bf16", mock: bool = True, config_variant: str = "v1"
) -> ConfigContainer:
"""B300, baseline config."""
base_cfg = get_workload_base_config(
model_family_name="nemotronh",
Expand All @@ -87,11 +97,15 @@ def nemotron_3_nano_pretrain_config_b300(precision: str = "bf16", config_variant
cfg.mixed_precision = precision_config
set_nemotron_3_nano_common_configs(cfg)
set_workload_base_configs(cfg, base_cfg)
if base_cfg.moe_flex_dispatcher_backend is not None:
cfg.model.moe_flex_dispatcher_backend = base_cfg.moe_flex_dispatcher_backend

return cfg


def nemotron_3_nano_pretrain_config_b200(precision: str = "bf16", config_variant: str = "v1") -> ConfigContainer:
def nemotron_3_nano_pretrain_config_b200(
precision: str = "bf16", mock: bool = True, config_variant: str = "v1"
) -> ConfigContainer:
"""B200, baseline config."""
base_cfg = get_workload_base_config(
model_family_name="nemotronh",
Expand All @@ -107,11 +121,15 @@ def nemotron_3_nano_pretrain_config_b200(precision: str = "bf16", config_variant
cfg.mixed_precision = precision_config
set_nemotron_3_nano_common_configs(cfg)
set_workload_base_configs(cfg, base_cfg)
if base_cfg.moe_flex_dispatcher_backend is not None:
cfg.model.moe_flex_dispatcher_backend = base_cfg.moe_flex_dispatcher_backend

return cfg


def nemotron_3_nano_pretrain_config_h100(precision: str = "bf16", config_variant: str = "v1") -> ConfigContainer:
def nemotron_3_nano_pretrain_config_h100(
precision: str = "bf16", mock: bool = True, config_variant: str = "v1"
) -> ConfigContainer:
"""H100, baseline config."""
base_cfg = get_workload_base_config(
model_family_name="nemotronh",
Expand All @@ -127,5 +145,7 @@ def nemotron_3_nano_pretrain_config_h100(precision: str = "bf16", config_variant
cfg.mixed_precision = precision_config
set_nemotron_3_nano_common_configs(cfg)
set_workload_base_configs(cfg, base_cfg)
if base_cfg.moe_flex_dispatcher_backend is not None:
cfg.model.moe_flex_dispatcher_backend = base_cfg.moe_flex_dispatcher_backend

return cfg
Original file line number Diff line number Diff line change
Expand Up @@ -30,39 +30,36 @@

BASE_NEMOTRON_3_NANO_CONFIG = WorkloadBaseConfig(
num_gpus=8,
global_batch_size=3072,
global_batch_size=512,
micro_batch_size=2,
tensor_model_parallel_size=4,
tensor_model_parallel_size=1,
expert_tensor_parallel_size=1,
expert_model_parallel_size=8,
moe_flex_dispatcher_backend="hybridep",
)

NEMOTRON_3_NANO_PRETRAIN_CONFIG_GB300_BF16_V1 = replace(
BASE_NEMOTRON_3_NANO_CONFIG,
tensor_model_parallel_size=1,
)
NEMOTRON_3_NANO_PRETRAIN_CONFIG_GB300_FP8_MX_V1 = NEMOTRON_3_NANO_PRETRAIN_CONFIG_GB300_BF16_V1
NEMOTRON_3_NANO_PRETRAIN_CONFIG_GB300_BF16_V1 = BASE_NEMOTRON_3_NANO_CONFIG
NEMOTRON_3_NANO_PRETRAIN_CONFIG_GB300_FP8_MX_V1 = BASE_NEMOTRON_3_NANO_CONFIG

NEMOTRON_3_NANO_PRETRAIN_CONFIG_GB200_BF16_V1 = replace(
BASE_NEMOTRON_3_NANO_CONFIG,
tensor_model_parallel_size=1,
)
NEMOTRON_3_NANO_PRETRAIN_CONFIG_GB200_FP8_MX_V1 = NEMOTRON_3_NANO_PRETRAIN_CONFIG_GB200_BF16_V1
NEMOTRON_3_NANO_PRETRAIN_CONFIG_GB200_BF16_V1 = BASE_NEMOTRON_3_NANO_CONFIG
NEMOTRON_3_NANO_PRETRAIN_CONFIG_GB200_FP8_MX_V1 = BASE_NEMOTRON_3_NANO_CONFIG

NEMOTRON_3_NANO_PRETRAIN_CONFIG_B300_BF16_V1 = replace(
BASE_NEMOTRON_3_NANO_CONFIG,
tensor_model_parallel_size=1,
)
NEMOTRON_3_NANO_PRETRAIN_CONFIG_B300_FP8_MX_V1 = NEMOTRON_3_NANO_PRETRAIN_CONFIG_B300_BF16_V1
NEMOTRON_3_NANO_PRETRAIN_CONFIG_B300_BF16_V1 = BASE_NEMOTRON_3_NANO_CONFIG
NEMOTRON_3_NANO_PRETRAIN_CONFIG_B300_FP8_MX_V1 = BASE_NEMOTRON_3_NANO_CONFIG

NEMOTRON_3_NANO_PRETRAIN_CONFIG_B200_BF16_V1 = BASE_NEMOTRON_3_NANO_CONFIG
NEMOTRON_3_NANO_PRETRAIN_CONFIG_B200_FP8_MX_V1 = BASE_NEMOTRON_3_NANO_CONFIG

NEMOTRON_3_NANO_PRETRAIN_CONFIG_B200_BF16_V1 = replace(

_NEMOTRON_3_NANO_PRETRAIN_CONFIG_H100 = replace(
BASE_NEMOTRON_3_NANO_CONFIG,
tensor_model_parallel_size=1,
num_gpus=16,
global_batch_size=1024,
micro_batch_size=1,
recompute_modules=["moe", "layernorm"],
)
NEMOTRON_3_NANO_PRETRAIN_CONFIG_B200_FP8_MX_V1 = NEMOTRON_3_NANO_PRETRAIN_CONFIG_B200_BF16_V1

NEMOTRON_3_NANO_PRETRAIN_CONFIG_H100_BF16_V1 = BASE_NEMOTRON_3_NANO_CONFIG
NEMOTRON_3_NANO_PRETRAIN_CONFIG_H100_FP8_CS_V1 = BASE_NEMOTRON_3_NANO_CONFIG
NEMOTRON_3_NANO_PRETRAIN_CONFIG_H100_BF16_V1 = _NEMOTRON_3_NANO_PRETRAIN_CONFIG_H100
NEMOTRON_3_NANO_PRETRAIN_CONFIG_H100_FP8_CS_V1 = _NEMOTRON_3_NANO_PRETRAIN_CONFIG_H100

__all__ = [
"NEMOTRON_3_NANO_PRETRAIN_CONFIG_GB300_BF16_V1",
Expand Down