Skip to content

perf(deepseek41): two-box decode switches in ds41-r9700-gorgon - #936

Merged
davide221 merged 3 commits into
mainfrom
perf/ds41-r9700-gorgon-decode
Nov 6, 2026
Merged

davide221 merged 3 commits into
mainfrom
perf/ds41-r9700-gorgon-decode

Conversation

@davide221

@davide221 davide221 commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Summary

ds41-r9700-gorgon (R9700 beside a 192 GB Gorgon Halo, every expert resident) never picked up the decode switches the expert-parallel cluster defaults carry (cluster_launch_env in launch_profiles.h). The profile now sets them as defaults:

  • LUCE_DS4_LANE_BATCH=1: the single-token verify lanes attend in one split-KV flash op
  • LUCE_DS4_SCHED_DEDICATED_COPIES=1, LUCE_DS4_HC_BOUNDARY_SPLIT=1, GGML_CUDA_PEER_COPY_KERNEL=1: one peer-copy kernel per handoff on dedicated copy streams
  • LUCE_MMID_GROUPED=1, LUCE_MMID_GROUPED_TYPES=79, LUCE_CUDA_MMVQ_MOE_FP2_PREFETCH=1: grouped MUL_MAT_ID and the ROCmFP2 prefetch loop
  • LUCE_DS4_GPU_ARGMAX_VERIFY=1, LUCE_DS4_DRAFT_CONTEXT_KV_CACHE=1: GPU argmax and the drafter's pinned context window
  • HSA_FORCE_FINE_GRAIN_PCIE=1: fine-grain pinned host memory

Profile env stays a default: a value the operator sets wins, and --paged-attention still leaves LUCE_MMID_GROUPED out (DEEPSEEK41_PAGED_UNQUALIFIED_ENV). LUCE_MOE_Q8_HANDOFF and LUCE_DS4_ENGRAM_PRECOMPUTE from the same set measured neutral on this layout and stay off. DS41.md gets the numbers below.

Validation

R9700 32 GB (PCIe Gen3 x4) + Ryzen AI Max+ PRO 495 192 GB, ROCMFP2S target, DSpark Q2K-Q4K drafter, greedy, fresh server per arm, 384-token answers, two runs each:

prompt before after
code (36 tokens) 44 tok/s 53-56 tok/s
2K-token document 36-38 tok/s 47.5-48 tok/s
33K-token document - 45 tok/s

The answers are byte-identical with and without the switches in every run, the 33K prompt included.

Paged batching, --paged-attention --max-concurrency 4 --kv-pool-tokens 131072 --ds4-prefill sparse, no drafter, four 256-token answers at once, two rounds: 20.4 -> 22.5 tok/s across the four (7.0 -> 8.0 each), no faults, answers coherent. Paged answers already vary round to round in both arms (the known near-tie behaviour in DS41.md), so they are not compared byte for byte.

🤖 Generated with Claude Code

View guided diff

The expert-parallel cluster defaults (cluster_launch_env) carry decode
switches the one-box R9700 + Gorgon profile never got: batched
single-token verify lanes, dedicated copy streams with one peer-copy
kernel per handoff, the HC boundary split, grouped MUL_MAT_ID (types
79), the ROCmFP2 prefetch loop, GPU argmax for verify, the drafter's
context K/V cache and fine-grain pinned host memory. The profile now sets
them as defaults; an explicit value still wins, and --paged-attention
still leaves LUCE_MMID_GROUPED out.

R9700 + 192 GB Ryzen AI Max, DSpark Q2K-Q4K drafter, greedy, 384-token
answers, fresh server per arm: code 44 -> 53-56 tok/s, a 2K-token
document 36-38 -> 47.5-48, 45 tok/s on a 33K-token document. The text is
byte-identical with and without the switches. Four users at once
(--paged-attention --max-concurrency 4 --ds4-prefill sparse, no drafter,
256-token answers): 20.4 -> 22.5 tok/s across the four, no faults.
LUCE_MOE_Q8_HANDOFF and LUCE_DS4_ENGRAM_PRECOMPUTE measured neutral here
and stay off.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

@davide221 davide221 left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code review

No issues found. Checked for bugs and logic errors in the changed code.

Reviewed 566ff119 · 0 candidate issues checked, kept at ≥70% confidence · add the code-review label to review again

@cubic-dev-ai cubic-dev-ai Bot 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.

All reported issues were addressed across 2 files

Reply with feedback, questions, or to request a fix.

View guided diff | Re-trigger cubic

Comment thread server/docs/DS41.md Resolved
Comment thread server/docs/DS41.md Resolved
Comment thread server/docs/DS41.md Resolved
davide221 and others added 2 commits November 4, 2026 14:27
The profile gained ten env defaults (50 -> 60), so the size check failed.
The test now checks each switch's value and that the two switches measured
neutral on this layout stay off.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…measured

DS41.md lists the ten switches by env var, says which engine the Measured
table and the before/after pairs come from, and marks that the paged pair
runs without LUCE_MMID_GROUPED (--paged-attention leaves it out). The model
card scopes byte-identity to one user with the drafter. ENVIRONMENT.md gains
the four switches its inventory lacked: LUCE_DS4_LANE_BATCH,
LUCE_DS4_SCHED_DEDICATED_COPIES, LUCE_DS4_HC_BOUNDARY_SPLIT and
GGML_CUDA_PEER_COPY_KERNEL.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@davide221
davide221 merged commit 61ba1f4 into main Nov 6, 2026
13 of 14 checks passed
@davide221
davide221 deleted the perf/ds41-r9700-gorgon-decode branch November 6, 2026 19:24
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.

1 participant