-
Notifications
You must be signed in to change notification settings - Fork 6.1k
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
[Core] Initial port of Ray to Python 3.13 #47984
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(skipping review for now)
It looks like cython/cython#3235 was merged. Looking forward to 3.13 & 3.13t support soon! |
Just checking in on how this is going. Are there any blockers other than doing the work to upgrade to 3.13t? Just curious if this is on the priority list & when 3.13t support will be available. |
Signed-off-by: Philipp Moritz <pcmoritz@gmail.com>
This is hitting cython/cython#5750, since Cython unfortunately doesn't seem to fix it, we will have to work around it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. Can we leave a comment in unique_ids.pxd
to undo the workarounds whenever it's possible?
Co-authored-by: Edward Oakes <ed.nmi.oakes@gmail.com> Signed-off-by: Philipp Moritz <pcmoritz@gmail.com>
<!-- Thank you for your contribution! Please review https://github.com/ray-project/ray/blob/master/CONTRIBUTING.rst before opening a pull request. --> <!-- Please add a reviewer to the assignee section when you create a PR. If you don't have the access to it, we will shortly find a reviewer and assign them to your PR. --> ## Why are these changes needed? After #47984 we can now build the wheels. Note that these are not tested yet, since unfortunately conda doesn't currently support Python 3.13 as the base environment (conda/conda#14353) and changing everything to run in a custom conda environment seems to require a decent amount of changes. ## Related issue number <!-- For example: "Closes #1234" --> ## Checks - [ ] I've signed off every commit(by using the -s flag, i.e., `git commit -s`) in this PR. - [ ] I've run `scripts/format.sh` to lint the changes in this PR. - [ ] I've included any doc changes needed for https://docs.ray.io/en/master/. - [ ] I've added any new APIs to the API Reference. For example, if I added a method in Tune, I've added it in `doc/source/tune/api/` under the corresponding `.rst` file. - [ ] I've made sure the tests are passing. Note that there might be a few flaky tests, see the recent failures at https://flakey-tests.ray.io/ - Testing Strategy - [ ] Unit tests - [ ] Release tests - [ ] This PR is not tested :(
This reverts commit d2004b6.
This reverts commit d2004b6.
This reverts commit d2004b6. Signed-off-by: Edward Oakes <ed.nmi.oakes@gmail.com>
<!-- Thank you for your contribution! Please review https://github.com/ray-project/ray/blob/master/CONTRIBUTING.rst before opening a pull request. --> <!-- Please add a reviewer to the assignee section when you create a PR. If you don't have the access to it, we will shortly find a reviewer and assign them to your PR. --> ## Why are these changes needed? After ray-project#47984 we can now build the wheels. Note that these are not tested yet, since unfortunately conda doesn't currently support Python 3.13 as the base environment (conda/conda#14353) and changing everything to run in a custom conda environment seems to require a decent amount of changes. ## Related issue number <!-- For example: "Closes ray-project#1234" --> ## Checks - [ ] I've signed off every commit(by using the -s flag, i.e., `git commit -s`) in this PR. - [ ] I've run `scripts/format.sh` to lint the changes in this PR. - [ ] I've included any doc changes needed for https://docs.ray.io/en/master/. - [ ] I've added any new APIs to the API Reference. For example, if I added a method in Tune, I've added it in `doc/source/tune/api/` under the corresponding `.rst` file. - [ ] I've made sure the tests are passing. Note that there might be a few flaky tests, see the recent failures at https://flakey-tests.ray.io/ - Testing Strategy - [ ] Unit tests - [ ] Release tests - [ ] This PR is not tested :( Signed-off-by: 400Ping <43886578+400Ping@users.noreply.github.com>
<!-- Thank you for your contribution! Please review https://github.com/ray-project/ray/blob/master/CONTRIBUTING.rst before opening a pull request. --> <!-- Please add a reviewer to the assignee section when you create a PR. If you don't have the access to it, we will shortly find a reviewer and assign them to your PR. --> ## Why are these changes needed? This is the first step towards #47933 It is not very tested at the moment (on Python 3.13), but it compiles locally (with `pip install -e . --verbose`) and can execute a simple workload like ``` >>> import ray >>> ray.init() 2024-10-10 16:03:31,857 INFO worker.py:1799 -- Started a local Ray instance. RayContext(dashboard_url='', python_version='3.13.0', ray_version='3.0.0.dev0', ray_commit='{{RAY_COMMIT_SHA}}') >>> @ray.remote ... def f(): ... return 42 ... >>> ray.get(f.remote()) 42 >>> ``` (and similar for actors). The main thing that needed to change to make Ray work on Python 3.13 was to upgrade Cython to 3.0.11 which seems to be the first version of Cython to support Python 3.13. Unfortunately it has a compiler bug cython/cython#3235 (the fix is not released yet) that I had to work around. I also had to work around cython/cython#5750 by changing some typing from `float` to `int | float`. ## Related issue number <!-- For example: "Closes #1234" --> ## Checks - [ ] I've signed off every commit(by using the -s flag, i.e., `git commit -s`) in this PR. - [ ] I've run `scripts/format.sh` to lint the changes in this PR. - [ ] I've included any doc changes needed for https://docs.ray.io/en/master/. - [ ] I've added any new APIs to the API Reference. For example, if I added a method in Tune, I've added it in `doc/source/tune/api/` under the corresponding `.rst` file. - [ ] I've made sure the tests are passing. Note that there might be a few flaky tests, see the recent failures at https://flakey-tests.ray.io/ - Testing Strategy - [ ] Unit tests - [ ] Release tests - [ ] This PR is not tested :( --------- Signed-off-by: Philipp Moritz <pcmoritz@gmail.com> Co-authored-by: pcmoritz <pcmoritz@anyscale.com> Co-authored-by: srinathk10 <68668616+srinathk10@users.noreply.github.com> Co-authored-by: Edward Oakes <ed.nmi.oakes@gmail.com>
<!-- Thank you for your contribution! Please review https://github.com/ray-project/ray/blob/master/CONTRIBUTING.rst before opening a pull request. --> <!-- Please add a reviewer to the assignee section when you create a PR. If you don't have the access to it, we will shortly find a reviewer and assign them to your PR. --> ## Why are these changes needed? After #47984 we can now build the wheels. Note that these are not tested yet, since unfortunately conda doesn't currently support Python 3.13 as the base environment (conda/conda#14353) and changing everything to run in a custom conda environment seems to require a decent amount of changes. ## Related issue number <!-- For example: "Closes #1234" --> ## Checks - [ ] I've signed off every commit(by using the -s flag, i.e., `git commit -s`) in this PR. - [ ] I've run `scripts/format.sh` to lint the changes in this PR. - [ ] I've included any doc changes needed for https://docs.ray.io/en/master/. - [ ] I've added any new APIs to the API Reference. For example, if I added a method in Tune, I've added it in `doc/source/tune/api/` under the corresponding `.rst` file. - [ ] I've made sure the tests are passing. Note that there might be a few flaky tests, see the recent failures at https://flakey-tests.ray.io/ - Testing Strategy - [ ] Unit tests - [ ] Release tests - [ ] This PR is not tested :(
<!-- Thank you for your contribution! Please review https://github.com/ray-project/ray/blob/master/CONTRIBUTING.rst before opening a pull request. --> <!-- Please add a reviewer to the assignee section when you create a PR. If you don't have the access to it, we will shortly find a reviewer and assign them to your PR. --> ## Why are these changes needed? This is the first step towards ray-project#47933 It is not very tested at the moment (on Python 3.13), but it compiles locally (with `pip install -e . --verbose`) and can execute a simple workload like ``` >>> import ray >>> ray.init() 2024-10-10 16:03:31,857 INFO worker.py:1799 -- Started a local Ray instance. RayContext(dashboard_url='', python_version='3.13.0', ray_version='3.0.0.dev0', ray_commit='{{RAY_COMMIT_SHA}}') >>> @ray.remote ... def f(): ... return 42 ... >>> ray.get(f.remote()) 42 >>> ``` (and similar for actors). The main thing that needed to change to make Ray work on Python 3.13 was to upgrade Cython to 3.0.11 which seems to be the first version of Cython to support Python 3.13. Unfortunately it has a compiler bug cython/cython#3235 (the fix is not released yet) that I had to work around. I also had to work around cython/cython#5750 by changing some typing from `float` to `int | float`. ## Related issue number <!-- For example: "Closes ray-project#1234" --> ## Checks - [ ] I've signed off every commit(by using the -s flag, i.e., `git commit -s`) in this PR. - [ ] I've run `scripts/format.sh` to lint the changes in this PR. - [ ] I've included any doc changes needed for https://docs.ray.io/en/master/. - [ ] I've added any new APIs to the API Reference. For example, if I added a method in Tune, I've added it in `doc/source/tune/api/` under the corresponding `.rst` file. - [ ] I've made sure the tests are passing. Note that there might be a few flaky tests, see the recent failures at https://flakey-tests.ray.io/ - Testing Strategy - [ ] Unit tests - [ ] Release tests - [ ] This PR is not tested :( --------- Signed-off-by: Philipp Moritz <pcmoritz@gmail.com> Co-authored-by: pcmoritz <pcmoritz@anyscale.com> Co-authored-by: srinathk10 <68668616+srinathk10@users.noreply.github.com> Co-authored-by: Edward Oakes <ed.nmi.oakes@gmail.com>
<!-- Thank you for your contribution! Please review https://github.com/ray-project/ray/blob/master/CONTRIBUTING.rst before opening a pull request. --> <!-- Please add a reviewer to the assignee section when you create a PR. If you don't have the access to it, we will shortly find a reviewer and assign them to your PR. --> ## Why are these changes needed? After ray-project#47984 we can now build the wheels. Note that these are not tested yet, since unfortunately conda doesn't currently support Python 3.13 as the base environment (conda/conda#14353) and changing everything to run in a custom conda environment seems to require a decent amount of changes. ## Related issue number <!-- For example: "Closes ray-project#1234" --> ## Checks - [ ] I've signed off every commit(by using the -s flag, i.e., `git commit -s`) in this PR. - [ ] I've run `scripts/format.sh` to lint the changes in this PR. - [ ] I've included any doc changes needed for https://docs.ray.io/en/master/. - [ ] I've added any new APIs to the API Reference. For example, if I added a method in Tune, I've added it in `doc/source/tune/api/` under the corresponding `.rst` file. - [ ] I've made sure the tests are passing. Note that there might be a few flaky tests, see the recent failures at https://flakey-tests.ray.io/ - Testing Strategy - [ ] Unit tests - [ ] Release tests - [ ] This PR is not tested :(
<!-- Thank you for your contribution! Please review https://github.com/ray-project/ray/blob/master/CONTRIBUTING.rst before opening a pull request. --> <!-- Please add a reviewer to the assignee section when you create a PR. If you don't have the access to it, we will shortly find a reviewer and assign them to your PR. --> ## Why are these changes needed? This is the first step towards ray-project#47933 It is not very tested at the moment (on Python 3.13), but it compiles locally (with `pip install -e . --verbose`) and can execute a simple workload like ``` >>> import ray >>> ray.init() 2024-10-10 16:03:31,857 INFO worker.py:1799 -- Started a local Ray instance. RayContext(dashboard_url='', python_version='3.13.0', ray_version='3.0.0.dev0', ray_commit='{{RAY_COMMIT_SHA}}') >>> @ray.remote ... def f(): ... return 42 ... >>> ray.get(f.remote()) 42 >>> ``` (and similar for actors). The main thing that needed to change to make Ray work on Python 3.13 was to upgrade Cython to 3.0.11 which seems to be the first version of Cython to support Python 3.13. Unfortunately it has a compiler bug cython/cython#3235 (the fix is not released yet) that I had to work around. I also had to work around cython/cython#5750 by changing some typing from `float` to `int | float`. ## Related issue number <!-- For example: "Closes ray-project#1234" --> ## Checks - [ ] I've signed off every commit(by using the -s flag, i.e., `git commit -s`) in this PR. - [ ] I've run `scripts/format.sh` to lint the changes in this PR. - [ ] I've included any doc changes needed for https://docs.ray.io/en/master/. - [ ] I've added any new APIs to the API Reference. For example, if I added a method in Tune, I've added it in `doc/source/tune/api/` under the corresponding `.rst` file. - [ ] I've made sure the tests are passing. Note that there might be a few flaky tests, see the recent failures at https://flakey-tests.ray.io/ - Testing Strategy - [ ] Unit tests - [ ] Release tests - [ ] This PR is not tested :( --------- Signed-off-by: Philipp Moritz <pcmoritz@gmail.com> Co-authored-by: pcmoritz <pcmoritz@anyscale.com> Co-authored-by: srinathk10 <68668616+srinathk10@users.noreply.github.com> Co-authored-by: Edward Oakes <ed.nmi.oakes@gmail.com>
<!-- Thank you for your contribution! Please review https://github.com/ray-project/ray/blob/master/CONTRIBUTING.rst before opening a pull request. --> <!-- Please add a reviewer to the assignee section when you create a PR. If you don't have the access to it, we will shortly find a reviewer and assign them to your PR. --> ## Why are these changes needed? After ray-project#47984 we can now build the wheels. Note that these are not tested yet, since unfortunately conda doesn't currently support Python 3.13 as the base environment (conda/conda#14353) and changing everything to run in a custom conda environment seems to require a decent amount of changes. ## Related issue number <!-- For example: "Closes ray-project#1234" --> ## Checks - [ ] I've signed off every commit(by using the -s flag, i.e., `git commit -s`) in this PR. - [ ] I've run `scripts/format.sh` to lint the changes in this PR. - [ ] I've included any doc changes needed for https://docs.ray.io/en/master/. - [ ] I've added any new APIs to the API Reference. For example, if I added a method in Tune, I've added it in `doc/source/tune/api/` under the corresponding `.rst` file. - [ ] I've made sure the tests are passing. Note that there might be a few flaky tests, see the recent failures at https://flakey-tests.ray.io/ - Testing Strategy - [ ] Unit tests - [ ] Release tests - [ ] This PR is not tested :(
Why are these changes needed?
This is the first step towards #47933
It is not very tested at the moment (on Python 3.13), but it compiles locally (with
pip install -e . --verbose
) and can execute a simple workload like(and similar for actors).
The main thing that needed to change to make Ray work on Python 3.13 was to upgrade Cython to 3.0.11 which seems to be the first version of Cython to support Python 3.13. Unfortunately it has a compiler bug cython/cython#3235 (the fix is not released yet) that I had to work around.
I also had to work around cython/cython#5750 by changing some typing from
float
toint | float
.Related issue number
Checks
git commit -s
) in this PR.scripts/format.sh
to lint the changes in this PR.method in Tune, I've added it in
doc/source/tune/api/
under thecorresponding
.rst
file.