Skip to content

feat(deepseek-v41): add H100-80GB recipes, Tulu3 data preparation, and coverage notes - #3962

Open
linmuchuiyang wants to merge 1 commit into
NVIDIA-NeMo:mainfrom
linmuchuiyang:feat/deepseek-v41-h100-recipes
Open

linmuchuiyang wants to merge 1 commit into
NVIDIA-NeMo:mainfrom
linmuchuiyang:feat/deepseek-v41-h100-recipes

Conversation

@linmuchuiyang

Copy link
Copy Markdown

What does this PR do?

Follow-up to #3960 (H100 guidance requested by @HuiyingLi). Adds four DeepSeek-V4.1-Flash recipes validated on 8-GPU H100-80GB nodes, a Tulu3 data-preparation script, and an H100 section on the model-coverage page.

Recipe Nodes × GPUs Topology GBS / microbatches Peak Result (100 updates)
deepseek_v41_flash_hellaswag_ep64_h100_16nodes.yaml 16 × 8 EP64, ep_shard2, owner128 128 / 1 58.4 GiB train 1.8185, val 1.9800 (GB200: 1.8177 / 2.0173)
deepseek_v41_flash_hellaswag_lora_h100_8nodes.yaml 8 × 8 EP32, ep_shard2, owner64 64 / 1 43.9 GiB train 2.2655, val 2.5737
deepseek_v41_flash_tulu3_cp8_h100_32nodes.yaml 32 × 8 EP64, ep_shard4, CP8 64 / 2 65.7 GiB val 0.5541 / 0.5444 (CP1 ref: 0.5477 / 0.5384)
deepseek_v41_flash_tulu3_packed_cp8_32k_h100_64nodes.yaml 64 × 8 EP64, ep_shard8, CP8 64 / 1 62.5 GiB val 0.5853 / 0.5778; ckpt 8.2 TB

