Skip to content

Conversation

@saitcakmak
Copy link
Contributor

Summary:
Acquisition._update_objective_thresholds or infer_objective_thresholds call within can lead to errors during Acquisition initialization, even if the corresponding acquisition function doesn't need objective thresholds. We have some conditional logic to protect against this but it is not comprehensive enough.

The particular example that triggered this diff is the use of P_Feasible acquisition function when there are no feasible points. In this case, we can't infer objective thresholds since we need feasible points.

This diff adds a try/except block to catch errors raised in infer_objective_thresholds and logs a warning if any error is caught. This should make it possible to easily debug any related errors (thanks to the log) while letting the acquisition functions that don't need the thresholds run without issues.

Differential Revision: D80259199

saitcakmak and others added 2 commits August 14, 2025 08:41
Summary:
`convert_to_block_design` is used for two purposes:
- In model fitting, to merge the datasets if a batched model is **allowed**. If something errors out here, we should just use a model-list rather than erroring out model fitting. We should also not use `force=True` here, since it is generally favorable to keep all the training data rather than forcing it to be block design by dropping some observations.
- In acquisition function selection, to see if any feasible points have been observed. We use `force=True` here, since we really need block design observations to evaluate feasibility. But we don't care about noise observations, so we shouldn't error out if only a subset of the datasets have noise. We can simply drop the noise.

Differential Revision: D80205523

Reviewed By: sunnyshen321
Summary:
`Acquisition._update_objective_thresholds` or `infer_objective_thresholds` call within can lead to errors during `Acquisition` initialization, even if the corresponding acquisition function doesn't need objective thresholds. We have some conditional logic to protect against this but it is not comprehensive enough.

The particular example that triggered this diff is the use of P_Feasible acquisition function when there are no feasible points. In this case, we can't infer objective thresholds since we need feasible points.

This diff adds a `try/except` block to catch errors raised in `infer_objective_thresholds` and logs a warning if any error is caught. This should make it possible to easily debug any related errors (thanks to the log) while letting the acquisition functions that don't need the thresholds run without issues.

Differential Revision: D80259199
@meta-cla meta-cla bot added the CLA Signed Do not delete this pull request or issue due to inactivity. label Aug 14, 2025
@facebook-github-bot
Copy link
Contributor

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

@codecov-commenter
Copy link

Codecov Report

❌ Patch coverage is 98.55072% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 96.04%. Comparing base (455cd1b) to head (5101d10).

Files with missing lines Patch % Lines
ax/generators/torch/botorch_modular/acquisition.py 90.90% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4149   +/-   ##
=======================================
  Coverage   96.04%   96.04%           
=======================================
  Files         566      566           
  Lines       57157    57189   +32     
=======================================
+ Hits        54897    54930   +33     
+ Misses       2260     2259    -1     

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

saitcakmak added a commit to saitcakmak/Ax that referenced this pull request Aug 14, 2025
)

Summary:

`Acquisition._update_objective_thresholds` or `infer_objective_thresholds` call within can lead to errors during `Acquisition` initialization, even if the corresponding acquisition function doesn't need objective thresholds. We have some conditional logic to protect against this but it is not comprehensive enough.

The particular example that triggered this diff is the use of P_Feasible acquisition function when there are no feasible points. In this case, we can't infer objective thresholds since we need feasible points.

This diff adds a `try/except` block to catch errors raised in `infer_objective_thresholds` and logs a warning if any error is caught. This should make it possible to easily debug any related errors (thanks to the log) while letting the acquisition functions that don't need the thresholds run without issues.

Reviewed By: sunnyshen321

Differential Revision: D80259199
@facebook-github-bot
Copy link
Contributor

This pull request has been merged in ef7081a.

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 Merged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants