Skip to content

Lower allocations in LQ/QR pushforwards - #326

Merged
kshyatt merged 9 commits into
mainfrom
ksh/aliasing_pfs
Nov 20, 2026
Merged

kshyatt merged 9 commits into
mainfrom
ksh/aliasing_pfs

Conversation

@kshyatt

@kshyatt kshyatt commented Nov 10, 2026

Copy link
Copy Markdown
Member

Added a specialized method for Diagonals as well. The issue we were running into was actually that the derivatives were aliased, so this PR reworks things a bit to avoid copying if we can by zeroing out parts of dA only once they've been used. Empirically it seemed to cut allocations in half when I compared locally.

@kshyatt
kshyatt requested a review from Jutho November 10, 2026 13:48
@codecov

codecov Bot commented Nov 10, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 96.77419% with 2 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/pushforwards/lq.jl 96.00% 1 Missing ⚠️
src/pushforwards/qr.jl 96.00% 1 Missing ⚠️
Files with missing lines Coverage Δ
src/MatrixAlgebraKit.jl 100.00% <ø> (ø)
src/common/pushforwards.jl 100.00% <100.00%> (ø)
src/pushforwards/lq.jl 98.00% <96.00%> (-2.00%) ⬇️
src/pushforwards/qr.jl 98.00% <96.00%> (-2.00%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@lkdvos lkdvos left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't say I checked all of the math carefully but overall looks good!

Comment thread src/pushforwards/qr.jl Resolved
Comment thread src/pushforwards/lq.jl Resolved
@kshyatt

kshyatt commented Nov 17, 2026

Copy link
Copy Markdown
Member Author

@Jutho did you have more thoughts here?

Comment thread src/pushforwards/lq.jl Resolved
Comment thread src/pushforwards/lq.jl Resolved
Comment thread src/pushforwards/lq.jl Resolved

@Jutho Jutho left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, looks great already, but I've left some comments for LQ. I think the same apply to QR.

@kshyatt
kshyatt enabled auto-merge (squash) November 19, 2026 15:06
Comment thread src/pushforwards/lq.jl Resolved
Comment thread src/pushforwards/qr.jl Resolved

@Jutho Jutho left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Final suggestion, but I already approve.

@kshyatt
kshyatt disabled auto-merge November 20, 2026 06:54
@kshyatt
kshyatt merged commit 5664502 into main Nov 20, 2026
34 checks passed
@kshyatt
kshyatt deleted the ksh/aliasing_pfs branch November 20, 2026 06:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants