Skip to content

Commit

Permalink
[ray] python 3.12 (ray-project#45621)
Browse files Browse the repository at this point in the history
Add python 3.12 wheel support. Please follow
https://docs.google.com/document/d/1-wmTLYwDA9QOHZRQ5IeUamyaTi3J0JorxvlQDbzodys/edit
for more details on the roll out phase for this support.

TL;DR; this PR will support python 3.12 as a nightly wheel; other
release artifacts will take more work

Related issue: ray-project#40211

Test:
- CI

Signed-off-by: can <[email protected]>
Co-authored-by: Philipp Moritz <[email protected]>
Signed-off-by: Ryan O'Leary <[email protected]>
  • Loading branch information
2 people authored and ryanaoleary committed Jun 6, 2024
1 parent 8ed8788 commit 22c2590
Show file tree
Hide file tree
Showing 9 changed files with 19 additions and 3 deletions.
1 change: 1 addition & 0 deletions .buildkite/build.rayci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ steps:
- "3.9"
- "3.10"
- "3.11"
- "3.12"
depends_on:
- manylinux
- forge
Expand Down
2 changes: 2 additions & 0 deletions .buildkite/core.rayci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ steps:
- "3.9"
- "3.10"
- "3.11"
- "3.12"
env:
PYTHON_VERSION: "{{matrix}}"
EXTRA_DEPENDENCY: core
Expand Down Expand Up @@ -243,6 +244,7 @@ steps:
- "3.9"
- "3.10"
- "3.11"
- "3.12"

# cpp tests
- label: ":ray: core: cpp tests"
Expand Down
1 change: 1 addition & 0 deletions .buildkite/windows.rayci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ steps:
- "3.9"
- "3.10"
- "3.11"
- "3.12"
depends_on: windowsbuild

- label: ":ray: core: :windows: cpp tests"
Expand Down
7 changes: 5 additions & 2 deletions ci/env/install-dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,11 @@ install_miniconda() {
)
fi

# Install mpi4py
"${WORKSPACE_DIR}"/ci/suppress_output conda install -c anaconda mpi4py -y
if [[ "${PYTHON-}" != "3.12" ]]; then
# Install mpi4py as a test dependency for Python <3.12; currently mpi4py is not
# available for Python 3.12
"${WORKSPACE_DIR}"/ci/suppress_output conda install -c anaconda mpi4py -y
fi

command -V python
test -x "${CONDA_PYTHON_EXE}" # make sure conda is activated
Expand Down
1 change: 1 addition & 0 deletions ci/ray_ci/builder_container.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ class PythonVersionInfo(TypedDict):
"3.9": PythonVersionInfo(bin_path="cp39-cp39"),
"3.10": PythonVersionInfo(bin_path="cp310-cp310"),
"3.11": PythonVersionInfo(bin_path="cp311-cp311"),
"3.12": PythonVersionInfo(bin_path="cp312-cp312"),
}
DEFAULT_PYTHON_VERSION = "3.9"
DEFAULT_BUILD_TYPE = "optimized"
Expand Down
1 change: 1 addition & 0 deletions ci/ray_ci/container.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
"BUILDKITE_LABEL",
"BUILDKITE_BAZEL_CACHE_URL",
"BUILDKITE_PIPELINE_ID",
"BUILDKITE_PULL_REQUEST",
]
_RAYCI_BUILD_ID = os.environ.get("RAYCI_BUILD_ID", "unknown")

Expand Down
2 changes: 1 addition & 1 deletion python/build-wheel-macos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ DOWNLOAD_DIR=python_downloads

NODE_VERSION="14"

PY_MMS=("3.9" "3.10" "3.11")
PY_MMS=("3.9" "3.10" "3.11" "3.12")

if [[ -n "${SKIP_DEP_RES}" ]]; then
./ci/env/install-bazel.sh
Expand Down
1 change: 1 addition & 0 deletions python/build-wheel-manylinux2014.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ PYTHON_VERSIONS=(
"py39 cp39-cp39"
"py310 cp310-cp310"
"py311 cp311-cp311"
"py312 cp312-cp312"
)

# Add the repo folder to the safe.dictory global variable to avoid the failure
Expand Down
6 changes: 6 additions & 0 deletions python/ray/tests/test_mpi.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ def run():


@pytest.mark.skipif(sys.platform != "linux", reason="Only test MPI on linux.")
@pytest.mark.skipif(
sys.version_info < (3, 12), reason="MPI not yet supported for python 3.12+"
)
def test_mpi_func_pi(change_test_dir, ray_start_regular):
@ray.remote(
runtime_env={
Expand All @@ -63,6 +66,9 @@ def calc_pi():


@pytest.mark.skipif(sys.platform != "linux", reason="Only test MPI on linux.")
@pytest.mark.skipif(
sys.version_info < (3, 12), reason="MPI not yet supported for python 3.12+"
)
def test_mpi_actor_pi(change_test_dir, ray_start_regular):
@ray.remote(
runtime_env={
Expand Down

0 comments on commit 22c2590

Please sign in to comment.