A sampler run that wall_time_fit stops after it has draws reports "Fitting complete" but writes no final credible intervals, histograms or diagnostics

オープン
#1,068 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

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

評価

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

調査の方向性

Start with tests/test_sampler_load_refusals_review4.py, especially test_a_budget_stopped_run_with_draws_writes_its_final_posterior_output, and trace how sampler shutdown writes posterior summaries after a wall_time_fit stop. Compare that path with the max_iterations completion path and check the AM continuation outputs mentioned in the test notes. Done when the test passes without xfail and budget stopped runs with draws write the expected final outputs.

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

説明

bug

A sampler run that wall_time_fit stops after it has recorded draws exits 0 with "Fitting complete" and a non-empty samples.txt. But it writes none of the final posterior output that a run reaching max_iterations writes: no credible68.0_final.txt or credible95.0_final.txt, no *_final histograms, and no diagnostics.txt. A user who reads the latest credible intervals gets the last periodic file, written at an earlier iteration than the run's last draw. ADR-0093 says a budgeted run is a finished run whose search was cut short, and writes exactly what a converged one writes. Here it doesn't.

Found while reviewing #1066. Reproduced on main at cbb8159c.

Reproduction

Analytic target, so no model or simulator is involved:

edition = 2
objective = gaussian, mean = 0 0, variance = 1 1
uniform_var = g1 -10 10
uniform_var = g2 -10 10
random_seed = 1
verbosity = 1
output_dir = out
job_type = dream
population_size = 4
max_iterations = 100000000
burn_in = 10
sample_every = 1
wall_time_fit = 40

pybnf -c x.conf -o:

  • It prints "Wall-time budget reached: stopped after 0:00:40 ... 1083 completed simulation(s)", then "Fitting complete", and exits 0.
  • samples.txt holds 1262 draws.
  • Results/ has credible68.0_{100,200,300}.txt and credible95.0_{100,200,300}.txt, and Histograms/ has g1_{100,200,300}.txt. There is no *_final file and no diagnostics.txt.

The same conf with max_iterations = 300 and no wall_time_fit writes credible68.0_final.txt, credible95.0_final.txt, Histograms/g1_final.txt, g2_final.txt and diagnostics.txt.

The review's test covers mh, pt, dream and am. It is a strict xfail in tests/test_sampler_load_refusals_review4.py: test_a_budget_stopped_run_with_draws_writes_its_final_posterior_output. The test's notes say am also writes no combined_params.txt and nothing to adaptive_files/ for a later continue_run.

What should happen

A sampler run stopped early with draws in hand should write the same final outputs as one that reaches max_iterations, from the draws it has. Otherwise it should end with an error that says the posterior summary was not written. Remove the xfail with the fix.

The same end state follows a min_objective stop (#1072). A run stopped before its first draw is already an error since #921.

主要言語
Python
スター
26
フォーク
25
平均マージ
4時間 25分
マージ済み PR(30日)
9

環境構築

はじめの一歩

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

lanl/PyBNF のほかの issue

lanl/PyBNF の issue をすべて見る

似ている issue

Python の issue をもっと見る

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

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