Skip to content

Adaptive per-call test set row limit at predict time - #348

Merged
klemens-floege merged 2 commits into
mainfrom
increase-row-limits
Jul 27, 2026
Merged

Adaptive per-call test set row limit at predict time#348
klemens-floege merged 2 commits into
mainfrom
increase-row-limits

Conversation

@klemens-floege

@klemens-floege klemens-floege commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

What

The API now accepts much larger test sets, and the static row/cell limits the client enforces already come from get_model_limits. What was missing client-side is the adaptive part: prediction compute scales with n_train_rows * n_test_rows, so the effective per-call test row limit shrinks as the fitted training set grows.

  • Add PREDICT_ROW_PAIRS_BUDGET (250k × 1M): at predict time the test row limit is min(test_set_max_rows, budget // n_train_rows) — e.g. 1M training rows → 250k test rows per call, ≤ 250k training rows → the static 1M cap binds.
  • validate_test_set takes an optional train_rows; both TabPFNClassifier and TabPFNRegressor pass the fitted training set size, so oversized test sets fail fast client-side with a clear "split across multiple calls" message instead of erroring after upload.
train rows test row limit per call
1M 250k
500k 500k
≤ 250k 1M (static cap)

Tests

Unit tests cover the static cap, the adaptive limit at the 1M-train anchor, the adaptive limit never exceeding the static cap, and the offline no-op when limits are unavailable.

🤖 Generated with Claude Code

@klemens-floege
klemens-floege requested a review from a team as a code owner July 24, 2026 12:13

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 208dc36. Configure here.

Comment thread src/tabpfn_client/estimator.py Outdated
@klemens-floege klemens-floege changed the title Increase row limits: 1M training rows, adaptive test set limit Adaptive per-call test set row limit at predict time Jul 24, 2026
The API accepts much larger test sets, but prediction compute scales
with n_train_rows * n_test_rows, so the effective per-call test row
limit shrinks as the fitted training set grows (e.g. 1M training rows
-> 250k test rows). Enforce this at predict time so oversized test
sets fail fast client-side with a clear message instead of erroring
after upload.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@klemens-floege
klemens-floege requested review from brendan-priorlabs and removed request for brendan-priorlabs July 24, 2026 14:20
Comment thread src/tabpfn_client/estimator.py Outdated
@klemens-floege
klemens-floege added this pull request to the merge queue Jul 27, 2026
Merged via the queue into main with commit 008e957 Jul 27, 2026
10 checks passed
@klemens-floege
klemens-floege deleted the increase-row-limits branch July 27, 2026 12:58
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.

2 participants