Skip to content

Switch to GMRES-based gradient solver to stabilize simple update into AD optimization test#279

Merged
lkdvos merged 2 commits intomasterfrom
lb/stabilize_su_into_ad
Oct 23, 2025
Merged

Switch to GMRES-based gradient solver to stabilize simple update into AD optimization test#279
lkdvos merged 2 commits intomasterfrom
lb/stabilize_su_into_ad

Conversation

@leburgel
Copy link
Member

An attempt to stabilize the test for running variational optimization on top of the simple update result for the Heisenberg model. It seems the gradient computation right at the start of the variational optimization is quite unstable, with both the EigSolver and LinSolver using KrylovKit.BiCGStab struggling a lot causing the test to systematically time out in the CI on some configurations.

The underlying reason for this might be that the simple update result has exact degeneracies in the SVD spectrum during the CTMRG projector computation, which causes trouble for the gradient computation in the first step. It seems that sometimes the optimization just cannot recover from this.

The problem is solved (at least locally for me) by switching to a LinSolver using KrylovKit.GMRES, which also takes a while to converge in the first step but seems more stable overall so the optimization can push through. While we should properly address the common issues with feeding an SU result into a variational optimization at some point, hopefully this at least fixes the CI issues for now.

@codecov
Copy link

codecov bot commented Oct 23, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
see 3 files with indirect coverage changes

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

@leburgel leburgel changed the title Switch gradient algorithm to LinSolver to stabilize simple update into AD optimization test Switch GMRES-based gradient solver to stabilize simple update into AD optimization test Oct 23, 2025
@leburgel leburgel changed the title Switch GMRES-based gradient solver to stabilize simple update into AD optimization test Switch to GMRES-based gradient solver to stabilize simple update into AD optimization test Oct 23, 2025
@leburgel
Copy link
Member Author

All the runners made it past the SU -> AD test without getting stuck at all, so this seems to solve the issue. We should probably understand better why GMRES doesn't struggle as much here, and if it's more stable in general maybe even switch the default linear solver from BiCGStab to GMRES.

But at least this should already reduce the CI pressure.

@leburgel leburgel requested a review from lkdvos October 23, 2025 12:23
@lkdvos
Copy link
Member

lkdvos commented Oct 23, 2025

I'll merge this without the tests, since they don't rerun due to the skip ci, and everything was passing.

@lkdvos lkdvos merged commit 1383693 into master Oct 23, 2025
1 check passed
@lkdvos lkdvos deleted the lb/stabilize_su_into_ad branch October 23, 2025 14:24
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