Skip to content

Commit 7c09d64

Browse files
committed
chore: merge main into Nemotron examples layout branch
Signed-off-by: Chen Cui <chcui@nvidia.com>
2 parents 03303a7 + a071193 commit 7c09d64

67 files changed

Lines changed: 7622 additions & 912 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.main.commit‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
52fbcbc18c2992db1747a4558f430e0519604ad0
1+
441a987409b8fdd2b90b463f7999bac970109a43

‎docs/conf.py‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,9 @@
5757
"_build",
5858
"Thumbs.db",
5959
".DS_Store",
60+
# Keep these guides in GitHub, but omit them from the published HTML.
61+
"models/nemotron/nemotron3.5-super-vl.md",
62+
"models/nemotron/nemotron3.5-super-vl-text-only.md",
6063
"skills/linting-and-formatting/SKILL.md",
6164
"skills/parity-testing/SKILL.md",
6265
"skills/pr-review/SKILL.md",

‎docs/fern/docs.yml‎

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,23 @@ versions:
2121
- display-name: nightly
2222
path: versions/nightly.yml
2323
slug: nightly
24+
25+
redirects:
26+
# Unpublished guides remain in GitHub; send bookmarks to Supported Models.
27+
# The catalog landing page exists in nightly, not in the frozen default version.
28+
- source: /nemo/megatron-bridge/supported-models/nemotron/nemotron-3-5-super-vl
29+
destination: /nemo/megatron-bridge/nightly/supported-models/supported-models
30+
- source: /nemo/megatron-bridge/nightly/supported-models/nemotron/nemotron-3-5-super-vl
31+
destination: /nemo/megatron-bridge/nightly/supported-models/supported-models
32+
- source: /nemo/megatron-bridge/supported-models/nemotron/nemotron-3-5-super-text-only
33+
destination: /nemo/megatron-bridge/nightly/supported-models/supported-models
34+
- source: /nemo/megatron-bridge/nightly/supported-models/nemotron/nemotron-3-5-super-text-only
35+
destination: /nemo/megatron-bridge/nightly/supported-models/supported-models
36+
- source: /nemo/megatron-bridge/models/nemotron/nemotron3.5-super-vl.html
37+
destination: /nemo/megatron-bridge/nightly/supported-models/supported-models
38+
- source: /nemo/megatron-bridge/nightly/models/nemotron/nemotron3.5-super-vl.html
39+
destination: /nemo/megatron-bridge/nightly/supported-models/supported-models
40+
- source: /nemo/megatron-bridge/models/nemotron/nemotron3.5-super-vl-text-only.html
41+
destination: /nemo/megatron-bridge/nightly/supported-models/supported-models
42+
- source: /nemo/megatron-bridge/nightly/models/nemotron/nemotron3.5-super-vl-text-only.html
43+
destination: /nemo/megatron-bridge/nightly/supported-models/supported-models

‎docs/fern/versions/nightly.yml‎

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -138,10 +138,7 @@ navigation:
138138
path: ./nightly/pages/models/nemotron/nemotron3-ultra.mdx
139139
- page: Nemotron 3.5 Lightning
140140
path: ./nightly/pages/models/nemotron/nemotron3.5-lightning.mdx
141-
- page: Nemotron 3.5 Super VL
142-
path: ./nightly/pages/models/nemotron/nemotron3.5-super-vl.mdx
143-
- page: Nemotron-3.5 Super Text-only
144-
path: ./nightly/pages/models/nemotron/nemotron3.5-super-vl-text-only.mdx
141+
# Super VL guides remain in GitHub, but are excluded from publication.
145142
- page: Nemotron Nano V2 VL
146143
path: ./nightly/pages/models/nemotron/nemotron-nano-v2-vl.mdx
147144
section: Nemotron

‎docs/fern/versions/nightly/pages/models/README.mdx‎

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
Choose a model to open its interactive import/export and training configurations. Every option comes directly from an authoritative YAML verification card; independent fields are never combined into synthetic commands.
66

7-
Current inventory: **28 model cards** and **400 concrete configurations**.
7+
Current inventory: **26 model cards** and **364 concrete configurations**.
88

99
Each model page lets you select import/export, pretraining, benchmarking, SFT, LoRA, or long-context SFT and immediately see the exact command and expected result for the recorded precision and GPU.
1010

@@ -112,7 +112,7 @@ Choose a model to inspect its recorded import/export, training, and precision co
112112
<section class="verification-provider-card">
113113
<header class="verification-provider-heading">
114114
<strong>NVIDIA</strong>
115-
<span>8 models</span>
115+
<span>6 models</span>
116116
</header>
117117
<div class="verification-provider-models">
118118
<a class="verification-model-link" href="nemotron/nemotron3-nano#verified-nemotron-3-nano-30b-a3b">
@@ -141,14 +141,6 @@ Choose a model to inspect its recorded import/export, training, and precision co
141141
<strong title="nvidia/NVIDIA-Nemotron-3.5-Lightning-30B-A3B-BF16">NVIDIA-Nemotron-3.5-Lightning-30B-A3B-BF16</strong>
142142
<span class="verification-status verification-status--verified" title="Verified">✓ Verified</span>
143143
</a>
144-
<a class="verification-model-link" href="nemotron/nemotron3.5-super-vl#verified-nemotron-3.5-super-vl-120b-a12b">
145-
<strong title="nvidia/NVIDIA-Nemotron-3.5-Super-VL-120B-A12B-BF16">NVIDIA-Nemotron-3.5-Super-VL-120B-A12B-BF16</strong>
146-
<span class="verification-status verification-status--partial" title="Partial">◐ Partial</span>
147-
</a>
148-
<a class="verification-model-link" href="nemotron/nemotron3.5-super-vl-text-only#verified-nemotron-3.5-super-vl-120b-a12b-text-only">
149-
<strong title="nvidia/NVIDIA-Nemotron-3.5-Super-VL-120B-A12B-BF16">NVIDIA-Nemotron-3.5-Super-VL-120B-A12B-BF16</strong>
150-
<span class="verification-status verification-status--partial" title="Partial">◐ Partial</span>
151-
</a>
152144
</div>
153145
</section>
154146
<section class="verification-provider-card">

‎docs/fern/versions/nightly/pages/models/nemotron/index.mdx‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@ Nemotron model documentation is organized by model variant.
1212
| Nemotron-3 Super | [nemotron3-super.md](nemotron3-super.md) |
1313
| Nemotron-3 Ultra | [nemotron3-ultra.md](nemotron3-ultra.md) |
1414
| Nemotron-3.5 Lightning | [nemotron3.5-lightning.md](nemotron3.5-lightning.md) |
15-
| Nemotron-3.5 Super VL | [nemotron3.5-super-vl.md](nemotron3.5-super-vl.md) |
16-
| Nemotron-3.5 Super Text-only | [nemotron3.5-super-vl-text-only.md](nemotron3.5-super-vl-text-only.md) |
1715
| Nemotron Nano V2 VL | [nemotron-nano-v2-vl.md](nemotron-nano-v2-vl.md) |
1816

1917
## Examples

‎docs/models/README.md‎

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
Choose a model to open its interactive import/export and training configurations. Every option comes directly from an authoritative YAML verification card; independent fields are never combined into synthetic commands.
66

7-
Current inventory: **28 model cards** and **400 concrete configurations**.
7+
Current inventory: **26 model cards** and **364 concrete configurations**.
88

99
Each model page lets you select import/export, pretraining, benchmarking, SFT, LoRA, or long-context SFT and immediately see the exact command and expected result for the recorded precision and GPU.
1010

