You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[ENH] Improve CG solver and add weights caching for better performance (#17)
# Enhanced Conjugate Gradient Solver with Improved Stability and GPU Support
This PR significantly improves the robustness and performance of our solver system with several key enhancements:
## Solver Improvements
- Completely refactored the `ConjugateGradientSolver` with enhanced stability features for ill-conditioned matrices
- Added adaptive tolerance, regularization support, and robust convergence criteria
- Implemented residual monitoring and restart capability for better convergence
- Added detailed diagnostics and warnings for numerical issues
## GPU Acceleration
- Added GPU support for PyKeOps solver in the torch backend
- Properly configured backend tensor handling for GPU operations
- Fixed device selection logic in solver interface
## Caching and Weights Management
- Added ability to pass initial weights through the interpolation input
- Implemented `weights_x0` in solver input for warm starts
- Added `clear_cache` method to `WeightCache` for better memory management
## Numerical Stability
- Fixed condition number computation and made plotting optional
- Properly store condition number in kernel options during operations
- Added safeguards against numerical breakdown in denominator calculations
- Implemented stagnation detection for ill-conditioned systems
## Experimental Features
- Added Nyström preconditioner implementation (currently disabled by default)
- Included configurable pivoting strategies for matrix approximation
These changes significantly improve the solver's ability to handle challenging numerical problems while maintaining performance.
0 commit comments