feat(launch): UX improvements regarding auto device placement, DeepSeek V4 flags and profiles, pass-through container entrypoint - #753
Open
Graffioh wants to merge 2 commits into
Conversation
Graffioh
force-pushed
the
refactor/launch-ux
branch
from
September 23, 2026 11:11
536689f to
a823950
Compare
Collaborator
Author
|
@cubic-dev-ai review this PR |
Contributor
@Graffioh I have started the AI code review. It will take a few minutes to complete. |
Contributor
There was a problem hiding this comment.
All reported issues were addressed across 22 files
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
Graffioh
force-pushed
the
refactor/launch-ux
branch
from
September 24, 2026 14:19
a823950 to
ac8c1a9
Compare
Graffioh
marked this pull request as ready for review
September 24, 2026 14:36
Contributor
There was a problem hiding this comment.
All reported issues were addressed across 23 files
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
- --target-device auto (and LUCE_TARGET_DEVICE as the default) places the model on a GPU it fits on, discrete before integrated, else the largest. For the Qwen3.5/3.6 hybrids the fit includes the KV cache at --max-ctx, sized from the GGUF header with the backend's own helper and cache types. - luce_server --list-devices [model] prints each GPU's backend:N index, arch and memory, the model's arch and size, and the auto choice. - A failed load on a device that is too small names the device that would hold the model. - --draft on a DeepSeek V4 target loads the DSpark drafter; LUCE_DS4_SPEC/LUCE_DS4_DRAFT still work when --draft is absent. An explicit --draft that fails to load stops startup, and an empty one is rejected instead of silently disabling speculation. - Draft placement has one precedence, in resolve_draft_placement(): an explicit --draft-device (auto:N names GPU N), then LUCE_DS4_DRAFT_GPU/_BACKEND, then the target GPU. - --expert-device backend:gpu is the flag form of the in-process expert split (LUCE_DS4_MOE_TP, _INPROC, _GPU, _BACKEND). - --profile ds4-strix and ds4-r9700-strix carry the qualified DeepSeek V4 recipes. Explicit flags and already-set environment variables win. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
… entrypoint The container could not express most luce_server launches: extra arguments after `serve` were dropped, a leading flag was exec'd as a command, GPU detection used nvidia-smi only, and the target always went to device 0 (issue Luce-Org#712: DeepSeek V4 on an R9700 + Strix Halo host tried to load 93 GB onto the 32 GB R9700). - `serve [flags]` and bare flags reach luce_server last, so they win; LUCE_ARGS and LUCE_PROFILE cover the same for compose files, and a command-line --profile replaces LUCE_PROFILE. An explicit --max-ctx is passed once, and the startup log shows it and any --target-devices placement as given. - Probe GPUs, model arch and the auto device with luce_server --list-devices on CUDA and ROCm alike; export LUCE_TARGET_DEVICE=auto and size the context from the chosen GPU. - Pick drafts by architecture: DeepSeek V4 gets its DSpark drafter and no DDTree, except when serving concurrently (--max-concurrency > 1 or --paged-attention), which is autoregressive; projectors and DSpark files are never DFlash drafts. - Add `devices`; drop the dead HOST_INFO writer and `lucebox` dispatch, and stop forwarding two flags luce_server no longer accepts. - test_entrypoint.sh replaces the cache-defaults test and runs the entrypoint without the caller's LUCE_* variables. - Docs: recipes use --draft, --expert-device and --profile, and cover --target-device auto, --list-devices and Docker passthrough. Fix the --max-ctx and --model-name defaults, the fused-decode load failure (it stops startup), and the 3090 + Strix recipe that never enabled its drafter. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Graffioh
force-pushed
the
refactor/launch-ux
branch
from
September 24, 2026 15:09
ac8c1a9 to
769d9c4
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #712.
Why
On an R9700 + Strix Halo host, the
:rocmcontainer loaded DeepSeek V4 Flash onto device 0 (the 32 GB R9700) and failed to allocate 93 GB. There was no way to fix this from the container, because the launch system could not express mostluce_serversetups:servedropped any extra arguments.--target-devicewas exec'd as a command.nvidia-smionly, so ROCm launches got no context sizing.--draft/--ddtree, which it ignored; its drafter was env-only (LUCE_DS4_SPEC,LUCE_DS4_DRAFT).What changes
luce_server--target-device autoplaces the model on a GPU it fits on: discrete before integrated, then the lowest index; if none fits, the largest.LUCE_TARGET_DEVICEsupplies the default when no flag or profile names a device.--max-ctx, sized from the GGUF header with the backend's own helper and cache types (Qwen3.8-27B: 2.2 GiB at 131072 tokens with q4_0). DeepSeek V4 and other families size their own caches and keep the margin.--list-devicesprintskv_mibat the default context.auto:0unless they opt in.--draft-device(auto:Nmeans GPU N), then DeepSeek V4'sLUCE_DS4_DRAFT_GPU/_BACKEND, then the target GPU.luce_server --list-devices [model.gguf]prints each GPU'sbackend:Nindex, arch and memory, the model's arch and size, and the auto choice.--drafton DeepSeek V4 loads the DSpark drafter, and--draft-deviceplaces it.LUCE_DS4_SPEC/LUCE_DS4_DRAFTstill work when--draftis absent.--draftthat fails to load now stops startup, and an empty--draftis rejected; the env spelling keeps its autoregressive fallback.--expert-device backend:gpuis the flag form ofLUCE_DS4_MOE_TP=1 _INPROC=1 _GPU=<n> _BACKEND=<b>.--profile ds4-strixand--profile ds4-r9700-strixcarry the qualified DeepSeek V4 recipes (flags plus, for the R9700 profile, 37 tuning variables).Container entrypoint (rewritten; 543 → ~300 lines)
serve [flags]and bare flags go toluce_serverlast, so they win.LUCE_ARGSandLUCE_PROFILEcover the same for compose files. A newdevicessubcommand runs--list-devices.luce_server --list-devices, so CUDA and ROCm are handled the same way. The entrypoint exportsLUCE_TARGET_DEVICE=autoand sizes the context from the chosen GPU. A profile's own--max-ctxis left alone, and an explicit--max-ctxflag is passed once and shown in the startup log. With--target-devices, the log names that placement.*dspark*.ggufand no--ddtree, and projector or DSpark files are never used as DFlash drafts.HOST_INFOwriter, which nothing reads;luceboxsubcommand, whose package is not in the image;--think-soft-close-min-ratioand--debug-thinking-logits, whichluce_serverrejects with "unknown option".Docs
DS4.md,RECOMMENDED_SETUPS.mdandimage-input.mdnow use--draft,--expert-deviceand--profile, and the README covers Docker passthrough.--max-ctxdefault (8192, not 131072) and the--model-namedefault (luce);LUCE_DS4_SPEC, so its drafter never loaded.Behaviour changes
models/draft/, except with--max-concurrency> 1 or--paged-attention: paged DS4 serving is autoregressive and rejects a drafter. ROCm launches now get the same context tiers as CUDA; before, ROCm stayed at 16384.--drafton DeepSeek V4 is no longer ignored.Validation
All runs were on an R9700 (gfx1201) + Strix Halo (gfx1151) host with
DeepSeek-V4-Flash-0731-ROCMFPX-MIX-STRIX.ggufand the DSpark Q4RMFP4 drafter. Baseline = unmodifiedmainbuilt for the same architectures.main, plain launch--target-device autohip:1, loads the whole model, serves correctlyhint: ... hip:1 ... is the better fit--profile ds4-strix --draft--profile ds4-r9700-strix --draftDS4.mdrecipe (scripted)hip:1, DSpark drafter, no--ddtree,max_ctx=131072, served a requestctest -R "server_unit|feature_gate"(HIP)test_launch_policyandserver_unit_entrypointNot covered locally:
device_select.cpphas a CUDA branch (sm_XYarch string); CI covers it.Out of scope / follow-ups
serve_ds4_dual_rocm_128k.sh(RX 7900 + Strix) and the qualification harness keep their env recipes, which still work. I can't qualify an RX 7900 profile here.:rocmimage does not shipbackend_ipc_daemonor build withLUCE_ROCMFP2_AFFINE, so the CUDA + Strix target-shard split and the RX 7900 profile still need a native build.harness/clients/common.shandserver/scripts/run.pykeep their own launch and draft resolution.🤖 Generated with Claude Code