Repository navigation
Conversation
Greptile SummaryGEPA’s automatic metric-call budgeting now accounts for reflection minibatches, full validation of accepted programs, and configured merge capacity. The earlier custom-sampler issue is resolved: automatic mode accepts samplers with and without a Confidence Score: 5/5No blocking failure remains. Runtime checks exercised automatic compilation with sized and opaque custom samplers, and focused GEPA budget tests passed.
What T-Rex did
Reviews (3): Last reviewed commit: "fix(dspy): preserve GEPA auto-budget API..." | Re-trigger Greptile |
|
Updated the PR to preserve backward compatibility for The legacy |
|
Hi! Just a quick follow-up on this PR. It looks like the GitHub Actions workflows are currently awaiting maintainer approval. The PR is still up to date from my side, and I'm happy to make any additional changes if needed. Thanks! |
Fixes #10245.
This PR updates
GEPA.auto_budget()to reflect the current GEPA evaluation flow.The bug
Before this change, the auto budget was calculated approximately as:
where
Vis the validation-set size,Cis the candidate count,Tis the estimated number of trials, andFis the assumed number of periodic full evaluations.This calculation had three stale assumptions:
The current GEPA loop instead evaluates both the parent and child on the configured reflection minibatch and performs full validation only when a proposal passes minibatch acceptance.
Consequently, changing
reflection_minibatch_sizechanged the actual metric-call cost but did not change the calculated auto budget.The fix
The updated budget calculation is:
where:
Vis the validation-set sizeRis the effective reflection minibatch sizeTis the estimated number of reflective trialsAis the number of accepted-candidate validations reserved by auto modeKis the maximum number of merge attemptsThe
2RTterm accounts for evaluating both the parent and child on each reflection minibatch.AVreserves full-validation cost for accepted candidates. Each merge attempt reserves five metric calls for merge screening plus one full validation, represented byK(5 + V).For custom batch samplers, the effective minibatch size is resolved from the sampler's
minibatch_sizeattribute when available. Otherwise, the legacy value of 35 is used with a warning.To preserve backward compatibility,
auto_budget()continues to accept the legacyminibatch_sizeandfull_eval_stepsparameters.full_eval_stepsis retained for compatibility but no longer affects the calculation.compile()also callsauto_budget()using the original three-keyword form, so subclasses overriding the legacy signature continue to work.The result remains a budget allocation rather than an exact prediction because rejected proposals skip full validation and custom GEPA policies may have different evaluation costs.
Verification
Added regression tests covering:
reflection_minibatch_sizethroughcompile()auto_budget()callsminibatch_sizeandfull_eval_stepskeywordsauto_budget()signatureAll focused GEPA tests and pre-commit checks pass.