fix(optimizer): log infill evaluations to TensorBoard in steady-state parallel runs#89
Merged
Merged
Conversation
… 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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Parallel runs (
n_jobs != 1) logged only the initial design to TensorBoard: workers carrytb_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_evalresult handler:update_stats()refreshescounter(the TB step) which the steady-state loop otherwise never advances — kept inside thetb_writerguard so the no-TB path stays byte-identical.add_hparamsentry per evaluated point + one scalars write per batch, mirroring the sequential main-loop call site._surrogate_lock— single-writer, no lock needed.Tests
test_parallel_logs_infill_evals— assertssuccess_ratescalar advances past the initial-design step (fails on pre-fix code).test_parallel_no_tensorboard_regression—tensorboard_log=Falseparallel run: no writer, no runs dir.🤖 Generated with Claude Code