Skip to content

Commit 056b78e

Browse files
docs(model): verify GLM-5.2 CPU export as a distributed export (#6292)
Signed-off-by: Kamran Jafari <kjafarisadeg@nvidia.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
1 parent cdf0a4d commit 056b78e

4 files changed

Lines changed: 73 additions & 36 deletions

File tree

‎docs/_static/model-verification/catalog-v1.json‎

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11139,21 +11139,23 @@
1113911139
"bridge_commit": "8645cda8738cbb87b8b998ad2d09341eef2510c7",
1114011140
"entries": [
1114111141
{
11142-
"bridge_commit": "8645cda8738cbb87b8b998ad2d09341eef2510c7",
11142+
"bridge_commit": "4566ea87f76c51eeae6c4a1467aed13db2899319",
1114311143
"command_topologies": [
1114411144
{
11145-
"nodes": "1"
11145+
"gpus_per_node": "1",
11146+
"nodes": "1",
11147+
"total_gpus": 1
1114611148
}
1114711149
],
1114811150
"commands": [
11149-
"./scripts/conversion/convert.sh import --executor slurm --device cpu --nodes 1 --hf-model zai-org/GLM-5.2 --hf-revision 4d67f66cc64d3219133b767c253b2ad1425c6c88 --megatron-path work/model-verification/glm5-2/cpu-megatron --torch-dtype bfloat16"
11151+
"./scripts/conversion/convert.sh import --executor slurm --device cpu --nodes 1 --gpus-per-node 1 --hf-model zai-org/GLM-5.2 --hf-revision 4d67f66cc64d3219133b767c253b2ad1425c6c88 --megatron-path work/model-verification/glm5-2/cpu-megatron --torch-dtype bfloat16"
1115011152
],
1115111153
"dimensions": {},
1115211154
"enabled_features": {},
1115311155
"entry_id": "glm5-2-hf-to-megatron-cpu",
11154-
"expected_result": "Import exits successfully and creates a reloadable CPU checkpoint. Its strict round-trip comparison matches all 59,585 BF16 tensors and 753,329,940,480 elements bitwise against the immutable HF revision.\n",
11156+
"expected_result": "Import exits successfully at about 1.4 TiB peak process RSS and creates a reloadable CPU checkpoint. Weights stay on CPU, but one GPU must be visible because the DSA indexer builds its rotary embedding on a CUDA device. The 791 tensors under model.layers.78 belong only to the intentionally disabled appended MTP auxiliary layer and are not imported; the CPU export of this checkpoint matches the remaining 58,794 tensors and 743,377,019,904 elements bitwise against the immutable HF revision. Verified in a NeMo Framework 26.10 release-candidate container, not the card's base container, with its bundled, unmodified Bridge.\n",
1115511157
"hardware": null,
11156-
"last_verified": "2026-07-22",
11158+
"last_verified": "2026-10-02",
1115711159
"metrics": {},
1115811160
"precision": "bf16",
1115911161
"source_pointer": "items.hf_to_megatron_cpu",
@@ -11191,21 +11193,25 @@
1119111193
"workflow": "hf_to_megatron_gpu"
1119211194
},
1119311195
{
11194-
"bridge_commit": "8645cda8738cbb87b8b998ad2d09341eef2510c7",
11196+
"bridge_commit": "4566ea87f76c51eeae6c4a1467aed13db2899319",
1119511197
"command_topologies": [
1119611198
{
11197-
"nodes": "1"
11199+
"expert_parallel": "32",
11200+
"expert_tensor_parallel": "1",
11201+
"nodes": "4",
11202+
"pipeline_parallel": "1",
11203+
"tensor_parallel": "1"
1119811204
}
1119911205
],
1120011206
"commands": [
11201-
"./scripts/conversion/convert.sh export --executor slurm --device cpu --nodes 1 --hf-model zai-org/GLM-5.2 --hf-revision 4d67f66cc64d3219133b767c253b2ad1425c6c88 --megatron-path work/model-verification/glm5-2/cpu-megatron --hf-path work/model-verification/glm5-2/cpu-hf-export --torch-dtype bfloat16"
11207+
"./scripts/conversion/convert.sh export --executor slurm --device cpu --nodes 4 --cpu-processes-per-node 8 --cpus-per-task 16 --mem 0 --exclusive --hf-model zai-org/GLM-5.2 --hf-revision 4d67f66cc64d3219133b767c253b2ad1425c6c88 --megatron-path work/model-verification/glm5-2/cpu-megatron --hf-path work/model-verification/glm5-2/cpu-hf-export --torch-dtype bfloat16 --tp 1 --pp 1 --ep 32 --etp 1 --distributed-timeout-minutes 240 --distributed-save --save-every-n-ranks 1 --no-progress"
1120211208
],
1120311209
"dimensions": {},
1120411210
"enabled_features": {},
1120511211
"entry_id": "glm5-2-megatron-to-hf-cpu",
11206-
"expected_result": "Export exits successfully; all 59,585 BF16 tensors and 753,329,940,480 elements match the immutable HF revision bitwise. Transformers 5.12.1 strictly reloads the output as GlmMoeDsaForCausalLM with 743,377,000,704 parameters.\n",
11212+
"expected_result": "The 32-process distributed CPU export exits successfully and writes 280 safetensors shards at about 0.9 TiB peak summed process RSS per node. All 58,794 exported tensors (58,719 BF16 and 75 FP32) and 743,377,019,904 elements match the immutable HF revision bitwise. The 791 tensors under model.layers.78 belong only to the intentionally disabled appended MTP auxiliary layer and remain outside this item. Transformers 5.15.0 strictly reloads the output as GlmMoeDsaForCausalLM with 743,377,000,704 parameters and no loading discrepancies. config.json is regenerated from the checkpoint; as loaded by Transformers it matches the reference except num_nextn_predict_layers, which is null because the MTP layer is not exported. generation_config.json, tokenizer.json, and chat_template.jinja are identical. A single-process export is OOM-killed above 1.9 TiB on 2 TB nodes, so EP32 splits the routed experts across 32 processes and each process keeps a full copy of the non-expert weights. PP stays 1 because convert.sh creates only uniform pipeline splits, and no uniform split of the 78 layers starts every stage on a layer that computes DSA top-k indices. The distributed CPU launcher requests no GPUs, but the exclusive nodes must expose one, because the DSA indexer builds its rotary embedding on a CUDA device. Verified in a NeMo Framework 26.10 release-candidate container, not the card's base container, with its bundled, unmodified Bridge.\n",
1120711213
"hardware": null,
11208-
"last_verified": "2026-07-22",
11214+
"last_verified": "2026-10-02",
1120911215
"metrics": {},
1121011216
"precision": "bf16",
1121111217
"source_pointer": "items.megatron_to_hf_cpu",
@@ -11704,7 +11710,7 @@
1170411710
"min_transformers_version": "5.12.1",
1170511711
"slug": "glm5-2",
1170611712
"source_card": "examples/model_verification_cards/glm5-2/card.yaml",
11707-
"summary": "Performance disclaimer: this card does not record a canonical pretrain performance result; reported timing and throughput metrics are functional verification observations, not standalone optimized performance results. GLM-5.2 H100 support verification currently covers exact GPU checkpoint round-trip on CPU and GPU, HF-to-Megatron forward equivalence, bounded full SFT with export/reload inference, 200K-context CP32 SFT, bounded PEFT, and bounded pretraining with a reloadable middle checkpoint and verified continuation. GB200 support verification currently covers bounded warm-start pretraining, bounded full SFT, 128K packed long-context SFT, bounded PEFT, bounded checkpoint resume, and deterministic legacy Megatron inference; post-SFT export/reload inference remains pending.\n",
11713+
"summary": "Performance disclaimer: this card does not record a canonical pretrain performance result; reported timing and throughput metrics are functional verification observations, not standalone optimized performance results. GLM-5.2 H100 support verification currently covers exact GPU checkpoint round-trip on CPU and GPU (the CPU path excludes the disabled MTP layer), HF-to-Megatron forward equivalence, bounded full SFT with export/reload inference, 200K-context CP32 SFT, bounded PEFT, and bounded pretraining with a reloadable middle checkpoint and verified continuation. GB200 support verification currently covers bounded warm-start pretraining, bounded full SFT, 128K packed long-context SFT, bounded PEFT, bounded checkpoint resume, and deterministic legacy Megatron inference; post-SFT export/reload inference remains pending.\n",
1170811714
"title": "glm5_2"
1170911715
}
1171011716
],

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ Choose a workflow, precision, and exact recorded combination. The command and ex
166166
<dl class="verification-model-detail-meta">
167167
<div><dt>Hardware</dt><dd>not specified</dd></div>
168168
<div><dt>Precision</dt><dd>BF16</dd></div>
169-
<div><dt>Last verified</dt><dd>2026-07-22</dd></div>
169+
<div><dt>Last verified</dt><dd>2026-10-02</dd></div>
170170
</dl>
171171
<section class="verification-command-section">
172172
<h5>Exact command</h5>
@@ -175,12 +175,12 @@ Choose a workflow, precision, and exact recorded combination. The command and ex
175175
<span>Command</span>
176176
<button type="button" class="verification-copy-command">Copy</button>
177177
</div>
178-
<pre><code class="language-bash">./scripts/conversion/convert.sh import --executor slurm --device cpu --nodes 1 --hf-model zai-org/GLM-5.2 --hf-revision 4d67f66cc64d3219133b767c253b2ad1425c6c88 --megatron-path work/model-verification/glm5-2/cpu-megatron --torch-dtype bfloat16</code></pre>
178+
<pre><code class="language-bash">./scripts/conversion/convert.sh import --executor slurm --device cpu --nodes 1 --gpus-per-node 1 --hf-model zai-org/GLM-5.2 --hf-revision 4d67f66cc64d3219133b767c253b2ad1425c6c88 --megatron-path work/model-verification/glm5-2/cpu-megatron --torch-dtype bfloat16</code></pre>
179179
</div>
180180
</section>
181181
<section class="verification-expected-result">
182182
<h5>Expected result</h5>
183-
<p>Import exits successfully and creates a reloadable CPU checkpoint. Its strict round-trip comparison matches all 59,585 BF16 tensors and 753,329,940,480 elements bitwise against the immutable HF revision.</p>
183+
<p>Import exits successfully at about 1.4 TiB peak process RSS and creates a reloadable CPU checkpoint. Weights stay on CPU, but one GPU must be visible because the DSA indexer builds its rotary embedding on a CUDA device. The 791 tensors under model.layers.78 belong only to the intentionally disabled appended MTP auxiliary layer and are not imported; the CPU export of this checkpoint matches the remaining 58,794 tensors and 743,377,019,904 elements bitwise against the immutable HF revision. Verified in a NeMo Framework 26.10 release-candidate container, not the card&#x27;s base container, with its bundled, unmodified Bridge.</p>
184184
</section>
185185
</article>
186186
<article id="glm5-2-hf-to-megatron-gpu" class="verification-model-detail" data-entry-detail="glm5-2-hf-to-megatron-gpu" tabindex="-1">
@@ -216,7 +216,7 @@ Choose a workflow, precision, and exact recorded combination. The command and ex
216216
<dl class="verification-model-detail-meta">
217217
<div><dt>Hardware</dt><dd>not specified</dd></div>
218218
<div><dt>Precision</dt><dd>BF16</dd></div>
219-
<div><dt>Last verified</dt><dd>2026-07-22</dd></div>
219+
<div><dt>Last verified</dt><dd>2026-10-02</dd></div>
220220
</dl>
221221
<section class="verification-command-section">
222222
<h5>Exact command</h5>
@@ -225,12 +225,12 @@ Choose a workflow, precision, and exact recorded combination. The command and ex
225225
<span>Command</span>
226226
<button type="button" class="verification-copy-command">Copy</button>
227227
</div>
228-
<pre><code class="language-bash">./scripts/conversion/convert.sh export --executor slurm --device cpu --nodes 1 --hf-model zai-org/GLM-5.2 --hf-revision 4d67f66cc64d3219133b767c253b2ad1425c6c88 --megatron-path work/model-verification/glm5-2/cpu-megatron --hf-path work/model-verification/glm5-2/cpu-hf-export --torch-dtype bfloat16</code></pre>
228+
<pre><code class="language-bash">./scripts/conversion/convert.sh export --executor slurm --device cpu --nodes 4 --cpu-processes-per-node 8 --cpus-per-task 16 --mem 0 --exclusive --hf-model zai-org/GLM-5.2 --hf-revision 4d67f66cc64d3219133b767c253b2ad1425c6c88 --megatron-path work/model-verification/glm5-2/cpu-megatron --hf-path work/model-verification/glm5-2/cpu-hf-export --torch-dtype bfloat16 --tp 1 --pp 1 --ep 32 --etp 1 --distributed-timeout-minutes 240 --distributed-save --save-every-n-ranks 1 --no-progress</code></pre>
229229
</div>
230230
</section>
231231
<section class="verification-expected-result">
232232
<h5>Expected result</h5>
233-
<p>Export exits successfully; all 59,585 BF16 tensors and 753,329,940,480 elements match the immutable HF revision bitwise. Transformers 5.12.1 strictly reloads the output as GlmMoeDsaForCausalLM with 743,377,000,704 parameters.</p>
233+
<p>The 32-process distributed CPU export exits successfully and writes 280 safetensors shards at about 0.9 TiB peak summed process RSS per node. All 58,794 exported tensors (58,719 BF16 and 75 FP32) and 743,377,019,904 elements match the immutable HF revision bitwise. The 791 tensors under model.layers.78 belong only to the intentionally disabled appended MTP auxiliary layer and remain outside this item. Transformers 5.15.0 strictly reloads the output as GlmMoeDsaForCausalLM with 743,377,000,704 parameters and no loading discrepancies. config.json is regenerated from the checkpoint; as loaded by Transformers it matches the reference except num_nextn_predict_layers, which is null because the MTP layer is not exported. generation_config.json, tokenizer.json, and chat_template.jinja are identical. A single-process export is OOM-killed above 1.9 TiB on 2 TB nodes, so EP32 splits the routed experts across 32 processes and each process keeps a full copy of the non-expert weights. PP stays 1 because convert.sh creates only uniform pipeline splits, and no uniform split of the 78 layers starts every stage on a layer that computes DSA top-k indices. The distributed CPU launcher requests no GPUs, but the exclusive nodes must expose one, because the DSA indexer builds its rotary embedding on a CUDA device. Verified in a NeMo Framework 26.10 release-candidate container, not the card&#x27;s base container, with its bundled, unmodified Bridge.</p>
234234
</section>
235235
</article>
236236
<article id="glm5-2-megatron-to-hf-gpu" class="verification-model-detail" data-entry-detail="glm5-2-megatron-to-hf-gpu" tabindex="-1">

‎docs/models/glm/glm5-2.md‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ Choose a workflow, precision, and exact recorded combination. The command and ex
166166
<dl class="verification-model-detail-meta">
167167
<div><dt>Hardware</dt><dd>not specified</dd></div>
168168
<div><dt>Precision</dt><dd>BF16</dd></div>
169-
<div><dt>Last verified</dt><dd>2026-07-22</dd></div>
169+
<div><dt>Last verified</dt><dd>2026-10-02</dd></div>
170170
</dl>
171171
<section class="verification-command-section">
172172
<h5>Exact command</h5>
@@ -175,12 +175,12 @@ Choose a workflow, precision, and exact recorded combination. The command and ex
175175
<span>Command</span>
176176
<button type="button" class="verification-copy-command">Copy</button>
177177
</div>
178-
<pre><code class="language-bash">./scripts/conversion/convert.sh import --executor slurm --device cpu --nodes 1 --hf-model zai-org/GLM-5.2 --hf-revision 4d67f66cc64d3219133b767c253b2ad1425c6c88 --megatron-path work/model-verification/glm5-2/cpu-megatron --torch-dtype bfloat16</code></pre>
178+
<pre><code class="language-bash">./scripts/conversion/convert.sh import --executor slurm --device cpu --nodes 1 --gpus-per-node 1 --hf-model zai-org/GLM-5.2 --hf-revision 4d67f66cc64d3219133b767c253b2ad1425c6c88 --megatron-path work/model-verification/glm5-2/cpu-megatron --torch-dtype bfloat16</code></pre>
179179
</div>
180180
</section>
181181
<section class="verification-expected-result">
182182
<h5>Expected result</h5>
183-
<p>Import exits successfully and creates a reloadable CPU checkpoint. Its strict round-trip comparison matches all 59,585 BF16 tensors and 753,329,940,480 elements bitwise against the immutable HF revision.
183+
<p>Import exits successfully at about 1.4 TiB peak process RSS and creates a reloadable CPU checkpoint. Weights stay on CPU, but one GPU must be visible because the DSA indexer builds its rotary embedding on a CUDA device. The 791 tensors under model.layers.78 belong only to the intentionally disabled appended MTP auxiliary layer and are not imported; the CPU export of this checkpoint matches the remaining 58,794 tensors and 743,377,019,904 elements bitwise against the immutable HF revision. Verified in a NeMo Framework 26.10 release-candidate container, not the card&#x27;s base container, with its bundled, unmodified Bridge.
184184
</p>
185185
</section>
186186
</article>
@@ -218,7 +218,7 @@ Choose a workflow, precision, and exact recorded combination. The command and ex
218218
<dl class="verification-model-detail-meta">
219219
<div><dt>Hardware</dt><dd>not specified</dd></div>
220220
<div><dt>Precision</dt><dd>BF16</dd></div>
221-
<div><dt>Last verified</dt><dd>2026-07-22</dd></div>
221+
<div><dt>Last verified</dt><dd>2026-10-02</dd></div>
222222
</dl>
223223
<section class="verification-command-section">
224224
<h5>Exact command</h5>
@@ -227,12 +227,12 @@ Choose a workflow, precision, and exact recorded combination. The command and ex
227227
<span>Command</span>
228228
<button type="button" class="verification-copy-command">Copy</button>
229229
</div>
230-
<pre><code class="language-bash">./scripts/conversion/convert.sh export --executor slurm --device cpu --nodes 1 --hf-model zai-org/GLM-5.2 --hf-revision 4d67f66cc64d3219133b767c253b2ad1425c6c88 --megatron-path work/model-verification/glm5-2/cpu-megatron --hf-path work/model-verification/glm5-2/cpu-hf-export --torch-dtype bfloat16</code></pre>
230+
<pre><code class="language-bash">./scripts/conversion/convert.sh export --executor slurm --device cpu --nodes 4 --cpu-processes-per-node 8 --cpus-per-task 16 --mem 0 --exclusive --hf-model zai-org/GLM-5.2 --hf-revision 4d67f66cc64d3219133b767c253b2ad1425c6c88 --megatron-path work/model-verification/glm5-2/cpu-megatron --hf-path work/model-verification/glm5-2/cpu-hf-export --torch-dtype bfloat16 --tp 1 --pp 1 --ep 32 --etp 1 --distributed-timeout-minutes 240 --distributed-save --save-every-n-ranks 1 --no-progress</code></pre>
231231
</div>
232232
</section>
233233
<section class="verification-expected-result">
234234
<h5>Expected result</h5>
235-
<p>Export exits successfully; all 59,585 BF16 tensors and 753,329,940,480 elements match the immutable HF revision bitwise. Transformers 5.12.1 strictly reloads the output as GlmMoeDsaForCausalLM with 743,377,000,704 parameters.
235+
<p>The 32-process distributed CPU export exits successfully and writes 280 safetensors shards at about 0.9 TiB peak summed process RSS per node. All 58,794 exported tensors (58,719 BF16 and 75 FP32) and 743,377,019,904 elements match the immutable HF revision bitwise. The 791 tensors under model.layers.78 belong only to the intentionally disabled appended MTP auxiliary layer and remain outside this item. Transformers 5.15.0 strictly reloads the output as GlmMoeDsaForCausalLM with 743,377,000,704 parameters and no loading discrepancies. config.json is regenerated from the checkpoint; as loaded by Transformers it matches the reference except num_nextn_predict_layers, which is null because the MTP layer is not exported. generation_config.json, tokenizer.json, and chat_template.jinja are identical. A single-process export is OOM-killed above 1.9 TiB on 2 TB nodes, so EP32 splits the routed experts across 32 processes and each process keeps a full copy of the non-expert weights. PP stays 1 because convert.sh creates only uniform pipeline splits, and no uniform split of the 78 layers starts every stage on a layer that computes DSA top-k indices. The distributed CPU launcher requests no GPUs, but the exclusive nodes must expose one, because the DSA indexer builds its rotary embedding on a CUDA device. Verified in a NeMo Framework 26.10 release-candidate container, not the card&#x27;s base container, with its bundled, unmodified Bridge.
236236
</p>
237237
</section>
238238
</article>

0 commit comments

Comments
 (0)