[BUG] Divergent KMeans++ Behavior for Equal Length Host and Device Resident Arrays
Open
Nobody has claimed this yet.
bug
- Dominant language
- Cuda
- Stars
- 854
- Forks
- 236
- Avg merge
- 3d 3h
- Merged PRs (30d)
- 62
Description
A device array calls the sequential kmeans++ algorithm with the entire dataset. However a host array with device_buffer_samples = 0 (default) would take a sample of shape min(3 * n_clusters, n_samples) * n_cols. This calls a cuml.accel test to fail.
-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
- generated xml file: /__w/cuml/cuml/test-results/junit-cuml-accel-scikit-learn.xml -
=========================== short test summary info ============================
FAILED python/cuml/cuml_accel_tests/upstream/scikit-learn/tests/test_pipeline.py::test_fit_predict_on_pipeline - AssertionError:
Arrays are not almost equal to 6 decimals
Mismatched elements: 120 / 150 (80%)
First 5 mismatches are at indices:
[0]: 7 (ACTUAL), 1 (DESIRED)
[1]: 1 (ACTUAL), 4 (DESIRED)
[2]: 1 (ACTUAL), 4 (DESIRED)
[3]: 1 (ACTUAL), 4 (DESIRED)
[4]: 7 (ACTUAL), 1 (DESIRED)
Max absolute difference among violations: 6
Max relative difference among violations: 6.
ACTUAL: array([7, 1, 1, 1, 7, 3, 7, 7, 1, 1, 7, 7, 1, 1, 3, 3, 3, 7, 3, 7, 7, 7,
7, 7, 7, 1, 7, 7, 7, 1, 1, 7, 3, 3, 1, 1, 7, 7, 1, 7, 7, 1, 1, 7,
7, 1, 7, 1, 7, 7, 6, 6, 6, 5, 6, 0, 6, 5, 6, 0, 5, 0, 5, 6, 0, 6,...
DESIRED: array([1, 4, 4, 4, 1, 7, 1, 1, 4, 4, 7, 1, 4, 4, 7, 7, 7, 1, 7, 7, 1, 7,
1, 1, 1, 4, 1, 1, 1, 4, 4, 1, 7, 7, 4, 4, 1, 1, 4, 1, 1, 4, 4, 1,
7, 4, 7, 4, 7, 1, 6, 6, 6, 2, 6, 2, 6, 2, 6, 2, 2, 6, 2, 6, 2, 6,...
= 1 failed, 37461 passed, 6138 skipped, 662 xfailed, 101 xpassed, 5277 warnings in 1086.09s (0:18:06) =
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with python/cuml/cuml_accel_tests/upstream/scikit-learn/tests/test_pipeline.py::test_fit_predict_on_pipeline and reproduce the reported failure. Trace the KMeans++ handling for host arrays with device_buffer_samples=0 and device-resident arrays, then verify that equal-length inputs produce consistent results and that the test passes.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- machine-learning, testing-qa
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100