Skip to content

Benchmarks - Add official-checkpoint V2-Lite generative inference - #886

Draft
gusui-msft wants to merge 8 commits into
mainfrom
feat/deepseek-v2-lite-inference-20261015
Draft

gusui-msft wants to merge 8 commits into
mainfrom
feat/deepseek-v2-lite-inference-20261015

Conversation

@gusui-msft

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

Copy link
Copy Markdown
Contributor

Summary

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

  • Isolated vLLM 0.31.0 worker for prefill and cached decode.
  • EOS-aware token counts, throughput, prefill latency, TTFT and TPOT.
  • Independent official-code numerical reference. The explicit h100_bf16_v6 policy is restricted to the H100 profile below; strict_fp32 remains the default.
  • Download-inclusive deadline, supervised worker cleanup and removal of each run's model cache. cache_root is required.
  • Runs in the SuperBench CUDA 13.0 image: a third_party target installs vLLM 0.31.0 with torch 2.13.0+cu130 in /opt/vllm and the official-code reference (transformers 4.46.3 on that torch) in /opt/deepseek-reference, outside the SuperBench Python. 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 FSDP training #887.

Validation

Validated on one Standard_ND96isrf_H100_v5 node, October 26-27, 2026.

Profile (superbench/config/deepseek-v2-lite-inference.yaml): 1 x H100 80GB, batch 8, prompt 512, up to 64 output tokens, 2 warmup + 256 measured batches; compiled, batch-invariant BF16 with numerical_policy=h100_bf16_v6.

Three independent cold runs through the ordinary internal single-node entrypoint:

Stage Seconds, min-max
Download and checkpoint verification 340.7-347.3
Engine setup and compilation 74.6-75.0
Generation, including warmup 208.9-209.7
Independent BF16/FP32 reference checks 656.4-661.9
Other checks, cleanup and orchestration* 48.3-48.4
Complete job, including local diagnosis 1329.0-1342.4

All three runs passed numerical checks and diagnosis. Mean GPU busy: 97.85-98.32%; maximum throughput deviation from the median: 0.334%.

The H100 runs used the code before these later changes: the helpers moved into deepseek_v2_lite/, workers start with python -m and package-relative imports, the numerical contract moved unchanged next to numerics.py, each run's model cache is removed, cache_root is required, numerical_policy is typed as a string, the tests were consolidated and the runtimes moved from a dedicated image into the CUDA 13.0 platform image. Compared with the validated files, function bodies change only in worker launch (run_worker, the new worker_environment and inference_worker.main) and the contract path (load_contract); the reference-loader and contract hashes that the numerical policy checks are unchanged. The platform image installs vLLM from PyPI and torch from the PyTorch cu130 index, without the official vLLM image's prebuilt FlashInfer caches. Cache removal counts toward duration and end_to_end_seconds; after a failed run it may continue until the deadline or for 60 seconds, whichever ends later, without replacing the original error. The changed code has not yet run on H100. The full CPU test suite and YAPF/flake8/mypy pass locally on Python 3.12, and the third_party target builds both environments locally.

Ranges span three runs; their endpoints are not additive. Other is the residual after timed stages. Download is included; image/dependency preparation is excluded.

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.

🔵 Needs a closer look

The independent numerical gate remains failing, and representative-profile GPU qualification requires human review before leaving Draft.

1 open issue
What changed in this PR

Adds an opt-in official-checkpoint DeepSeek V2-Lite generation benchmark, isolated from existing framework dependencies.

Changes:

  • Adds BF16 generation, actual token accounting, and download-inclusive deadlines.
  • Adds an independent FP32 reference and CPU contract tests.
  • Provides runtime packaging, a candidate GPU profile, and documentation of pending qualification.
File Description
tests/​benchmarks/​model_benchmarks/​test_vllm_deepseek_v2_lite.py Tests adapter reports and failures.
tests/​benchmarks/​model_benchmarks/​test_deepseek_v2_lite_utils.py Tests shared worker contracts.
tests/​benchmarks/​model_benchmarks/​test_deepseek_v2_lite_reference.py Tests reference comparison logic.
tests/​benchmarks/​model_benchmarks/​test_deepseek_v2_lite_inference_worker.py Tests token counts and timings.
superbench/​config/​deepseek-v2-lite-inference.yaml Adds a single-replica candidate profile.
superbench/​benchmarks/​model_benchmarks/​vllm_deepseek_v2_lite.py Integrates the benchmark with SuperBench.
superbench/​benchmarks/​model_benchmarks/​deepseek_v2_lite_utils.py Adds checkpoint, input, and subprocess contracts.
superbench/​benchmarks/​model_benchmarks/​deepseek_v2_lite_reference.py Implements independent numerical checks.
superbench/​benchmarks/​model_benchmarks/​deepseek_v2_lite_inference_worker.py Implements generation and reference orchestration.
superbench/​benchmarks/​model_benchmarks/​__init__.py Exports the new benchmark.
docs/​user-tutorial/​benchmarks/​model-benchmarks.md Documents usage and qualification limits.
dockerfile/​requirements/​deepseek-v2-lite-reference.txt Pins reference dependencies.
dockerfile/​deepseek-v2-lite-inference.dockerfile Packages isolated worker environments.

