Skip to content

draft - #459

Merged
luciaquirke merged 3 commits into
feat/contrastive-queriesfrom
feat/contrastive-queries-helper
Sep 13, 2026
Merged

draft#459
luciaquirke merged 3 commits into
feat/contrastive-queriesfrom
feat/contrastive-queries-helper

Conversation

@luciaquirke

Copy link
Copy Markdown
Collaborator

Stacked on #458. Moves the build-side contrast out of IndexConfig into a helper so the config stays unchanged.

  • build_contrast(index_cfg, control, preprocess_cfg) in bergson/build.py builds the index, builds control under <run_path>/contrast, and subtracts its aggregated gradient in place. A None control is a plain build.
  • trackstar, ekfac and approxunrolling call it with their query_contrast; the IndexConfig.contrast field and its hidden-from-CLI handling are gone.
  • Standalone bergson build no longer takes a contrast; the pipelines and MAGIC/validate are unchanged in behaviour.

Tests: tests/test_contrast.py, test_build.py, test_builder.py, test_hessian.py, ekfac_tests, SOURCE trainer integration and checkpoint parsing all pass on an A40 (140 passed, 4 skipped).

🤖 Generated with Claude Code

https://claude.ai/code/session_01Kyh3is739zD8bg3wdiHgEn

@luciaquirke luciaquirke changed the title refactor: build_contrast helper instead of an IndexConfig field draft Sep 11, 2026
@luciaquirke
luciaquirke force-pushed the feat/contrastive-queries-helper branch 9 times, most recently from 73b5423 to f881ebf Compare September 12, 2026 00:11
@luciaquirke
luciaquirke force-pushed the feat/contrastive-queries branch from 24adfb2 to 3be7a68 Compare September 12, 2026 00:14
@luciaquirke
luciaquirke force-pushed the feat/contrastive-queries-helper branch from f881ebf to 35661de Compare September 12, 2026 00:14
Keep IndexConfig unchanged. The three query-building pipelines call
build_contrast(index_cfg, control, preprocess_cfg), which runs the two
builds and subtracts the control's aggregated gradient in place.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kyh3is739zD8bg3wdiHgEn
@luciaquirke
luciaquirke force-pushed the feat/contrastive-queries-helper branch from 35661de to 5ba9969 Compare September 12, 2026 00:14
…rast or not

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@luciaquirke
luciaquirke force-pushed the feat/contrastive-queries-helper branch from 52ada60 to 1a60a77 Compare September 13, 2026 07:50
@luciaquirke
luciaquirke merged commit 7c0110e into feat/contrastive-queries Sep 13, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant