feat(dflash): add direct DeepSeek4 pure-UMA runtime path#489
Conversation
d4f3a8f to
32c0541
Compare
There was a problem hiding this comment.
2 issues found across 4 files
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
32c0541 to
1c2d253
Compare
|
This update stabilizes the PR489 DeepSeek4 direct pure-UMA runtime path. The previous implementation introduced the direct DeepSeek4 pure-UMA path, but the HC backend graph path was still incomplete and unsafe as a default runtime path. This revision keeps the incomplete batch HC backend graph opt-in only, and uses the verified quality-stable CPU-side/eager HC path by default. Changes
ValidationStrict exactseq validation, default runtime,
Replay performance, default runtime,
|
|
Verified with #502 (ROCmFPx). Combined build passes on lucebox5. Perf: 256/32 (ctx1m): prefill=144.36 tok/s, decode=12.1 tok/s also cleaned up the |
There was a problem hiding this comment.
All reported issues were addressed across 10 files
Not reviewed (too large): server/src/deepseek4/deepseek4_graph.cpp (~3,169 lines) - if these are generated or fixture files, add them to ignored paths to exclude them from future reviews.
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
2026-07-10 Update
ValidationQuality checks passed on 256/32, 4k/128, and 8k/256 validation runs. All performance numbers below use the default path,
|
There was a problem hiding this comment.
3 issues found across 11 files
Not reviewed (too large): server/src/deepseek4/deepseek4_graph.cpp (~4,552 lines) - if these are generated or fixture files, add them to ignored paths to exclude them from future reviews.
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="server/src/server/http_server.cpp">
<violation number="1" location="server/src/server/http_server.cpp:182">
P2: Responses can lose a legitimate `�` character because `Utf8OutputFilter` drops valid U+FFFD code points after validating the UTF-8 sequence. Since invalid byte sequences are already skipped by the validator, preserving valid U+FFFD avoids corrupting model output while still filtering malformed bytes.</violation>
</file>
<file name="server/src/deepseek4/deepseek4_internal.h">
<violation number="1" location="server/src/deepseek4/deepseek4_internal.h:355">
P2: `want_logits=false` does not currently skip the output head/readback on this path, so prefill chunks that only need KV/routing state still perform the expensive logits projection. Threading `want_logits` into the graph implementation would make the new API contract true.</violation>
</file>
<file name="server/src/deepseek4/deepseek4_hc_cuda.cu">
<violation number="1" location="server/src/deepseek4/deepseek4_hc_cuda.cu:618">
P2: Batch HC pre can fail for valid `n_hc > 4` configs: `hc_pre_batch_device_locked` compares `mix_dim` to `kMixDim` (24) even though allocation and public validation allow `kMaxMixDim` (80). Matching this guard to `kMaxMixDim` keeps the direct batch path usable for all accepted HC counts.</violation>
</file>
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
| MoeHybridStreamEngine * stream_engine = nullptr, | ||
| ExpertIpcClient * expert_worker = nullptr, | ||
| bool worker_owns_hot_ids = false, | ||
| bool want_logits = true, |
There was a problem hiding this comment.
P2: want_logits=false does not currently skip the output head/readback on this path, so prefill chunks that only need KV/routing state still perform the expensive logits projection. Threading want_logits into the graph implementation would make the new API contract true.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At server/src/deepseek4/deepseek4_internal.h, line 355:
<comment>`want_logits=false` does not currently skip the output head/readback on this path, so prefill chunks that only need KV/routing state still perform the expensive logits projection. Threading `want_logits` into the graph implementation would make the new API contract true.</comment>
<file context>
@@ -314,9 +350,34 @@ bool deepseek4_step(
- MoeHybridStreamEngine * stream_engine = nullptr,
+ ExpertIpcClient * expert_worker = nullptr,
+ bool worker_owns_hot_ids = false,
+ bool want_logits = true,
+ bool disable_cached_decode = false,
DeepSeek4StepTelemetry * telemetry = nullptr,
</file context>
Summary
This PR brings the current DeepSeek4 backend line from #353 to
main, and adds a directDeepSeek4Backendruntime path for non-layer-split DeepSeek4 requests in the C++ server.Before this change,
arch=deepseek4always went throughDeepSeek4LayerSplitAdapter+LayerSplitBackend, even for ordinary single-backend placements such as pure HIP / UMA. This PR keeps the existing layer-split route when the configured device is actually layer-split, and routes non-layer-split placements to the native DeepSeek4 backend instead.It also adds decode-side full-step graph reuse and fuller full-step timing telemetry so the direct runtime can be validated and profiled on large UMA devices.
Changes
deepseek4requests toDeepSeek4Backend.DeepSeek4LayerSplitAdapter+LayerSplitBackendpath fordevice.is_layer_split().build / alloc / set / compute / readtimings in DeepSeek4 runtime telemetry.Validation
gfx1151environment withmax_ctx=104857681687.7 MB1M ctx:6897.8 MB1M ctxruntime checks with the defaultchunk=512:256 / 321228.3 ms208.422001.8 ms16.004096 / 12818429.1 ms222.268288.5 ms15.408192 / 25642513.7 ms192.6917407.2 ms14.7016384 / 512108775.9 ms150.6238418.0 ms13.30above listed data is obselette due to lack of HC-correctness guard