Skip to content

Conversation

@kshyatt
Copy link
Member

@kshyatt kshyatt commented Dec 23, 2025

This lets us reuse a lot of the setup infrastructure for ChainRules, Mooncake, and (soon) Enzyme. Also starts testing the AD rules on GPU.

@kshyatt kshyatt requested review from Jutho and lkdvos December 23, 2025 07:58
@github-actions
Copy link

github-actions bot commented Dec 23, 2025

Your PR no longer requires formatting changes. Thank you for your contribution!

@kshyatt kshyatt force-pushed the testsuite-ad branch 2 times, most recently from 0669d08 to 958dd36 Compare December 23, 2025 18:25
@kshyatt kshyatt force-pushed the testsuite-ad branch 6 times, most recently from fad3f4a to daeab4d Compare January 9, 2026 09:52
@codecov
Copy link

codecov bot commented Jan 19, 2026

Codecov Report

❌ Patch coverage is 82.56881% with 19 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...ixAlgebraKitAMDGPUExt/MatrixAlgebraKitAMDGPUExt.jl 0.00% 4 Missing ⚠️
...MatrixAlgebraKitCUDAExt/MatrixAlgebraKitCUDAExt.jl 0.00% 4 Missing ⚠️
src/pullbacks/lq.jl 88.46% 3 Missing ⚠️
src/pullbacks/qr.jl 88.46% 3 Missing ⚠️
ext/MatrixAlgebraKitChainRulesCoreExt.jl 85.71% 2 Missing ⚠️
src/pullbacks/eig.jl 88.88% 1 Missing ⚠️
src/pullbacks/eigh.jl 88.88% 1 Missing ⚠️
src/pullbacks/svd.jl 90.90% 1 Missing ⚠️
Files with missing lines Coverage Δ
...gebraKitMooncakeExt/MatrixAlgebraKitMooncakeExt.jl 96.95% <100.00%> (-2.18%) ⬇️
src/common/defaults.jl 64.28% <100.00%> (+2.74%) ⬆️
src/common/pullbacks.jl 100.00% <100.00%> (ø)
src/pullbacks/polar.jl 100.00% <100.00%> (ø)
src/pullbacks/eig.jl 86.20% <88.88%> (+1.14%) ⬆️
src/pullbacks/eigh.jl 81.25% <88.88%> (+1.25%) ⬆️
src/pullbacks/svd.jl 89.25% <90.90%> (+0.92%) ⬆️
ext/MatrixAlgebraKitChainRulesCoreExt.jl 82.14% <85.71%> (+0.32%) ⬆️
src/pullbacks/lq.jl 95.89% <88.46%> (+0.57%) ⬆️
src/pullbacks/qr.jl 95.89% <88.46%> (+0.65%) ⬆️
... and 2 more

... and 2 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@kshyatt
Copy link
Member Author

kshyatt commented Jan 20, 2026

I think this is ready for review if CI passes, it's not testing the Diagonal stuff for now waiting on @lkdvos 's PR, but it will radically simplify adding tests for that and CUDA and Enzyme

Copy link
Member

@lkdvos lkdvos left a comment

Choose a reason for hiding this comment

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

I left a bunch of smaller comments through the code, and only quickly went through the actual test suites. Am I correct that these haven't changed much?

I think in general it would be nice to try and link some of the GPU issues we are facing with actual issue numbers and resolve them through dispatch alternatives, rather than having to alter the code for regular arrays as well.
In particular, isa(A, Array) seems a bit to strict since we also support views etc, which would then also take the slow path.

:svd_compact, :svd_trunc, :svd_trunc_no_error, :svd_vals,
:left_polar, :right_polar,
)
copy_f = Symbol(:cr_copy_, f)
Copy link
Member

Choose a reason for hiding this comment

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

Why is this cr_ ? what does that mean?

Copy link
Member

Choose a reason for hiding this comment

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

I think I just got the difference with the mc_ ones, I thought this should all be run in separate modules though so there shouldn't necessarily be any nameclashing here?
I might be missing something though

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes they might be, I gave them different names just to be super clear but I guess it is not so clear 😓

@kshyatt
Copy link
Member Author

kshyatt commented Jan 23, 2026

Now that the enzyme stuff is merged, I'll work on incorporating that into this PR and addressing the remaining comments

@kshyatt
Copy link
Member Author

kshyatt commented Jan 23, 2026

OK, the Enzyme tests are now part of the testsuite. I turned off the Diagonal tests for now in the interests of dealing with that in a subsequent PR.

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