Skip to content

Conversation

@kshyatt
Copy link
Member

@kshyatt kshyatt commented Dec 12, 2025

This PR adds a compute_error field to TruncatedAlgorithm and changes eig_trunc!, eigh_trunc!, and svd_trunc! (and their non-mutating counterparts) to accept an array epsilon as part of their arguments. The purpose of this is twofold: to make handling the truncation error easier in AD, and to avoid forcing GPU synchronization.

First run at addressing #114

Remaining TODOs:

  • Use compute_error in alg also in the Chainrules AD rules

@kshyatt kshyatt requested review from Jutho and lkdvos December 12, 2025 13:15
@github-actions
Copy link

github-actions bot commented Dec 12, 2025

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

This PR adds a `compute_error` field to `TruncatedAlgorithm` and
changes `eig_trunc!`, `eigh_trunc!`, and `svd_trunc!` (and their
non-mutating counterparts) to accept an array `epsilon` as part
of their arguments. The purpose of this is twofold: to make handling
the truncation error easier in AD, and to avoid forcing GPU
synchronization.
@codecov
Copy link

codecov bot commented Dec 12, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.

Files with missing lines Coverage Δ
ext/MatrixAlgebraKitChainRulesCoreExt.jl 81.42% <100.00%> (ø)
...gebraKitMooncakeExt/MatrixAlgebraKitMooncakeExt.jl 98.96% <100.00%> (-0.02%) ⬇️
src/algorithms.jl 91.17% <100.00%> (+0.06%) ⬆️
src/implementations/eig.jl 99.12% <100.00%> (+0.04%) ⬆️
src/implementations/eigh.jl 94.48% <100.00%> (+0.19%) ⬆️
src/implementations/svd.jl 92.54% <100.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@kshyatt kshyatt marked this pull request as ready for review December 12, 2025 14:13
@kshyatt
Copy link
Member Author

kshyatt commented Dec 15, 2025

Discussed on slack and decided to close this in favor of #116

@kshyatt kshyatt closed this Dec 15, 2025
@kshyatt kshyatt deleted the ksh/error_arg branch December 15, 2025 15:50
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.

2 participants