Skip to content

feat(fit): progress logging + skip_candidates knob - #1

Merged
adrida merged 1 commit into
mainfrom
feat/fit-progress-logging
Apr 24, 2026
Merged

adrida merged 1 commit into
mainfrom
feat/fit-progress-logging

Conversation

@adrida

@adrida adrida commented Apr 24, 2026

Copy link
Copy Markdown
Owner

tracer.fit() previously produced no output during potentially-long candidate sweeps and pipeline-family construction. On multi-class high-dim embedding inputs (e.g. 22-class × 1024-dim BGE-M3) a single stuck candidate (GradientBoosting) silently stretched a sweep from ~13s to ~20 minutes with no signal at all.

This wires up default per-candidate + per-stage progress to stderr and exposes a configuration knob to drop known-slow candidates without monkey-patching.

Changes

  • FitConfig.verbose: bool = True — gates a default stderr logger
  • FitConfig.skip_candidates: tuple[str, ...] = () — drop candidates by name
  • surrogate._candidates(n, skip=()) — new parameter
  • surrogate.search_best_surrogate now accepts skip= and tolerates both the legacy on_candidate(name, f1) signature and a new 3-arg variant on_candidate(name, f1, elapsed_seconds). Callback exceptions are warned and swallowed so a buggy logger can't abort a fit.
  • fit.pipeline.build_global / build_l2d / build_rsb / _build_accepting_stage / fit_frontier all accept log= and skip=, emit stage-start and stage-end heartbeats, and forward skip= to the surrogate sweep.
  • api.fit constructs the default stderr logger when verbose=True and threads log/skip through to fit_frontier.
  • CLI demo's monkey-patched _candidates / search_best_surrogate are updated to accept the new parameters transparently.

Tests (tests/test_fit.py)

  • callback invoked once per candidate under both legacy and extended signatures
  • raising callback does not derail the sweep; warning is emitted
  • skip_candidates removes named models from the factory
  • verbose=True emits [tracer.fit +Xs] heartbeats to stderr
  • verbose=False remains silent

All 21 tests pass locally.

tracer.fit() previously produced no output during potentially-long candidate
sweeps and pipeline-family construction. On multi-class high-dim embedding
inputs (e.g. 22-class × 1024-dim BGE-M3) a single stuck candidate
(GradientBoosting) silently stretched a sweep from ~13s to ~20 minutes with
no signal at all.

This wires up default per-candidate + per-stage progress to stderr and exposes
a configuration knob to drop known-slow candidates without monkey-patching.

Changes
- FitConfig.verbose: bool = True — gates a default stderr logger
- FitConfig.skip_candidates: tuple[str, ...] = () — drop candidates by name
- surrogate._candidates(n, skip=()) — new parameter
- surrogate.search_best_surrogate now accepts skip= and tolerates both the
  legacy on_candidate(name, f1) signature and a new 3-arg variant
  on_candidate(name, f1, elapsed_seconds). Callback exceptions are warned
  and swallowed so a buggy logger can't abort a fit.
- fit.pipeline.build_global / build_l2d / build_rsb / _build_accepting_stage /
  fit_frontier all accept log= and skip=, emit stage-start and stage-end
  heartbeats, and forward skip= to the surrogate sweep.
- api.fit constructs the default stderr logger when verbose=True and threads
  log/skip through to fit_frontier.
- CLI demo's monkey-patched _candidates / search_best_surrogate are updated
  to accept the new parameters transparently.

Tests (tests/test_fit.py)
- callback invoked once per candidate under both legacy and extended signatures
- raising callback does not derail the sweep; warning is emitted
- skip_candidates removes named models from the factory
- verbose=True emits [tracer.fit +Xs] heartbeats to stderr
- verbose=False remains silent

All 21 tests pass locally.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@adrida
adrida merged commit 15310bc into main Apr 24, 2026
5 checks passed
@adrida
adrida deleted the feat/fit-progress-logging branch April 24, 2026 20:44
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