Review effort: Balanced

@codecov

codecov Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 95.59229% with 48 lines in your changes missing coverage. Please review.
✅ Project coverage is 87.43%. Comparing base (c548e79) to head (2ffcb7e).

Files with missing lines Patch % Lines
...chmarks/model_benchmarks/deepseek_v2_lite/utils.py 91.34% 20 Missing ⚠️
...el_benchmarks/deepseek_v2_lite/inference_worker.py 94.58% 13 Missing ⚠️
...rks/model_benchmarks/deepseek_v2_lite/reference.py 93.41% 11 Missing ⚠️
...arks/model_benchmarks/deepseek_v2_lite/numerics.py 98.96% 3 Missing ⚠️
...nchmarks/model_benchmarks/vllm_deepseek_v2_lite.py 99.21% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #886      +/-   ##
==========================================
+ Coverage   86.36%   87.43%   +1.07%     
==========================================
  Files         107      114       +7     
  Lines        8258     9347    +1089     
==========================================
+ Hits         7132     8173    +1041     
- Misses       1126     1174      +48     
Flag Coverage Δ
cpu-python3.10-unit-test 74.26% <91.68%> (+2.31%) ⬆️
cpu-python3.12-unit-test 74.26% <91.68%> (+2.31%) ⬆️
cpu-python3.7-unit-test 72.17% <77.86%> (+0.76%) ⬆️
cuda-unit-test 85.22% <91.68%> (+0.85%) ⬆️

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.

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

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.

🔵 Needs a closer look

The reported numerical gate still fails and representative-profile GPU qualification remains incomplete, so the PR should remain Draft.

1 open issue

Review effort: Balanced

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

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.

🔵 Needs a closer look

Numerical acceptance remains blocked, GPU/runtime qualification is incomplete, and measured-generation NaN detection needs correction.

1 open issue
1 previously missed issue

In code that hasn't changed since last review

Medium severity Enable VLLM_RAISE_ON_LOGIT_NANS before engine creation

superbench/​benchmarks/​model_benchmarks/​deepseek_v2_lite_inference_worker.py:195

Enable VLLM_RAISE_ON_LOGIT_NANS before importing vLLM. In vLLM 0.31.0, both NaN-checking switches default to off; setting this switch also enables NaN detection and raises on corrupted logits. Without it, request_times() cannot rely on metrics.is_corrupted to reject NaNs. Measured requests return no log probabilities and are not sent to the reference, so corruption confined to measured generation can still yield successful throughput results. Add a CPU contract assertion that this setting is enabled before engine creation.

Review effort: Balanced

@gusui-msft
gusui-msft force-pushed the feat/deepseek-v2-lite-inference-20261015 branch from bbb0fb2 to df969f6 Compare October 28, 2026 18:18
Copilot AI balanced review requested due to automatic review settings October 28, 2026 18:18
@gusui-msft
gusui-msft force-pushed the feat/deepseek-v2-lite-inference-20261015 branch from df969f6 to e9c0c2c Compare October 28, 2026 18:24

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

Unbounded cache cleanup runs after the duration check and elapsed-time snapshot, allowing the invocation to exceed its deadline while reporting success and an understated runtime.

1 open issue
1 resolved since last review

Review effort: Balanced

Copilot AI balanced review requested due to automatic review settings October 28, 2026 18:24

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

Cache cleanup occurs after the deadline check and elapsed-time recording, allowing runs to exceed the complete-job budget while still reporting success.

2 open issues

Review effort: Balanced

@gusui-msft
gusui-msft force-pushed the feat/deepseek-v2-lite-inference-20261015 branch from e9c0c2c to 9ddecb5 Compare October 28, 2026 18:56
Copilot AI balanced review requested due to automatic review settings October 28, 2026 18:56

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.

🔵 Needs a closer look

