[Engine] STRATA_VERIFY_DEVICE_PLAN: layer 1 can copy the previous window's PLE rows (non-deterministic replies)

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

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

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

評価

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

調査の方向性

engine/src/core/verify.cpp を開き、1527行目付近の Verifier::record_window を見つけてください。ここではレイヤー1のPLEコピーが ar_on() によって保護されています。doorbellグラフにおけるレイヤー0のホスト待機がそのコピーをどう順序付けているかを読み、デバイス計画パスで待機しない点と比較してください。device_plan_ が設定されているときにも待機が発生するよう、1行の変更を適用してください。STRATA_VERIFY_DEVICE_PLAN=1 を指定してgreedyプロンプトを2回実行し、出力が一致することを確認して完了としてください。

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

説明

Problem

With STRATA_VERIFY_DEVICE_PLAN=1 (E-6), greedy replies on my Tesla V100 differed from run to run. They also
differed from the doorbell graph's replies with the same settings. I saw this on 0.2.12 (CUDA). The code below is
unchanged in 0.2.16.

Cause

In Verifier::record_window (engine/src/core/verify.cpp, 0.2.16 line 1527), layer 1's PLE copy waits for the host
only when ar_on():

if (l == 1 && ple_on) {
    if (grp == 0) {
        if (ar_on()) wait_flag_ge(m_flag_, 1, cs);
        copy_from_mapped(ple_, m_ple_, (int64_t) T * N, cs);

In the doorbell graph, layer 0's own wait on the host orders this copy after the host has gathered the PLE rows
(the host does that during its step 0, before it raises flag 1). A device-planned layer 0 does not wait for the host
at all. So the copy can read m_ple_ before the host has written this window's rows, and it gets the previous
window's rows.

Fix

The same wait when the device plans the layer:

        if (ar_on() || device_plan_) wait_flag_ge(m_flag_, 1, cs);

Commit with only this change (one line + a comment):
https://github.com/ksooad/Strata/commit/0b65aa8cc

Validation

  • Tesla V100-SXM2-32GB, 0.2.12, Qwen3.8-Flash-Next UD-Q3_K_XL, --adapt-swaps 0 --pcie-frac 0 (deterministic engine).
    Before the fix, the greedy texts of a fixed prompt set (6 prompts, 400 tokens) differed from run to run with
    STRATA_VERIFY_DEVICE_PLAN=1. After the fix they were identical between runs.
  • Not run: 0.2.16 with STRATA_VERIFY_DEVICE_PLAN=1 and without the fix. Only the code was compared, and the line is
    unchanged. Also not run: any SYCL build.
主要言語
C++
スター
11.6k
フォーク
1k
平均マージ
18日 13時間
マージ済み PR(30日)
4

環境構築

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

はじめの一歩

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

Niko1221/Strata のほかの issue

Niko1221/Strata の issue をすべて見る

似ている issue

C++ の issue をもっと見る

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

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