Documentation Updates for cuML Python Developer Guide#6843
Documentation Updates for cuML Python Developer Guide#6843rapids-bot[bot] merged 14 commits intorapidsai:branch-25.08from
Conversation
- Added guidelines on using the rapids-logger library for logging, including usage examples and best practices. - Updated the documentation style guide for consistency with NumPy docstring standards. - Expanded the multi-GPU support section with Dask integration details and best practices for effective usage. - General formatting improvements.
|
Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually. Contributors can view more details about this message here. |
- Use "accessibility" terminology to acknowledge that memory can be host or device accessible rather than relying on the actual physical location. - Remove reference to cuml-cpu related components.
2ec87bb to
a1428ef
Compare
| # These operations will run concurrently | ||
| kmeans1.fit(X1) | ||
| kmeans2.fit(X2) |
There was a problem hiding this comment.
I'm honestly not sure how true that is considering that the two Python functions are actually not running asynchronously. I've mostly corrected the previously defunct example and made sure that this code runs.
There was a problem hiding this comment.
This isn't true, kmeans1.fit will fully run before kmeans2.fit starts. It would be true if they were running in separate threads/processes though, but in that case there's no real reason to create your own handles anyway.
There was a problem hiding this comment.
I'm not sure about this specific case but when you talk about benchmarking you often get advice like https://docs.cupy.dev/en/stable/user_guide/performance.html#benchmarking or the very end of section 3 https://docs.pytorch.org/tutorials/recipes/recipes/benchmark.html#benchmarking-with-torch-utils-benchmark-timer
The cupy guide suggests to me a Python function (my_func in that example) can return before all the work is done. All that happens before it returns is that the kernel is launched. What exactly happens when the function returns the result of the kernel (but you don't look at it?) probably depends on the library (not sure if PyTorch and cupy do the same thing?).
But my take away from all this is that you have to be very precise with the example and what you are measuring. To avoid creating more confusion. So maybe we can link to such a guide that is very precise about when what happens? For example, in the k-means example here, what happens if I access kmeans1.cluster_centers_ without calling s1.sync()?
There was a problem hiding this comment.
Indeed, the kernel functions could in fact run asynchronously until we block on the sync calls, but I just ran some tests and did some profiling and they are certainly not for this example. I made sure to additionally test with all sync calls removed (both within the user code within our code) and it made no difference.
This is certainly worth exploring, but not within the scope of this PR.
There was a problem hiding this comment.
Given that the statement here isn't true (you can't concurrently run estimators like this), should we rip this section out then? Sorry, I should have been clearer in my review - I approved since it was strictly better than what we had before, but this section is inaccurate and should be amended IMO.
There was a problem hiding this comment.
Yes, we probably should and happy to do so in an immediate follow-up. This PR constitutes a general improvement so no need to bike-shed on this.
| # These operations will run concurrently | ||
| kmeans1.fit(X1) | ||
| kmeans2.fit(X2) |
There was a problem hiding this comment.
This isn't true, kmeans1.fit will fully run before kmeans2.fit starts. It would be true if they were running in separate threads/processes though, but in that case there's no real reason to create your own handles anyway.
|
/merge |
This PR addresses several documentation improvements outlined in the issue, focusing on the Python Developer Guide and Estimator Guide.
Core Documentation Updates
Estimator Guide Revisions
Updated guide to clarify API matching policy:
Content Organization:
Memory Management Terminology
Closes #6850 .