perf(objective): compute linear_predictor distances with in-place NumPy operations - #345
Conversation
…Py operations Recreates PR #183 on a clean base: the original branch history was corrupted by a bad base merge that would have deleted several mainline modules. Same two-file delta: build dist_sq via in-place += and out= kernels, avoiding several N x J intermediate allocations per objective evaluation; numerical results unchanged (objective/math tests pass).
|
Warning Review limit reached
Next review available in: 9 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
Comment |
|
@coderabbitai review Generated by Claude Code |
|
✅ Action performedReview finished.
|
Summary
Clean recreation of #183 on the current
main. The original branch's history was corrupted by a bad base merge that would have deleted several mainline modules (classification.rs,detect.rs,dif.rs,equating.rs,exposure.rs,gtheory.rs,utility.rs,classification.py, …) — verified withgit merge-treeand documented on #183 before closing it.Same two-file delta as the original Bolt optimization:
python/fast_mlsirm/objective.py— build thelinear_predictorpairwise distance with in-place NumPy operations (+=,np.maximum(..., out=...),np.sqrt(..., out=...)), avoiding several N×J intermediate allocations per objective evaluation. Numerical results are unchanged; the NumPy path stays the parity reference for the Rust core..jules/bolt.md— records the in-place-operations learning per the journal convention.Verification
tests/test_objective.py+tests/test_math.py: 16 passed, 5 skipped (no Rust core locally; parity tests skip by design).max(d², 0) + epsbefore the square root, identical clamping semantics).Developer experience: removes redundant allocations from the hottest NumPy-path loop without touching the numeric contract shared with
mlsirm-core.User experience: identical outputs; lower peak memory on large N×J problems when running on the NumPy fallback backend.
🤖 Generated with Claude Code
https://claude.ai/code/session_01ERVynrYEjd2TwYvusVpA9f
Generated by Claude Code