Repository navigation
feat(gepa): upgrade engine to 0.1.4 - #10209
Merged
Merged
Conversation
Contributor
Greptile SummaryGEPA is upgraded to 0.1.4 with deterministic adapter RNG restoration during checkpoint resume, clear rejection of unsupported reflection-cost budgets, and compatibility for the newly exposed proposal and tracking controls. Checkpoint/resume behavior and focused GEPA tests completed successfully. Confidence Score: 5/5No blocking failure remains. Checkpoint restoration, reflection-cost handling, and GEPA 0.1.4 control forwarding all behaved as intended in executed checks.
What T-Rex did
Reviews (5): Last reviewed commit: "fix(gepa): allow an unset reflection cos..." | Re-trigger Greptile |
isaacbmiller
force-pushed
the
amp/gepa-014-core
branch
2 times, most recently
from
August 17, 2026 19:42
0704747 to
c865c4d
Compare
Amp-Thread-ID: https://ampcode.com/threads/T-019ffe40-c240-70bb-8cb2-db33146ed8e6 Co-authored-by: Isaac Miller <isaac@cmpnd.ai>
Amp-Thread-ID: https://ampcode.com/threads/T-019ffe40-c240-70bb-8cb2-db33146ed8e6 Co-authored-by: Isaac Miller <isaac@cmpnd.ai>
isaacbmiller
force-pushed
the
amp/gepa-014-core
branch
from
August 17, 2026 19:49
c865c4d to
d008f96
Compare
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.
Why this PR exists
DSPy is pinned to GEPA 0.1.1. GEPA 0.1.4 changes the optimization model from one proposal per iteration to an optional multi-proposal pipeline and adds adapter checkpoint state, new acceptance/selection controls, and LM-based reflection-cost accounting.
This PR is intentionally the minimal dependency/compatibility layer. It upgrades GEPA and makes DSPy's existing adapter correct for the new checkpoint and configuration contracts, but does not add candidate-level concurrency. That optimization is isolated in stacked PR #10210. Reflection-cost accounting remains explicitly unsupported rather than introducing a second cost ledger alongside LM history.
Relevant upstream changes: GEPA 0.1.1 → 0.1.4
GEPA 0.1.4 adds:
sampling_strategy: one or many(parent, minibatch)proposal tasks per iteration (SameParentSampling,IndependentSampling,PxNSampling)selection_strategyandacceptance_criterion: control which evaluated proposals enter the candidate pooladapter.batch_evaluate(items): adapters can batch or parallelize candidate evaluation; evaluate-only adapters use GEPA's ordered sequential fallbackget_adapter_state()/set_adapter_state(): adapter-private state now participates in checkpoint save/resumemax_reflection_cost: reads cumulative cost from the supplied reflection LMwandb_attach_existing,mlflow_attach_existing, andtracking_key_prefixThe default
SingleMutationSamplingpath remains the old one-proposal behavior. The multi-proposal design intentionally keeps GEPA's engine sequential and puts batching at the adapter/LM edge. See GEPA 0.1.4 and its parallel-proposals contract.What changes in DSPy
gepa_kwargs; DSPy uses GEPA's sequentialevaluate()fallbackrandom.Randomstate, so resumed proposal sampling follows the uninterrupted runNonemax_reflection_costis rejected clearly because DSPy LMs do not yet expose the cumulative-cost interface GEPA requires;Noneremains valid and means no cost budgetgepa_kwargsgepa[dspy] == 0.1.1→0.1.4The executable production change is deliberately small: RNG checkpoint hooks and validation of the unsupported cost budget. There is no wrapper, executor, or local GEPA engine patch in this PR.
Behavior and risk
Expected behavior
Known upstream 0.1.4 limitation
GEPA 0.1.4 incorrectly requests traces while evaluating accepted candidates on the full validation set (gepa-ai/gepa#428). DSPy's traced and ordinary evaluation paths are not equivalent for every runtime failure, so this can produce missing/misaligned validation results and an
IndexErrorin affected runs.This PR does not monkeypatch GEPA or silently switch evaluation behavior. The upstream trace-aware fix is gepa-ai/gepa#430 and is expected in GEPA 0.1.5. The dependency bump can be reviewed and merged independently; the eventual 0.1.5 pin is a follow-up once published.
Review guide
The functional diff is limited to:
pyproject.toml,uv.lock: dependency resolutiondspy/teleprompt/gepa/gepa_utils.py: adapter RNG checkpoint statedspy/teleprompt/gepa/gepa.py: passthrough documentation and explicit cost-budget rejectiontests/teleprompt/test_gepa.py: RNG round-trip andmax_reflection_costcontractCandidate parallelism is intentionally out of scope here; review it separately in #10210. Reflection-cost accounting remains deferred until it can use DSPy's canonical LM accounting rather than a parallel counter.
Verification
uv run pytest tests/teleprompt -q— 81 passeduv run pre-commit run --all-files— passeduv lock --check— passedgit diff --check— passed