[Engine] explicit --layer-split reloads CUDA0 dense weights a second time at startup (0 MiB freed)
メンテナーはふだん 5 日以内に返信
評価
調査の方向性
src/program/generate.cppの6554~6557行目付近にあるtrimロジックと、7168行目付近にある後続のtrimブロックを読み、5580行目および5607~5612行目付近にある先行のstage_trim処理と比較してください。提示された--layer-split 18,33 --trim-stage-weightsコマンドで再現し、stage_trimがすでに有効な場合に、冗長なスキャンと再読み込みがスキップされることを確認してください。起動時にネイティブの射影行列が一度だけ読み込まれ、このtrimについて0 MiB freedが報告されなくなれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Area
[Engine] (speed, kernels, models, the server and API)
Desktop app, Terminal or source?
Source (START-HERE.bat, setup.sh or a build)
What happened
On an explicit --layer-split (for example --layer-split 18,33 --trim-stage-weights, or when the early spill walk converts auto into an explicit split), stage_trim (src/program/generate.cpp:5580) already trims CUDA0 before its initial wt.load and native_dense.load (src/program/generate.cpp:5607-5612):
strata generate: layer split: CUDA0 loads the dense weights of layers 0-17 only
strata generate: 95 MiB of weights loaded from .../packs/unsloth_iq3_xxs in 0.2 s (855 canonical tensors skipped: served natively)
strata: STRATA_HC_Q8=1: 0.24 GiB of Q8_0 hyper-connection projections for the verify read
strata generate: 191 native projection matrices, 1146.24 MiB of weights, in 5.1 s
However, const bool trim = o.trim_stage_weights && multi_gpu && !stages.empty(); at src/program/generate.cpp:6554 (added for --layer-split auto post-search trimming) does not check !stage_trim. As a result, on an explicit split:
if (trim)atsrc/program/generate.cpp:6557scansindex.txtand runsWeightTable::pool_bytes48 times over the already-trimmedskipset.if (trim)atsrc/program/generate.cpp:7168freesCUDA0's already-trimmed weight arena andNativeDenseprojections, re-allocates the same size, and reloads all 191 native projection matrices (1,146.24 MiB) from the GGUF shards a second time, adding ~5-7 seconds to startup and logging0 MiB freed:
strata: STRATA_HC_Q8=1: 0.24 GiB of Q8_0 hyper-connection projections for the verify read
strata generate: 191 native projection matrices, 1146.24 MiB of weights, in 5.0 s
strata generate: layer split: CUDA0 keeps only its own layers' dense weights (0.43 GiB in all): CUDA0 0-17 (0 MiB freed) (the later cards trim in late_weights)
Expected behavior: when stage_trim is already true (const bool trim = o.trim_stage_weights && multi_gpu && !stages.empty() && !stage_trim;), skip the redundant post-search trim_prefix scan and CUDA0 reload.
Smallest steps or command that reproduce it
./build/strata --serve \
--pack /path/to/packs/unsloth_iq3_xxs \
--native /path/to/Qwen3.8-Flash-Next-UD-IQ3_XXS-00001-of-00004.gguf \
--ple-gguf /path/to/Qwen3.8-Flash-Next-UD-IQ3_XXS-00004-of-00004.gguf \
--layer-split 18,33 --trim-stage-weights
Reproduction status
Reproduced locally
Strata version
Strata 0.2.15 · engine 0.1.61 (commit c77572806)
Graphics card, memory and system
RTX 5060 Ti 16 GB + RTX 2080 Ti 11 GB + RTX 3080 Ti 12 GB · 2x Xeon E5-2683 v4 · 188 GiB DDR4 RAM · Ubuntu Linux 7.3.4
Model, size and settings
Qwen3.8-Flash-Next UD-IQ3_XXS · 512K context (--kv k8v4) · --layer-split 18,33 --trim-stage-weights
Logs
strata generate: layer split: CUDA0 loads the dense weights of layers 0-17 only
strata generate: 95 MiB of weights loaded from .../packs/unsloth_iq3_xxs in 0.2 s (855 canonical tensors skipped: served natively)
strata: STRATA_HC_Q8=1: 0.24 GiB of Q8_0 hyper-connection projections for the verify read
strata generate: 191 native projection matrices, 1146.24 MiB of weights, in 5.1 s
...
strata: STRATA_HC_Q8=1: 0.24 GiB of Q8_0 hyper-connection projections for the verify read
strata generate: 191 native projection matrices, 1146.24 MiB of weights, in 5.0 s
strata generate: layer split: CUDA0 keeps only its own layers' dense weights (0.43 GiB in all): CUDA0 0-17 (0 MiB freed) (the later cards trim in late_weights)
- 主要言語
- C++
- スター
- 11.6k
- フォーク
- 1k
- 平均マージ
- 18日 13時間
- マージ済み PR(30日)
- 4
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
Niko1221/Strata のほかの issue
-
needs-format
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
Niko1221/Strata#6251 · コメント 1 件 ·
メンテナーはふだん 5 日以内に返信
-
[TUI] A leftover run config marks a model installed: the list checks the file name, not the filesオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 83/100
メンテナーはふだん 5 日以内に返信
-
needs-format
難易度 2/5 1〜3時間 初心者へのやさしさ 73/100
Niko1221/Strata#6229 · コメント 1 件 ·
メンテナーはふだん 5 日以内に返信
-
[Engine] qsa_rows_bench: --ctx below 32768 makes the dense step read outside the page table (Xid 31)オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
メンテナーはふだん 5 日以内に返信
-
[Other] Terminal: shell tab completion for the strata command対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
Niko1221/Strata#6086 · コメント 2 件 ·
メンテナーはふだん 5 日以内に返信
Niko1221/Strata の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
HarperFast/rocksdb-js#1131 ·
メンテナーはふだん 1 日以内に返信
-
area/daemon bug good first issue platform/linux priority/p2
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
ToshiNamura/Deimos#5 ·
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
metasequoiaime/msime#11666 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
patrick-hudson/put.gd-desktop#1679 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
Detokenizer keeps ▁ for BPE tokenizers with a top-level Metaspace decoder (NLLB, Reformer)対応中かも @0z5a が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
openvinotoolkit/openvino_tokenizers#840 ·
メンテナーはふだん 1 日以内に返信