Every recipe body is the GB200 recipe with only the keys listed in its header changed (topology-driven global_batch_size, defer_fsdp_grad_sync: false where gradient accumulation is required on 80 GB parts, and moe.reshard_after_forward: false as the interim work-around for #3958 until #3961 lands). ci: blocks are omitted because the runs need 16–64 eight-GPU nodes.

prepare_tulu3_data.py produces the DS41_DATA_ROOT Arrow layouts the Tulu3 recipes describe in their headers (4096-token padding=max_length rows, and prepacked 32k THD packs via pack_dataset(..., cp_size=1, pad_to_multiple_of=2)), using the existing ChatDataset, tokenize_dataset_parallel and pack_dataset helpers.

The coverage page gains an "H100 80 GB Systems" section: recipe table, the data-prep entry point, NCCL_PXN_DISABLE=1 on multi-node InfiniBand (#3959), the memory behaviour of defer_fsdp_grad_sync, node-local JIT caches, and the checkpoint size/restore note for the packed recipe.

Environment: NGC nemo-automodel:26.08 + this repo at e2c47c5b, torch 2.13, NCCL 2.30.5, Slurm/pyxis, 16–64 nodes of 8 × H100-80GB with InfiniBand.

Closes #3960

Checklist

  • Recipes follow the existing header/license format and keep the GB200 recipes untouched
  • Python file passes ruff check
  • DCO sign-off

🤖 Generated with Claude Code

@linmuchuiyang
linmuchuiyang requested review from a team and jgerh as code owners September 21, 2026 07:42
@copy-pr-bot

copy-pr-bot Bot commented Sep 21, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@HuiyingLi

Copy link
Copy Markdown
Contributor

/ok to test 0520f9c

…d coverage notes

Add four DeepSeek-V4.1-Flash recipes validated on 8-GPU H100-80GB nodes
(100 updates each): HellaSwag full SFT on 16 nodes (GBS 128), HellaSwag
LoRA on 8 nodes, Tulu3 4k CP8 on 32 nodes, and Tulu3 packed 32k CP8 on
64 nodes. Each header lists the differences from the GB200 recipe and the
reason: the extra ep_shard FSDP axis over the experts, the GBS floor at
dp=128, defer_fsdp_grad_sync: false for gradient accumulation on 80 GB
parts, and moe.reshard_after_forward: false as the interim work-around for
issue NVIDIA-NeMo#3958 until PR NVIDIA-NeMo#3961 lands.

Add prepare_tulu3_data.py, which builds the DS41_DATA_ROOT Arrow layouts
the Tulu3 recipes expect (4096-token padded rows and prepacked 32k THD
packs) from tulu3_chat_template.jinja.

Extend the model-coverage page with an H100 section: recipe table with
measured memory and losses, the data-preparation entry point, the
NCCL_PXN_DISABLE=1 requirement on multi-node InfiniBand (issue NVIDIA-NeMo#3959), the
memory behaviour of defer_fsdp_grad_sync, node-local JIT caches, and the
checkpoint size of the packed recipe.

Closes NVIDIA-NeMo#3960

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Signed-off-by: linmuchuiyang <6169320+linmuchuiyang@users.noreply.github.com>

@jgerh jgerh left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Completed tech pubs review of docs/model-coverage/llm/deepseek-ai/deepseek-v41-flash.mdx and provided a few comments.

Comment on lines 8 to 9
uses a 40-layer causal encoder/decoder backbone with 384 routed experts, one
shared expert, and six selected experts per token. Its CSA2 attention shares

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
uses a 40-layer causal encoder/decoder Mixture-of-Experts (MoE) backbone with
384 routed experts, one shared expert, and six selected experts per token. Its CSA2 attention shares

| Recipe | Topology and Batch | Optimizer Moments and Checkpoints |
|---|---|---|
| [HellaSwag EP64](https://github.com/NVIDIA-NeMo/Automodel/blob/main/examples/llm_finetune/deepseek_v41/deepseek_v41_flash_hellaswag_ep64_16nodes.yaml) | 16 nodes × 4 GB200; EP64, owner64, TP1/PP1/CP1; global batch 64, local batch 1 | BF16 moments; checkpoint saving disabled |
| [HellaSwag EP64, H100](https://github.com/NVIDIA-NeMo/Automodel/blob/main/examples/llm_finetune/deepseek_v41/deepseek_v41_flash_hellaswag_ep64_h100_16nodes.yaml) | 16 nodes × 8 H100-80GB; EP64 with ep_shard2, owner128, TP1/PP1/CP1; global batch 128, local batch 1 | BF16 moments; checkpoint saving disabled; see [H100 80 GB Systems](#h100-80-gb-systems) |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
| [HellaSwag EP64, H100](https://github.com/NVIDIA-NeMo/Automodel/blob/main/examples/llm_finetune/deepseek_v41/deepseek_v41_flash_hellaswag_ep64_h100_16nodes.yaml) | 16 nodes × 8 H100-80GB; EP64 with ep_shard2, owner128, TP1/PP1/CP1; global batch 128, local batch 1 | BF16 moments; checkpoint saving disabled; see [H100 80 GB Systems](#h100-80-gb-systems) |
| [HellaSwag EP64, H100](https://github.com/NVIDIA-NeMo/Automodel/blob/main/examples/llm_finetune/deepseek_v41/deepseek_v41_flash_hellaswag_ep64_h100_16nodes.yaml) | 16 nodes × 8 H100 80 GB; EP64 with ep_shard2, owner128, TP1/PP1/CP1; global batch 128, local batch 1 | BF16 moments; checkpoint saving disabled; see [H100 80 GB Systems](#h100-80-gb-systems) |

Comment on lines 66 to 67
See the [Slurm launcher guide](/job-launchers/slurm-cluster) and
[installation guide](/get-started/installation) for setup. Compilation caches

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
See the [Slurm Launcher Guide](/job-launchers/slurm-cluster) and
[Installation Guide](/get-started/installation) for setup. Compilation caches

`ep_size: 64` on 128 or more GPUs the mesh derives an additional `ep_shard`
FSDP axis over the routed experts, which halves the per-rank expert state.
The variants below were validated on 8-GPU H100 nodes with InfiniBand, 100
updates each, with the NGC `nemo-automodel:26.08` container plus this

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
updates each, with the NGC `nemo-automodel:26.08` container plus this
updates each, using the NGC `nemo-automodel:26.08` container plus this

updates each, with the NGC `nemo-automodel:26.08` container plus this
repository at `e2c47c5b` (torch 2.13, NCCL 2.30.5).

| Recipe | Topology and Batch | Overrides versus the GB200 recipe | Peak memory / result |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
| Recipe | Topology and Batch | Overrides versus the GB200 recipe | Peak memory / result |
| Recipe | Topology and Batch | Overrides Compared to the GB200 Recipe | Peak Memory / Result |

| Recipe | Topology and Batch | Overrides versus the GB200 recipe | Peak memory / result |
|---|---|---|---|
| [HellaSwag EP64, H100](https://github.com/NVIDIA-NeMo/Automodel/blob/main/examples/llm_finetune/deepseek_v41/deepseek_v41_flash_hellaswag_ep64_h100_16nodes.yaml) | 16 × 8 H100; EP64, ep_shard2, owner128; GBS 128, LBS 1, one microbatch | `global_batch_size: 128` | 58.4 GiB; train 1.8185, validation 1.9800 (GB200: 1.8177 / 2.0173) |
| [HellaSwag LoRA, H100](https://github.com/NVIDIA-NeMo/Automodel/blob/main/examples/llm_finetune/deepseek_v41/deepseek_v41_flash_hellaswag_lora_h100_8nodes.yaml) | 8 × 8 H100; EP32, ep_shard2, owner64; GBS 64, LBS 1, one microbatch | none | 43.9 GiB; train 2.2655, validation 2.5737 |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
| [HellaSwag LoRA, H100](https://github.com/NVIDIA-NeMo/Automodel/blob/main/examples/llm_finetune/deepseek_v41/deepseek_v41_flash_hellaswag_lora_h100_8nodes.yaml) | 8 × 8 H100; EP32, ep_shard2, owner64; GBS 64, LBS 1, one microbatch | none | 43.9 GiB; train 2.2655, validation 2.5737 |
| [HellaSwag LoRA, H100](https://github.com/NVIDIA-NeMo/Automodel/blob/main/examples/llm_finetune/deepseek_v41/deepseek_v41_flash_hellaswag_lora_h100_8nodes.yaml) | 8 × 8 H100; EP32, ep_shard2, owner64; GBS 64, LBS 1, one microbatch | None | 43.9 GiB; train 2.2655, validation 2.5737 |

Text inputs use unpacked `input_ids [batch, sequence]`, right padding, and
zero-based positions. The optional `labels [batch, sequence]` API computes
shifted causal cross-entropy with `-100` ignored. Attention KV and index
quantize/dequantize boundaries remain part of every forward and use

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
quantize and dequantize boundaries remain part of every forward and use


The released vision tower is enabled by the default model configuration and
disabled by the HellaSwag recipe. `DeepseekV41Processor` supports ordinary
text/image conversations and save/reload. Image inputs require unpacked

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
text and image conversations and save/reload. Image inputs require unpacked

`input_ids [batch, sequence]`, `pixel_values [all_patches, 3, patch_size, patch_size]`,
`image_grid_hws [images, 2]`, and `vision_token_types [batch, sequence]`.
The image encoder and projector reuse DeepSeek V4 modules; image delimiters
and visual router bias are retained. Specialized tool/reasoning formatting

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
and visual router bias are retained. Specialized tool and reasoning formatting

This is a measured baseline, not a strict parity pass.

An earlier PR commit, `ae380ea74b8417a000c1639ebd64991aafeb42b8`, completed
three resident forward/backward iterations using the now-removed custom FP32

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
three resident forward and backward iterations using the now-removed custom FP32

@svcnvidia-nemo-ci svcnvidia-nemo-ci added the waiting-on-customer Waiting on the original author to respond label Sep 21, 2026

This branch was successfully deployed

3 active (outdated) deployments
public 0520f9c9 Deployed Sep 21, 2026 by copy-pr-bot[bot] via release / finalize / notify #4717
test 0520f9c9 Deployed Sep 21, 2026 by copy-pr-bot[bot] via cicd-wait-in-queue #10888
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

community-request waiting-on-customer Waiting on the original author to respond

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[docs] DeepSeek-V4.1 CP recipes on 80 GB parts: defer_fsdp_grad_sync: true keeps unsharded params + grads across microbatches (+33 GB)

4 participants