Skip to content

Detach tensor in gen_candidates_scipy to avoid test failure due to new warning #2797

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

Balandat
Copy link
Contributor

@Balandat Balandat commented Apr 2, 2025

Summary:
pytorch/pytorch#143261 added a new warning to pytorch that gets raised when converting a tensor with gradients to a scalar without detaching it first.

This caused some test failues in botorch (which are likely a bit overzealous, but we can fix that separately). This makes a change in gen_candidates_scipy to fix this.

There are most likely other occurrences of this in botorch that we should fix, but here I'm quickly addressing the test failures first.

Reviewed By: saitcakmak

Differential Revision: D72286925

…new warning

Summary:
pytorch/pytorch#143261 added a new warning to pytorch that gets raised when converting a tensor with gradients to a scalar without detaching it first.

This caused some test failues in botorch (which are likely a bit overzealous, but we can fix that separately). This makes a change in `gen_candidates_scipy` to fix this.

There are most likely other occurrences of this in botorch that we should fix, but here I'm quickly addressing the test failures first.

Reviewed By: saitcakmak

Differential Revision: D72286925
@facebook-github-bot facebook-github-bot added the CLA Signed Do not delete this pull request or issue due to inactivity. label Apr 2, 2025
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D72286925

Copy link

codecov bot commented Apr 2, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.98%. Comparing base (a44b2aa) to head (c2dbc45).
Report is 14 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2797   +/-   ##
=======================================
  Coverage   99.98%   99.98%           
=======================================
  Files         207      207           
  Lines       18695    18695           
=======================================
  Hits        18692    18692           
  Misses          3        3           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@Balandat
Copy link
Contributor Author

Balandat commented Apr 7, 2025

Resolved by da6ee3a (unclear why this wasn't auto-closed).

@Balandat Balandat closed this Apr 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed Do not delete this pull request or issue due to inactivity. fb-exported
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants