Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bump to minimum python version to 3.10 and test 3.12 #2293

Closed
wants to merge 9 commits into from

Conversation

sdaulton
Copy link
Contributor

@sdaulton sdaulton commented Apr 10, 2024

Motivation

Bump minimum version of python from 3.9 -> 3.10 and start testing 3.12, since scientific python is no longer supporting py3.9: https://scientific-python.org/specs/spec-0000/

Have you read the Contributing Guidelines on pull requests?

(Write your answer here.)

Test Plan

Circle CI, running manual nightly job: https://github.com/sdaulton/botorch/actions/runs/8638469226

@facebook-github-bot facebook-github-bot added the CLA Signed Do not delete this pull request or issue due to inactivity. label Apr 10, 2024
@facebook-github-bot
Copy link
Contributor

@sdaulton has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

.github/workflows/deploy_on_release.yml Outdated Show resolved Hide resolved
.github/workflows/deploy_on_release.yml Show resolved Hide resolved
setup.py Outdated Show resolved Hide resolved
@saitcakmak
Copy link
Contributor

Looks like there are 3 tutorial failures. Two of them should be resolved once the Ax PR lands. The last one seems to originate from the cma package. It might require an upstream fix before we can land this -- or we can temporarily disable that tutorial.

@saitcakmak
Copy link
Contributor

I looked into this a bit more closely. Looks like the failures happen because we're using development version of numpy 2.0 (installed with torch nightly), which changes some things with the copy kwarg.

@Balandat
Copy link
Contributor

@saitcakmak we don't need to use the numpy 2.0 dev version though, right? Or do the torch nightlies depend on it? If not we should be able to install numpy <2.0 first and then the torch nightlies in CI

@saitcakmak
Copy link
Contributor

I am guessing numpy 2.0 rc1 gets installed because the install command for pytorch nightly is pip install --pre .... If --pre is not necessary, removing it could fix the issue without having to pin numpy. I recall this causing an issue with another dependency in the recent past

@Balandat
Copy link
Contributor

Yeah that's definitely the reason it gets installed. But if we manually install numpy (without the --pre option) prior to installing torch, it shouldn't be upgrading numpy, even when installing torch with --pre option.

@saitcakmak
Copy link
Contributor

I think removing --pre (if it works) is a cleaner solution than pinning numpy. Both in that it will not add additional commands in various places, and it won't introduce code that needs to be cleaned up later. By the time numpy 2.0 is released, we should aim to be compatible with it -- which doens't require a lot of work, as I found in CMA-ES/pycma#251. We likely have much less numpy code than cma does.

@sdaulton
Copy link
Contributor Author

removing pre did the trick.

@facebook-github-bot
Copy link
Contributor

@sdaulton has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

exclude:
- os: "macos-14"
python-version: "3.9" # not available for macos-14
python-version: ["3.10", "3.11", "3.12"]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's not test 3.11 here? If things work for 3.10 and 3.12 they should also work for 3.11. And having 3.11 here will cost a bunch of GHA capacity (note that macos hosts are more expensive)

exclude:
- os: "macos-14"
python-version: "3.9" # not available for macos-14
python-version: ["3.10", "3.11", "3.12"]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
python-version: ["3.10", "3.11", "3.12"]
python-version: ["3.10", "3.12"]

exclude:
- os: "macos-14"
python-version: "3.9" # not available for macos-14
python-version: ["3.10", "3.11", "3.12"]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
python-version: ["3.10", "3.11", "3.12"]
python-version: ["3.10", "3.12"]

exclude:
- os: "macos-14"
python-version: "3.9" # not available for macos-14
python-version: ["3.10", "3.11", "3.12"]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
python-version: ["3.10", "3.11", "3.12"]
python-version: ["3.10", "3.12"]

exclude:
- os: "macos-14"
python-version: "3.9" # not available for macos-14
python-version: ["3.10", "3.11", "3.12"]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
python-version: ["3.10", "3.11", "3.12"]
python-version: ["3.10", "3.12"]

exclude:
- os: "macos-14"
python-version: "3.9" # not available for macos-14
python-version: ["3.10", "3.11", "3.12"]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
python-version: ["3.10", "3.11", "3.12"]
python-version: ["3.10", "3.12"]

exclude:
- os: "macos-14"
python-version: "3.9" # not available for macos-14
python-version: ["3.10", "3.11", "3.12"]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
python-version: ["3.10", "3.11", "3.12"]
python-version: ["3.10", "3.12"]

exclude:
- os: "macos-14"
python-version: "3.9" # not available for macos-14
python-version: ["3.10", "3.11", "3.12"]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
python-version: ["3.10", "3.11", "3.12"]
python-version: ["3.10", "3.12"]

- name: Fetch all history for all tags and branches
# We need to do this so setuptools_scm knows how to set the BoTorch version.
run: git fetch --prune --unshallow
- if: ${{ !inputs.use_stable_pytorch_gpytorch }}
name: Install latest PyTorch & GPyTorch
# Ax and cma are not compatible with numpy 2.0 yet
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# Ax and cma are not compatible with numpy 2.0 yet

exclude:
- os: "macos-14"
python-version: "3.9" # not available for macos-14
python-version: ["3.10", "3.11", "3.12"]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
python-version: ["3.10", "3.11", "3.12"]
python-version: ["3.10", "3.12"]

exclude:
- os: "macos-14"
python-version: "3.9" # not available for macos-14
python-version: ["3.10", "3.11", "3.12"]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
python-version: ["3.10", "3.11", "3.12"]
python-version: ["3.10", "3.12"]

exclude:
- os: "macos-14"
python-version: "3.9" # not available for macos-14
python-version: ["3.10", "3.11", "3.12"]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
python-version: ["3.10", "3.11", "3.12"]
python-version: ["3.10", "3.12"]

exclude:
- os: "macos-14"
python-version: "3.9" # not available for macos-14
python-version: ["3.10", "3.11", "3.12"]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
python-version: ["3.10", "3.11", "3.12"]
python-version: ["3.10", "3.12"]

exclude:
- os: "macos-14"
python-version: "3.9" # not available for macos-14
python-version: ["3.10", "3.11", "3.12"]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
python-version: ["3.10", "3.11", "3.12"]
python-version: ["3.10", "3.12"]

@Balandat
Copy link
Contributor

removing pre did the trick.

But that is not installing the nightly pytorch build though?

@facebook-github-bot
Copy link
Contributor

@sdaulton has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@facebook-github-bot
Copy link
Contributor

@sdaulton merged this pull request in 404d869.

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.

None yet

4 participants