Skip to content

Commit 4e7b996

Browse files
author
intern_nem_dev_3
committed
Pin upstream checkout revisions in docs
1 parent 9cf231a commit 4e7b996

12 files changed

Lines changed: 188 additions & 17 deletions

File tree

docs/nemotron/nano3/pretrain.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,10 +178,10 @@ $ uv run nemotron nano3 pretrain --run YOUR-CLUSTER
178178
For direct execution outside this CLI, use the scripts in the [Megatron-Bridge](https://github.com/NVIDIA-NeMo/Megatron-Bridge) repository:
179179

180180
```bash
181-
# Clone the repository and checkout the nano-v3 branch
181+
# Clone the repository and checkout the pinned nano-v3 revision
182182
git clone https://github.com/NVIDIA-NeMo/Megatron-Bridge.git
183183
cd Megatron-Bridge
184-
git checkout nano-v3
184+
git checkout 1cedb0a9c5f79d2cd2b5226a86b794b9f0e048a8 # nano-v3
185185

186186
# Run pretraining (inside container on compute node)
187187
python examples/recipes/nemotron_3/pretrain_nemotron_3_nano.py \

docs/nemotron/nano3/sft.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -221,10 +221,10 @@ $ uv run nemotron nano3 sft --run YOUR-CLUSTER
221221
For direct execution outside this CLI, use the scripts in the [Megatron-Bridge](https://github.com/NVIDIA-NeMo/Megatron-Bridge) repository:
222222

223223
```bash
224-
# Clone the repository and checkout the nano-v3 branch
224+
# Clone the repository and checkout the pinned nano-v3 revision
225225
git clone https://github.com/NVIDIA-NeMo/Megatron-Bridge.git
226226
cd Megatron-Bridge
227-
git checkout nano-v3
227+
git checkout 1cedb0a9c5f79d2cd2b5226a86b794b9f0e048a8 # nano-v3
228228

229229
# Run fine-tuning (inside container on compute node)
230230
python examples/recipes/nemotron_3/finetune_nemotron_3_nano.py \

docs/nemotron/super3/pretrain.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -260,10 +260,10 @@ Each phase resumes from the previous phase's checkpoint automatically.
260260
For direct execution outside this CLI, use the scripts in the [Megatron-Bridge](https://github.com/NVIDIA-NeMo/Megatron-Bridge) repository:
261261

262262
```bash
263-
# Clone the repository and checkout the super-v3 branch
263+
# Clone the repository and checkout the pinned super-v3 revision
264264
git clone https://github.com/NVIDIA-NeMo/Megatron-Bridge.git
265265
cd Megatron-Bridge
266-
git checkout super-v3
266+
git checkout f570c0529c81b57cb2ae909bd31a19408c7f4583 # super-v3
267267

268268
# Run pretraining with real data (inside container on compute node)
269269
torchrun --nproc-per-node=8 examples/models/nemotron_3/pretrain_nemotron_3_super.py \

docs/nemotron/super3/quantization.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,10 +109,10 @@ Pass the desired config name via `--export-quant-cfg` to `quantize.py`.
109109
For direct execution, use the scripts in the [Megatron-Bridge](https://github.com/NVIDIA-NeMo/Megatron-Bridge) repository:
110110

111111
```bash
112-
# Clone the repository and checkout the super-v3 branch
112+
# Clone the repository and checkout the pinned super-v3 revision
113113
git clone https://github.com/NVIDIA-NeMo/Megatron-Bridge.git
114114
cd Megatron-Bridge
115-
git checkout super-v3
115+
git checkout f570c0529c81b57cb2ae909bd31a19408c7f4583 # super-v3
116116
```
117117

118118
### Quantize

docs/nemotron/super3/rl/index.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,9 +127,11 @@ uv run nemotron super3 rl rlvr -c test --run YOUR-CLUSTER
127127
Alternatively, run directly inside the NeMo-RL repo:
128128

129129
```bash
130-
# Clone NeMo-RL
130+
# Clone NeMo-RL with super-v3 branch context, then pin the exact revision
131131
git clone --recursive -b super-v3 https://github.com/NVIDIA-NeMo/RL.git
132132
cd RL
133+
git checkout bb0a7d43931950a74522e159f7117543a87b580b # super-v3
134+
git submodule update --init --recursive
133135
```
134136

135137
#### Prepare Data

docs/nemotron/super3/sft.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -218,10 +218,10 @@ $ uv run nemotron super3 sft --run YOUR-CLUSTER
218218
For direct execution outside this CLI, use the scripts in the [Megatron-Bridge](https://github.com/NVIDIA-NeMo/Megatron-Bridge) repository:
219219

220220
```bash
221-
# Clone the repository and checkout the super-v3 branch
221+
# Clone the repository and checkout the pinned super-v3 revision
222222
git clone https://github.com/NVIDIA-NeMo/Megatron-Bridge.git
223223
cd Megatron-Bridge
224-
git checkout super-v3
224+
git checkout f570c0529c81b57cb2ae909bd31a19408c7f4583 # super-v3
225225

226226
# Full-parameter SFT (inside container on compute node)
227227
torchrun --nproc-per-node=8 examples/models/nemotron_3/finetune_nemotron_3_super.py \
Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
from __future__ import annotations
2+
3+
import re
4+
from pathlib import Path
5+
6+
REPO_ROOT = Path(__file__).resolve().parents[2]
7+
8+
MEGATRON_BRIDGE_REPO = "https://github.com/NVIDIA-NeMo/Megatron-Bridge.git"
9+
NEMO_RL_REPO = "https://github.com/NVIDIA-NeMo/RL.git"
10+
AUTOMODEL_REPO = "https://github.com/NVIDIA-NeMo/Automodel.git"
11+
12+
SUPER_V3_SHA = "f570c0529c81b57cb2ae909bd31a19408c7f4583"
13+
NANO_V3_SHA = "1cedb0a9c5f79d2cd2b5226a86b794b9f0e048a8"
14+
NEMO_RL_SUPER_V3_SHA = "bb0a7d43931950a74522e159f7117543a87b580b"
15+
AUTOMODEL_NEMOTRON_OMNI_SHA = "7dfec6130ddf675cc9721d1619945dcc743f0095"
16+
17+
SUPER3_MEGATRON_BRIDGE_DOCS = (
18+
REPO_ROOT / "docs/nemotron/super3/pretrain.md",
19+
REPO_ROOT / "docs/nemotron/super3/sft.md",
20+
REPO_ROOT / "docs/nemotron/super3/quantization.md",
21+
)
22+
NANO3_MEGATRON_BRIDGE_DOCS = (
23+
REPO_ROOT / "docs/nemotron/nano3/pretrain.md",
24+
REPO_ROOT / "docs/nemotron/nano3/sft.md",
25+
)
26+
SUPER3_RL_DOC = REPO_ROOT / "docs/nemotron/super3/rl/index.md"
27+
AUTOMODEL_COOKBOOK = (
28+
REPO_ROOT
29+
/ "usage-cookbook/Nemotron-3-Nano-Omni/automodel/automodel_training_cookbook.md"
30+
)
31+
32+
33+
def _read(path: Path) -> str:
34+
return path.read_text(encoding="utf-8")
35+
36+
37+
def _assert_lower_sha(value: str) -> None:
38+
assert re.fullmatch(r"[0-9a-f]{40}", value)
39+
40+
41+
def _assert_checkout_pinned(path: Path, *, repo: str, branch: str, sha: str) -> None:
42+
text = _read(path)
43+
44+
assert repo in text, f"{path} missing repo {repo}"
45+
assert branch in text, f"{path} missing branch context {branch}"
46+
assert sha in text, f"{path} missing pinned SHA {sha}"
47+
_assert_lower_sha(sha)
48+
assert re.search(rf"^git checkout {re.escape(sha)}(?:\s+#\s*{re.escape(branch)})?$", text, re.MULTILINE), (
49+
f"{path} does not checkout pinned {branch} SHA {sha}"
50+
)
51+
52+
53+
def test_super3_megatron_bridge_docs_pin_super_v3_revision() -> None:
54+
for path in SUPER3_MEGATRON_BRIDGE_DOCS:
55+
_assert_checkout_pinned(
56+
path,
57+
repo=MEGATRON_BRIDGE_REPO,
58+
branch="super-v3",
59+
sha=SUPER_V3_SHA,
60+
)
61+
assert "git checkout super-v3" not in _read(path)
62+
63+
64+
def test_nano3_megatron_bridge_docs_pin_nano_v3_revision() -> None:
65+
for path in NANO3_MEGATRON_BRIDGE_DOCS:
66+
_assert_checkout_pinned(
67+
path,
68+
repo=MEGATRON_BRIDGE_REPO,
69+
branch="nano-v3",
70+
sha=NANO_V3_SHA,
71+
)
72+
assert "git checkout nano-v3" not in _read(path)
73+
74+
75+
def test_super3_rl_doc_pins_nemo_rl_super_v3_revision() -> None:
76+
text = _read(SUPER3_RL_DOC)
77+
78+
_assert_checkout_pinned(
79+
SUPER3_RL_DOC,
80+
repo=NEMO_RL_REPO,
81+
branch="super-v3",
82+
sha=NEMO_RL_SUPER_V3_SHA,
83+
)
84+
assert "git clone --recursive -b super-v3" in text
85+
assert "git submodule update --init --recursive" in text
86+
87+
88+
def test_automodel_cookbook_pins_nemotron_omni_revision() -> None:
89+
text = _read(AUTOMODEL_COOKBOOK)
90+
91+
_assert_checkout_pinned(
92+
AUTOMODEL_COOKBOOK,
93+
repo=AUTOMODEL_REPO,
94+
branch="nemotron-omni",
95+
sha=AUTOMODEL_NEMOTRON_OMNI_SHA,
96+
)
97+
assert "git clone -b nemotron-omni" in text
98+
assert "gitlab-master.nvidia.com" not in text

usage-cookbook/Nemotron-3-Nano-Omni/automodel/automodel_training_cookbook.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,9 @@ The **base model** produces free-form descriptions. After fine-tuning, it output
5959
cd /opt/Automodel
6060

6161
# Or from a source checkout:
62-
git clone -b nemotron-omni ssh://git@gitlab-master.nvidia.com:12051/huiyingl/automodel-omni.git
63-
cd automodel-omni
62+
git clone -b nemotron-omni https://github.com/NVIDIA-NeMo/Automodel.git
63+
cd Automodel
64+
git checkout 7dfec6130ddf675cc9721d1619945dcc743f0095 # nemotron-omni
6465
```
6566

6667
:::{note}
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
# intern_nem_dev_3 - 状态
22

3-
<!-- METADATA:STATUS=Working,TASK=task169_usage_cookbook_automodel_cord_v2_revision_pin_s1,SESSION=1 -->
3+
<!-- METADATA:STATUS=Working,TASK=task172_docs_upstream_branch_checkout_revision_pins_s1,SESSION=1 -->
44

55
| 字段 ||
66
|------|-----|
77
| Name | intern_nem_dev_3 |
88
| Status | Working |
9-
| Current Task | task169_usage_cookbook_automodel_cord_v2_revision_pin_s1 |
10-
| PR | https://github.com/songCNMS/Nemotron/pull/276 |
9+
| Current Task | task172_docs_upstream_branch_checkout_revision_pins_s1 |
10+
| PR | pending |
1111
| Session | 1 |
12-
| Recent Progress | PR #276 opened for Nano-Omni AutoModel CORD-v2 cookbook revision pins after focused pytest, py_compile, Ruff, static probe/grep, live-surface scan, and diff checks passed |
12+
| Recent Progress | Created task172 branch from origin/main 9cf231a; pinning scoped upstream checkout examples and adding static docs guards |
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# task172_docs_upstream_branch_checkout_revision_pins_s1
2+
3+
<!-- METADATA:STATUS=InProgress,ASSIGNEE=intern_nem_dev_3 -->
4+
5+
## Summary
6+
7+
Pin scoped Super3, Nano3, and Nano-Omni AutoModel documentation examples that
8+
clone or checkout upstream release branches to PM-verified exact commit SHAs.
9+
10+
## Scope
11+
12+
- `docs/nemotron/super3/pretrain.md`
13+
- `docs/nemotron/super3/sft.md`
14+
- `docs/nemotron/super3/quantization.md`
15+
- `docs/nemotron/super3/rl/index.md`
16+
- `docs/nemotron/nano3/pretrain.md`
17+
- `docs/nemotron/nano3/sft.md`
18+
- `usage-cookbook/Nemotron-3-Nano-Omni/automodel/automodel_training_cookbook.md`
19+
- Focused static docs test under `tests/docs/`
20+
21+
## Acceptance
22+
23+
- Super3 Megatron-Bridge docs use
24+
`f570c0529c81b57cb2ae909bd31a19408c7f4583` for `super-v3`.
25+
- Nano3 Megatron-Bridge docs use
26+
`1cedb0a9c5f79d2cd2b5226a86b794b9f0e048a8` for `nano-v3`.
27+
- Super3 RL docs use
28+
`bb0a7d43931950a74522e159f7117543a87b580b` for NeMo-RL `super-v3`.
29+
- AutoModel cookbook uses
30+
`7dfec6130ddf675cc9721d1619945dcc743f0095` for `nemotron-omni`.
31+
- Static tests prove scoped docs keep repo/branch context and exact SHA
32+
checkout guidance.
33+
34+
## Boundaries
35+
36+
- Docs/static-test only.
37+
- No live git clone/fetch/checkout, build, data prep, train/eval, endpoint
38+
calls, W&B, cluster jobs, deploy, artifact ops, direct `main`/`master` push,
39+
or self-merge.

0 commit comments

Comments
 (0)