Skip to content

fix: make bar distribution reductions device-agnostic - #1366

Closed
aniruddhaadak80 wants to merge 2 commits into
PriorLabs:mainfrom
aniruddhaadak80:fix/bardist-device-agnostic-reductions
Closed

aniruddhaadak80 wants to merge 2 commits into
PriorLabs:mainfrom
aniruddhaadak80:fix/bardist-device-agnostic-reductions

Conversation

@aniruddhaadak80

Copy link
Copy Markdown
Contributor

Supersedes local branch fix/bardist-device-agnostic-reductions. See commit history for details.

ggprior and others added 2 commits August 10, 2026 16:29
`FullSupportBarDistribution.mean` re-homes its buffer onto the logits'
device; `median`, `mode` and `icdf` index `borders` with logit-derived
indices and did not. A criterion sitting on a different device than the
logits therefore failed every reduction except `mean`, with

    RuntimeError: indices should be either on cpu or on the same device
                  as the indexed tensor

That is reachable whenever a fitted estimator is reassembled and only
part of it is placed — restoring one and moving the weights but not the
bar distribution, for instance. `mean` silently working made it look
like a partial failure rather than a placement problem.

Index a same-device view of the borders in `icdf` and `mode`, matching
what `mean` already does. `quantile` and `ucb` inherit it via `icdf`.
`bucket_widths` derives from the borders, so it follows.

The `.to()` is a no-op when the devices already match: results are
bit-identical on the co-located path, and match to float32 tolerance
across devices.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings October 9, 2026 05:10

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@github-actions
github-actions Bot requested a review from priorphil October 9, 2026 05:10

@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 afb1eb2. Configure here.

`borders` directly and raised. That can happen whenever an estimator is
reassembled and only part of it is moved — e.g. restoring a fitted regressor
and placing the weights but not the bar distribution.
"""

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Test docstring narrates prior failure

Low Severity

The module docstring recounts what previous code did and why it raised, including that mean already re-homed its buffer while median, mode, and icdf indexed borders directly. Docstrings should state current behavior only, not the incident or prior implementation.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit afb1eb2. Configure here.

@priorphil

Copy link
Copy Markdown
Collaborator

Hi @aniruddhaadak80, thanks for the time you've put into TabPFN. A few of your earlier fixes were useful and we merged them.We've since adopted contribution guidelines, and your open issues and PRs don't fit them. External contributors can have at most 3 open PRs, and you have 10. The AI section also asks that a human reviews every submission before it goes in, answers review questions personally, and only reports problems they actually ran into. Bulk-filed reports from automated bug-hunting are called out as not welcome. Oscar's question on #1317 never got an answer.So we're closing all of your open issues and PRs. We'll fix #1344 and #1355 ourselves and credit you in the commits.If you want to keep contributing, please open one focused PR at a time that you've reviewed yourself, and reply to reviewers in your own words. If you think we got something wrong, reply here.

@priorphil priorphil closed this Oct 20, 2026
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.

4 participants