Skip to content

Add: integrate DeepSeek V4 DSpark serving - #208

Draft
hashiqiqixian wants to merge 4 commits into
hw-native-sys:mainfrom
hashiqiqixian:feat/dspark-serving-integration
Draft

Add: integrate DeepSeek V4 DSpark serving#208
hashiqiqixian wants to merge 4 commits into
hw-native-sys:mainfrom
hashiqiqixian:feat/dspark-serving-integration

Conversation

@hashiqiqixian

Copy link
Copy Markdown

Summary

Integrate the DeepSeek V4 DSpark model-side pipeline into PyPTO Serving with the target DP4 x TP4 dense topology and EP16 MoE topology.

The serving data flow covered by this change is:

terminal prefill
  -> target token sampling
  -> initialize three drafter KV layers
  -> produce seven draft tokens
  -> target verification decode
  -> commit the accepted prefix per request
  -> update request-local context and drafter KV
  -> produce the next seven-token proposal

Changes

  • Admit the DSpark DP4 x TP4, EP16 topology and select the DSpark PyPTO-lib kernel family.
  • Add DSpark checkpoint validation, weight staging, task arguments, and device-buffer ownership.
  • Wire terminal Prefill to the three-layer drafter, TP4 LM head, seven-step Markov sampler, and confidence output.
  • Keep stable TP4 request/query ownership through Decode and support different accepted-prefix lengths within one batch.
  • Bound verification by remaining context capacity and fall back to target-only Decode when another full proposal cannot fit.
  • Carry request sampling parameters and integrate the device-sampling ABI needed by the target path.
  • Document the required full DSpark W8A8 checkpoint instead of the base DeepSeek-V4-Flash checkpoint.

Dependencies

Validation

On ci-69:

  • task_20260828_152804_31283327088: Ruff passed; 173 targeted Serving tests passed and 1 was deselected.
  • PyPTO-lib TP4 Markov B4: task_20260828_145457_72515728721 passed.
  • PyPTO-lib TP4 + EP8 drafter B4: task_20260828_145528_78912424701 passed.
  • Checkpoint startup-contract inspection: task_20260828_153100_6586995834 correctly rejected the available base W8A8 checkpoint because 85 of 123 DSpark startup weights are missing.

Local review:

  • Complete origin/main...HEAD diff reviewed.
  • git diff --check passed.
  • Copyright header check passed.

Current limitations

  • A real DSpark checkpoint end-to-end Serving run is not yet complete. The available /data/models/dsv4-flash-w8a8 checkpoint contains only part of mtp.0 and lacks mtp.1, mtp.2, Markov, and confidence-head weights.
  • DP4 x TP4, EP16 is the implemented/static serving contract, but it has not yet been physically validated as a complete 16-device Serving deployment.
  • Confidence values are produced by the model pipeline, but confidence-driven adaptive verification scheduling is not included in this PR.
  • Prefix caching is intentionally disabled for DSpark in this revision.

Related model work: hw-native-sys/pypto-lib#935.

ChenShenAi and others added 4 commits August 27, 2026 19:20
- integrate temperature/top-k sampling into autoregressive and fused MTP-1 decode
- keep sampling controls in device state and support request-level seeds
- default top-p to the device-supported value of 1.0
- guard stochastic MTP-1 output with real-NPU accuracy coverage
@coderabbitai

coderabbitai Bot commented Aug 28, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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