Repository navigation
Skip the cache update when a coordinate does not move, version 0.2.2 - #5
Merged
Merged
Conversation
The coordinate steps of CDInverseKroneckerLoss and CDInverseReducedSymKroneckerLoss updated the p × p cache A = Σx Θ Σy after every visit, even when the coordinate did not change, as for most coordinates that stay at zero in a full pass: each visit cost O(p²), a full pass over the p² (or p(p+1)/2) coordinates O(p⁴). They now return early when the change is zero, as CovSel's CDDirectDifferenceLoss does. The iterates are bitwise unchanged. On AR(1) data with n = 500 and one BLAS thread, invQSymHessian is 3.4×, 8.4× and 18× faster at p = 30, 50 and 80, and estimate(SymmetricNormal) 1.2-1.6×. The two coordinate descent solves in invAsymHessianEstimation are 17× faster at p = 50 and 80× at p = 80, but the function only 1.2-1.4×, because its weights (_computeVar!, O(n p³) per call) now take nearly all of its time. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #5 +/- ##
=======================================
Coverage 98.64% 98.65%
=======================================
Files 12 12
Lines 1407 1409 +2
=======================================
+ Hits 1388 1390 +2
Misses 19 19 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The coordinate steps of
CDInverseKroneckerLossandCDInverseReducedSymKroneckerLossupdated the p × p cacheA = Σx Θ Σyafter every visit, even when the coordinate did not change, as for most coordinates that stay at zero in a full pass. Each visit thus cost O(p²), and a full pass O(p⁴). Both now return early when the change is zero, as CovSel'sCDDirectDifferenceLossalready does. The iterates are bitwise unchanged (same hashes before and after in every case below). Version 0.2.2.Timings
AR(1) data (ρ = 0.5 for X, 0.3 for Y), n = 500, entry (3, 2), one BLAS thread, Apple M3 Pro, Julia 1.13.2; minimum of three runs, in ms.
invQSymHessianinvAsymHessianEstimationestimate(SymmetricNormal)estimate(AsymmetricNormal)The two coordinate descent solves inside
invAsymHessianEstimationbecame 17× faster at p = 50 and 80× at p = 80 (22.2 → 1.3 ms and 176.1 → 2.2 ms, single runs). The function as a whole gains less because its weights now take nearly all of its time:_computeVar!loops over all n samples for each of the p² entries, O(n p³) per call, about 2 × 240 ms at p = 80. That is the next thing to speed up, in a separate PR.Test plan
Pkg.test()on Julia 1.13.2 and 1.10.12 (20184 tests pass on each; CovSel added from GitHub on 1.10, as CI does).🤖 Generated with Claude Code