Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
2771c16
perf(dflash): add safe exact prefill bands
cheese-cakee Aug 6, 2026
ed89917
fix(dflash): preserve existing prefill schedulers
cheese-cakee Aug 6, 2026
ce2cbd9
fix(dflash): harden exact prefill lifecycle
cheese-cakee Aug 7, 2026
4049d99
fix(dflash): separate exact prefill logits readback
cheese-cakee Aug 10, 2026
aebdd44
test(dflash): preserve recursive output contracts
cheese-cakee Aug 10, 2026
5c0745e
fix(dflash): preserve exact raw-ring reduction order
cheese-cakee Aug 10, 2026
de8428c
fix(dflash): scope raw-ring order to exact prefill
cheese-cakee Aug 10, 2026
c6d5815
fix(dflash): preserve q1 hybrid FFN order for exact q4
cheese-cakee Aug 11, 2026
423bd17
fix(dflash): retire exact route graph metadata
cheese-cakee Aug 11, 2026
3e98b46
Merge upstream/main into exact prefill bands
cheese-cakee Aug 12, 2026
a4f43a8
Merge upstream/main into exact prefill bands
cheese-cakee Aug 13, 2026
7fe85b8
test(dflash): read balanced quota from correct slot
cheese-cakee Aug 14, 2026
919b1e2
merge: reconcile exact prefill with current main
cheese-cakee Aug 17, 2026
ce291c6
fix(hip): map no-device error in CUDA shim
cheese-cakee Aug 17, 2026
285c3b7
Merge remote-tracking branch 'origin/main' into codex/pr590-current-m…
cheese-cakee Aug 17, 2026
dda094f
fix(deepseek4): avoid cached graphs during snapshot prefill
cheese-cakee Aug 17, 2026
61909d5
fix(deepseek4): force eager snapshot prefill graphs
cheese-cakee Aug 18, 2026
5f7799b
fix(deepseek4): defer terminal snapshot save
cheese-cakee Aug 18, 2026
12bbce6
Merge remote-tracking branch 'origin/main' into codex/pr590-current-m…
cheese-cakee Aug 18, 2026
c2b557f
merge: reconcile exact prefill with current main
cheese-cakee Aug 18, 2026
42d5c3e
fix(ds4): suppress inactive warning without verifier hooks
cheese-cakee Aug 18, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions server/docs/DS4.md
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,7 @@ The runtime logs the chosen split with a `[deepseek4-split] auto-split:` banner.
|----------|---------|
| `DFLASH_DS4_CUDA_LAYERS` | Override the auto-split heuristic and pin the first `N` DeepSeek4 layers to CUDA. The remaining `43 - N` layers run on the Halo shard. |
| `DFLASH_DS4_TIMING` | Enable DS4 timing logs for the layer-split parent and target-shard daemon. Useful for profiling prefill/decode breakdowns; leave unset for normal runs. |
| `DFLASH_DS4_EXACT_PREFILL_BANDS` | Opt in to compressor-safe exact prefill bands up to four tokens on supported layer-range paths. Exact attention remains tokenwise. Leave unset for the default single-token path; `--chunk 1` is the hard fallback. |
| `DFLASH_DS4_ROCTX` | HIP-only, default-off semantic ROCTX ranges for an external rocprof trace. The library is loaded dynamically only when set to `1`, `true`, `yes`, or `on`. |
| `DFLASH_DS4_SPEC` / `DFLASH_DS4_DRAFT` | Enable DSpark and select its GGUF. |
| `DFLASH_DS4_DRAFT_BACKEND` / `DFLASH_DS4_DRAFT_GPU` | Backend and device for the in-process drafter. |
Expand Down
1 change: 1 addition & 0 deletions server/docs/ENVIRONMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ consolidation of this list into CLI flags is tracked as follow-up work.
- `DFLASH_DS4_DRAFT_BACKEND` - deepseek4_backend.cpp
- `DFLASH_DS4_DRAFT_GPU` - deepseek4_backend.cpp
- `DFLASH_DS4_DSPARK_DEBUG` - deepseek4_graph.cpp
- `DFLASH_DS4_EXACT_PREFILL_BANDS` - deepseek4_backend.cpp
- `DFLASH_DS4_FUSED_VERIFY` - deepseek4_dspark_spec.cpp, deepseek4_loader.cpp
- `DFLASH_DS4_HOTNESS_CSV` - deepseek4_backend.cpp
- `DFLASH_DS4_MOE_TP` - deepseek4_backend.cpp
Expand Down
1 change: 1 addition & 0 deletions server/hip_compat/cuda_runtime.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ using cudaDeviceProp = hipDeviceProp_t;
// Error codes
#define cudaSuccess hipSuccess
#define cudaErrorInvalidValue hipErrorInvalidValue
#define cudaErrorNoDevice hipErrorNoDevice
#define cudaErrorIllegalAddress hipErrorIllegalAddress
#define cudaErrorAssert hipErrorAssert
#define cudaErrorLaunchFailure hipErrorLaunchFailure
Expand Down
263 changes: 221 additions & 42 deletions server/src/deepseek4/deepseek4_backend.cpp

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions server/src/deepseek4/deepseek4_backend.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ int deepseek4_hybrid_prefill_chunk_tokens(
int context_end,
int current_cap = 0);

bool deepseek4_prefill_allows_decode_graph_reuse(bool save_snapshot);

class DeepSeek4Backend : public ModelBackend {
public:
explicit DeepSeek4Backend(const DeepSeek4BackendConfig & cfg);
Expand Down
16 changes: 9 additions & 7 deletions server/src/deepseek4/deepseek4_fused_verify.inc
Original file line number Diff line number Diff line change
Expand Up @@ -1024,7 +1024,7 @@ static int ds4_try_fused_verify_step(
const float * embed,
int n_tokens,
int kv_start,
std::vector<float> & out_logits,
std::vector<float> * out_logits,
const int32_t * token_ids,
Ds4VerifyHooks * hooks,
DeepSeek4StepTelemetry * telemetry,
Expand Down Expand Up @@ -1342,21 +1342,23 @@ static int ds4_try_fused_verify_step(
ggml_backend_tensor_get(fg->logits, hooks->all_logits_out->data(), 0,
sizeof(float) * (size_t) w.n_vocab * q);
}
if (!argmax_only) {
out_logits.resize((size_t) w.n_vocab);
ggml_backend_tensor_get(fg->logits, out_logits.data(),
if (!argmax_only && out_logits) {
out_logits->resize((size_t) w.n_vocab);
ggml_backend_tensor_get(fg->logits, out_logits->data(),
(size_t) (q - 1) * (size_t) w.n_vocab * sizeof(float),
sizeof(float) * (size_t) w.n_vocab);
} else {
out_logits.clear();
} else if (out_logits) {
out_logits->clear();
}
if (hooks->capture_out && ex->capture && ncap > 0) {
hooks->capture_out->resize((size_t) ncap * w.n_embd * q);
ggml_backend_tensor_get(
ex->capture, hooks->capture_out->data(), 0,
sizeof(float) * hooks->capture_out->size());
}
if (telemetry) {
if (telemetry &&
(argmax_only || hooks->all_logits_out || out_logits ||
(hooks->capture_out && ex->capture && ncap > 0))) {
telemetry->full_graph_read_us += ds4_elapsed_us(read_t0, Ds4TimingClock::now());
}
return 1;
Expand Down
Loading