Skip to content
Open
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
12 changes: 10 additions & 2 deletions docs/nemotron/super3/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,16 @@ $ uv run nemotron super3 data prep sft --run YOUR-CLUSTER
$ uv run nemotron super3 sft --run YOUR-CLUSTER

// Stage 2: Reinforcement Learning
$ uv run nemotron super3 data prep rl --run YOUR-CLUSTER
$ uv run nemotron super3 rl --run YOUR-CLUSTER
$ uv run nemotron super3 data prep rl rlvr --run YOUR-CLUSTER
$ uv run nemotron super3 data prep rl swe1 --run YOUR-CLUSTER
$ uv run nemotron super3 data prep rl swe2 --run YOUR-CLUSTER
$ uv run nemotron super3 data prep rl rlhf --run YOUR-CLUSTER
$ uv run nemotron super3 rl rlvr -c rlvr1 --run YOUR-CLUSTER
$ uv run nemotron super3 rl rlvr -c rlvr2 --run YOUR-CLUSTER
$ uv run nemotron super3 rl rlvr -c rlvr3 --run YOUR-CLUSTER
$ uv run nemotron super3 rl swe1 --run YOUR-CLUSTER
$ uv run nemotron super3 rl swe2 --run YOUR-CLUSTER
$ uv run nemotron super3 rl rlhf --run YOUR-CLUSTER

// Stage 3: Evaluation
$ uv run nemotron super3 eval --run YOUR-CLUSTER
Expand Down
4 changes: 2 additions & 2 deletions src/nemotron/cli/commands/super3/data/prep/_typer_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
from __future__ import annotations

from nemotron.cli.commands.super3.data.prep.pretrain import META as PRETRAIN_META, pretrain
from nemotron.cli.commands.super3.data.prep.rl import META as RL_META, rl
from nemotron.cli.commands.super3.data.prep.rl import rl_app
from nemotron.cli.commands.super3.data.prep.sft import META as SFT_META, sft
from nemo_runspec.recipe_typer import RecipeTyper

Expand All @@ -43,4 +43,4 @@

prep_app.add_recipe_command(pretrain, meta=PRETRAIN_META)
prep_app.add_recipe_command(sft, meta=SFT_META)
prep_app.add_recipe_command(rl, meta=RL_META)
prep_app.add_typer(rl_app, name="rl")
240 changes: 0 additions & 240 deletions src/nemotron/cli/commands/super3/data/prep/rl.py

This file was deleted.

8 changes: 6 additions & 2 deletions src/nemotron/cli/commands/super3/data/prep/rl/_typer_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@

from nemo_runspec.recipe_typer import RecipeTyper

from nemotron.cli.commands.super3.data.prep.rl.rlhf import META as RLHF_META, rlhf
from nemotron.cli.commands.super3.data.prep.rl.rlvr import META as RLVR_META, rlvr
from nemotron.cli.commands.super3.data.prep.rl.swe1 import META as SWE1_META, swe1
from nemotron.cli.commands.super3.data.prep.rl.swe2 import META as SWE2_META, swe2

rl_app = RecipeTyper(
name="rl",
Expand All @@ -22,5 +25,6 @@
)

rl_app.add_recipe_command(rlvr, meta=RLVR_META, rich_help_panel="RL Sub-Stages")

# TODO: Add swe1, swe2, rlhf sub-stage data prep commands as needed.
rl_app.add_recipe_command(swe1, meta=SWE1_META, rich_help_panel="RL Sub-Stages")
rl_app.add_recipe_command(swe2, meta=SWE2_META, rich_help_panel="RL Sub-Stages")
rl_app.add_recipe_command(rlhf, meta=RLHF_META, rich_help_panel="RL Sub-Stages")
43 changes: 43 additions & 0 deletions src/nemotron/cli/commands/super3/data/prep/rl/rlhf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Copyright (c) 2025, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

"""RLHF data prep command (super3 stage3_rlhf sub-stage)."""

from __future__ import annotations

import typer

from nemo_runspec import parse as parse_runspec
from nemo_runspec.recipe_config import parse_recipe_config
from nemo_runspec.recipe_typer import RecipeMeta

from nemotron.cli.commands.super3.data.prep.rl._base import _execute_data_prep_rl

SCRIPT_PATH = "src/nemotron/recipes/super3/stage2_rl/stage3_rlhf/data_prep.py"
SPEC = parse_runspec(SCRIPT_PATH)

META = RecipeMeta(
name=SPEC.name,
script_path=SCRIPT_PATH,
config_dir=str(SPEC.config_dir),
default_config=SPEC.config.default,
input_artifacts={"data": "Raw RLHF preference JSONL"},
output_artifacts={"data": "Split train/val JSONL"},
)


def rlhf(ctx: typer.Context) -> None:
"""Prepare data for RLHF (stage3 — human preference prompts)."""
cfg = parse_recipe_config(ctx)
_execute_data_prep_rl(cfg, script_path=SCRIPT_PATH, spec=SPEC)
43 changes: 43 additions & 0 deletions src/nemotron/cli/commands/super3/data/prep/rl/swe1.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Copyright (c) 2025, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

"""SWE1 data prep command (super3 stage2_swe1 sub-stage)."""

from __future__ import annotations

import typer

from nemo_runspec import parse as parse_runspec
from nemo_runspec.recipe_config import parse_recipe_config
from nemo_runspec.recipe_typer import RecipeMeta

from nemotron.cli.commands.super3.data.prep.rl._base import _execute_data_prep_rl

SCRIPT_PATH = "src/nemotron/recipes/super3/stage2_rl/stage2_swe1/data_prep.py"
SPEC = parse_runspec(SCRIPT_PATH)

META = RecipeMeta(
name=SPEC.name,
script_path=SCRIPT_PATH,
config_dir=str(SPEC.config_dir),
default_config=SPEC.config.default,
input_artifacts={"data": "Raw SWE-Pivot JSONL"},
output_artifacts={"data": "Split train/val JSONL"},
)


def swe1(ctx: typer.Context) -> None:
"""Prepare data for SWE1 (stage2.1 — SWE-Pivot prompts)."""
cfg = parse_recipe_config(ctx)
_execute_data_prep_rl(cfg, script_path=SCRIPT_PATH, spec=SPEC)
Loading