drowzeys GitHub avatar

Keys-Concurrency-Patch-for-DSpark-DeepSeek-V4-Flash

drowzeys

一个补丁,用于在 NVIDIA DGX Spark 上实现 DSpark 推测解码的正确服务器内连续批量并发,突破了默认 max-num-seqs=1 的限制。

Stars

11

7 天增长

暂无数据

Fork 数

0

开放 Issue

0

开源协议

Apache-2.0

最近更新

2026-06-29

AI 仓库情报摘要
FR-AI / ANALYSIS

为什么值得关注

它消除了 DSpark 服务中的硬并发瓶颈,在 16 个并发请求下达到 290 tok/s 且零错误,同时保持单流输出字节一致。

适合谁使用

  • 在 DGX Spark 硬件上部署基于 DSpark 的推测解码的开发者
  • 在生产或研究环境中使用 DeepSeek-V4-Flash/Pro 的用户
  • 优化 LLM 服务吞吐量的工程师(特别是使用推测解码)
  • 研究推测解码系统中连续批处理的学者

典型使用场景

  • 为多个并发用户请求提供高吞吐、低延迟的服务
  • 跨多个 DGX Spark 堆栈扩展 DSpark 服务以处理更大负载
  • 在请求变动和连续批处理下保持确定性输出正确性
  • 评估推测解码中并发度与吞吐量之间的权衡

项目优势

  • 性能已验证:单个 2-Spark 堆栈在并发 16 时达到 290 tok/s,两个堆栈达 375 tok/s,且接近线性扩展
  • 并发负载下输出字节一致,通过正确性测试验证
  • 所有测试并发级别(每堆栈 1-16)均观察零错误
  • 代码改动最小(+278 行),仅针对两个根本原因

使用前须知

  • 仅在 DeepSeek-V4-Flash-DSpark 上验证;DeepSeek-V4-Pro-DSpark 未测试
  • 非均匀路径需要设置 VLLM_DSPARK_GPU_REJECTED_CONTEXT_MASK=1;传统均匀路径未修改
  • 建议在生产部署前进行数小时的浸泡测试,并且补丁需要特定的 overlay 构建环境

README 快速开始

Keys-Concurrency Patch for DSpark + DeepSeek-V4-Flash/Pro

Correct in-server continuous-batch concurrency for DSpark speculative decoding on NVIDIA DGX Spark (GB10 / SM121).

Stock DSpark serving forces --max-num-seqs 1 — the upstream recipe states the DSpark draft path "stalls under max_num_seqs>1 in this build, so requests serialize. The win is depth (context), not width (concurrency)."

This patch removes that limitation. With it, DSpark serves multiple concurrent streams correctly under independent (staggered) request arrivals, while keeping single-stream output byte-identical to the unpatched engine.

Validated on DeepSeek-V4-Flash-DSpark, vLLM DSpark overlay (Rafael Caricio integration / TonyD2Wild packaging), TP=2 on 2× DGX Spark (GB10), 2026-06-29. The patch is in the model-agnostic DSpark proposer/model code, so it is expected to apply to DeepSeek-V4-Pro-DSpark as well — but Pro is untested; please report results.


Results

Headline below; full single + dual-stack tables in RESULTS.md. One stack = 2× DGX Spark (GB10), TP=2, kv-cache-dtype fp8, DSpark γ=5, gpu-memory-utilization 0.80, max-num-seqs 16.

Concurrency unlocked (this patch) — one 2-Spark stack

total concurrencystatic (best-case)staggered (real arrivals)acceptanceerrors
149 tok/s~50 tok/s~0.60
4122 tok/s104 tok/s~0.590
8183 tok/s139 tok/s~0.560
16290 tok/s191 tok/s~0.550
  • Single-stream unchanged: ~50–54 tok/s, provably byte-identical output.
  • Zero errors at every level; draft acceptance stays healthy (~0.55) — DSpark keeps accelerating under load.

Scaling out — 2 stacks (4 Sparks) measured

total concurrency1 stack2 stacksscaling
32375 tok/s (16+16, 32/32 ok)~1.96×

Replicas scale ~linearly (independent stacks behind a least-connections router).

Correctness

A deterministic request (temperature 0, ignore_eos) produces byte-identical output whether run alone or while other requests start/finish around it (forcing continuous-batch condense). Run benchmarks/correctness_test.py.


What the patch does

Two root causes blocked max_num_seqs>1:

Patch 1 — request-stable KV slot. DSpark's only persistent pe

项目描述

Concurrency Patch to enable on DSpark - DeepSeek V4 Flash/Pro C=16 can be modified for more

相关仓库与替代方案

根据分类、Topic 和编程语言匹配的相似项目。

lopopolo
精选
lopopolo GitHub avatar

harness-engineering

Harness Engineering is a methodology for improving coding agent outputs by carefully crafting the environment around them—providing curated context, tools, and executable constraints that encode an organization’s nonfunctional requirements and cumulative lessons.

AI 与机器学习AI 智能体
2,390
slvDev
精选
slvDev GitHub avatar

esp32-ai

A 28.9 million parameter language model runs on an $8 ESP32-S3 microcontroller entirely on-device, generating simple stories at about 9.5 tokens per second.

AI 与机器学习大语言模型
1,960
littledivy
精选
littledivy GitHub avatar

mimic

mimic captures traffic from any iOS or web app and automatically generates a Python client library that lets you call the app's API like a regular library.

AI 与机器学习
1,482