[Engine] Switching quant tiers starts the learned expert profile over: the save path is per pack tag, while the loader only checks geometry
I maintainer di solito rispondono entro 4 giorni
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 55/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Ambito
- backend, performance
Direzione di ricerca
Start with learned_profile_args() and profile_shape() in the Python serving and config path, then compare their fallback behavior with read_expert_profile() in src/core/expert_cache.cpp. Check how the configured save path and per-replica suffix are formed. Done means a same-geometry profile can be selected when the tagged save file is missing, with a log naming the adopted file; the issue also suggests documenting profile portability.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Problem: On one machine running three quantisation tiers of Qwen3.8-Flash-Next, each tier's learned expert profile is stored under a different pack-tagged filename, so changing tier starts the adaptive tier from the shipped baseline instead of from a profile that a previous tier already trained. The engine loader itself does not require a tier match: it accepts any profile whose header reports the same layer and expert counts.
Environment: engine 0.1.62, Windows 11, RTX 3090 24 GB (sm_86), CUDA 13.0. Model: Qwen3.8-Flash-Next (48 layers x 512 experts). Tiers used on this box: UD-IQ4_XS v3.1 (--native, 4 shards), UD-Q4_K_XL, and Swift-1.5 IQ3_S_G8. Relevant settings: --expert-cache auto --adapt-every 1 --adapt-swaps 160 --adapt-decay 0.97 --kv int8 --kv-resident 20480 --max-context 393216, config keys expert_profile_save and expert_profile_save_every: 5.
Reproduce:
- Train a profile on tier A (a few hours of normal use;
expert profile saved to ... (periodic)appears in the log, and the start log showspre-filled 6495 of 6495 slots from the profile). - Point the config at tier B, a different quantisation of the same model, and start serve.
- Watch
data/gain a secondexpert-profile-learned-<new-tag>.bin, and the start log name that new file rather than the trained one.
Expected: a tier change either reuses an existing profile of the same geometry as its starting prior, or says in one line that it is starting fresh.
Actual: a new tagged file is created and the first start begins from the config's --expert-profile (the shipped baseline), because learned_profile_args() substitutes the saved profile only when that exact path already exists and matches:
learned = profile_shape(save if os.path.isabs(save) else os.path.join(here, save))
base = profile_shape(args[i] if os.path.isabs(args[i]) else os.path.join(here, args[i]))
if learned is not None and learned == base:
args[i] = save
(profile_shape() returns None for a missing file, so on a new tag the substitution never happens.)
Evidence — the four profile files on this box have identical headers, so nothing in the format is tier-specific:
| file | magic | ver | layers | experts | slots | ranked |
|---|---|---|---|---|---|---|
expert-profile.bin (shipped) |
STRP | 1 | 48 | 512 | 24576 | 24576 |
...-learned-...-unsloth-iq4xs-v31.bin |
STRP | 1 | 48 | 512 | 24576 | 24576 |
...-learned-...-unsloth-q4kxl.bin |
STRP | 1 | 48 | 512 | 24576 | 24576 |
...-learned-...-iq3s-g8.bin (separate install) |
STRP | 1 | 48 | 512 | 24576 | 24576 |
read_expert_profile() (src/core/expert_cache.cpp) rejects only on a bad magic, on version != 1, and on nl != n_layers || ne != n_expert ("it is a profile for a different artifact"). It never compares the pack, the quantisation, or a weight hash, and slots is not a constraint either: the file stores all 24,576 (layer, expert) pairs and the engine takes the top N for whatever the current resident budget is.
The tagged absolute path itself is written by the install/Control layer, not by serve; in this checkout the config simply carries
"expert_profile_save": "<data>/expert-profile-learned-021-unsloth-iq4xs-v31.bin", and serve/replicas.py only suffixes it per replica.
Workaround available today: point expert_profile_save at the trained file of another tier with the same geometry. The header check passes and the start log then shows the trained profile being pre-filled (this is the step we have not run end to end yet — see status below).
Two small suggestions:
- When no profile exists for the configured save path, look in the same directory for another
STRPversion 1 profile with the same(layers, experts)and use it as the prior, with one log line naming the adopted file. This is the same checkprofile_shape()already performs, applied as a fallback. - Document that a learned profile is portable across quantisation tiers of the same geometry, and that the pack tag in the filename is a naming convention rather than a compatibility requirement.
Related: #6200 and #6201 propose a two-timescale STRM sidecar because a saved profile over-specialises on the most recent workload. This report is not that problem and needs no new format: the profile that would have been reused already exists, on disk, for the same geometry. One connection worth a maintainer's answer: #6200 attributes the over-specialisation partly to the default adaptive decay of 0.7 per adaptation. We run --adapt-decay 0.97 (half-life roughly 23 adaptations instead of about 2), and day-to-day hit rates on this box stay at 91-96% across mixed work. We have not run the 0.7 arm, so this is a hypothesis, not a result — if 0.97 already removes most of the drift #6200 describes, the sidecar may be solving a smaller problem than it looks.
Reproduction status: unconfirmed static analysis with direct file and config inspection. The header table, the config keys, the start-log lines and the two code paths above were all read directly on this machine. We have not yet started a second tier from the first tier's profile on this box, so the reuse itself is inferred from read_expert_profile()'s acceptance rule, not observed. Verifying it is one cold start and one log line.
- Lingua principale
- C++
- Stelle
- 11.6k
- Fork
- 1k
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di Niko1221/Strata
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
Niko1221/Strata#7365 · 2 commenti ·
I maintainer di solito rispondono entro 4 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 4 giorni
-
[GUI] Engine chip: move the breathing status dot to the right end of the quant line, inside the chipAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 86/100
I maintainer di solito rispondono entro 4 giorni
-
[GUI] The top horizontal stroke of 更 in the sidebar footer is never drawn (Windows, 125% scaling)Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
Niko1221/Strata#7276 · 1 commento ·
I maintainer di solito rispondono entro 4 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
Niko1221/Strata#7230 · 1 commento ·
I maintainer di solito rispondono entro 4 giorni
Tutte le issue di Niko1221/Strata
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
I maintainer di solito rispondono entro 1 giorno
-
`test_controlled_TermSequenceBox_logging` and `test_symbolic_ops` fail when another test runs firstAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
Quantinuum/tket#2282 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 84/100
KhronosGroup/Vulkan-Tutorial#555 ·
I maintainer di solito rispondono entro 10 giorni
-
Server crashes when a mob dies to poisonForse già presa @joelstiller l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
DarkCastleMUD/DarkCastle#305 ·
I maintainer di solito rispondono entro 1 giorno
-
[Issue]: RAS status report lists the wrong pids for an outlier nodeForse già presa @bhargavchintam l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
I maintainer di solito rispondono entro 2 giorni