Skip to content

Commit 9f45ebb

Browse files
authored
Merge branch 'main' into yuya/fix-mimo-terminal-validation
2 parents 2aea767 + c30562d commit 9f45ebb

126 files changed

Lines changed: 8399 additions & 1138 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-
02fec4b9a193b2f62c7cfaae0d17db282a8fafe6
1+
4a4de865795f123eda422ebf0a4c13d2418cf3cb

‎.main.commit‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
c9b53d0a87cb926f47115259593ecfeb351ca29f
1+
f6c33bde4cdc10805ee7157db746d47b758f5f02

‎3rdparty/Megatron-LM‎

Submodule Megatron-LM updated 338 files

‎README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ Megatron Bridge provides out-of-the-box bridges and training recipes for a wide
235235
| **Ernie** | [Ernie 4.5 MoE](https://github.com/NVIDIA-NeMo/Megatron-Bridge/tree/main/src/megatron/bridge/models/ernie), [Ernie 4.5 VL MoE](https://github.com/NVIDIA-NeMo/Megatron-Bridge/tree/main/src/megatron/bridge/models/ernie_vl) |
236236
| [**Falcon**](docs/models/falcon/index.md) | Falcon H1 |
237237
| [**Gemma**](docs/models/gemma/index.md) | Gemma / Gemma 2 (deprecated), Gemma 3, Gemma 3-VL, Gemma 4 (26B-A4B MoE / 31B dense), Gemma 4-VL (26B-A4B MoE) |
238-
| [**GLM**](docs/models/glm/index.md) | GLM-4.5 / GLM-4.7 / GLM-4.7-Flash, GLM-4.5V, GLM-5 / GLM-5.1 / GLM-5.2 |
238+
| [**GLM**](docs/models/glm/index.md) | GLM-4.5 / GLM-4.7 / GLM-4.7-Flash, GLM-4.5V, GLM-5 / GLM-5.1 / GLM-5.2 / [GLM-5.3](docs/models/glm/glm5-2.md) |
239239
| [**GPT-OSS**](docs/models/gpt_oss/index.md) | GPT-oss |
240240
| [**HY V3**](https://huggingface.co/tencent/Hy3-preview-Base) | Hy3 preview-Base (HF → Megatron checkpoint conversion) |
241241
| [**Kimi**](docs/models/kimi/index.md) | Kimi K2, Kimi-K2.5-VL |

‎docker/Dockerfile.ci‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ finally:
4545
PY
4646

4747
ARG INSTALL_DEEPEP=True
48-
ARG DEEPEP_COMMIT=34152ae28f80bcc3ee38d7a12cb2ad87cfd4ea72
48+
ARG DEEPEP_COMMIT=10d4dd7377d5bce900fbb4b80cce863764892b95
4949
ARG REINSTALL_NVSHMEM=True
5050

5151
ENV PATH="/opt/venv/bin:/usr/local/bin:$PATH" \

‎docker/Dockerfile.fw_final‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ RUN pip install "fastapi==0.139.1" \
9393
"jupyterlab>=4.5.10" \
9494
"jupyter-server>=2.20.0" \
9595
"mistune>=3.3.0" \
96-
"GitPython>=3.1.55" && \
96+
"GitPython>=3.1.62,<4" && \
9797
# Address CVE from transitive dependency
9898
pip uninstall -y opencv-python-headless nvidia-dali-cuda130
9999

‎docker/common/fw_pyproject.toml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ override-dependencies = [
114114
"nvidia-modelopt; sys_platform == 'never'", # Installed by MBridge
115115
"setuptools>=82.0.0", # Required by vllm
116116
"open-clip-torch>=3.2.0", # Required by megatron-bridge, override nemo-toolkit's 2.24.0 constraint
117+
"hydra-core>=1.3.4,<1.4", # CVE-2026-68508
117118
"lilcom!=1.8.2",
118119
"cryptography>=48.0.1,<49", # Required by megatron-bridge, override nemo-run's constraint
119120
"opencv-python; sys_platform == 'never'", # Use the dependency from the base pytorch container

‎docker/patches/deepep.patch‎

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,21 @@
11
diff --git a/setup.py b/setup.py
2-
index 63ce332..4e13462 100644
2+
index d30d25e..941c96d 100644
33
--- a/setup.py
44
+++ b/setup.py
5-
@@ -37,7 +37,7 @@ if __name__ == '__main__':
5+
@@ -52,7 +52,6 @@ def get_extension_hybrid_ep_cpp():
6+
# Basic compile arguments
7+
compile_args = {
8+
"nvcc": [
9+
- "-std=c++17",
10+
"-Xcompiler",
11+
"-fPIC",
12+
"--expt-relaxed-constexpr",
13+
@@ -191,7 +190,7 @@ def get_extension_deep_ep_cpp():
614
'-Wno-sign-compare', '-Wno-reorder', '-Wno-attributes']
715
nvcc_flags = ['-O3', '-Xcompiler', '-O3']
816
sources = ['csrc/deep_ep.cpp', 'csrc/kernels/runtime.cu', 'csrc/kernels/layout.cu', 'csrc/kernels/intranode.cu']
917
- include_dirs = ['csrc/']
1018
+ include_dirs = ['csrc/', '/usr/local/cuda/include/cccl/']
1119
library_dirs = []
1220
nvcc_dlink = []
13-
extra_link_args = []
21+
extra_link_args = ['-lcuda']

‎docs/fern/versions/nightly/pages/models/glm/glm5-2.mdx‎

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,37 @@
11
# GLM-5.2
22

3-
[GLM-5](https://huggingface.co/zai-org/GLM-5), [GLM-5.1](https://huggingface.co/zai-org/GLM-5.1), and [GLM-5.2](https://huggingface.co/zai-org/GLM-5.2) are large sparse MoE language models with Multi-Latent Attention and Dynamic Sparse Attention. Megatron Bridge supports these checkpoints through the shared `GLM5Bridge`.
3+
[GLM-5](https://huggingface.co/zai-org/GLM-5), [GLM-5.1](https://huggingface.co/zai-org/GLM-5.1), [GLM-5.2](https://huggingface.co/zai-org/GLM-5.2), and [GLM-5.3](https://huggingface.co/zai-org/GLM-5.3) use the shared `GLM5Bridge` for their MoE, Multi-Latent Attention, and Dynamic Sparse Attention architecture. GLM-5.3 shares GLM-5.2's architecture and import mappings; full-model GLM-5.3 verification remains pending.
4+
5+
6+
## GLM-5.2 / GLM-5.3 compatibility
7+
8+
The pinned publisher configs for [GLM-5.2](https://huggingface.co/zai-org/GLM-5.2/blob/cf457fa734ab149ffef225f80893eb38c6ff5cdc/config.json) and [GLM-5.3](https://huggingface.co/zai-org/GLM-5.3/blob/aca966e4e02791568aa6a4ced368624b3d897f42/config.json) have identical architecture fields: 78 decoder layers, 256 routed experts with top-8 routing, MLA, and the same DSA IndexShare pattern. All 59,585 base checkpoint tensor names and shapes also match. AutoBridge resolves both to `GlmMoeDsaForCausalLM` and `GLM5Bridge`; no separate provider is needed. **GLM-5.3-Flash is a different architecture and is outside this support statement.**
9+
10+
The checkpoints have important differences:
11+
12+
- **Precision:** GLM-5.2 stores BF16 weights (plus FP32 router biases). GLM-5.3 stores 59,044 weights as E4M3 FP8 with FP32 scales per 128×128 block. The existing GLM bridge dequantizes these weights to BF16 on import. This is distinct from enabling FP8 training.
13+
- **Config metadata:** GLM-5.3 adds `quantization_config` and records Transformers 5.15.0 instead of 5.12.0. Use the repository's supported dependency versions.
14+
- **Tokenizer and generation defaults:** `tokenizer.json`, `tokenizer_config.json`, and `generation_config.json` are identical at those revisions, including token IDs and sampling defaults.
15+
- **Chat formatting:** GLM-5.3's template adds low reasoning effort, retains historical reasoning by default, always opens a thinking response (it does not honor `enable_thinking=False`), and changes structured tool-result handling and ordering. Load the template from the GLM-5.3 checkpoint; do not substitute GLM-5.2's template.
16+
17+
For config/provider loading without weights:
18+
19+
```python
20+
from megatron.bridge import AutoBridge
21+
22+
bridge = AutoBridge.from_hf_pretrained(
23+
"zai-org/GLM-5.3", revision="aca966e4e02791568aa6a4ced368624b3d897f42" # pragma: allowlist secret (public HF revision)
24+
)
25+
provider = bridge.to_megatron_provider(load_weights=False)
26+
```
27+
28+
For **BF16 export** using the FP8 source as the reference, explicitly select `--export-weight-dtype bfloat16` with the GPU or distributed-CPU conversion backend (API: `weight_dtype=torch.bfloat16`). This removes FP8 scale tensors from strict source-key validation and writes a BF16 artifact rather than claiming a bitwise FP8 round trip. The serial-CPU backend does not support this option. MTP is disabled by default; the appended MTP layer is outside that default inference graph.
29+
30+
### Verification limits
31+
32+
The recorded commands and results below belong to the checkpoint named in each verification card. GLM-5.2 results do **not** establish GLM-5.3 full-checkpoint conversion/export, forward parity, generation, SFT/PEFT, resume, long-context behavior, or performance. Those GLM-5.3 checks remain unverified. The `glm52_*` recipes are pinned to GLM-5.2 and retain that name and attribution; changing only their display name would not select GLM-5.3 weights or its chat template.
33+
34+
[Production qualification tracker #5476](https://github.com/NVIDIA-NeMo/Megatron-Bridge/issues/5476) remains open. It includes repeated-MTP training semantics, precision controls, dynamic context parallelism, production recipes, checkpoint continuity, convergence, and hardware-specific performance qualification. See also the open [export context-length fix #5996](https://github.com/NVIDIA-NeMo/Megatron-Bridge/pull/5996), [router-bias fix #6036](https://github.com/NVIDIA-NeMo/Megatron-Bridge/pull/6036), and [recipe-selection fix #5608](https://github.com/NVIDIA-NeMo/Megatron-Bridge/pull/5608).
435

536
<!-- BEGIN GENERATED VERIFIED CONFIGURATIONS -->
637

‎docs/fern/versions/nightly/pages/models/glm/glm5.mdx‎

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,37 @@
11
# GLM-5
22

3-
[GLM-5](https://huggingface.co/zai-org/GLM-5), [GLM-5.1](https://huggingface.co/zai-org/GLM-5.1), and [GLM-5.2](https://huggingface.co/zai-org/GLM-5.2) are large sparse MoE language models with Multi-Latent Attention and Dynamic Sparse Attention. Megatron Bridge supports these checkpoints through the shared `GLM5Bridge`.
3+
[GLM-5](https://huggingface.co/zai-org/GLM-5), [GLM-5.1](https://huggingface.co/zai-org/GLM-5.1), [GLM-5.2](https://huggingface.co/zai-org/GLM-5.2), and [GLM-5.3](https://huggingface.co/zai-org/GLM-5.3) use the shared `GLM5Bridge` for their MoE, Multi-Latent Attention, and Dynamic Sparse Attention architecture. GLM-5.3 shares GLM-5.2's architecture and import mappings; full-model GLM-5.3 verification remains pending.
4+
5+
6+
## GLM-5.2 / GLM-5.3 compatibility
7+
8+
The pinned publisher configs for [GLM-5.2](https://huggingface.co/zai-org/GLM-5.2/blob/cf457fa734ab149ffef225f80893eb38c6ff5cdc/config.json) and [GLM-5.3](https://huggingface.co/zai-org/GLM-5.3/blob/aca966e4e02791568aa6a4ced368624b3d897f42/config.json) have identical architecture fields: 78 decoder layers, 256 routed experts with top-8 routing, MLA, and the same DSA IndexShare pattern. All 59,585 base checkpoint tensor names and shapes also match. AutoBridge resolves both to `GlmMoeDsaForCausalLM` and `GLM5Bridge`; no separate provider is needed. **GLM-5.3-Flash is a different architecture and is outside this support statement.**
9+
10+
The checkpoints have important differences:
11+
12+
- **Precision:** GLM-5.2 stores BF16 weights (plus FP32 router biases). GLM-5.3 stores 59,044 weights as E4M3 FP8 with FP32 scales per 128×128 block. The existing GLM bridge dequantizes these weights to BF16 on import. This is distinct from enabling FP8 training.
13+
- **Config metadata:** GLM-5.3 adds `quantization_config` and records Transformers 5.15.0 instead of 5.12.0. Use the repository's supported dependency versions.
14+
- **Tokenizer and generation defaults:** `tokenizer.json`, `tokenizer_config.json`, and `generation_config.json` are identical at those revisions, including token IDs and sampling defaults.
15+
- **Chat formatting:** GLM-5.3's template adds low reasoning effort, retains historical reasoning by default, always opens a thinking response (it does not honor `enable_thinking=False`), and changes structured tool-result handling and ordering. Load the template from the GLM-5.3 checkpoint; do not substitute GLM-5.2's template.
16+
17+
For config/provider loading without weights:
18+
19+
```python
20+
from megatron.bridge import AutoBridge
21+
22+
bridge = AutoBridge.from_hf_pretrained(
23+
"zai-org/GLM-5.3", revision="aca966e4e02791568aa6a4ced368624b3d897f42" # pragma: allowlist secret (public HF revision)
24+
)
25+
provider = bridge.to_megatron_provider(load_weights=False)
26+
```
27+
28+
For **BF16 export** using the FP8 source as the reference, explicitly select `--export-weight-dtype bfloat16` with the GPU or distributed-CPU conversion backend (API: `weight_dtype=torch.bfloat16`). This removes FP8 scale tensors from strict source-key validation and writes a BF16 artifact rather than claiming a bitwise FP8 round trip. The serial-CPU backend does not support this option. MTP is disabled by default; the appended MTP layer is outside that default inference graph.
29+
30+
### Verification limits
31+
32+
The recorded commands and results below belong to the checkpoint named in each verification card. GLM-5.2 results do **not** establish GLM-5.3 full-checkpoint conversion/export, forward parity, generation, SFT/PEFT, resume, long-context behavior, or performance. Those GLM-5.3 checks remain unverified. The `glm52_*` recipes are pinned to GLM-5.2 and retain that name and attribution; changing only their display name would not select GLM-5.3 weights or its chat template.
33+
34+
[Production qualification tracker #5476](https://github.com/NVIDIA-NeMo/Megatron-Bridge/issues/5476) remains open. It includes repeated-MTP training semantics, precision controls, dynamic context parallelism, production recipes, checkpoint continuity, convergence, and hardware-specific performance qualification. See also the open [export context-length fix #5996](https://github.com/NVIDIA-NeMo/Megatron-Bridge/pull/5996), [router-bias fix #6036](https://github.com/NVIDIA-NeMo/Megatron-Bridge/pull/6036), and [recipe-selection fix #5608](https://github.com/NVIDIA-NeMo/Megatron-Bridge/pull/5608).
435

536
<!-- BEGIN GENERATED VERIFIED CONFIGURATIONS -->
637

0 commit comments

Comments
 (0)