Skip to content

Commit 0a88bc2

Browse files
Merge branch 'main' into nvegesna/llama3-8b-gb200-nvfp4-fp8-dpa
Signed-off-by: nvegesna-netizen <nvegesna@nvidia.com>
2 parents 7ea0d18 + 8a84d71 commit 0a88bc2

211 files changed

Lines changed: 11883 additions & 2210 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.

‎.dev.commit‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
af91b6b5cc5aec01458b8e6d24ccb0f4717e49e3
1+
cae55c1f0991abd3e391d0029b15bcb35723d3f6

‎.github/scripts/test_docker_dependency_layers.sh‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,13 @@ ancestor_sha=$(git -C "$revision_worktree" rev-parse HEAD)
9999
printf 'main\n' >>"$revision_worktree/file"
100100
git -C "$revision_worktree" commit -qam main
101101
main_sha=$(git -C "$revision_worktree" rev-parse HEAD)
102+
git -C "$revision_worktree" switch -q -c dev
103+
printf 'dev\n' >>"$revision_worktree/file"
104+
git -C "$revision_worktree" commit -qam dev
105+
dev_ancestor_sha=$(git -C "$revision_worktree" rev-parse HEAD)
106+
printf 'dev tip\n' >>"$revision_worktree/file"
107+
git -C "$revision_worktree" commit -qam dev-tip
108+
dev_sha=$(git -C "$revision_worktree" rev-parse HEAD)
102109
git -C "$revision_worktree" branch contributor "$ancestor_sha"
103110
git -C "$revision_worktree" switch -q contributor
104111
printf 'approved\n' >>"$revision_worktree/file"
@@ -122,6 +129,7 @@ git -C "$revision_worktree" add unapproved
122129
git -C "$revision_worktree" commit -q -m unapproved
123130
unapproved_sha=$(git -C "$revision_worktree" rev-parse HEAD)
124131
git -C "$revision_worktree" push -q "$revision_repo" "$main_sha:refs/heads/main"
132+
git -C "$revision_worktree" push -q "$revision_repo" "$dev_sha:refs/heads/dev"
125133
git -C "$revision_worktree" push -q "$revision_repo" "$mirror_sha:refs/heads/pull-request/123"
126134
git -C "$revision_worktree" push -q "$revision_repo" "$merge_sha:refs/pull/123/merge"
127135
git -C "$revision_worktree" push -q \
@@ -140,6 +148,8 @@ sed "s#\.github/scripts/validate_mcore_repo\.sh#$temporary_dir/revision-bin/repo
140148
"$revision_validator" >"$temporary_dir/revision-validator"
141149
chmod +x "$temporary_dir/revision-validator"
142150
"$temporary_dir/revision-validator" "$revision_repo" "$ancestor_sha"
151+
"$temporary_dir/revision-validator" "$revision_repo" "$dev_ancestor_sha"
152+
"$temporary_dir/revision-validator" "$revision_repo" "$dev_sha"
143153
"$temporary_dir/revision-validator" "$revision_repo" "$mirror_sha"
144154
"$temporary_dir/revision-validator" "$revision_repo" "$merge_sha"
145155
"$temporary_dir/revision-validator" "$revision_repo" "$queue_sha"
@@ -222,6 +232,12 @@ if "$temporary_dir/revision-validator" "$revision_repo" not-a-full-sha; then
222232
exit 1
223233
fi
224234

235+
if grep -q 'transformer-engine @ git+https://github.com/NVIDIA/TransformerEngine.git@' pyproject.toml || \
236+
grep -q '^name = "transformer-engine"$' pyproject.toml; then
237+
echo "Bridge must inherit the TransformerEngine source and metadata from the selected MCore ref" >&2
238+
exit 1
239+
fi
240+
225241
composite_action=".github/actions/test-template/action.yml"
226242
if grep -qE 'mcore_(commit|ref)|MCORE_COMMIT|uv sync --all-extras --all-groups' "$composite_action"; then
227243
echo "Test template must use the already-validated MCore in the built image" >&2

‎.github/scripts/validate_mcore_revision.sh‎

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ fi
1515
refs=$(git ls-remote \
1616
"$repo" \
1717
"refs/heads/main" \
18+
"refs/heads/dev" \
1819
"refs/heads/pull-request/*" \
1920
"refs/heads/gh-readonly-queue/*/pr-*" \
2021
"refs/pull/*/merge")
@@ -23,18 +24,22 @@ trap 'rm -rf "$object_store"' EXIT
2324
git -C "$object_store" init --quiet
2425

2526
main_sha=$(awk '$2 == "refs/heads/main" {print $1}' <<<"$refs")
26-
if [[ -n "$main_sha" ]] && \
27-
git -C "$object_store" fetch --quiet --filter=blob:none --no-tags "$repo" "$main_sha" "$revision"; then
28-
if git -C "$object_store" merge-base --is-ancestor "$revision" "$main_sha"; then
29-
exit 0
27+
dev_sha=$(awk '$2 == "refs/heads/dev" {print $1}' <<<"$refs")
28+
for protected_sha in "$main_sha" "$dev_sha"; do
29+
if [[ -n "$protected_sha" ]] && \
30+
git -C "$object_store" fetch --quiet --filter=blob:none --no-tags "$repo" "$protected_sha" "$revision"; then
31+
if git -C "$object_store" merge-base --is-ancestor "$revision" "$protected_sha"; then
32+
exit 0
33+
fi
3034
fi
31-
fi
35+
done
3236

3337
while IFS=$'\t' read -r sha ref; do
3438
if [[ "$sha" != "$revision" ]]; then
3539
continue
3640
fi
37-
if [[ "$ref" =~ ^refs/heads/pull-request/[0-9]+$ ]] || \
41+
if [[ "$ref" == "refs/heads/dev" ]] || \
42+
[[ "$ref" =~ ^refs/heads/pull-request/[0-9]+$ ]] || \
3843
[[ "$ref" =~ ^refs/heads/gh-readonly-queue/(main|dev)/pr-[0-9]+-[0-9a-f]{40}$ ]]; then
3944
exit 0
4045
fi

‎.main.commit‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
6513e3e23d6b5eda6a1c934990b15e804237732b
1+
24bad8e677d22625d86ef2a54c9506b6e4992c93

‎3rdparty/Megatron-LM‎

Submodule Megatron-LM updated 281 files

‎README.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
</div>
1212

