Skip to content
This repository was archived by the owner on Jul 17, 2026. It is now read-only.

feat(recon): fixed-k and scheduled-probability subset routing (S11, additive)#977

Open
claude-spd1 wants to merge 1 commit into
feature/jaxfrom
feature/routing-schedules-fixed-k
Open

feat(recon): fixed-k and scheduled-probability subset routing (S11, additive)#977
claude-spd1 wants to merge 1 commit into
feature/jaxfrom
feature/routing-schedules-fixed-k

Conversation

@claude-spd1

Copy link
Copy Markdown
Collaborator

Description

Two new subset-routing configs for the recon terms, plus the plumbing they need:

  • fixed_k_subset (k: PositiveInt) — per position, a uniformly-drawn subset of exactly k live sites (vs uniform_k's per-position k ~ U{1..n}).
  • scheduled_probability (p: ScheduleConfig) — static_probability with p evaluated at the traced step via scheduled_value_traced. Increasing ramps use final_val_frac > 1; a validator pins both schedule endpoints to [0, 1].

Plumbing: RoutingSampler is now (key, leading_shape, step_f32) -> draws — samplers already run inside the jitted step, so the traced step just threads in; only scheduled samplers read it. build_loss_terms / make_plan / subset_chunk_plan gain total_steps so the scheduled sampler can anchor its schedule (all call sites updated, incl. tests).

SPEC: S11 and the SAMPLE_ROUTING binding-seam row amended additively (marked AMENDED 2026-07-12) — @oli-clive-griffin please eyeball per the one-rule. R1 independence is unchanged: draws stay independent across sites/positions/forwards/steps; the schedule only moves p.

Motivation and Context

Board task run-some-random-architecture-ideas: Oli's scheduled-subset-recon idea (early training wants more base-model supervision → low routing p ramped up) plus his ask for more static k values. Wave 1 (static p dose-response + uniform_k baseline) is already running as wandb group routep-sched-1; this PR unblocks wave 2 (3 schedule arms + fixed-k {1,3,6,12,24}).

Related Issue

Board task run-some-random-architecture-ideas.

How Has This Been Tested?

  • New param_decomp/tests/test_routing.py: fixed-k routes exactly k per position (k ∈ {1,3,8}), k > n refused, uniform_k span sanity, static-p empirical mean ≈ p, scheduled-p empirical mean tracks get_scheduled_value at steps {0, 50, 99} (incl. ramp reaching 1.0), endpoint validators refuse p > 1. Green at default device count and XLA_FLAGS=--xla_force_host_platform_device_count=4.
  • Touched suites green locally in batches: test_recon_log_keys, test_config, test_no_bake_invariant, test_llama_simple_mlp, test_generic_model_io, test_llama8b, test_checkpoint, test_checkpoint_production_topology, stacked_parity, lab tms/resid_mlp. (Full suite OOMs on my CPU box at ~30% regardless of change — relying on CI for the full matrix.)
  • make type clean; equivalence goldens untouched (no numeric path changed — existing samplers gained an ignored arg).

Does this PR introduce a breaking change?

No behavior change for existing configs (new arg is ignored by existing samplers; RNG key derivation unchanged, so existing-arm trajectories are bit-identical). API-level: build_loss_terms/make_plan/subset_chunk_plan/RoutingSampler signatures gained total_steps/step_f32 — all in-repo callers updated.

Crew-Address: task/run-some-random-architecture-ideas

🤖 Generated with Claude Code

…ended, additive)

Two new routing configs for the subset recon terms:
- fixed_k_subset: per position, a uniform subset of exactly k live sites
  (vs uniform_k's k ~ U{1..n}).
- scheduled_probability: static_probability with p evaluated per step from
  a ScheduleConfig (increasing ramps use final_val_frac > 1; both endpoints
  validated as probabilities).

SAMPLE_ROUTING gains the traced step: RoutingSampler is now
(key, leading_shape, step_f32) -> draws; only scheduled samplers read the
step (all others ignore it), and build_loss_terms/make_plan thread
total_steps down so the scheduled sampler can evaluate its schedule with
scheduled_value_traced. SPEC S11 + the SAMPLE_ROUTING binding-seam row
amended additively; R1 independence unchanged (draws stay independent
across sites, positions, forwards, steps — the schedule only moves p).

Motivation (board task run-some-random-architecture-ideas): test whether
the subset recon term wants more base-model supervision early — low
routing p ramped up over training — vs the static uniform-k baseline.

Crew-Address: task/run-some-random-architecture-ideas
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant