Skip to content

Add sklearn.cluster.HDBSCAN acceleration to cuml.accel - #8472

Open
viclafargue wants to merge 1 commit into
NVIDIA:mainfrom
viclafargue:add-sklearn-hdbscan-to-cuml-accel
Open

Add sklearn.cluster.HDBSCAN acceleration to cuml.accel#8472
viclafargue wants to merge 1 commit into
NVIDIA:mainfrom
viclafargue:add-sklearn-hdbscan-to-cuml-accel

Conversation

@viclafargue

Copy link
Copy Markdown
Contributor

Closes #7522.

Adds a dedicated cuml.accel proxy for sklearn.cluster.HDBSCAN, backed by cuML’s GPU implementation while keeping the existing hdbscan.HDBSCAN integration unchanged.

The new adapter translates parameters and fitted state, supports dbscan_clustering after GPU fitting, preserves the originating scikit-learn interface during serialization, and falls back to scikit-learn for unsupported parameters or inputs. It also enforces C-contiguous HDBSCAN input to correctly handle pandas DataFrames.

Includes integration, CPU/GPU interoperability, serialization, fallback, and upstream compatibility coverage, with documentation of expected numerical differences.

@viclafargue
viclafargue requested a review from a team as a code owner August 12, 2026 12:52
@viclafargue
viclafargue requested a review from divyegala August 12, 2026 12:52
@github-actions github-actions Bot added the Cython / Python Cython or Python issue label Aug 12, 2026
@csadorf csadorf added improvement Improvement / enhancement to an existing function non-breaking Non-breaking change labels Aug 17, 2026

@csadorf csadorf left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nice work! Please address the min_samples semantic mismatch and my other comments. Otherwise, this looks good to me.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

That's a very small number of new xfails -- nice!

X,
dtype="float32",
mem_type=mem_type,
order="C",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is this fixing a pre-existing issue with Fortran-contiguous input? check_inputs otherwise preserves the input order, while HDBSCAN expects C-major input. If so, could we add a focused regression test?

Comment on lines +641 to +643
- Scikit-learn and cuML both count each point itself in ``min_samples``, so
this parameter is forwarded without an offset. The separate
``hdbscan.HDBSCAN`` proxy retains its own parameter handling.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

From my understanding, forwarding this value unchanged is incorrect. runner.h increments min_samples before native execution to match the contrib convention:

linkage_params.min_samples = params.min_samples + 1;

On this branch, sklearn with k=5 versus cuml.accel with k=5 gives an ARI of 0.0, while using k=4 on the accelerated estimator raises it to 0.864. Independently, sklearn k matches contrib k-1 exactly.

Could we translate the semantics in the sklearn adapter, handle the min_samples=1 boundary explicitly, and add a boundary-sensitive regression test? The current parameter-translation test appears to codify the unchanged forwarding.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Cython / Python Cython or Python issue improvement Improvement / enhancement to an existing function non-breaking Non-breaking change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support scikit-learn's HDBSCAN version in cuml.accel

2 participants