Skip to content

Benchmarks - Add official-checkpoint V2-Lite FSDP training - #887

Open
gusui-msft wants to merge 9 commits into
mainfrom
feat/deepseek-v2-lite-training-20261015
Open

gusui-msft wants to merge 9 commits into
mainfrom
feat/deepseek-v2-lite-training-20261015

Conversation

@gusui-msft

@gusui-msft gusui-msft commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Add deepseek-v2-lite-training, an opt-in benchmark using the full official DeepSeek-V2-Lite checkpoint for multi-GPU BF16 training.

  • Full-parameter FSDP training on fixed text with real AdamW updates.
  • Independent loss and gradient checks against an unsharded official-code reference.
  • Optional stable-sorted expert dispatch; official dispatch remains the default.
  • Checkpoint integrity, actual token accounting, download-inclusive deadlines, a single-launcher check, owned-worker cleanup and removal of each run's model cache. cache_root is required.
  • Runs in the SuperBench Python of the CUDA 13.0 image, with its PyTorch and transformers. Configuration, CPU tests and documentation are included; existing default suites remain unchanged.
  • Helpers live in superbench/benchmarks/model_benchmarks/deepseek_v2_lite/; the utility, reference and cache modules and their tests are shared with Benchmarks - Add official-checkpoint V2-Lite generative inference #886.

Validation

On 2026-11-18, commit 125697ad passed three independent cold runs through the internal single-node entrypoint on one Standard_ND96isrf_H100_v5 node. All three passed the reference loss and gradient checks, updated 15,705,428,721 parameter elements per run, and finished with zero diagnosis issues. The 128 measured loss and gradient-norm values matched bit for bit across the three runs.

Tested profile: 4 x H100 80 GB, BF16 FSDP, batch size 36 per GPU, sequence length 512, 2 warmup steps and 128 measured steps, on the SuperBench CUDA 13.0 image with transformers 4.52.4. The runs used moe_dispatch=stable_sorted and PYTORCH_CUDA_ALLOC_CONF=backend:native; the shipped deepseek-v2-lite-training.yaml is a smaller example using the default official dispatch.

Cold run Training throughput (tokens/s) Complete job (s) Per-GPU mean utilization
1 27,514.60 929.03 84.8-85.8%
2 26,954.57 901.89 83.0-86.8%
3 27,331.68 882.73 84.5-86.3%

Median throughput was 27,331.68 tokens/s; the largest deviation from that median was 1.38% (5% limit). Each job started with an empty model cache. Job time includes the 31.4 GB checkpoint download, weight verification, reference checks, training, local diagnosis and checkpoint cache removal. It excludes image pull and dependency setup.

This comment was marked as duplicate.

Copilot AI balanced review requested due to automatic review settings October 20, 2026 22:42

This comment was marked as duplicate.

Copilot AI balanced review requested due to automatic review settings October 21, 2026 20:54

This comment was marked as duplicate.

@gusui-msft
gusui-msft force-pushed the feat/deepseek-v2-lite-training-20261015 branch from d405e7e to 33cdce5 Compare October 28, 2026 18:18
Copilot AI balanced review requested due to automatic review settings October 28, 2026 18:18

This comment was marked as duplicate.

@gusui-msft
gusui-msft force-pushed the feat/deepseek-v2-lite-training-20261015 branch from 33cdce5 to 5a776ad Compare October 28, 2026 18:56
Copilot AI balanced review requested due to automatic review settings October 28, 2026 18:56

This comment was marked as duplicate.

Copilot AI balanced review requested due to automatic review settings October 29, 2026 21:53

This comment was marked as duplicate.

Copilot AI balanced review requested due to automatic review settings October 29, 2026 22:54

This comment was marked as duplicate.

Copilot AI balanced review requested due to automatic review settings October 30, 2026 01:18

This comment was marked as duplicate.

Copilot AI balanced review requested due to automatic review settings October 30, 2026 15:22

This comment was marked as duplicate.

Copilot AI balanced review requested due to automatic review settings October 30, 2026 21:18

This comment was marked as resolved.

