Skip to content

Refactor GMM TUs to use gmm_matrix.json - #2693

Open
aamijar wants to merge 5 commits into
NVIDIA:mainfrom
aamijar:gmm-refactor-files
Open

aamijar wants to merge 5 commits into
NVIDIA:mainfrom
aamijar:gmm-refactor-files

Conversation

@aamijar

@aamijar aamijar commented Sep 24, 2026

Copy link
Copy Markdown
Member

Use new instantiation TU architecture for GMM instantiations introduced in #1984. Previously GMM was maintaining separate .cu files for each type instead of using the _matrix.json to generate at build time.

Additionally, we move the detail specific files (already were using detail namespace) to the detail folder.

@aamijar
aamijar requested review from a team as code owners September 24, 2026 21:04
@aamijar aamijar self-assigned this Sep 24, 2026
@aamijar aamijar added non-breaking Introduces a non-breaking change improvement Improves an existing functionality labels Sep 24, 2026
@aamijar aamijar moved this to Needs Review in Unstructured Data Processing Sep 24, 2026
@coderabbitai

coderabbitai Bot commented Oct 8, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: NVIDIA/cuvs/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Enterprise
  • Run ID: dd3c1429-3101-4d4b-8d44-bbb4b4f74e1f
📥 Commits

Reviewing files that changed from the base of the PR and between 5f87679 and 0241840.

📒 Files selected for processing: 8
  • cpp/CMakeLists.txt
  • cpp/src/cluster/detail/gmm_impl.cuh
  • cpp/src/cluster/detail/gmm_kernels.cuh
  • cpp/src/cluster/gmm.cuh
  • cpp/src/cluster/gmm_double.cu
  • cpp/src/cluster/gmm_float.cu
  • cpp/src/cluster/gmm_inst.cu.in
  • cpp/src/cluster/gmm_matrix.json
💤 Files with no reviewable changes: 4
  • cpp/src/cluster/detail/gmm_kernels.cuh
  • cpp/src/cluster/detail/gmm_impl.cuh
  • cpp/src/cluster/gmm_double.cu
  • cpp/src/cluster/gmm_float.cu

Included review availability: This review used your included allowance. Your plan provides up to 12 included reviews per hour; 10 remain after this review.

📝 Summary

Summary by CodeRabbit

  • Refactor
    • GMM operations remain available for both single- and double-precision data.
    • Existing GMM operations and argument validation remain unchanged, so callers can continue using the same functionality.
    • The way GMM support is organized has changed without altering the available operations or their behavior.

GMM float and double wrappers are replaced by entry points in a shared source template. A data-type matrix configures those entry points, and CMake generates the corresponding source files for compilation.

Changes: GMM data-type instantiation

Layer / File(s) Summary
Configure typed GMM entry points
cpp/src/cluster/gmm_matrix.json, cpp/src/cluster/gmm_inst.cu.in, cpp/src/cluster/gmm_float.cu, cpp/src/cluster/gmm_double.cu, cpp/src/cluster/gmm.cuh
The matrix defines float and double configurations. The shared template adds fit, predict, predict_proba, and score_samples entry points that forward to their typed implementations. The former per-type wrapper files are deleted, and the implementation include path changes.
Generate typed sources in CMake
cpp/CMakeLists.txt
CMake generates GMM source files from the matrix and template for compilation.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Refactor

Suggested reviewers: achirkin, divyegala

Merge Risk: ⚪ Minimal · up to 02418

The float and double GMM entry points are wired through generated sources, with no concrete regression identified in the reviewed change. No merge-blocking risk remains.

Pre-merge checks: Passed 5
Check name Status Explanation
Description check Passed The description accurately explains the GMM instantiation refactor and the move of detail-specific files.
Title check Passed The title clearly identifies the main change: refactoring GMM translation units to use gmm_matrix.json.
Docstring Coverage Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

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

Labels

improvement Improves an existing functionality non-breaking Introduces a non-breaking change

Projects

Status: Needs Review

Development

Successfully merging this pull request may close these issues.

1 participant