Skip to content
5 changes: 4 additions & 1 deletion python/cuml/cuml/manifold/umap.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -273,13 +273,16 @@ class UMAP(Base,
def on_train_end(self, embeddings):
print(embeddings.copy_to_host())

handle : cuml.Handle
handle : cuml.Handle or pylibraft.common.DeviceResourcesSNMG
Specifies the cuml.handle that holds internal CUDA state for
computations in this model. Most importantly, this specifies the CUDA
stream that will be used for the model's computations, so users can
run different models concurrently in different streams by creating
handles in several streams.
If it is None, a new one is created.
Using `pylibraft.common.DeviceResourcesSNMG` as the handle will run batched knn graph
Comment thread
jinsolp marked this conversation as resolved.
building using multiple GPUs. This will only be valid when `build_algo=nn_descent` and
`nnd_n_clusters > 1`.
verbose : int or boolean, default=False
Sets logging level. It must be one of `cuml.common.logger.level_*`.
See :ref:`verbosity-levels` for more info.
Expand Down
14 changes: 9 additions & 5 deletions python/cuml/cuml/tests/test_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,12 +138,16 @@ def get_param_doc(param_doc_obj, name: str):

base_item_doc = get_param_doc(base_doc_params, name)

# Ensure the docstring is identical
assert (
found_doc.type == base_item_doc.type
), "Docstring mismatch for {}".format(name)
if not (
found_doc.type.startswith("cuml.Handle")
and klass == cuml.manifold.umap.UMAP
):
# Ensure the docstring is identical
assert (
found_doc.type == base_item_doc.type
), "Docstring mismatch for {}".format(name)
Comment on lines +141 to +148
Copy link
Copy Markdown
Contributor

@csadorf csadorf Jul 28, 2025

Choose a reason for hiding this comment

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

The need for the exceptional handling here hints at an abstraction issue. This test ensures that the base class parameters and its children have the same signature for parameters of the same name. We need the exception because this is no longer the case, the UMAP class has a different signature.

A "correct" fix could be to either actually change the signature of the Base class such that it generally accepts instances of either cuml.Handle or pylibraft.common.DeviceResourcesSNMG type or ensure that cuml.Handle is either dervied from DeviceResourcesSNMG or at least shares a common base class.

We should not make any attempt at fixing or addressing this in this PR since it was originally introduced in #6654.

I suggest that we maintain this state for now and evaluate independently whether a correction is needed.


assert " ".join(found_doc.desc) == " ".join(base_item_doc.desc)
assert " ".join(found_doc.desc) == " ".join(base_item_doc.desc)


@pytest.mark.parametrize("child_class", list(all_base_children.keys()))
Expand Down