Repository navigation
[Engine] helper cards given by --expert-cache-device are placement: no auto layer split, no split reorder (v0.2.23 rebase) - #7434
Open
fri-K wants to merge 1 commit into
Conversation
… reorder (Niko1221#665, Niko1221#1352) Niko1221#665 made --peer-device suppress the automatic layer split; the native multi-helper args --expert-cache-device1..3 were left out, so a multi-GPU helper-cache config got "--layer-split auto" injected AND the Niko1221#1352 speed reorder applied on top. On a mixed-family board (RX 9060 XT primary + 2x RX 6600 expert-cache helpers) that silently demotes the fastest card to the LAST split stage: the first request then staged a split across families which hard-crashed that host twice (GPU reset, no recovery). Helper mode must never be silently converted into a split. helper_cache_of() covers every helper arg and check_placement() rejects helper placement beside an explicit "layer_split" and a --peer-device outside the visible set, at config check; they live in server_parts/engines.py beside layer_split_of. ordered_gpus() keeps the config order when helpers are in play and the startup announce names helper caches instead of the peer tier. Plain split and peer configs render exactly as before. terminal/serve/test_placement_helpers.py: 11 cases incl. the no-reorder regression. On unpatched main the suite fails 4+7 against these cases; the full terminal/ discovery (1947 tests incl. these) shows one pre-existing failure (test_telemetry_adl Windows ADL reader choice, identical on unpatched main) and nothing else. ---
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.
Problem and result
A multi-helper config — gpu: [0, 1, 2] with --expert-cache-device1 auto --expert-cache-device2 auto (RX 9060 XT primary + two RX 6600 expert-cache tiers; gfx1200 + gfx1032 mixed) — is placement, but serve does not know it.
Before (still true at v0.2.23): --layer-split auto is injected anyway and the GPU order is rewritten so the fastest card (the gfx1200 primary) lands in the LAST split stage. On the board this runs on, the first such request hard-crashed the host twice (GPU reset, power-cycle needed).
After: helper placement is honored end to end — no injection, no reorder, correct announce line — and check_placement() fails at config-check on contradictory placement (helper args beside an explicit layer_split, --peer-device outside the visible set). Split-only and peer-only configs render byte-identical to before.
Repro on pristine v0.2.23 (release-prep commit 4560d03):
cfg = {"gpu": [0,1,2], "backend": "hip", "args": ["--expert-cache-device1", "auto", "--expert-cache-device2", "auto"]}
terminal/serve/server_parts/engines.py:783 (v0.2.23): layer_split_of(cfg) = True -> serve injects --layer-split auto + reorders
branch: layer_split_of(cfg) = False | helper_cache_of(cfg) = True
This supersedes #6324 (closed): the repo moved serve/ to terminal/serve/ and server.py into server_parts/ at 0.2.16; this branch is the same patch rebased onto the 0.2.23 release tag, cherry-pick applied cleanly (3 files, +134/-6). Upstream has since added --peer-device to layer_split_of, but the expert-cache args are still ungated.
Approach
One gate shared by both injection points, in #665's style: helper_cache_of() recognizes every helper arg (--peer-device, --expert-cache-device1..3); layer_split_of() and ordered_gpus() consult it; check_placement() turns silent misplacement into a config-check error.
serve never sets STRATA_PRIMARY_DEVICE, so visible order IS placement — the reorder actively breaks it. No engine-side changes.
Validation
Passed
Failed
Not run
Limits
Single host, single model family. Staged layer-split across gfx1200+gfx1032 stays dangerous on this board — this change makes serve stop silently creating it; it does not make the split itself safe. check_placement() rejects helper+explicit-split rather than reconciling it — stricter than a merge, chosen because the merge already proved fatal here.