diff --git a/ci/test_python_common.sh b/ci/test_python_common.sh index 5f1894356c..e2d19a3325 100644 --- a/ci/test_python_common.sh +++ b/ci/test_python_common.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright (c) 2022-2024, NVIDIA CORPORATION. +# Copyright (c) 2022-2025, NVIDIA CORPORATION. set -euo pipefail @@ -17,7 +17,7 @@ rapids-dependency-file-generator \ --prepend-channel "${CPP_CHANNEL}" \ --prepend-channel "${PYTHON_CHANNEL}" | tee env.yaml -rapids-mamba-retry env create --yes -f env.yaml -n test +rapids-mamba-retry env create --quiet --yes -f env.yaml -n test # Temporarily allow unbound variables for conda activation. set +u diff --git a/python/cuml/cuml/manifold/umap.pyx b/python/cuml/cuml/manifold/umap.pyx index 079b270d0a..83f29f76c8 100644 --- a/python/cuml/cuml/manifold/umap.pyx +++ b/python/cuml/cuml/manifold/umap.pyx @@ -334,6 +334,22 @@ class UMAP(UniversalBase, _cpu_estimator_import_path = 'umap.UMAP' embedding_ = CumlArrayDescriptor(order='C') + _hyperparam_interop_translator = { + "metric": { + "sokalsneath": "NotImplemented", + "rogerstanimoto": "NotImplemented", + "sokalmichener": "NotImplemented", + "yule": "NotImplemented", + "ll_dirichlet": "NotImplemented", + "russellrao": "NotImplemented", + "kulsinski": "NotImplemented", + "dice": "NotImplemented", + "wminkowski": "NotImplemented", + "mahalanobis": "NotImplemented", + "haversine": "NotImplemented", + } + } + @device_interop_preparation def __init__(self, *, n_neighbors=15, diff --git a/python/cuml/cuml/tests/experimental/accel/estimators_hyperparams/test_accel_umap.py b/python/cuml/cuml/tests/experimental/accel/estimators_hyperparams/test_accel_umap.py index 543d545caf..67ace7c3fd 100644 --- a/python/cuml/cuml/tests/experimental/accel/estimators_hyperparams/test_accel_umap.py +++ b/python/cuml/cuml/tests/experimental/accel/estimators_hyperparams/test_accel_umap.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2024, NVIDIA CORPORATION. +# Copyright (c) 2024-2025, NVIDIA CORPORATION. # # Licensed under the Apache License, Version 2.0 (the “License”); # you may not use this file except in compliance with the License. @@ -46,10 +46,33 @@ def test_umap_min_dist(manifold_data, min_dist): @pytest.mark.parametrize( - "metric", ["euclidean", "manhattan", "chebyshev", "cosine"] + "metric", + [ + "euclidean", + "manhattan", + "chebyshev", + "cosine", + # These metrics are currently not supported in cuml, + # we test them here to make sure no exception is raised + "sokalsneath", + "rogerstanimoto", + "sokalmichener", + "yule", + "ll_dirichlet", + "russellrao", + "kulsinski", + "dice", + "wminkowski", + "mahalanobis", + "haversine", + ], ) def test_umap_metric(manifold_data, metric): X = manifold_data + # haversine only works for 2D data + if metric == "haversine": + X = X[:, :2] + umap = UMAP(metric=metric, random_state=42) X_embedded = umap.fit_transform(X) trust = trustworthiness(X, X_embedded, n_neighbors=5)