Successful-run cache cleanup occurs after the final deadline and timing checks, allowing the benchmark to exceed its duration budget while reporting success and an understated runtime.

2 open issues

Review effort: Balanced

Copilot AI balanced review requested due to automatic review settings October 29, 2026 20:06

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.

🔵 Needs a closer look

Specialist validation is needed for the H100-calibrated numerical bounds and version-specific vLLM timing/shutdown behavior, which CPU mocks and artifact hashes alone cannot establish.

No open issues 🎉

2 resolved since last review

Review effort: Balanced

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

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.

🔵 Needs a closer look

Specialist review is needed to validate the hash-referenced H100 calibration and holdout evidence against the pinned GPU runtime, since CPU controls cannot establish the numerical acceptance bounds.

No open issues 🎉

Review effort: Balanced

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

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.

🔵 Needs a closer look

Specialist review is needed because the H100 acceptance tolerances depend on calibration and qualification artifacts available only as hashes, and CPU control-flow tests cannot establish numerical validity.

No open issues 🎉

Review effort: Balanced

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

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.

🔵 Needs a closer look

Specialist review is needed to validate the H100 policy’s calibrated numerical bounds because calibration and holdout reports are supplied only as hashes, and CPU tests cannot establish qualified-runtime guarantees.

No open issues 🎉

Review effort: Balanced

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

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.

🔵 Needs a closer look

The H100 qualification predates the final worker-launch and cache-cleanup changes, leaving the numerical policy and runtime path in need of GPU-owner review and a cold H100 validation run.

No open issues 🎉

Review effort: Balanced

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.

🔵 Needs a closer look

The final CUDA 13.0 image and module-based worker launches still require cold end-to-end H100 validation to confirm engine compatibility, numerical correctness, and deadline-bounded cleanup.

No open issues 🎉

Review effort: Balanced

gusui-msft and others added 8 commits November 17, 2026 17:12
Add deepseek-v2-lite-inference, an opt-in benchmark that downloads the
official DeepSeek-V2-Lite checkpoint and measures single-GPU BF16
generation with an isolated vLLM 0.31.0 worker.

- Prefill and cached-decode metrics from actual output token counts.
- Independent official-code reference with an explicit H100 BF16
  numerical policy; strict FP32 remains the default policy.
- 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 numerical_policy as a string so
`sb benchmark list-parameters` can render it. Describe the validated H100
scope in the documentation, and mark the numerics module's script-mode
import for type checking without changing executable code. Refer to the
numerical contract by path, because the docs build cannot bundle a
linked JSON file.

Co-authored-by: Copilot <[email protected]>
Include model-cache cleanup in the download-inclusive deadline and end-to-end timing. Bound and reap the cleanup process on timeout, retain failure-path cleanup, and finalize success only afterward.

Clarify the strict FP32 and input-matched H100 numerical guarantees and add lifecycle regression coverage.

Co-authored-by: Copilot <[email protected]>
Move bounded model-cache removal into a module shared with the training
benchmark. Successful runs still finish cleanup within the duration, and
a cleanup timeout still fails the run. After a failed or timed-out run,
cleanup may continue until the job deadline or for 60 seconds, whichever
ends later, and an unfinished cleanup is logged instead of replacing the
original error.

Co-authored-by: Copilot <[email protected]>
Keep only what users need to run the benchmark and interpret its
results: the workload and checks, numerical policies and validated
scope, usage, cache cleanup and duration. Drop validation timings and
implementation details, which remain in the pull request and code.
List every reported metric under its full result name.

Co-authored-by: Copilot <[email protected]>
Group the V2-Lite worker, reference, numerical policy, 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. The H100 numerical contract moves unchanged next to
numerics.py.

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]>
…13.0 image

Replace the dedicated inference image with a third_party target that the CUDA 13.0
platform image runs. It installs vLLM 0.31.0 with torch 2.13.0+cu130 in /opt/vllm
and the official-code reference, transformers 4.46.3 on that torch, in
/opt/deepseek-reference, both outside the SuperBench Python. Remove the inference
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]>
…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]>
@gusui-msft
gusui-msft force-pushed the feat/deepseek-v2-lite-inference-20261015 branch from ae8490a to 2ffcb7e Compare November 18, 2026 00:12
Copilot AI balanced review requested due to automatic review settings November 18, 2026 00:12

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.

🔵 Needs a closer look

Earlier H100 results predate the CUDA 13.0 image and worker/runtime changes, leaving this version’s cold-start compilation, numerical checks, deadlines, and descendant cleanup unverified end to end.

No open issues 🎉

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.

2 participants