Repository navigation
Conversation
…e#554) Every worker builds its LLMEnsemble from the same llm_seed, so all workers drew the same sequence of models, and a recycled worker (max_tasks_per_child) restarted it. _run_iteration_worker now reseeds the worker's sampler from md5(f"{llm_seed}:{iteration}"), derived like llm_seed itself: draws are independent across workers and reproducible whichever worker runs which iteration. With random_seed unset the sampler is left alone.
|
|
1 similar comment
|
|
This branch has not been deployed
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.
Fixes #554.
Problem
OpenEvolve.__init__derives onellm_seedand writes it into every model config. Each worker's_lazy_init_worker_componentsthen builds anLLMEnsembleseeded from it. So every worker draws the same sequence of models, and a recycled worker (max_tasks_per_child) restarts that sequence. With N workers, the realized model mix is K draws repeated N times rather than N·K independent draws.Change
_run_iteration_workercalls_seed_worker_ensemble(iteration)after lazy init. It reseeds the worker's sampler frommd5(f"{llm_seed}:{iteration}"), derived the same wayllm_seeditself is:random_seedunset, the sampler is left alone (already independent).The evaluator-model ensemble isn't touched: its only use is
generate_all_with_context, which doesn't sample.Tests
tests/test_worker_model_seeding.py(6 tests) simulates workers as_worker_initbuilds them:_run_iteration_workerseeds with its iteration.With the reseed made a no-op (the old behaviour), the three behavioural tests fail. Full suite:
python -m unittest discover tests, 918 tests, OK (2 skipped). Black-formatted.Also checked end to end: in openevolve-bedrock, a 40-iteration spawn-mode run with 3 workers against a fake endpoint matches per-model call counts predicted from this derivation exactly. That project currently patches this in from outside, and will drop the patch once a release contains this fix.