[FEA] Return centers generated by raft::random::make_blobs

Open
#3,169 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

@NIne-WIngEd is already working on this.

Since Oct 27, 2026.

  • #3192 by @NIne-WIngEd — open

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
53/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Active

Research direction

Read cpp/include/raft/random/detail/make_blobs.cuh, especially the make_blobs_caller implementation linked in the issue. Trace how the temporary centers are created and how the public API calls into it, then identify the relevant make_blobs tests. Done means an optional output exposes the exact generated centers while preserving samples, labels, and RNG behavior; verify with the same-seed and zero-standard-deviation comparisons described in the issue.

Written by the indexing model from the issue text.

Description

Is your feature request related to a problem? Please describe.

When centers == nullptr, make_blobs_caller creates centers in a temporary rand_centers buffer and discards them after generating the samples. A caller that wants to return the generated centers cannot retrieve the exact centers used for that dataset. This blocks cuml.datasets.make_blobs(..., return_centers=True) from using the same RAFT generation path as return_centers=False without changing the samples and labels for a fixed seed. See the current implementation and cuML #8482.

Describe the solution you'd like

Provide an optional output for generated centers, while keeping the existing API usable. When requested, RAFT should return the centers it used for the samples, without changing sample generation, labels, or RNG behavior. A regression test should call make_blobs twice with the same seed, once requesting centers and once not, and compare the samples and labels exactly. With zero standard deviation, each sample should equal the returned center for its label.

Describe alternatives you've considered

cuML can generate centers separately and pass them as input, but that follows a different RNG path and changes the dataset when return_centers is toggled. Keeping a second CuPy generator is also possible, but the cuML review prefers resolving this in RAFT before switching backends.

Dominant language
Cuda
Stars
1.1k
Forks
260
Avg merge
1d 18h
Merged PRs (30d)
21

Getting set up

  • No Dockerfile or Docker Compose file
  • Has a pull request template
  • No contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from NVIDIA/raft

All issues in NVIDIA/raft

Similar issues

More Machine Learning issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.