Skip to content

feature: trust region support in DIOM - #1103

Open
bouayoubegrine wants to merge 2 commits into
JuliaSmoothOptimizers:mainfrom
oihanc:diom-tr2
Open

bouayoubegrine wants to merge 2 commits into
JuliaSmoothOptimizers:mainfrom
oihanc:diom-tr2

Conversation

@bouayoubegrine

@bouayoubegrine bouayoubegrine commented Jul 27, 2026

Copy link
Copy Markdown

When applied to Hermitian A, DIOM coincides with CG in exact arithmetic. However, in finite precision, DIOM acts as a form of reorthogonalization that can significantly improve upon CG's robustness in the presence of ill conditioning.

This commit introduces the trust-region constraint management in DIOM so it can be used as a drop-in replacement of CG in a trust-region solver such as trunk.

Summary:

  • Add shared DiomCgStats struct for CG/DIOM to store quadratic objective
  • Add quadratic objective computation in DIOM and CG if radius > 0 (O(1)/iteration)
  • Compute residual at trust-region boundary for diom
  • Add unit tests for quadratic problem with and without trust region.

@amontoison amontoison 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.

Thanks for the pull request.
I requested a few changes in the code.
Please also rebase your PR such that we can run the CI tests.

Comment thread src/diom.jl Outdated
Comment thread src/diom.jl Outdated
Comment thread src/diom.jl Outdated
Comment thread src/diom.jl Outdated
Comment thread src/diom.jl
Comment thread src/diom.jl Outdated
Comment thread src/diom.jl
Comment thread .gitignore
Comment thread test/test_cg.jl Outdated
Comment thread test/test_diom.jl
@amontoison

Copy link
Copy Markdown
Member

When applied to Hermitian A, DIOM coincides with CG in exact arithmetic. However, in finite precision, DIOM acts as a form of regularization that can significantly improve upon CG's robustness in the presence of ill conditioning.

regularization ---> reorthogonalization?

When applied to Hermitian A, DIOM coincides with CG in exact
arithmetic. However, in finite precision, DIOM acts as a form of
regularization that can significantly improve upon CG's
robustness in the presence of ill conditioning.

This commit introduces the trust-region constraint management
in DIOM so it can be used as a drop-in replacement of CG in a
trust-region solver such as trunk.

Summary:

- Add shared DiomCgStats struct for CG/DIOM to store quadratic objective
- Add quadratic objective computation in DIOM and CG if radius > 0  (O(1)/iteration)
- Compute residual at trust-region boundary for diom
- Add unit tests for quadratic problem with and without trust region.
@bouayoubegrine

Copy link
Copy Markdown
Author

@amontoison, the changes have been made! Thanks for your comments!

@bouayoubegrine
bouayoubegrine force-pushed the diom-tr2 branch 4 times, most recently from 95160ec to a54a6fc Compare August 12, 2026 22:12
@github-actions

github-actions Bot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor
Package name latest stable
AdaptiveRegularization
CaNNOLeS
DCISolver
FletcherPenaltySolver
JSOSolvers
PartiallySeparableNLPModels
PartiallySeparableSolvers
PartitionedVectors
Percival
RipQP

@amontoison amontoison 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.

I like the modifications but more work is still needed.

Comment thread src/block_krylov_workspaces.jl Outdated
Comment thread src/cg.jl Outdated
Comment thread src/cg.jl Outdated
Comment thread src/diom.jl Outdated
Comment thread src/diom.jl Outdated
Comment thread src/cg.jl Outdated
Comment thread src/cg.jl Outdated
Comment thread src/diom.jl Outdated
Comment thread src/diom.jl Outdated
Comment thread src/diom.jl Outdated

@amontoison amontoison 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.

I like the modifications but more work is still needed.

@codecov

codecov Bot commented Aug 13, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 99.04762% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 97.73%. Comparing base (9536ef7) to head (79a9981).
⚠️ Report is 149 commits behind head on main.

Files with missing lines Patch % Lines
src/diom.jl 97.05% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1103      +/-   ##
==========================================
+ Coverage   94.68%   97.73%   +3.05%     
==========================================
  Files          45       50       +5     
  Lines        8027    10130    +2103     
==========================================
+ Hits         7600     9901    +2301     
+ Misses        427      229     -198     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

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

…ic. However, in finite precision, DIOM acts as a form of reorthogonalization that can significantly improve upon CG's robustness in the presence of ill conditioning.

This commit introduces the trust-region constraint management in DIOM so it can be used as a drop-in replacement of CG in a trust-region solver such as trunk.

Summary:

Update SimpleStats to store quadratic objective
Add quadratic objective computation in DIOM and CG if radius > 0 (O(1)/iteration)
Compute residual at trust-region boundary for diom
Add unit tests for quadratic problem with and without trust region.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants