Skip to content

Commit

Permalink
Remove support for anaconda (official package) (#2617)
Browse files Browse the repository at this point in the history
Summary:
See #2613 for details. An anaconda package will still be a conda package available on the `c conda-forge`channel for those users who need it.

Pull Request resolved: #2617

Reviewed By: saitcakmak, esantorella

Differential Revision: D65603328

Pulled By: Balandat

fbshipit-source-id: 973086a49b51daf07718060d64893c44e3483dee
  • Loading branch information
Balandat authored and facebook-github-bot committed Nov 7, 2024
1 parent 9ae465b commit a919929
Show file tree
Hide file tree
Showing 15 changed files with 38 additions and 297 deletions.
14 changes: 0 additions & 14 deletions .conda/build_conda.sh

This file was deleted.

50 changes: 0 additions & 50 deletions .conda/meta.yaml

This file was deleted.

42 changes: 4 additions & 38 deletions .github/workflows/deploy_on_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ on:

jobs:

tests-and-coverage-pip:
tests-and-coverage:
name: Test & Coverage
uses: ./.github/workflows/reusable_test_pip.yml
uses: ./.github/workflows/reusable_test.yml
with:
use_latest_pytorch_gpytorch: false
secrets: inherit
Expand All @@ -20,7 +20,7 @@ jobs:
runs-on: ubuntu-latest
permissions:
id-token: write # This is required for PyPI OIDC authentication.
needs: tests-and-coverage-pip
needs: tests-and-coverage
steps:
- uses: actions/checkout@v4
- name: Fetch all history for all tags and branches
Expand All @@ -44,43 +44,9 @@ jobs:
with:
verbose: true

package-deploy-conda:
name: Package conda and deploy to anaconda.org
runs-on: 8-core-ubuntu
needs: tests-and-coverage-pip
steps:
- uses: actions/checkout@v4
- uses: conda-incubator/setup-miniconda@v3
with:
miniconda-version: "latest"
activate-environment: test
python-version: "3.10"
- name: Fetch all history for all tags and branches
run: git fetch --prune --unshallow
- name: Install dependencies
shell: bash -l {0}
run: |
conda install -y setuptools_scm conda-build conda-verify anaconda-client
conda install -y scipy sphinx pytest flake8 multipledispatch
conda install -y -c pytorch pytorch cpuonly
conda install -y -c gpytorch gpytorch
conda install -y -c conda-forge pyro-ppl>=1.8.4
conda config --set anaconda_upload no
- name: Build and verify conda package
shell: bash -l {0}
run: |
./scripts/build_and_verify_conda_package.sh
- name: Deploy to anaconda.org
shell: bash -l {0}
run: |
botorch_version=$(python -m setuptools_scm)
build_dir="$(pwd)/.conda/conda_build/noarch"
pkg_file="${build_dir}/botorch-${botorch_version}-0.tar.bz2"
anaconda -t ${{ secrets.ANACONDA_UPLOAD_TOKEN }} upload -u pytorch $pkg_file
publish-versioned-website:
name: Publish versioned website
needs: [package-deploy-pypi, package-deploy-conda]
needs: package-deploy-pypi
uses: ./.github/workflows/reusable_website.yml
with:
publish_versioned_website: true
Expand Down
34 changes: 2 additions & 32 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:
jobs:
tests-and-coverage-nightly:
name: Test & Coverage
uses: ./.github/workflows/reusable_test_pip.yml
uses: ./.github/workflows/reusable_test.yml
with:
use_latest_pytorch_gpytorch: true
secrets: inherit
Expand Down Expand Up @@ -60,39 +60,9 @@ jobs:
skip-existing: true
verbose: true

package-conda:
name: Test conda build
runs-on: 8-core-ubuntu
steps:
- uses: actions/checkout@v4
- uses: conda-incubator/setup-miniconda@v3
with:
miniconda-version: "latest"
activate-environment: test
python-version: "3.10"
- name: Fetch all history for all tags and branches
run: git fetch --prune --unshallow
- name: Install dependencies
shell: bash -l {0}
env:
ALLOW_LATEST_GPYTORCH_LINOP: true
# Don't need most deps for conda build, but need them for testing
# We do need setuptools_scm though to properly parse the version
run: |
conda install -y scipy multipledispatch setuptools_scm conda-build conda-verify
conda config --set anaconda_upload no
conda install -y -c pytorch-nightly pytorch cpuonly
conda install -y -c conda-forge pyro-ppl>=1.8.4
pip install git+https://github.com/cornellius-gp/linear_operator.git
pip install git+https://github.com/cornellius-gp/gpytorch.git
- name: Build and verify conda package
shell: bash -l {0}
run: |
./scripts/build_and_verify_conda_package.sh
publish-latest-website:
name: Publish latest website
needs: [tests-and-coverage-nightly, package-test-deploy-pypi, package-conda]
needs: [tests-and-coverage-nightly, package-test-deploy-pypi]
uses: ./.github/workflows/reusable_website.yml
with:
publish_versioned_website: false
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Reusable Test Workflow w/ pip
name: Reusable Test Workflow

on:
workflow_call:
Expand All @@ -13,8 +13,8 @@ on:


jobs:
tests-and-coverage-pip:
name: Tests and coverage (pip, Python ${{ matrix.python-version }}, ${{ matrix.os }})
tests-and-coverage:
name: Tests and coverage (Python ${{ matrix.python-version }}, ${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
Expand Down
40 changes: 3 additions & 37 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,43 +9,9 @@ on:

jobs:

tests-and-coverage-pip:
name: Test & Coverage (pip)
uses: ./.github/workflows/reusable_test_pip.yml
tests-and-coverage:
name: Test & Coverage
uses: ./.github/workflows/reusable_test.yml
with:
use_latest_pytorch_gpytorch: true
secrets: inherit

tests-conda:
name: Tests (conda, ${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: ["ubuntu-latest", "macos-14", "windows-latest"]
python-version: ["3.10", "3.12"]
steps:
- uses: actions/checkout@v4
- uses: conda-incubator/setup-miniconda@v3
with:
miniconda-version: "latest"
activate-environment: test
python-version: ${{ matrix.python-version }}
- name: Install dependencies
shell: bash -l {0}
env:
ALLOW_LATEST_GPYTORCH_LINOP: true
run: |
conda install pytorch torchvision -c pytorch
conda install -y pip scipy sphinx pytest flake8
pip install git+https://github.com/cornellius-gp/linear_operator.git
pip install git+https://github.com/cornellius-gp/gpytorch.git
pip install .[test]
- name: Unit tests -- BoTorch
shell: bash -l {0}
run: |
pytest -ra test/
- name: Unit tests -- BoTorch Community
shell: bash -l {0}
run: |
pytest -ra test_community/
40 changes: 4 additions & 36 deletions .github/workflows/test_stable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,48 +5,16 @@ on:

jobs:

tests-and-coverage-pip-stable:
tests-and-coverage-stable:
name: Test & Coverage
uses: ./.github/workflows/reusable_test_pip.yml
uses: ./.github/workflows/reusable_test.yml
with:
use_latest_pytorch_gpytorch: false
upload_coverage: false
secrets: inherit

tests-conda-stable:
name: Tests (conda, ${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: ["ubuntu-latest", "macos-14", "windows-latest"]
python-version: ["3.10", "3.12"]
steps:
- uses: actions/checkout@v4
- uses: conda-incubator/setup-miniconda@v3
with:
miniconda-version: "latest"
activate-environment: test
python-version: ${{ matrix.python-version }}
- name: Install dependencies
shell: bash -l {0}
run: |
conda install -y -c pytorch pytorch cpuonly
conda install -y pip scipy pytest
conda install -y -c gpytorch gpytorch
conda install -y -c conda-forge pyro-ppl>=1.8.4
pip install .[test]
- name: Unit tests and coverage -- BoTorch
shell: bash -l {0}
run: |
pytest -ra test/ --cov botorch/ --cov-report term-missing --cov-report xml:botorch_cov.xml
- name: Unit tests and coverage -- BoTorch Community
shell: bash -l {0}
run: |
pytest -ra test_community/ --cov botorch_community/ --cov-report term-missing --cov-report xml:botorch_community_cov.xml
tests-and-coverage-min-req-pip:
name: Tests and coverage min req. torch, gpytorch & linear_operator versions (pip, Python ${{ matrix.python-version }}, ${{ matrix.os }})
tests-and-coverage-min-req:
name: Tests and coverage min req. torch, gpytorch & linear_operator versions (Python ${{ matrix.python-version }}, ${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
Expand Down
34 changes: 10 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
[![Nightly](https://github.com/pytorch/botorch/actions/workflows/nightly.yml/badge.svg)](https://github.com/pytorch/botorch/actions?query=workflow%3ANightly)
[![Codecov](https://img.shields.io/codecov/c/github/pytorch/botorch.svg)](https://codecov.io/github/pytorch/botorch)

[![Conda](https://img.shields.io/conda/v/pytorch/botorch.svg)](https://anaconda.org/pytorch/botorch)
[![PyPI](https://img.shields.io/pypi/v/botorch.svg)](https://pypi.org/project/botorch)
[![License](https://img.shields.io/badge/license-MIT-green.svg)](LICENSE)

Expand Down Expand Up @@ -63,39 +62,26 @@ Optimization simply use Ax.
- scipy
- multiple-dispatch

### Prerequisite only for MacOS users with Intel processors:
Before installing BoTorch, we recommend first manually installing PyTorch, a required dependency of
BoTorch. Installing it according to the [PyTorch installation instructions](https://pytorch.org/get-started/locally/)
ensures that it is properly linked against MKL, a library that optimizes mathematical computation for Intel processors.
This will result in up to an order-of-magnitude speed-up for Bayesian optimization, as at the moment,
installing PyTorch from pip does not link against MKL.

The PyTorch installation instructions currently recommend:
1. Install [Anaconda](https://www.anaconda.com/distribution/#download-section). Note that there are different installers for Intel and M1 Macs.
2. Install PyTorch following the [PyTorch installation instructions](https://pytorch.org/get-started/locally/).
Currently, this suggests running `conda install pytorch torchvision -c pytorch`.

If you want to customize your installation, please follow the [PyTorch installation instructions](https://pytorch.org/get-started/locally/) to build from source.

### Option 1: Installing the latest release

The latest release of BoTorch is easily installed either via
[Anaconda](https://www.anaconda.com/distribution/#download-section) (recommended) or pip.
The latest release of BoTorch is easily installed via `pip`:

**To install BoTorch from Anaconda**, run
```bash
conda install botorch -c pytorch -c gpytorch -c conda-forge
pip install botorch
```
The above command installs BoTorch and any needed dependencies. ` -c pytorch -c gpytorch -c conda-forge` means that the most preferred source to install from is the PyTorch channel, the next most preferred is the GPyTorch channel,
and the least preferred is conda-forge.

**Alternatively, to install with `pip`**, do
_Note_: Make sure the `pip` being used is actually the one from the newly created
Conda environment. If you're using a Unix-based OS, you can use `which pip` to check.

BoTorch [stopped publishing](https://github.com/pytorch/botorch/discussions/2613#discussion-7431533)
an official Anaconda package to the `pytorch` channel after the 0.12 release. However,
users can still use the package published to the `conda-forge` channel and install botorch via

```bash
pip install botorch
conda install botorch -c gpytorch -c conda-forge
```

_Note_: Make sure the `pip` being used is actually the one from the newly created Conda environment. If you're using a Unix-based OS, you can use `which pip` to check.

### Option 2: Installing from latest main branch

If you would like to try our bleeding edge features (and don't mind potentially
Expand Down
14 changes: 7 additions & 7 deletions docs/getting_started.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,19 @@ Before jumping the gun, we recommend you start with the high-level

#### Installation Requirements:

BoTorch is easily installed via
[Anaconda](https://www.anaconda.com/distribution/#download-section) (strongly recommended for OSX)
or `pip`:
BoTorch is easily installed via `pip` (recommended). It is also possible to
use the (unofficial) [Anaconda](https://www.anaconda.com/distribution/#download-section)
package from the `-c conda-forge` channel.

<!--DOCUSAURUS_CODE_TABS-->
<!--Conda-->
```bash
conda install botorch -c pytorch -c gpytorch -c conda-forge
```
<!--pip-->
```bash
pip install botorch
```
<!--Conda-->
```bash
conda install botorch -c gpytorch -c conda-forge
```
<!--END_DOCUSAURUS_CODE_TABS-->

For more installation options and detailed instructions, please see the
Expand Down
12 changes: 0 additions & 12 deletions environment.yml

This file was deleted.

Loading

0 comments on commit a919929

Please sign in to comment.