1313
## 📣 News
14+
- [08/11/2026] **NVIDIA Nemotron 3.5 Lightning is released!** Read the technical blog [here](https://developer.nvidia.com/blog/nvidia-nemotron-3-5-lightning-delivers-fast-accurate-specialized-task-execution-for-long-running-agents/). See the [Nemotron 3.5 Lightning README](https://github.com/NVIDIA-NeMo/Megatron-Bridge/blob/main/examples/models/nemotron/nemotron_3/lightning/README.md) for details.
15+
1416
- [07/31/2026] **[K-EXAONE-2](https://huggingface.co/LGAI-EXAONE/K-EXAONE-2.0-750B-A37B) is now supported**! Day-0 support for LG AI Research's K-EXAONE-2 (750B-A37B MoE) is now available on the [k-exaone-2 branch](https://github.com/NVIDIA-NeMo/Megatron-Bridge/tree/k-exaone-2). Users can convert checkpoints, run inference, fine-tune with SFT or PEFT (LoRA), and use the NVFP4 inference-optimized checkpoint released alongside the model. See the branch documentation for setup instructions and examples.
1517

1618
- [07/17/2026] [**LongStraw (MinT-2M)**](https://github.com/MindLab-Research/longstraw) is a long-context RL research system from MindLab Research that uses Megatron Bridge's modeling and LoRA capabilities. LongStraw explores resident-prefix, response-only GRPO by capturing a shared prompt once and replaying only the trainable response branches, and reports a 2.1M-token GLM-5.2 execution path across 32 NVIDIA H20 GPUs. The broader MinT system behind this work was also used to post-train [**Macaron-V1-Preview**](https://macaron.im/mindlab/research/macaron-v1-preview), MindLab's 749B Mixture-of-LoRA agent model derived from GLM-5.1. Learn more in the [paper](https://arxiv.org/abs/2607.14952).

‎docs/bridge-guide.md‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,11 @@ Or with a helper script:
290290
./scripts/conversion/convert.sh export --hf-model meta-llama/Llama-3.2-1B --megatron-path ./megatron_checkpoints/llama32_1b --hf-path ./hf_exports/llama32_1b
291291
```
292292

293+
Megatron-LM training checkpoints do not normally contain the Bridge
294+
`run_config.yaml` required by this export command. See
295+
[Export Megatron-LM checkpoints without a Bridge run config](megatron-lm-to-megatron-bridge.md#export-megatron-lm-checkpoints-without-a-bridge-run-config)
296+
for the configuration generation and validation workflow.
297+
293298
### Create Megatron models and run locally
294299

295300
```bash

‎docs/bridge-rl-integration.md‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ from megatron.bridge.training.state import GlobalState
155155
# Minimal bootstrap
156156
state = GlobalState()
157157
state.cfg = megatron_cfg
158-
initialize_megatron(cfg=megatron_cfg)
158+
pg_collection = initialize_megatron(cfg=megatron_cfg)
159159
set_jit_fusion_options(megatron_cfg.model, megatron_cfg.train.micro_batch_size)
160160

161161
ckpt_ctx = init_checkpointing_context(megatron_cfg.checkpoint)
@@ -165,6 +165,7 @@ model_list = get_model(
165165
use_torch_fsdp2=megatron_cfg.dist.use_torch_fsdp2,
166166
overlap_param_gather_with_optimizer_step=megatron_cfg.optimizer.overlap_param_gather_with_optimizer_step,
167167
data_parallel_random_init=megatron_cfg.rng.data_parallel_random_init,
168+
pg_collection=pg_collection,
168169
)
169170
optimizer, scheduler = setup_optimizer(
170171
optimizer_config=megatron_cfg.optimizer,
@@ -440,11 +441,12 @@ class MegatronBridgeAdapter:
440441
from megatron.bridge.training.initialize import initialize_megatron, set_jit_fusion_options
441442
from megatron.bridge.models.model_provider import get_model
442443
from megatron.bridge.training.optim import setup_optimizer
443-
initialize_megatron(cfg=self.megatron_cfg)
444+
pg_collection = initialize_megatron(cfg=self.megatron_cfg)
444445
set_jit_fusion_options(self.megatron_cfg.model, self.megatron_cfg.train.micro_batch_size)
445446
self.model_list = get_model(self.megatron_cfg.model, self.megatron_cfg.ddp,
446447
use_torch_fsdp2=self.megatron_cfg.dist.use_torch_fsdp2,
447-
overlap_param_gather_with_optimizer_step=self.megatron_cfg.optimizer.overlap_param_gather_with_optimizer_step)
448+
overlap_param_gather_with_optimizer_step=self.megatron_cfg.optimizer.overlap_param_gather_with_optimizer_step,
449+
pg_collection=pg_collection)
448450
self.model = self.model_list[0]
449451
self.optimizer, self.scheduler = setup_optimizer(self.megatron_cfg.optimizer, self.megatron_cfg.scheduler, self.model_list,
450452
use_gloo_process_groups=self.megatron_cfg.dist.use_gloo_process_groups)

‎docs/fern/versions/0.4.2/pages/bridge-rl-integration.mdx‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ from megatron.bridge.training.state import GlobalState
151151
# Minimal bootstrap
152152
state = GlobalState()
153153
state.cfg = megatron_cfg
154-
initialize_megatron(cfg=megatron_cfg)
154+
pg_collection = initialize_megatron(cfg=megatron_cfg)
155155
set_jit_fusion_options(megatron_cfg.model, megatron_cfg.train.micro_batch_size)
156156

157157
ckpt_ctx = init_checkpointing_context(megatron_cfg.checkpoint)
@@ -161,6 +161,7 @@ model_list = get_model(
161161
use_torch_fsdp2=megatron_cfg.dist.use_torch_fsdp2,
162162
overlap_param_gather_with_optimizer_step=megatron_cfg.optimizer.overlap_param_gather_with_optimizer_step,
163163
data_parallel_random_init=megatron_cfg.rng.data_parallel_random_init,
164+
pg_collection=pg_collection,
164165
)
165166
optimizer, scheduler = setup_optimizer(
166167
optimizer_config=megatron_cfg.optimizer,
@@ -431,11 +432,12 @@ class MegatronBridgeAdapter:
431432
from megatron.bridge.training.initialize import initialize_megatron, set_jit_fusion_options
432433
from megatron.bridge.models.model_provider import get_model
433434
from megatron.bridge.training.optim import setup_optimizer
434-
initialize_megatron(cfg=self.megatron_cfg)
435+
pg_collection = initialize_megatron(cfg=self.megatron_cfg)
435436
set_jit_fusion_options(self.megatron_cfg.model, self.megatron_cfg.train.micro_batch_size)
436437
self.model_list = get_model(self.megatron_cfg.model, self.megatron_cfg.ddp,
437438
use_torch_fsdp2=self.megatron_cfg.dist.use_torch_fsdp2,
438-
overlap_param_gather_with_optimizer_step=self.megatron_cfg.optimizer.overlap_param_gather_with_optimizer_step)
439+
overlap_param_gather_with_optimizer_step=self.megatron_cfg.optimizer.overlap_param_gather_with_optimizer_step,
440+
pg_collection=pg_collection)
439441
self.model = self.model_list[0]
440442
self.optimizer, self.scheduler = setup_optimizer(self.megatron_cfg.optimizer, self.megatron_cfg.scheduler, self.model_list,
441443
use_gloo_process_groups=self.megatron_cfg.dist.use_gloo_process_groups)

‎docs/fern/versions/nightly/pages/bridge-guide.mdx‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,11 @@ Or with a helper script:
258258
./scripts/conversion/convert.sh export --hf-model meta-llama/Llama-3.2-1B --megatron-path ./megatron_checkpoints/llama32_1b --hf-path ./hf_exports/llama32_1b
259259
```
260260

261+
Megatron-LM training checkpoints do not normally contain the Bridge
262+
`run_config.yaml` required by this export command. See
263+
[Export Megatron-LM checkpoints without a Bridge run config](megatron-lm-to-megatron-bridge.md#export-megatron-lm-checkpoints-without-a-bridge-run-config)
264+
for the configuration generation and validation workflow.
265+
261266
### Create Megatron models and run locally
262267

263268
```bash

0 commit comments

Comments
 (0)