Stabilize singular empirical covariance precision - #8606
Stabilize singular empirical covariance precision#8606sylvesterkaczmarek wants to merge 4 commits into
Conversation
Signed-off-by: Sylvester Kaczmarek <16242628+sylvesterkaczmarek@users.noreply.github.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
Included review availability: Your plan provides up to 12 included reviews per hour; 10 remain after this review. 📝 SummarySummary by CodeRabbit
WalkthroughChangesEmpirical covariance stability
Estimated code review effort: 2 (Simple) | ~10 minutes Severity of issue fixed: Medium Merge Risk: ⚪ Minimal · up to This change stabilizes singular covariance precision and Mahalanobis distances with dtype-aware behavior and regression coverage. No actionable merge-blocking risk is identified. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
🧪 Generate unit tests (beta)
Comment |
Signed-off-by: Simon Adorf <sadorf@nvidia.com>
csadorf
left a comment
There was a problem hiding this comment.
Looks good. I ran all 44 EmpiricalCovariance tests and found no meaningful performance regression. I pushed the required pre-commit fix to this PR. Please run the pre-commit hooks for future commits.
| return cp.dot(X_centered.T, X_centered) / X.shape[0] | ||
|
|
||
|
|
||
| def _pinv(covariance): |
There was a problem hiding this comment.
I’d suggest investigating a Hermitian-specific pseudoinverse based on cp.linalg.eigh in a follow-up. That would also match scikit-learn’s use of scipy.linalg.pinvh. I ran some quick tests, and performance looked promising. This fix looks good, so we can merge as-is.
This comment has been minimized.
This comment has been minimized.
|
CI is only blocked by the known |
Signed-off-by: Sylvester Kaczmarek <16242628+sylvesterkaczmarek@users.noreply.github.com>
|
/ok to test b9e981f |
Closes #8566
Summary
Validation
python3 -m py_compile python/cuml/cuml/covariance/empirical_covariance.py python/cuml/tests/test_empirical_covariance.pygit diff --check