[Engine] Calibration sweeps bench the stock DFlash2 pack: engine_args called without exe in tools/calibrate.py

オープン 初心者向け
#5,720 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 4 日以内に返信

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
85/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
python

調査の方向性

tools/calibrate.py の256行目付近を読み、server_args の呼び出しを serve/server.py の engine_args の呼び出しと比較してください。引数 exe が drafting.apply と strata_control/drafting.py の selector-pack の選択にどう渡されるかを追ってください。issue に記載されたキャリブレーションの再現を実行し、drafter pack とメモリを通常の serving と比較してください。同じ設定で両方の経路が同じ pack を選択すれば完了です。

索引モデルが issue の本文から書いたものです。

説明

needs-format

Area: [Engine]
Desktop app, Terminal or source?: Source (START-HERE.bat / setup.sh / a build)
Reproduction status: Reproduced locally
Strata version: Strata 0.2.13.1 (commit 87dfca0e) - engine 0.1.59.1 (CUDA sm_120)
Graphics card, memory and system: NVIDIA GeForce RTX 5080 16 GB - 96 GB RAM - Windows 11
Model, size and settings: Qwen3.8-Flash-Next UD-Q4_K_XL with the locally converted q4_0-selq4.pack

What happened

tools/calibrate.py builds the sweep arms with serve.server.engine_args, but calls it without the exe argument:

  • tools/calibrate.py:256 - return server_args(cfg) (import at :255)
  • serve/server.py:3781 - def engine_args(cfg: dict, exe: str | None = None, ...); docstring: "exe is the engine program that will start: the drafter's flags follow what that program takes"
  • serve/server.py:3799-3801 - drafting.apply(..., engine=exe)
  • strata_control/drafting.py:610 - if engine is not None and converted_ok(data_dir) and engine_reads_selector_q4(engine): return converted_path(data_dir)

With engine=None the gate on drafting.py:610 can never pass, so pack_path falls through to stock PACK_NAME (drafting.py:214) and every sweep engine is pinned to the bf16-selector pack while the rig actually serves q4_0-selq4.pack. The harness docstring at calibrate.py:251 promises it "tunes the engine as it runs" - here it does not.

Same run, same machine, same engine binary, five minutes apart:

22:11-22:20  eight sweep engines:  DFlash2 drafter on (...q4_0.pack)
                                   drafter ~690 MiB, expert cache -> 1911 slots
22:20:56     real serve:           DFlash2 drafter on (...q4_0-selq4.pack)
                                   "selector codebooks: Q4_0 rows (about 174 MiB less than bf16)"
                                   drafter ~516 MiB, expert cache -> 1957 slots

The only difference between the two paths is engine=exe present (server.py) vs engine=None (calibrate.py:256).

Impact: calibration measures under a different fixed VRAM/slot state than production (690 MiB drafter / 1911 slots while sweeping, 516 MiB / 1957 when serving). Decisions that can flip inside ~174 MiB of cache are at risk - this rig's run adopted --pool-workers 2, and the adapt-trio and pcie-frac candidates were measured on the same mismatch.

Smallest steps that reproduce it

  1. Windows/CUDA rig below the tuned-pack gate (tuned_applies, drafting.py:419-442) with the locally converted q4_0-selq4.pack (verified, .ok marker present, engine binary carrying the Q4-selector marker text).
  2. Run START-HERE.bat --calibrate.
  3. Compare the DFlash2 drafter on line between the sweep starts (stock) and the post-calibration serve (selq4).

Proposed fix

# tools/calibrate.py:256
-    return server_args(cfg)
+    return server_args(cfg, cfg.get("exe"))

engine_args already treats exe as optional, so configs without the key behave exactly as today; a normal serve passes the same cfg["exe"] to the same function, making sweep and production agree by construction.

主要言語
C++
スター
11.6k
フォーク
1k
PR マージ指標
30日以内にマージされた PR はありません

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

Niko1221/Strata のほかの issue

Niko1221/Strata の issue をすべて見る

似ている issue

C++ の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。