[Engine] Switching quant tiers starts the learned expert profile over: the save path is per pack tag, while the loader only checks geometry
Maintainer thường phản hồi trong vòng 4 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 55/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Lĩnh vực
- backend, performance
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- C++
- Star
- 11.6k
- Fork
- 1k
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của Niko1221/Strata
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Niko1221/Strata#7365 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 4 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 4 ngày
-
[GUI] Engine chip: move the breathing status dot to the right end of the quant line, inside the chipĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
Maintainer thường phản hồi trong vòng 4 ngày
-
[GUI] The top horizontal stroke of 更 in the sidebar footer is never drawn (Windows, 125% scaling)Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Niko1221/Strata#7276 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 4 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
Niko1221/Strata#7230 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 4 ngày
Tất cả issue của Niko1221/Strata
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
Maintainer thường phản hồi trong vòng 1 ngày
-
`test_controlled_TermSequenceBox_logging` and `test_symbolic_ops` fail when another test runs firstĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Quantinuum/tket#2282 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 84/100
KhronosGroup/Vulkan-Tutorial#555 ·
Maintainer thường phản hồi trong vòng 10 ngày
-
Server crashes when a mob dies to poisonCó thể đã có người làm @joelstiller đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
DarkCastleMUD/DarkCastle#305 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[Issue]: RAS status report lists the wrong pids for an outlier nodeCó thể đã có người làm @bhargavchintam đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
Maintainer thường phản hồi trong vòng 2 ngày