Skip to content

Conversation

@Balandat
Copy link
Contributor

@Balandat Balandat commented Dec 21, 2025

It may happen that NSGA-II does not find any feasible solutions, in which case it will return None as the results X attribute. This breaks the current code with a TypeError. This also led to flaky unit tests, see e.g. here; https://github.com/meta-pytorch/botorch/actions/runs/20408594090/job/58641991612

This PR adds a max_attempts input to optimize_with_nsgaii to increase robustness. This should fix the flaky unit tests.

It may happen that NSGA-II does not find any feasible solutions, in which case it will return `None` as the results `X` attribute. This breaks the current code with a `TypeError`. This also led to flaky unit tests, see e.g. here; https://github.com/meta-pytorch/botorch/actions/runs/20408594090/job/58641991612

This PR adds a `num_retries` input to `optimize_with_nsgaii` to increase robustness. This should fix the flaky unit tests.
@meta-cla meta-cla bot added the CLA Signed Do not delete this pull request or issue due to inactivity. label Dec 21, 2025
@codecov
Copy link

codecov bot commented Dec 21, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.99%. Comparing base (679d875) to head (f3bcd45).
⚠️ Report is 5 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3116   +/-   ##
=======================================
  Coverage   99.99%   99.99%           
=======================================
  Files         219      219           
  Lines       21174    21253   +79     
=======================================
+ Hits        21172    21251   +79     
  Misses          2        2           

☔ 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.

@meta-codesync
Copy link

meta-codesync bot commented Dec 22, 2025

@Balandat has imported this pull request. If you are a Meta employee, you can view this in D89633109.

@meta-codesync
Copy link

meta-codesync bot commented Dec 22, 2025

@Balandat merged this pull request in 6bd7f6d.

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. Merged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants