Skip to content

Commit 666ac3c

Browse files
authored
Merge branch 'main' into yuya/bug-hunter-gpt3-alias-20260718
2 parents 3af4a5b + 4de0797 commit 666ac3c

160 files changed

Lines changed: 10077 additions & 796 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-
b3b1e2d793c596c2fa61076d001ab93f294e4e87
1+
2f2f8ebaef90f4d62a18a43808398223b1fc5809

.github/scripts/test_docker_dependency_layers.sh

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -252,9 +252,18 @@ if ! grep -Fq \
252252
echo "Bridge's lock metadata must preserve the MCore TE extra" >&2
253253
exit 1
254254
fi
255-
if grep -q 'transformer-engine @ git+https://github.com/NVIDIA/TransformerEngine.git@' pyproject.toml || \
256-
grep -q '^name = "transformer-engine"$' pyproject.toml; then
257-
echo "Bridge must inherit the TransformerEngine source and metadata from the selected MCore ref" >&2
255+
if grep -q 'transformer-engine @ git+https://github.com/NVIDIA/TransformerEngine.git@' pyproject.toml; then
256+
echo "Bridge must inherit the TransformerEngine source from the selected MCore ref" >&2
257+
exit 1
258+
fi
259+
260+
if ! grep -Fq ' NVTE_SKIP_SUBMODULE_CHECKS_DURING_BUILD=1 \' "$dockerfile"; then
261+
echo "CI builds must disable TransformerEngine's recursive build-time submodule fetch" >&2
262+
exit 1
263+
fi
264+
if grep -R -qE 'git submodule update.*--recursive|git submodule update --init --recursive' \
265+
"$dockerfile" docker .github/actions; then
266+
echo "CI build surfaces must not fetch recursive submodules at build time" >&2
258267
exit 1
259268
fi
260269

.github/workflows/verl-e2e-weekly.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ jobs:
130130
cd /workspace/verl
131131
git checkout "$VERL_REF"
132132
git rev-parse HEAD
133+
python3 -m pip install uv
133134
bash "$SCRIPT_PATH"
134135
'
135136

.main.commit

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2a75ac12c54ba6a42b34024756820bf819a2e25f
1+
731b791469004f8fdcb896e65d610d6b1b0ebb32

3rdparty/Megatron-LM

Submodule Megatron-LM updated 320 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/19/2026] **Megatron Bridge 0.6.0 released!** Highlights include GLM-5.2 with cuDNN fused DSA for 128K THD-packed context-parallel training, new LLM/VLM/diffusion models, more reliable VLM data and sequence packing, improved checkpoint and LoRA workflows, unified training and conversion launchers, and refreshed performance recipes. Huge thanks to our community contributors! See the [full release notes](https://github.com/NVIDIA-NeMo/Megatron-Bridge/releases/tag/v0.6.0).
15+
1416
- [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.
1517

1618
- [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.

docker/Dockerfile.ci

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ ENV PATH="/opt/venv/bin:/usr/local/bin:$PATH" \
5555
UV_VERSION="0.7.2" \
5656
UV_HTTP_TIMEOUT=120 \
5757
NVTE_BUILD_NUM_PHILOX_ROUNDS=3 \
58+
NVTE_SKIP_SUBMODULE_CHECKS_DURING_BUILD=1 \
5859
HYBRID_EP_MULTINODE=1 \
5960
RDMA_CORE_HOME=/opt/rdma-core/build \
6061
LD_LIBRARY_PATH="/usr/local/cuda/lib64/:$LD_LIBRARY_PATH"
@@ -192,7 +193,7 @@ COPY --chown=1000:1000 . /opt/Megatron-Bridge
192193
# prepared environment, and uses /nemo_run for runtime outputs. Keep those paths owned by the
193194
# existing unprivileged base-image user instead of relying on a root final user.
194195
RUN install -d -o 1000 -g 1000 -m 0755 /nemo_run /home/ubuntu/.cache && \
195-
chown 1000:1000 /opt/Megatron-Bridge
196+
chown -R 1000:1000 /opt/Megatron-Bridge
196197

197198
ENV HOME=/home/ubuntu
198199
USER 1000:1000

docker/Dockerfile.fw_base

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,12 @@
1313
# limitations under the License.
1414

1515
# Build layer variables
16-
# Supported mode: FW_DEP_BUILDER=base, FW_BASE_FINAL=fw_toolkit_builder
16+
# Supported mode: FW_DEP_BUILDER=base, FW_BASE_FINAL=fw_toolkit_builder,
17+
# VLLM_WHEEL_SRC=vllm_wheel_build|vllm_wheel_none
1718
# TRT-LLM stages are not present in this Dockerfile.
1819
ARG FW_DEP_BUILDER
1920
ARG FW_BASE_FINAL
21+
ARG VLLM_WHEEL_SRC=vllm_wheel_build
2022

2123
ARG NEMO_FW_BASE_IMAGE
2224
FROM ${NEMO_FW_BASE_IMAGE} AS base
@@ -31,7 +33,7 @@ ENV NVIDIA_PRODUCT_NAME="NeMo Framework" \
3133
##
3234
##############################################################################
3335

34-
FROM base AS vllm_wheel
36+
FROM base AS vllm_wheel_build
3537

3638
ARG VLLM_VERSION=v0.14.1
3739
ARG MAX_JOBS=4
@@ -47,6 +49,13 @@ RUN mkdir -p /src/vllm && \
4749
pip install -r requirements/build/cuda.txt && \
4850
pip wheel --no-deps --no-build-isolation -v .
4951

52+
# /src/vllm must exist for the install step's bind mount.
53+
FROM base AS vllm_wheel_none
54+
55+
RUN mkdir -p /src/vllm
56+
57+
FROM ${VLLM_WHEEL_SRC} AS vllm_wheel
58+
5059
##############################################################################
5160
##
5261
## Top layer of FW_BASE container
@@ -127,10 +136,14 @@ RUN --mount=type=bind,source=docker/common/install_nsys.sh,target=/opt/install_n
127136
# Copy Wheels
128137
RUN --mount=type=bind,from=vllm_wheel,source=/src/vllm/,target=/tmp/vllm/ \
129138
--mount=type=bind,source=docker/patches/vllm.patch,target=/opt/vllm.patch \
139+
if ! compgen -G "/tmp/vllm/vllm*.whl" >/dev/null; then \
140+
echo "No vLLM wheel produced; skipping vLLM install."; \
141+
else \
130142
pip install /tmp/vllm/vllm*.whl && \
131143
pushd /usr/local/lib/python3.12/dist-packages/vllm && \
132144
patch -p1 < /opt/vllm.patch && \
133-
popd
145+
popd; \
146+
fi
134147

135148
##############################################################################
136149
##

docker/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ docker build \
132132
| `FW_BASE_FINAL` | Output stage. `trtllm_install` (with TRT-LLM) or `fw_toolkit_builder` (without) |
133133
| `UV_VERSION` | uv version to install |
134134
| `VLLM_VERSION` | vLLM git tag to build |
135+
| `VLLM_WHEEL_SRC` | Stage supplying the vLLM wheel. `vllm_wheel_build` (default) builds it from source; `vllm_wheel_none` skips both the build and the install |
135136
| `TRT_LLM_COMMIT` | TensorRT-LLM git commit or tag |
136137
| `TRT_LLM_VERSION` | TensorRT-LLM version string embedded as an image environment variable |
137138
| `TRT_VER` | TensorRT version for the TRT-LLM install scripts |

docs/bridge-rl-integration.md

Lines changed: 30 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -76,24 +76,46 @@ Translate your RL framework config into Megatron Bridge's `ConfigContainer` for
7676

7777
```python
7878
import torch
79+
from megatron.bridge import AutoBridge
7980
from megatron.bridge.training.config import (
8081
ConfigContainer,
8182
TrainingConfig,
8283
OptimizerConfig,
8384
SchedulerConfig,
8485
DistributedDataParallelConfig,
8586
CheckpointConfig,
87+
LoggerConfig,
8688
TokenizerConfig,
8789
)
8890
from nemo_rl.models.policy import PolicyConfig # or your own policy cfg type
8991

9092
# Example: map your RL config to Megatron config
9193
def build_megatron_config(rl_cfg: PolicyConfig, pretrained_ckpt_dir: str) -> ConfigContainer:
92-
model_cfg = rl_cfg["megatron_cfg"].copy()
94+
bridge = AutoBridge.from_hf_pretrained(rl_cfg["model_name"])
95+
model_cfg = bridge.to_megatron_provider(load_weights=False)
96+
97+
# Keep framework-owned optimizer/scheduler/DDP mappings out of the model
98+
# provider. Apply only provider fields, with Bridge validating each name.
99+
provider_fields = (
100+
"tensor_model_parallel_size",
101+
"pipeline_model_parallel_size",
102+
"context_parallel_size",
103+
"expert_model_parallel_size",
104+
"expert_tensor_parallel_size",
105+
"sequence_parallel",
106+
"recompute_granularity",
107+
"recompute_method",
108+
"recompute_num_layers",
109+
)
110+
model_overrides = {name: rl_cfg["megatron_cfg"][name] for name in provider_fields if name in rl_cfg["megatron_cfg"]}
111+
93112
# Precision
94-
dtype = rl_cfg["precision"]
95-
model_cfg["bf16"] = dtype == "bfloat16"
96-
model_cfg["fp16"] = dtype == "float16"
113+
dtype = {
114+
"float32": torch.float32,
115+
"bfloat16": torch.bfloat16,
116+
"float16": torch.float16,
117+
}[rl_cfg["precision"]]
118+
model_cfg.apply_overrides_and_finalize(dtype=dtype, overrides=model_overrides)
97119

98120
checkpoint = CheckpointConfig(
99121
save_interval=100,
@@ -130,17 +152,19 @@ def build_megatron_config(rl_cfg: PolicyConfig, pretrained_ckpt_dir: str) -> Con
130152
tokenizer_model=rl_cfg["model_name"],
131153
)
132154

133-
return ConfigContainer(
155+
cfg = ConfigContainer(
134156
model=model_cfg,
135157
checkpoint=checkpoint,
136-
logger=None,
158+
logger=LoggerConfig(),
137159
train=train,
138160
optimizer=opt,
139161
ddp=ddp,
140162
scheduler=sch,
141163
dataset=None,
142164
tokenizer=tokenizer,
143165
)
166+
cfg.validate()
167+
return cfg
144168
```
145169

146170
Initialize Megatron-Core using a helper similar to `setup_megatron_model` from NeMo-RL:

0 commit comments

Comments
 (0)