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

Aperta
#1,068 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
58/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
python
Ambito
data

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.

Lingua principale
Python
Stelle
26
Fork
25
Merge medio
4h 25m
PR unite (30g)
9

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di lanl/PyBNF

Tutte le issue di lanl/PyBNF

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.