Repository navigation
feat(server): place --target-device auto by GPU availability and multi-GPU technique - #821
Conversation
e998e70 to
f2c3230
Compare
Review findings addressed
Updated the server reference, including the stale Verification
Availability remains a startup snapshot, not a reservation; simultaneous launches can race. CUDA uses free memory without a busy-process signal. KFD host-PID labels/self-exclusion are not namespace-safe in containers using a separate PID namespace; this is documented. Nonzero PCI-function mapping was verified with filesystem fixtures, not partitioned GPU hardware. |
Production-readiness follow-up at
|
| Comparison | Result |
|---|---|
DeepSeek explicit hip:0 + expert hip:1 + peer access vs auto expert parallel |
Generated message bytes, finish reason, and completion-token counts matched on all four prompts; repeats stable |
DeepSeek Strix-only hip:1 vs auto expert parallel |
Same equality on all four prompts; repeats stable |
Qwen explicit hip:1 vs auto, F16 KV, two concurrent paged slots |
Same equality on all four prompts; repeats stable |
Qwen was configured with a 1,048,576-token logical context and a 4,096-token physical pool to exercise the auto-placement feature constraint. This did not test million-token inference.
For each auto configuration, also sent 12 requests through two simultaneous HTTP clients, interrupted a streamed generation after 12 SSE events, then checked two recovery requests. DeepSeek's single-slot backend queued the overlapping requests; Qwen used a two-slot paged backend. No request errors or output drift. Both ended with zero active/parked requests. Total: 68 completed requests, 2,432 generated tokens, plus two intentional stream disconnects.
Strict requested output formatting was not universally obeyed: DeepSeek added a sentence around the correct arithmetic answer and Markdown fences around JSON; Qwen also fenced JSON. The baselines did the same. This is not a broad model-quality pass.
Reasons not to give blanket production approval
- Untuned auto expert parallel was slower than Strix-only in this sample: the DeepSeek retrieval request took 84.2–84.7 s, versus 66.9–67.5 s on Strix alone. This is not a controlled performance qualification, but the automatic preference for both GPUs is not established as a performance win.
- No long-context/long-duration soak, raw-logit oracle, multimodal/drafter coverage, memory-pressure fault campaign, or end-to-end CUDA auto-placement qualification was performed.
- Simultaneous-start placement races and container PID-namespace limitations remain as documented.
The latest Linux/Windows builds, workspace/commit checks, and R9700/Strix/GB10 GPU CI jobs pass. The speed-profile job is skipped.
Recommendation: keep production pinned to a qualified profile/explicit topology; treat the new automatic multi-GPU policy as a controlled canary until workload-specific performance and long-running qualification are complete. No additional source changes or deployment were made in this validation pass.
|
@davide221 cubic can't start this review because your workspace has reached its monthly review limit. cubic has reviewed 161,326 of the 160,000 allowed lines of code this month. Reviews resume on 24 October 2026 (in 17 days). Enable flex capacity to cover overages automatically and resume reviews now. Learn how flex capacity works. To help optimise your usage, you can tune cubic to get the most out of your usage limits:
|
|
The code review bot stopped. The review failed, so nothing was posted. Maintainers: see the lucebox_bots run log. |
|
The code review bot stopped. The review failed, so nothing was posted. Maintainers: see the lucebox_bots run log. |
|
The code review bot stopped. The review failed, so nothing was posted. Maintainers: see the lucebox_bots run log. |
Code reviewNo issues found. Checked for bugs and logic errors in the changed code. Reviewed |
|
The code review bot stopped. An unexpected error occurred. Maintainers: see the lucebox_bots run log. |
|
The code review bot stopped. The Maintainers: see the lucebox_bots run log. |
davide221
left a comment
There was a problem hiding this comment.
Code review
No issues found. Checked for bugs and logic errors in the changed code.
Note: the diff reviewer gave no answer.
Reviewed 38d1ea5c · 0 candidate issues checked, kept at ≥80% confidence · add the code-review label to review again
davide221
left a comment
There was a problem hiding this comment.
Code review
No issues found. Checked for bugs and logic errors in the changed code.
Reviewed 38d1ea5c · 0 candidate issues checked, kept at ≥80% confidence · add the code-review label to review again
davide221
left a comment
There was a problem hiding this comment.
Code review
No issues found. Checked for bugs and logic errors in the changed code.
Reviewed 38d1ea5c · 0 candidate issues checked, kept at ≥80% confidence · add the code-review label to review again
davide221
left a comment
There was a problem hiding this comment.
Code review
No issues found. Checked for bugs and logic errors in the changed code.
Reviewed 38d1ea5c · 0 candidate issues checked, kept at ≥70% confidence · add the code-review label to review again
davide221
left a comment
There was a problem hiding this comment.
Code review
Found 1 issue:
- Multi-GPU auto placement checks only the summed free memory, not each GPU's share (
server/src/placement/device_select.h:235-260)
Reviewed 38d1ea5c · 1 candidate issue checked, kept at ≥70% confidence · add the code-review label to review again
davide221
left a comment
There was a problem hiding this comment.
Code review
No issues found. Checked for bugs and logic errors in the changed code.
Reviewed 38d1ea5c · 0 candidate issues checked, kept at ≥70% confidence · add the code-review label to review again
davide221
left a comment
There was a problem hiding this comment.
Code review
No issues found. Checked for bugs and logic errors in the changed code.
Reviewed 38d1ea5c · 2 candidate issues checked, kept at ≥70% confidence · add the code-review label to review again
davide221
left a comment
There was a problem hiding this comment.
Code review
No issues found. Checked for bugs and logic errors in the changed code.
Reviewed 38d1ea5c · 1 candidate issue checked, kept at ≥70% confidence · add the code-review label to review again
davide221
left a comment
There was a problem hiding this comment.
Code review
No issues found. Checked for bugs and logic errors in the changed code.
Reviewed 38d1ea5c · 1 candidate issue checked, kept at ≥70% confidence · add the code-review label to review again
…room The hybrid expert budget reserved 0.5 GiB on the main GPU, but check_device_headroom() requires 1.5 GiB free on a discrete GPU after load. Without LUCE_EXPERT_BUDGET_MB (every qualified profile pins one), an R9700 + Strix Halo expert-parallel launch filled the R9700 to 0.99 GiB free and failed. The budget now reserves the device headroom. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…i-GPU technique auto skips GPUs another process holds and sizes devices by free memory. On AMD a GPU is busy when another process has KFD queues there or more than 64 MiB in vram_<gpu_id>: a server, single-GPU or split, holds every GPU it spans about a second after it starts, before its weights load. Free memory alone cannot tell, since Strix Halo reports ~121 GiB free while holding DeepSeek V4 or half of a layer-split Qwen. The log and --list-devices name each such process, its model and the GPUs it spans. Placement order: 1. a discrete GPU that holds the model alone (Qwen 27B decodes 36 tok/s on an R9700, 15 split with Strix Halo); 2. the architecture's multi-GPU technique over the free GPUs when they hold the model together: DeepSeek4 expert parallel, layer-split families by layer weighted by free memory; 3. one GPU that holds it, discrete first; 4. the roomiest GPU for backends with expert offload; 5. otherwise stop before loading. With --profile, auto picks only the device. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
38d1ea5 to
d01872d
Compare
Summary
--target-device autonow places a model by what the GPUs are doing at startup, and by how the model can use more than one GPU.vram_<gpu_id>(/sys/class/kfd/kfd/proc). Free memory alone cannot tell: Strix Halo reports ~121 GiB free while holding DeepSeek V4 or half of a layer-split Qwen. A server single-GPU or split shows up on every GPU it spans, about a second after it starts and before its weights load. The startup log and--list-devicesname it:busy=pid 1154989 luce_server Qwen3.8-27B-IQ4_XS-pure.gguf on hip:0+hip:1.--expert-device), layer-split families by layer (weights ∝ free memory). This targets models only Strix Halo can hold, where the discrete GPU's help beats Strix alone;--profile, auto picks only the device, since a profile is qualified for one topology.--target-device auto --profile ds4-strixbehaves as before.check_device_headroom()requires 1.5 GiB on a discrete GPU. Every R9700 + Strix expert-parallel launch withoutLUCE_EXPERT_BUDGET_MBfailed at 0.99 GiB free. The qualified profiles pin a lower budget, so they never hit it.qwen4exp(Qwen3.8-Flash-Next) has no layer-split or expert-device path, so auto places it on one free GPU: the R9700 when it fits there, otherwise Strix Halo.Validation (R9700
hip:0+ Strix Halohip:1, rebased on c320db9)DeepSeek-V4-Flash-0731 ROCMFPX-MIX-STRIX (91.5 GiB),
--target-device auto --max-ctx 8192, no profile:hip:0,hip:1, peer access onWhy a model that fits the discrete GPU stays there: Qwen3.8-27B IQ4_XS (13.5 GiB) forced into an auto layer split (
[0,13)R9700,[13,64)Strix Halo) decoded 15.1 tok/s over 128 tokens, against 36.2 tok/s on the R9700 alone. Both were warm, 2 runs each. With this order, auto keeps it onhip:0. The split path itself loaded and answered correctly.Detection was checked against a Qwen 27B layer split (
--target-devices hip:0,hip:1), a single-GPU Qwen server, and a server 2 s into loading.test_server_unit630/630test_feature_gate, including newtest_launch_policycases for the availability policytest/test_entrypoint.shPASSNot covered
ds4-r9700-strixtuning. Its 33.7 tok/s on a 2-token reply is not a benchmark.ds4-strixon Strix alone is documented at 42 tok/s with 131K context. Whether DS4 should prefer Strix alone when both GPUs are free is open.🤖 Generated with Claude Code