Skip to content

fix(optimizer): log infill evaluations to TensorBoard in steady-state parallel runs#89

Merged
bartzbeielstein merged 1 commit into
mainfrom
fix/tensorboard-parallel-infill
Jun 7, 2026
Merged

fix(optimizer): log infill evaluations to TensorBoard in steady-state parallel runs#89
bartzbeielstein merged 1 commit into
mainfrom
fix/tensorboard-parallel-infill

Conversation

@bartzbeielstein
Copy link
Copy Markdown
Contributor

Summary

Parallel runs (n_jobs != 1) logged only the initial design to TensorBoard: workers carry tb_writer=None (the writer cannot cross the dill/process boundary), and the parent steady-state result loop updated storage without ever writing per-eval hparams/scalars.

This adds parent-side per-eval logging in the batch_eval result handler:

  • update_stats() refreshes counter (the TB step) which the steady-state loop otherwise never advances — kept inside the tb_writer guard so the no-TB path stays byte-identical.
  • One add_hparams entry per evaluated point + one scalars write per batch, mirroring the sequential main-loop call site.
  • Thread-safety: the result loop runs only in the parent main thread; eval workers never hold the writer and search threads only touch the surrogate under _surrogate_lock — single-writer, no lock needed.

Tests

  • test_parallel_logs_infill_evals — asserts success_rate scalar advances past the initial-design step (fails on pre-fix code).
  • test_parallel_no_tensorboard_regressiontensorboard_log=False parallel run: no writer, no runs dir.
  • Full suite: 1745 passed; ruff clean.

🤖 Generated with Claude Code

… parallel runs

The steady-state result loop updated storage but never wrote per-eval
hparams/scalars, so parallel (n_jobs != 1) runs logged only the initial
design. Refresh stats and write hparams+scalars from the parent main
thread after each batch_eval result (single-writer: workers carry
tb_writer=None and search threads never touch the writer, so no lock is
needed). update_stats() is kept inside the tb_writer guard so the no-TB
path stays byte-identical.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@bartzbeielstein bartzbeielstein merged commit de1f1bc into main Jun 7, 2026
5 checks passed
@bartzbeielstein bartzbeielstein deleted the fix/tensorboard-parallel-infill branch June 7, 2026 12:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant