Repository navigation
[tune] Modernize AxSearch for Ax Platform 1.0.0+ - #60522
Conversation
There was a problem hiding this comment.
Code Review
This pull request effectively modernizes the AxSearch integration to support Ax platform versions 1.0.0 and newer. The changes correctly adopt the new objectives API, replacing deprecated parameters, and properly handle the new AssertionError for checking experiment existence, ensuring compatibility across different Ax versions. The addition of defensive error handling when accessing the experiment post-setup is a good improvement for robustness. Overall, the changes are clear, correct, and well-executed.
|
@justinvyu PTAL |
|
This pull request has been automatically marked as stale because it has not had You can always ask for help on our discussion forum or Ray's public slack channel. If you'd like to keep this open, just leave any comment, and the stale label will be removed. |
|
Note stale. |
|
To ensure stability across the modern Ax API, I have verified these fixes using Ray Tune’s smoke tests and a custom test suite across key stable releases in the Ax 1.x ecosystem:
|
There was a problem hiding this comment.
Could you update the version of ax-platform in https://github.com/ray-project/ray/blob/master/python/requirements/ml/tune-requirements.txt?
There was a problem hiding this comment.
Thanks @matthewdeng. I updated tune-requirements.txt to pin ax-platform==1.2.1 (with a note on the >=1.0.0 compatibility requirement).
I also rebased the branch to fix the missing DCO sign-offs. Ready for review.
There was a problem hiding this comment.
Ah, the cursor-bot had a good catch. I am updating the test files to match the new API and removing the redundant error handling now. Will push a fix shortly.
There was a problem hiding this comment.
Sweet. I think one other thing you'll have to do is to get the compiled dependencies (which you can get from the Buildkite job) and update the requirements_compiled.txt file.
There was a problem hiding this comment.
Thanks for the tip. My local build environment is acting up, so I will grab the generated requirements_compiled.txt from the Buildkite artifacts once this run finishes and push that update tonight/tomorrow.
There was a problem hiding this comment.
Ray Requirements Compilation Update
TLDR: If I can't get the requirements_compiled.txt from BuildKite artifacts, can I hack a version using pip-tools on ARM64, or do I need access to an AMD64/x86_64 system due to platform-specific GPU dependencies?
Update on Requirements Compilation
Hey @matthewdeng, thanks for the guidance! I'm still working on getting the dependencies sorted out properly.
Background:
I discovered that Ray uses a monolithic requirements_compiled.txt that includes dependencies from all modular requirements files (base, tune, serve, llm, test, cloud, etc.), rather than separate compiled files.
The core issue:
When BuildKite tried to build with just the updated tune-requirements.txt (ax-platform==1.2.1), it failed with a constraint conflict:
ERROR: Cannot install ax-platform==1.2.1 because these package versions have conflicting dependencies.
The conflict is caused by:
The user requested ax-platform==1.2.1
The user requested (constraint) ax-platform==0.3.2
This happened because requirements_compiled.txt still had the old constraint while the source file specified the new version.
Compilation challenges on ARM64:
Ray's official compilation script skips ARM64 platforms (I am currently using a mac mini):
$ ./ci/ci.sh compile_pip_dependencies
+ [[ arm64 == \a\a\r\c\h\6\4 ]]
+ echo 'Skipping for aarch64'
Skipping for aarch64Current approach (manual hack):
I'm using pip-tools locally to regenerate requirements, but this approach has limitations:
- Platform differences: ARM64 vs x86_64 dependency resolution may differ
- Missing GPU packages: Many packages like
torch+cu121aren't available for ARM64 - Ray's custom logic: Official compilation may have specific handling I'm missing
Looking at dl-gpu-requirements.txt, Ray uses complex platform-specific dependencies:
torch==2.3.0+cu121
tensorflow-macos==2.15.1; sys_platform == 'darwin' and platform_machine == 'arm64'
cupy-cuda12x>=13.4.0; sys_platform != 'darwin'
These won't resolve correctly on my ARM64 Mac.
Backup plan:
If the manual approach fails, I can use NYU's HPC cluster (AMD64) to run Ray's official compilation process:
./ci/ci.sh compile_pip_dependenciesQuestion: Is the manual pip-tools approach acceptable as a quick fix, or should I prioritize using the official compilation on x86_64 hardware?
Thanks for your patience.
There was a problem hiding this comment.
Quick update: The manual pip-tools approach is creating version conflicts.
I'm going to compile properly on NYU's HPC (AMD64) using ./ci/ci.sh compile_pip_dependencies to avoid ARM64/platform issues. Should have the correct requirements_compiled.txt shortly.
e44b946 to
49e6bbc
Compare
Signed-off-by: Adel Nour <[email protected]>
Head branch was pushed to by a user without write access
Signed-off-by: Adel Nour <[email protected]>
Add a Linux x86_64 lower bound (>=2.26.2,<3) in dl-cpu/dl-gpu and py313 mirrors so pip-compile constraints match cu128 torch. Update requirements_compiled.txt and requirements_compiled_py3.13.txt to nvidia-nccl-cu12==2.26.2, fixing pip/uv conflicts with requirements_compiled used as -c during ray-ml Docker installs and raydepsets. Signed-off-by: Adel Nour <[email protected]>
Pin ax-platform==1.2.1, bayesian-optimization==1.4.3, nevergrad==0.4.3.post7, and ConfigSpace==0.7.1 to match tune-requirements.txt. Omit jaxtyping cap for Python 3.13 (cap remains in default file for Python 3.10). Regenerate requirements_compiled_py3.13.txt if included in this commit. Signed-off-by: Adel Nour <[email protected]>
Signed-off-by: Adel Nour <[email protected]>
dd4f73c to
e2abdf2
Compare
Gate torchtext==0.18.0 to python_version < 3.13 in dl-cpu and py313/dl-cpu because 0.18.0 has no cp313 wheels. Set nevergrad to 0.4.3.post7 in requirements_compiled_py3.13.txt so it matches tune-requirements and avoids uv unsat with -c during raydepsets. Signed-off-by: Adel Nour <[email protected]>
jaxlib only publishes cp313 wheels from 0.4.34 onward; jax 0.4.33 caps jaxlib at 0.4.33, so older pins fail pip resolution on 3.13. Align dl-cpu, dl-gpu (CUDA jaxlib), and data-test py313 files with comments. Signed-off-by: Adel Nour <[email protected]>
…txt; seeing if they pass tests compiled_requirements.txt was grabed as an artifact from build: pip-compile dependencies [g8_s0] Signed-off-by: Adel Nour <[email protected]>
…PU jaxlib) Pin jax/jaxlib to 0.9.2 on CPU/data-test; replace jaxlib+X+cuda12.cudnn89 with jax-cuda12-plugin[with-cuda]==0.9.2 for CUDA 12 (cp313; legacy GCS cudnn89 path has no viable GPU wheels for 3.13). Signed-off-by: Adel Nour <[email protected]>
5e7296d to
5104552
Compare
| from ax.generation_strategy.generation_strategy import GenerationStrategy | ||
| except ImportError: | ||
| # ax 0.x | ||
| from ax import Models |
There was a problem hiding this comment.
Inconsistent fallback import path for older Ax Models
Low Severity
The fallback import for older Ax versions in test_sample.py uses from ax import Models, while test_tune_restore_warm_start.py correctly uses from ax.modelbridge.registry import Models. The from ax import Models shortcut is not guaranteed to work across all older Ax versions — the canonical import path for pre-1.0 Ax is ax.modelbridge.registry. This inconsistency means the fallback branch in testSampleBoundsAx could raise an ImportError on some older Ax installations.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 5104552e9a9dddc604a4580a04e3c4ed8b4509aa. Configure here.
f1152f3 to
4ea61a3
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
There are 2 total unresolved issues (including 1 from previous review).
Reviewed by Cursor Bugbot for commit 4ea61a3121741b5a6cdb377b9ee41ad61867604a. Configure here.
…ern-api Signed-off-by: Adel Nour <[email protected]>
4ea61a3 to
ad541d5
Compare


Update AxSearch to work with modern Ax versions (1.0.0+) which have:
Changes:
Fixes part of #60512