Add Evolution-Strategies reference tier (EGGROLL W1) - #541
Merged
Merged
Conversation
Host-free reference tier (Decision #28 tier-1) for the gradient-free / Evolution-Strategies track, plus the design plan and operator-improvement catalog it drives. python/tessera/stdlib/es.py - population_forward: batched-LoRA forward x·Mᵀ + (σ/√r)·sign·(x·B)·Aᵀ (Thm 1) - es_update: materialization-free factored update Σ f_i·sign_i·A_iB_iᵀ/√r/N (Thm 2) - low_rank_perturbation / reconstruct_factors: member-keyed factors - fitness_shaping / centered_rank / antithetic_sign; zscore delegates to rl.normalize_group_advantages so ES and GRPO share one normalizer (O6) Three audit-forced contracts are honored by construction: - G2 member-keyed RNG: factors fold in (epoch, pair) via rng.RNGKey.fold_in, never the device rank — orthogonal to Decision #18's per-rank stream - G4 sigma is a required semantic (fails closed) - I6 fp32/s32 accumulation (Decision #32); bf16 accum rejected tests/unit/test_es_reference.py: two oracle families (16/16) — A1–A5 exact (any r) + G4 fail-closed, B1–B3 statistical (expectation). mypy clean. docs/audit/compiler/EGGROLL_SUPPORT_PLAN.md: proof-backed op contract for the W2 op es_low_rank_correction, the corrections verification forced (Thm 3 antithetic rank, mean-field score dropped, G6 downgraded), and a 12-item catalog of improvements to existing operators (P0: numeric_policy carrier, saturating requantize, shared-operand batched GEMM). Reference tier only — the IR op + primitive_coverage registration land with W2 (a declaration needs a consumer, Decision #29). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1f7a865296
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
test_audit_docs.py requires every live compiler doc to be routed in docs/audit/compiler/README.md and every audit_role:plan doc to link the compiler map + INTEGRATED_COMPILER_PLAN.md. Add the routing header to the plan and a catalog entry to the index. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…d outcome Codex review findings on #541: - P2 (accum): es_update accepted accum="s32" but always used float64, so the advertised integer lane silently aliased fp32. Now s32/int32 raise NotImplementedError (the EGG integer lane is W-later); only fp32/f32 execute. - P2 (dtype): _np_storage silently widened fp16/bf16 to float32. Now normalizes through canonicalize_dtype and maps to real numpy storage (np.float16, ml_dtypes.bfloat16), rejecting unsupported spellings (Decision #21a). Tests added: s32 rejected, fp16/bf16 storage preserved, fp8 rejected. - P1 (backend sync): the shared es_low_rank_correction contract + fp32/s32 accumulation policy now records a per-architecture outcome in each backend queue under sync key EGGROLL-ES-LOWRANK-2026-08-09 (AGENTS.md sibling-backend rule); the plan doc names the key. Regenerated test_coverage (dtype-tag column) for the new dtype test. Co-Authored-By: Claude Opus 4.8 <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.
What
W1 of the gradient-free / Evolution-Strategies track: the host-free reference tier (Decision #28 tier-1) for EGGROLL (Evolution Strategies at the Hyperscale, arXiv:2511.16652), plus the proof-backed design plan and the operator-improvement catalog it drives.
New:
python/tessera/stdlib/es.pypopulation_forward— batched-LoRA forwardx·Mᵀ + (σ/√r)·sign·(x·B)·Aᵀ(Thm 1, exact)es_update— materialization-free factored updateΣ f_i·sign_i·A_iB_iᵀ/√r/N(Thm 2, exact)low_rank_perturbation/reconstruct_factors— member-keyed factorsfitness_shaping/centered_rank/antithetic_sign—zscoredelegates torl.normalize_group_advantages, so ES and GRPO share one normalizer (operator win O6)Three audit-forced contracts honored by construction:
(epoch, pair)viarng.RNGKey.fold_in, never the device rank (orthogonal to Decision Apple GPU Tier-2: projection ops + batched MHA composition #18's per-rank stream)sigmais a required semantic (fails closed)Tests:
tests/unit/test_es_reference.py— 16/16 greenTwo oracle families mirroring the
verify_synthesized_*split (exact vs statistical, never conflated):min(⌈N/2⌉·r, out, in)), member-keyed RNG, fp32-accum contract, G4 fail-closedCov(E)=Iat r=1), unbiased-on-linear, bias-needs-∇³f, GRPO-normalizer reusemypy clean (ratchet=0 held); 35 existing governance + stdlib tests unaffected.
Docs:
docs/audit/compiler/EGGROLL_SUPPORT_PLAN.mdProof-backed contract for the W2 op
es_low_rank_correction, the three corrections verification forced (antithetic rank, mean-field score dropped — it's near-orthogonal to the gradient at low r and breaks the factorization, G6 downgraded — CLT makes the quantile threshold well-calibrated), and a 12-item catalog of improvements to existing operators (P0:numeric_policycarrier below Graph-IR, saturating requantize, shared-operand batched GEMM).Scope
Reference tier only. The Graph-IR op +
op_catalog/primitive_coverageregistration land with W2 — registering the op now would declare a contract with no consumer (Decision #29). Generatedtest_coveragedoc regenerated for the newnormalize_group_advantagesreference.🤖 Generated with Claude Code