@gusui-msft
gusui-msft marked this pull request as ready for review October 30, 2026 22:11
@gusui-msft
gusui-msft requested a review from a team as a code owner October 30, 2026 22:11
@microsoft Microsoft (microsoft) deleted a comment from codecov Bot Oct 30, 2026
@codecov

codecov Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 86.95652% with 105 lines in your changes missing coverage. Please review.
✅ Project coverage is 86.41%. Comparing base (c548e79) to head (125697a).

Files with missing lines Patch % Lines
...del_benchmarks/deepseek_v2_lite/training_worker.py 68.39% 73 Missing ⚠️
...chmarks/model_benchmarks/deepseek_v2_lite/utils.py 91.34% 20 Missing ⚠️
...rks/model_benchmarks/deepseek_v2_lite/reference.py 93.41% 11 Missing ⚠️
...marks/model_benchmarks/pytorch_deepseek_v2_lite.py 99.04% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #887      +/-   ##
==========================================
+ Coverage   86.36%   86.41%   +0.05%     
==========================================
  Files         107      114       +7     
  Lines        8258     9063     +805     
==========================================
+ Hits         7132     7832     +700     
- Misses       1126     1231     +105     
Flag Coverage Δ
cpu-python3.10-unit-test 72.81% <81.57%> (+0.85%) ⬆️
cpu-python3.12-unit-test 72.81% <81.57%> (+0.85%) ⬆️
cpu-python3.7-unit-test 72.07% <78.75%> (+0.65%) ⬆️
cuda-unit-test 84.12% <81.57%> (-0.25%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@polarG Hongtao Zhang (polarG) 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.

# Severity Title Location
1 SHOULD-FIX Enforce the single-launcher contract for local and MPI modes superbench/benchmarks/model_benchmarks/pytorch_deepseek_v2_lite.py:65
2 SHOULD-FIX Qualify the H100 validation claim for the current code docs/user-tutorial/benchmarks/model-benchmarks.md:180
3 NON-BLOCKING Avoid or document a full FP32 host copy per rank superbench/benchmarks/model_benchmarks/deepseek_v2_lite/training_worker.py:150
4 NON-BLOCKING Preserve timeout classification when descendant cleanup fails superbench/benchmarks/model_benchmarks/deepseek_v2_lite/utils.py:277
5 NON-BLOCKING Test that downloads actually invoke checkpoint verification tests/benchmarks/model_benchmarks/test_deepseek_v2_lite.py:267

Verdict: NEEDS-CHANGES — The launcher guard and the unqualified H100 validation claim should be corrected.

gusui-msft added a commit that referenced this pull request Nov 2, 2026
…led cleanup

Port the shared fixes from the #887 review, keeping deepseek_v2_lite/utils.py
and its tests identical in both PRs:

- Check PROC_RANK, WORLD_SIZE and OMPI_COMM_WORLD_SIZE independently, so a
  second local process or a masked MPI world size cannot start another model
  replica.
- If descendant cleanup fails after the deadline, the supervisor returns
  126 and run_worker raises a TimeoutError that names the failed cleanup.
- The download test now proves that a corrupted shard is rejected.

Co-authored-by: Copilot <[email protected]>
Copilot AI balanced review requested due to automatic review settings November 2, 2026 21:16

Copilot AI 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.

🟡 Changes recommended

The documentation attributes H100 validation to the shipped CUDA 13.0 image, although the runs used an earlier image before subsequent runtime changes, and must distinguish the validated profile from the unvalidated current runtime.

1 open issue

Review effort: Balanced

gusui-msft and others added 9 commits November 17, 2026 17:11
Add deepseek-v2-lite-training, an opt-in benchmark that downloads the
official DeepSeek-V2-Lite checkpoint and runs full-parameter BF16 FSDP
training with real AdamW updates.

- Loss and sampled-gradient checks against an unsharded official-code
  reference.
- Optional stable-sorted expert dispatch; official dispatch remains the
  default.
- Download-inclusive deadline and supervised worker cleanup.
- Runtime image recipe, configuration, CPU tests and documentation.

Co-authored-by: Copilot <[email protected]>
Delete each run's downloaded checkpoint cache after the worker exits,
on success, failure or timeout, while keeping its report and logs.
A cleanup error is logged without discarding a validated measurement;
a runner timeout during cleanup is still reported as a timeout.

Require cache_root instead of defaulting to a relative directory inside
the SuperBench output tree. Declare moe_dispatch as a string so
`sb benchmark list-parameters` can render it. Document the validated H100
profile parameters, and import torch for type checking in the
stable-dispatch test.

Co-authored-by: Copilot <[email protected]>
Apply the inference benchmark's cache-cleanup contract to training.
Model-cache removal now counts toward the download-inclusive deadline and
end_to_end_seconds, and the success result is finalized after cleanup.
After a failed or timed-out run, cleanup may continue until the job
deadline or for 60 seconds, whichever ends later, without replacing the
original error. The bounded removal is shared with the inference
benchmark.

Co-authored-by: Copilot <[email protected]>
Keep only what users need to run the benchmark and interpret its
results: the workload and checks, MoE dispatch, validated profile,
usage, cache cleanup and duration. Drop validation timings and
implementation details, which remain in the pull request and code.
Use full result names in the metrics table.

Co-authored-by: Copilot <[email protected]>
Group the V2-Lite worker, reference, MoE dispatch, utility and cache modules
under superbench/benchmarks/model_benchmarks/deepseek_v2_lite/; the adapter
stays flat like the other model benchmarks. Workers start as
`python -m deepseek_v2_lite.<module>` with the package parent on PYTHONPATH
and use package-relative imports, so worker interpreters still need no
SuperBench install.

Merge the tests into one file for this benchmark and one for the shared
helpers, and drop tests that repeat another test's coverage or check trivial
guards.

Co-authored-by: Copilot <[email protected]>
Load the official checkpoint for training with the installed transformers instead
of the reference loader, whose transformers==4.46.3 pin the inference contract
binds by source hash. The profile no longer sets runtime_python, so the worker
uses the SuperBench Python. Remove the training Dockerfile and its requirement
locks, update the usage docs, and note that only the inference workers run
without SuperBench.

Co-authored-by: Copilot <[email protected]>
Keep what users need to run and read the benchmark: the workload, its reference
check, the validated profile, the CUDA 13.0 image with transformers 4.x, and the
cache_root and duration rules.

Co-authored-by: Copilot <[email protected]>
…led cleanup

- Check PROC_RANK, WORLD_SIZE and OMPI_COMM_WORLD_SIZE independently, so a
  second local process or a masked MPI world size cannot start another
  full-model job.
- If descendant cleanup fails after the deadline, the supervisor returns
  126 and run_worker raises a TimeoutError that names the failed cleanup.
- The download test now proves that a corrupted shard is rejected.

Co-authored-by: Copilot <[email protected]>
Name the runtime that the H100 validation used and state the host memory
that full-model FP32 loading needs before FSDP sharding, as measured on
four H100 GPUs.

Co-authored-by: Copilot <[email protected]>
@gusui-msft
gusui-msft force-pushed the feat/deepseek-v2-lite-training-20261015 branch from c759206 to 125697a Compare November 18, 2026 00:11
Copilot AI balanced review requested due to automatic review settings November 18, 2026 00:11
gusui-msft added a commit that referenced this pull request Nov 18, 2026
…led cleanup

Port the shared fixes from the #887 review, keeping deepseek_v2_lite/utils.py
and its tests identical in both PRs:

- Check PROC_RANK, WORLD_SIZE and OMPI_COMM_WORLD_SIZE independently, so a
  second local process or a masked MPI world size cannot start another model
  replica.
- If descendant cleanup fails after the deadline, the supervisor returns
  126 and run_worker raises a TimeoutError that names the failed cleanup.
- The download test now proves that a corrupted shard is rejected.

Co-authored-by: Copilot <[email protected]>

Copilot AI 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.

🟢 Approval recommended

There are no active review issues requiring changes to the opt-in DeepSeek-V2-Lite training benchmark.

No open issues 🎉

1 resolved since last review

Review effort: Balanced

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants