Skip to content

Add cuml ray hpo example#664

Merged
jacobtomlinson merged 8 commits intorapidsai:mainfrom
ncclementi:cuml-ray-hpo
Mar 11, 2026
Merged

Add cuml ray hpo example#664
jacobtomlinson merged 8 commits intorapidsai:mainfrom
ncclementi:cuml-ray-hpo

Conversation

@ncclementi
Copy link
Contributor

@ncclementi ncclementi commented Feb 12, 2026

I wanted to push this because it's almost there, but there are some hiccups that I think will make the notebook more complicated if fix now, but we can wait a bit, and things will hopefully be easier.

Look at the comments in the review.

Ignore failing CI for now, I know it's broken :P

TODO:

  • I still need to add a card in the index for this, and make sure it renders correctly
  • Test end to end for uv and conda

Regarding,

# TODO CHECK IF WE SHOULD CONVERT TO NUMPY ARRAYS FOR Ray Tune FOR zero copy efficiency on CPU?
# https://docs.ray.io/en/latest/ray-core/objects.html#fetching-object-data

I tried doing a ray.put and ray.get using numpy arrays, I only noticed on the Ray dashboard that the object Store memory was ~ 0.5 smaller, ( 1GB vs 1.5 GB) that being said, this did not affect the time it took to run the 8 trials, so I decided not to complicate the notebook.

Regarding

**TODO (BLOCKED)**: CuPy 13 requires a system CUDA install (or conda, but not relevant here). CuPy 14 is releasing
soon and properly supports installations with only CUDA wheels. This support will come via the cuda-pathfinder project.
Once CuPy 14 is out, upgrading it in an existing cuML environment would patch this (e.g., having cuML or cuDF 26.02 but
bumping CuPy in your own env). Existing RAPIDS packages pin `cupy>=13.6`, which would resolve to 14 in a new
environment or upgrade. This will be autofixed, effectively. Unfortunately, Brev doesn't have a system CUDA installed, or
at least is not in GCP machines.

After a conversation with @jacobtomlinson we decided to document the path for both uv and conda, as is at the moment and when cupy 14 is out, simplify the uv one. It's unclear when cupy 14 will be out yet.

@ncclementi ncclementi requested a review from a team as a code owner February 12, 2026 00:36
@review-notebook-app
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

Copy link
Contributor Author

@ncclementi ncclementi left a comment

Choose a reason for hiding this comment

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

Things to discuss

"When running this notebook with a Conda environment, you may see messages like the following appear in your output while Ray hyperparameter trials are running:\n",
" \n",
"```\n",
"(raylet) I0000 00:00:1770938640.198717 34590 chttp2_transport.cc:1182] ipv4:10.128.0.35:33125: Got goaway [2]\n",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's not clear to me why this happen, but things run successfully, so I left a note, it only happens on the conda install.

@ncclementi
Copy link
Contributor Author

@jacobtomlinson I'm seeing quite a bit of issues with the build and deploy, that I don't see locally when building the docs.

There is a warning, that seem to be treated as error, but it's not super clear which ones, I see

build finished with problems, 2 warnings (with warnings treated as errors).
make: *** [Makefile:20: dirhtml] Error 1
Error: Process completed with exit code 2.

Maybe this one, could be one?

/home/runner/work/deployment/deployment/source/examples/cuml-ray-hpo/notebook.ipynb:50002: WARNING: Lexing literal_block '! python get_data.py --full-dataset ## for a smaller dataset remove --full-dataset' as "python" resulted in an error at token: '!'. Retrying in relaxed mode. [misc.highlighting_failure]

@ncclementi ncclementi changed the title [WIP-DNM] Add cuml ray hpo example Add cuml ray hpo example Feb 13, 2026
@jacobtomlinson
Copy link
Member

jacobtomlinson commented Feb 13, 2026

Thanks for this. I'll block out some time next week to review it thoroughly.

I think this is the warning that's causing the CI to fail. It should probably be text.

/home/runner/work/deployment/deployment/source/examples/cuml-ray-hpo/notebook.ipynb:180002: WARNING: Pygments lexer name 'txt' is not known [misc.highlighting_failure]

@ncclementi
Copy link
Contributor Author

Oh that was it, Thank you @jacobtomlinson
I did not even see that part in the output, I was looking at the red parts.

"````{tab-item} uv\n",
":sync: uv\n",
"\n",
"1. Check Your CUDA Version in the Jupyter terminal\n",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Update: CuPy 14 was released. Now when installing cuml via uv pip in a system that does not have a system installation of cuda runtime, things work as expected.  cuml  is bringing the runtime with it, and cupy can find it successfully.

I tested things and had no problem.

@@ -0,0 +1,560 @@
{
Copy link
Member

@jacobtomlinson jacobtomlinson Mar 3, 2026

Choose a reason for hiding this comment

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

Out if interest I installed the jupyter-server-proxy and tried to access the Ray dashboard at myinstance.brevlab.com/proxy/8265 but the page doesn't load because Ray is not working properly with the proxy. I might make a small reproducer and open it on Ray.


Reply via ReviewNB

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I haven't tried that, but it would be worth reporting this to Brev. I was accessing the Ray dashboard in the browser directly, and in that case the port-forward worked just fine.

@ncclementi
Copy link
Contributor Author

@jacobtomlinson Thanks for the review, I think I cover all your suggestions.

@jacobtomlinson jacobtomlinson merged commit b3104bb into rapidsai:main Mar 11, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Create Workflow Example Ray + cuml on Brev

2 participants