@@ -112,7 +112,7 @@ Choose a model to inspect its recorded import/export, training, and precision co
112112
<section class="verification-provider-card">
113113
<header class="verification-provider-heading">
114114
<strong>NVIDIA</strong>
115-
<span>8 models</span>
115+
<span>6 models</span>
116116
</header>
117117
<div class="verification-provider-models">
118118
<a class="verification-model-link" href="nemotron/nemotron3-nano.html#verified-nemotron-3-nano-30b-a3b">
@@ -139,14 +139,6 @@ Choose a model to inspect its recorded import/export, training, and precision co
139139
<strong title="nvidia/NVIDIA-Nemotron-3.5-Lightning-30B-A3B-BF16">NVIDIA-Nemotron-3.5-Lightning-30B-A3B-BF16</strong>
140140
<span class="verification-status verification-status--verified" title="Verified">✓ Verified</span>
141141
</a>
142-
<a class="verification-model-link" href="nemotron/nemotron3.5-super-vl.html#verified-nemotron-3.5-super-vl-120b-a12b">
143-
<strong title="nvidia/NVIDIA-Nemotron-3.5-Super-VL-120B-A12B-BF16">NVIDIA-Nemotron-3.5-Super-VL-120B-A12B-BF16</strong>
144-
<span class="verification-status verification-status--partial" title="Partial">◐ Partial</span>
145-
</a>
146-
<a class="verification-model-link" href="nemotron/nemotron3.5-super-vl-text-only.html#verified-nemotron-3.5-super-vl-120b-a12b-text-only">
147-
<strong title="nvidia/NVIDIA-Nemotron-3.5-Super-VL-120B-A12B-BF16">NVIDIA-Nemotron-3.5-Super-VL-120B-A12B-BF16</strong>
148-
<span class="verification-status verification-status--partial" title="Partial">◐ Partial</span>
149-
</a>
150142
</div>
151143
</section>
152144
<section class="verification-provider-card">
Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
# DiffusionGemma
2+
3+
Megatron Bridge supports the public `google/diffusiongemma-26B-A4B-it`
4+
checkpoint for block-diffusion SFT.
5+
6+
## What is implemented
7+
8+
- HF ↔ Megatron conversion and exact checkpoint tensor coverage.
9+
- Text and image-conditioned encoder/decoder inference.
10+
- Uniform-state corruption with one diffusion time per example.
11+
- `base-sft`, `reweighted-ce`, `loo-ce`, and `reweighted-loo-ce` objectives.
12+
- Detached two-pass self-conditioning.
13+
- Optional clean-target encoder next-token loss. It runs a separate encoder
14+
pass so the denoising decoder never sees the target tokens as context.
15+
- Tensor parallelism with sequence parallelism and expert parallelism.
16+
- Distributed optimizer training and torch-dist checkpoint save/resume.
17+
18+
The reference SFT objective does not add a router balancing penalty. The
19+
provider exposes `moe_aux_loss_coeff` for experiments, but its default is zero.
20+
21+
## Recipe
22+
23+
Use `diffusion_gemma_26b_sft_config()` from
24+
`megatron.bridge.recipes.diffusion_gemma`. The production recipe uses TP=1,
25+
EP=8, one pipeline stage, BF16 mixed precision, a distributed optimizer, and
26+
full uniform activation recomputation. The recomputation setting keeps
27+
large-image prompts with long text and prior-target context within H200
28+
memory; callers can override it for shorter inputs.
29+
Pass `train_path` and optional `validation_path`/`test_path` to train on
30+
existing JSONL split files; the adapter never creates a new split. Without
31+
`train_path`, the recipe uses synthetic smoke-test data. Each JSONL row has the
32+
form:
33+
34+
```json
35+
{"messages":[{"role":"user","content":[{"type":"image","image":"images/example.png"},{"type":"text","text":"Describe the image."}]}],"completion":"A blue square above a red circle."}
36+
```
37+
38+
Image paths are local and relative to the JSONL file. The caller is responsible
39+
for supplying only instructions/context available at inference time and for
40+
curating completion labels. Multi-block completions are split without
41+
truncation; only prior clean target blocks are appended to the encoder context.
42+
43+
```python
44+
from megatron.bridge.recipes.diffusion_gemma import diffusion_gemma_26b_sft_config
45+
from megatron.bridge.training.diffusion_gemma_step import forward_step
46+
from megatron.bridge.training.pretrain import pretrain
47+
48+
cfg = diffusion_gemma_26b_sft_config(
49+
train_path="data/train.jsonl", validation_path="data/validation.jsonl",
50+
test_path="data/test.jsonl",
51+
)
52+
pretrain(cfg, forward_step)
53+
```
54+
55+
Run this entry point with `uv run python -m torch.distributed.run
56+
--nproc_per_node=8 train.py`. Initial weights are loaded through the HF bridge
57+
hook; `checkpoint.load` points to the resume directory, not the HF model ID.
58+
59+
The dataset must emit the following fields:
60+
61+
```text
62+
input_ids, attention_mask, position_ids, mm_token_type_ids,
63+
canvas_ids, canvas_mask,
64+
pixel_values, image_position_ids # optional for image examples
65+
```
66+
67+
Prompts are left-padded; canvases are right-padded. When sequence parallelism
68+
is enabled, the prompt length must be divisible by TP.
69+
70+
## Validation evidence
71+
72+
The tiny model has HF loss/gradient parity at roughly 1e-3 relative gradient
73+
error and overfits a fixed batch. TP=2 and EP=2 checks pass, including a
74+
prompt crossing the toy sliding-window boundary. A real 26B BF16
75+
run on eight H200 GPUs completed three unfrozen optimizer steps with EP=8 and a
76+
distributed optimizer; no updates were skipped or non-finite. After warmup,
77+
the measured steps were about 4.6–6.1 seconds and peak rank-0 allocated memory
78+
was about 74.6 GiB.
79+
With the clean-target encoder objective enabled, the three-step smoke also
80+
passed: warmed-up steps measured 6.1–8.4 seconds and peak rank-0 allocated
81+
memory was about 83.6 GiB. These are small synthetic microbatches, not a
82+
prediction of production throughput. No 26B optimizer checkpoint
83+
was written during either smoke run.
84+
On a synthetic long-context multimodal example with a large image, a long text
85+
prompt, and a multi-block completion, the recipe completed three EP=8 steps
86+
with recomputation enabled. Peak rank-0 allocation was 123.8 GiB and warmed-up
87+
steps took about 3.4 seconds. The same example without recomputation exceeded
88+
the 139.8 GiB H200 capacity during attention.
89+
90+
The two-GPU `pretrain()` checkpoint test saved at step three and resumed in
91+
a fresh process. Steps four through six reproduced the uninterrupted losses,
92+
gradient norms, and consumed-sample positions exactly.
93+
94+
## Known limitations
95+
96+
- Context parallelism and pipeline parallelism are not implemented by the
97+
diffusion training step.
98+
- Context lengths beyond the validated sliding-window boundary still need
99+
production-shaped memory and quality evaluation.
100+
- `MockDiffusionGemmaDatasetConfig` is for smoke tests only. Pass
101+
`train_path` to use `DiffusionGemmaDatasetConfig` with curated JSONL input files.
102+
- A successful optimizer smoke test does not demonstrate task quality or
103+
generalization. Those require held-out task evaluation on a saved split.

‎docs/models/gemma/index.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ gemma2.md
1010
gemma3.md
1111
gemma3-vl.md
1212
gemma4-vl.md
13+
diffusiongemma.md
1314
```
1415

1516
| Variant | Guide |
@@ -19,3 +20,4 @@ gemma4-vl.md
1920
| Gemma 3 | [gemma3.md](gemma3.md) |
2021
| Gemma 3 VL | [gemma3-vl.md](gemma3-vl.md) |
2122
| Gemma 4 VL | [gemma4-vl.md](gemma4-vl.md) |
23+
| DiffusionGemma | [diffusiongemma.md](diffusiongemma.md) |

0 commit comments

Comments
 (0)