Fix BeamSearchStrategy config validation, candidate schema, and PTX fingerprint logging - #146
Fix BeamSearchStrategy config validation, candidate schema, and PTX fingerprint logging#146jayden1711 wants to merge 1 commit into
Conversation
…int logging - Guard num_expanding_parents against 0 and negative values by clamping to 1 with a warning; previously a value of 0 caused select_candidates() to return no candidates, silently wasting entire optimization rounds - Add None guard so num_expanding_parents=None (expand all) is preserved - Add missing 'inspirations' key to beam search candidate dicts to match the SearchStrategy Protocol contract already honored by GreedyStrategy; populates via database.sample_inspirations() with the parent excluded - Extend SimpleMutator.build_prompt to accept and render inspirations as reference kernels in the optimization prompt - Log a warning in ptx_hash_from_cache when a PTX file cannot be read instead of silently skipping it, so callers know the fingerprint may be incomplete - Add tests for BeamSearchStrategy config validation, candidate schema contract, and worker fanout math - Add tests for ptx_hash_from_cache normalization invariants, constant preservation, and directory edge cases
|
Hi @jayden1711! Thank you for your pull request and welcome to our community. Action RequiredIn order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you. ProcessIn order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA. Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks! |
|
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks! |
Closes #145
Summary:
Three fixes in the beam search strategy and PTX fingerprinting infrastructure.
BeamSearchStrategyacceptednum_expanding_parents=0and negative valueswithout error. A value of 0 causes
select_candidates()to return an emptylist, spawning zero workers per round and silently consuming all
max_roundswith no optimization progress.
BeamSearchStrategycandidate dicts were also missing theinspirationskeyrequired by the
SearchStrategyProtocol.GreedyStrategyalready providesthis key.
BeamSearchStrategydid not, leaving a schema inconsistency thatwould cause future
Mutatorimplementations to silently receive no inspirationcontext under beam search.
ptx_hash_from_cachesilently skipped unreadable PTX files with no log output,returning an incomplete fingerprint with no indication to the caller.
Changes:
num_expanding_parentsagainst 0 and negative values by clamping to 1with a warning; preserve
None(expand all) as a valid inputinspirationskey to beam search candidate dicts, populated viadatabase.sample_inspirations()with the parent kernel excludedSimpleMutator.build_promptto accept and render inspirations asreference kernels in the optimization prompt
ptx_hash_from_cachewhen a PTX file cannot be readinstead of silently skipping it
BeamSearchStrategyandptx_hash_from_cacheTesting:
19 new tests added. All 72 existing tests pass.