Skip to content

Update skip_fit_gpytorch_mll mock to patch at call site - #5037

Closed
esantorella wants to merge 1 commit into
facebook:mainfrom
esantorella:export-D96645791
Closed

esantorella wants to merge 1 commit into
facebook:mainfrom
esantorella:export-D96645791

Conversation

@esantorella

Copy link
Copy Markdown
Contributor

Summary:
FitGPyTorchMLL is going away, so a mock needs to be updated.

Note that skip_fit_gpytorch_mll_context_manager will now only work with MBM. It used to mock a function used by fit_gpytorch_mll, so it would work whereever fit_gpytorch_mll was called; now does so by mocking fit_gpytorch_mll itself, through its import at ax.generators.torch.botorch_modular.utils.

Is this OK for current use cases? There are only two places in Ax that fit_gpytorch_mll is used: One in botorch_modular/utils, where this will work, and one in tutorials/modular_botorch/modular_botorch.ipynb, where this won't work since fit_gpytorch_mll is imported from botorch.fit. So I updated the tutorial to import from ax.generators.torch.botorch_modular.utils

Reviewed By: saitcakmak, mpolson64

Differential Revision: D96645791

Summary:
`FitGPyTorchMLL` is going away, so a mock needs to be updated.

Note that `skip_fit_gpytorch_mll_context_manager` will now only work with MBM. It used to mock a function used by `fit_gpytorch_mll`, so it would work whereever `fit_gpytorch_mll` was called; now does so by mocking `fit_gpytorch_mll` itself, through its import at `ax.generators.torch.botorch_modular.utils`.

Is this OK for current use cases? There are only two places in Ax that `fit_gpytorch_mll` is used: One in `botorch_modular/utils`, where this will work, and one in `tutorials/modular_botorch/modular_botorch.ipynb`, where this won't work since `fit_gpytorch_mll` is imported from `botorch.fit`. So I updated the tutorial to import from `ax.generators.torch.botorch_modular.utils`

Reviewed By: saitcakmak, mpolson64

Differential Revision: D96645791
@meta-cla meta-cla Bot added the CLA Signed Do not delete this pull request or issue due to inactivity. label Mar 16, 2026
@meta-codesync

meta-codesync Bot commented Mar 16, 2026

Copy link
Copy Markdown

@esantorella has exported this pull request. If you are a Meta employee, you can view the originating Diff in D96645791.

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.84%. Comparing base (05f34d5) to head (df4afbf).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5037   +/-   ##
=======================================
  Coverage   96.83%   96.84%           
=======================================
  Files         606      606           
  Lines       65322    65322           
=======================================
+ Hits        63256    63261    +5     
+ Misses       2066     2061    -5     

☔ 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

meta-codesync Bot commented Mar 16, 2026

Copy link
Copy Markdown

This pull request has been merged in 3659190.

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 meta-exported

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants