Skip to content

Apply ABI Breaking Changes for KMeans#2147

Open
tarang-jain wants to merge 2 commits into
rapidsai:mainfrom
tarang-jain:breaking
Open

Apply ABI Breaking Changes for KMeans#2147
tarang-jain wants to merge 2 commits into
rapidsai:mainfrom
tarang-jain:breaking

Conversation

@tarang-jain
Copy link
Copy Markdown
Contributor

@tarang-jain tarang-jain commented May 31, 2026

Closes #2048

_v2 APIs were tagged to be removed in 26.08.
We also remove the inerta_check field that was marked for deprecation

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 31, 2026

Review Change Stack

📝 Walkthrough

Walkthrough

Removes the deprecated KMeans v2 C API (types and functions), deletes the inertia_check param from headers and language bindings, simplifies internal param converters to the unified params type, updates tests to call unsuffixed APIs, and updates C/Python docs.

Changes

Remove KMeans v2 API variants

Layer / File(s) Summary
Remove v2 params structure and inertia_check field from header
c/include/cuvs/cluster/kmeans.h
Removes inertia_check from cuvsKMeansParams, deletes cuvsKMeansParams_v2 typing/docs, and drops ABI compatibility comments.
Remove v2 function declarations from header
c/include/cuvs/cluster/kmeans.h
Deletes cuvsKMeansFit_v2, cuvsKMeansPredict_v2, and related v2 docs so unsuffixed signatures remain.
Simplify internal parameter converters in implementation
c/src/cluster/kmeans.cpp
Replaces templated param converters with fixed overloads taking const cuvsKMeansParams& and removes template params from _fit/__predict helpers.
Remove v2 function implementations and inertia_check initialization
c/src/cluster/kmeans.cpp
Removes .inertia_check initializer from cuvsKMeansParamsCreate and deletes cuvsKMeansParamsCreate_v2, Destroy_v2, Fit_v2, Predict_v2 implementations.
Update tests to call unsuffixed KMeans API
c/tests/cluster/kmeans_c.cu
Removes templated test dispatchers and v2-specific test cases; tests now call cuvsKMeansParamsCreate, cuvsKMeansFit, cuvsKMeansPredict directly.
Update C API documentation
fern/pages/c_api/c-api-cluster-kmeans.md
Removes v2 API sections and replacement/ABI notes referencing _v2 signatures.
Remove inertia_check from Python docs
fern/pages/python_api/python-api-cluster-kmeans.md
Deletes inertia_check from the documented KMeansParams parameters and __init__ signature.
Cython bindings and implementation
python/cuvs/.../kmeans.pxd, python/cuvs/.../kmeans.pyx
Removes inertia_check field from the .pxd, deletes inertia_check kwarg and warning logic from the .pyx.
Rust FFI bindings
rust/cuvs-sys/src/bindings.rs
Removes inertia_check from the FFI cuvsKMeansParams struct and updates compile-time size/offset assertions to the new layout.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

Suggested labels

breaking, cpp, Rust, improvement

Suggested reviewers

  • cjnolet
  • lowener
  • robertmaynard
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 8.33% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed All linked issue requirements are met: _v2 APIs removed from C tests, header, and implementation; template ParamsT removed; inertia_check deprecated from Python API; documentation updated.
Out of Scope Changes check ✅ Passed All changes are directly scoped to the linked issue requirements: removing _v2 APIs, deprecating inertia_check, and updating related documentation across C/Python/Rust code.
Description check ✅ Passed The PR description clearly relates to the changeset by referencing issue #2048 and describing the removal of _v2 APIs and the inertia_check field, which align with the actual changes across multiple files.
Title check ✅ Passed The title 'Apply ABI Breaking Changes for KMeans' accurately and directly summarizes the main objective of the PR, which is to apply C ABI breaking changes to the KMeans API by removing _v2 APIs and the inertia_check parameter.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands and usage tips.

@tarang-jain tarang-jain requested review from a team as code owners May 31, 2026 23:13
@tarang-jain tarang-jain self-assigned this May 31, 2026
@tarang-jain tarang-jain added breaking Introduces a breaking change improvement Improves an existing functionality labels May 31, 2026
@tarang-jain tarang-jain changed the title Apply A ABI Breaking Changes for KMeans Apply ABI Breaking Changes for KMeans May 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking Introduces a breaking change improvement Improves an existing functionality

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

[Tracker] Apply KMeans C ABI Breaking Changes in 26.08

1 participant