Skip to content

Commit 1d4e14a

Browse files
saitcakmakfacebook-github-bot
authored andcommitted
Remove ax dependency from tutorials (#2839)
Summary: Updates BoTorch tutorials to remove dependency on Ax. - Custom BoTorch model w/ Ax tutorial is removed. We have another custom model tutorial that covers the non-Ax subject. - Custom acquisition tutorial is updated to remove Ax parts and moved to bite-sized tutorials. - Tutorials index page is updated to point to the Ax tutorial that is being added in facebook/Ax#3722. The link will not work until Ax 1.0 is released. - Ax dependency is removed from `setup.py` and the GHA workflows are updated to remove Ax related blocks. New tutorial landing page: <img width="1918" alt="Screenshot 2025-05-05 at 1 46 58 PM" src="https://github.com/user-attachments/assets/472d6a09-99e1-464c-9b45-07f4464283b2" /> Custom acquisition tutorial: <img width="1916" alt="Screenshot 2025-05-05 at 1 49 12 PM" src="https://github.com/user-attachments/assets/bb813158-e711-4ce0-b399-2530f2e9b8f6" /> Pull Request resolved: #2839 Reviewed By: mpolson64 Differential Revision: D74189651 Pulled By: saitcakmak fbshipit-source-id: b8cffa21a337605e922886bb9f92fd33f9765d0f
1 parent ed2e5c0 commit 1d4e14a

File tree

10 files changed

+547
-3648
lines changed

10 files changed

+547
-3648
lines changed

.github/workflows/nightly.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,8 @@ jobs:
7575
contents: write
7676

7777
run_tutorials:
78-
name: Run tutorials without smoke test on latest PyTorch / GPyTorch / Ax
78+
name: Run tutorials without smoke test on latest PyTorch / GPyTorch
7979
uses: ./.github/workflows/reusable_tutorials.yml
8080
with:
8181
smoke_test: false
8282
use_stable_pytorch_gpytorch: false
83-
use_stable_ax: false

.github/workflows/publish_website.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,8 @@ jobs:
4747
- name: Install dependencies
4848
env:
4949
ALLOW_LATEST_GPYTORCH_LINOP: true
50-
ALLOW_BOTORCH_LATEST: true # Allow Ax to install w/ new BoTorch release.
5150
run: |
5251
uv pip install ."[dev, tutorials]"
53-
# There may not be a compatible Ax uv pip version, so we use the development version.
54-
uv pip install git+https://github.com/facebook/Ax.git
5552
- if: ${{ inputs.new_version }}
5653
name: Create new docusaurus version
5754
run: |

.github/workflows/reusable_tutorials.yml

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,6 @@ on:
99
use_stable_pytorch_gpytorch:
1010
required: true
1111
type: boolean
12-
use_stable_ax:
13-
required: true
14-
type: boolean
1512
workflow_call:
1613
inputs:
1714
smoke_test:
@@ -22,10 +19,6 @@ on:
2219
required: false
2320
type: boolean
2421
default: false
25-
use_stable_ax:
26-
required: false
27-
type: boolean
28-
default: false
2922

3023
jobs:
3124
tutorials:
@@ -66,19 +59,6 @@ jobs:
6659
ALLOW_LATEST_GPYTORCH_LINOP: true
6760
run: |
6861
uv pip install .[tutorials]
69-
- if: ${{ !inputs.use_stable_ax }}
70-
name: Install latest Ax
71-
env:
72-
# This is so Ax's setup doesn't install a pinned BoTorch version.
73-
ALLOW_BOTORCH_LATEST: true
74-
run: |
75-
uv pip install git+https://github.com/facebook/Ax.git
76-
- if: ${{ inputs.use_stable_ax }}
77-
name: Install stable Ax
78-
env:
79-
ALLOW_BOTORCH_LATEST: true
80-
run: |
81-
uv pip install ax-platform --no-binary ax-platform
8262
- if: ${{ inputs.smoke_test }}
8363
name: Run tutorials with smoke test
8464
run: |

.github/workflows/test_stable.yml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,18 +52,16 @@ jobs:
5252
run: |
5353
pytest -ra test_community/ --cov botorch_community/ --cov-report term-missing --cov-report xml:botorch_community_cov.xml
5454
55-
run_tutorials_stable_w_latest_ax:
56-
name: Run tutorials without smoke test on min req. versions of PyTorch & GPyTorch and latest Ax
55+
run_tutorials_stable:
56+
name: Run tutorials without smoke test on min req. versions of PyTorch & GPyTorch
5757
uses: ./.github/workflows/reusable_tutorials.yml
5858
with:
5959
smoke_test: false
6060
use_stable_pytorch_gpytorch: true
61-
use_stable_ax: false
6261

6362
run_tutorials_stable_smoke_test:
64-
name: Run tutorials with smoke test on min req. versions of PyTorch & GPyTorch and latest Ax
63+
name: Run tutorials with smoke test on min req. versions of PyTorch & GPyTorch
6564
uses: ./.github/workflows/reusable_tutorials.yml
6665
with:
6766
smoke_test: true
6867
use_stable_pytorch_gpytorch: true
69-
use_stable_ax: false

.github/workflows/tutorials_smoke_test.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,8 @@ on:
1010

1111
jobs:
1212
run_tutorials_with_smoke_test:
13-
name: Run tutorials with smoke test on latest PyTorch / GPyTorch / Ax
13+
name: Run tutorials with smoke test on latest PyTorch / GPyTorch
1414
uses: ./.github/workflows/reusable_tutorials.yml
1515
with:
1616
smoke_test: true
1717
use_stable_pytorch_gpytorch: false
18-
use_stable_ax: false

docs/tutorials/index.mdx

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,27 +4,32 @@ title: BoTorch Tutorials
44
The tutorials here will help you understand and use BoTorch in
55
your own work. They assume that you are familiar with both
66
Bayesian optimization (BO) and PyTorch.
7-
8-
If you are new to BO, we recommend you start with the
7+
* If you are new to BO, we recommend you start with the
98
[Ax docs](https://ax.dev/docs/bayesopt) and the
109
following
1110
[tutorial paper](https://arxiv.org/abs/1807.02811).
12-
13-
If you are new to PyTorch, the easiest way to get started is
11+
* If you are new to PyTorch, the easiest way to get started is
1412
with the [What is PyTorch?](https://pytorch.org/tutorials/beginner/blitz/tensor_tutorial.html#sphx-glr-beginner-blitz-tensor-tutorial-py)
1513
tutorial.
1614

17-
The BoTorch tutorials are grouped into the following four areas.
18-
1915

2016
<h4>Using BoTorch with Ax</h4>
21-
These tutorials give you an overview of how to leverage
22-
[Ax](https://ax.dev), a platform for sequential
23-
experimentation, in order to simplify the management of your BO
24-
loop. Doing so can help you focus on the main aspects of BO
25-
(models, acquisition functions, optimization of acquisition
26-
functions), rather than tedious loop control. See our
27-
[Documentation](/docs/botorch_and_ax)
17+
_For practitioners_ who are interested in running experiments
18+
to optimize various objectives using Bayesian optimization,
19+
we recommend using [Ax](https://ax.dev) rather than BoTorch.
20+
[Ax](https://ax.dev) provides a user-friendly interface for
21+
experiment configuration and orchestration, while choosing an
22+
appropriate Bayesian optimization algorithm to optimize the
23+
given objective, following BoTorch best practices.
24+
25+
_For researchers_ who are interested in running experiments with
26+
their custom BoTorch models and acquisition functions,
27+
[Ax](https://ax.dev)'s Modular BoTorch Interface offers a convenient
28+
way to leverage custom BoTorch objects while utilizing
29+
[Ax](https://ax.dev) experiment configuration and orchestration. Check out
30+
[Modular BoTorch tutorial](https://ax.dev/docs/tutorials/modular_botorch/)
31+
to learn how to use custom BoTorch objects in Ax!
32+
See [this documentation](/docs/botorch_and_ax)
2833
for additional information.
2934

3035
<h4>Full Optimization Loops</h4>

setup.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,8 @@
1717
TEST_REQUIRES = ["pytest", "pytest-cov", "requests"]
1818
FMT_REQUIRES = ["flake8", "ufmt", "flake8-docstrings"]
1919
TUTORIALS_REQUIRES = [
20-
"ax-platform",
2120
"cma",
2221
"jupyter",
23-
"kaleido",
2422
"matplotlib",
2523
"memory_profiler",
2624
"papermill",

0 commit comments

Comments
 (0)