8000 [FEATURE REQUEST] Implementation of L-BFGS Optimizer in MLX · Issue #1967 · ml-explore/mlx · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

[FEATURE REQUEST] Implementation of L-BFGS Optimizer in MLX #1967

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
sck-at-ucy opened this issue Mar 17, 2025 · 2 comments
Open

[FEATURE REQUEST] Implementation of L-BFGS Optimizer in MLX #1967

sck-at-ucy opened this issue Mar 17, 2025 · 2 comments

Comments

@sck-at-ucy
Copy link

For Physics-Informed NN (PINNs) often switching to L-BFGS (from Adam type optimizers) at later stages of training seems to help final convergence. I know it is probably not in the plans of the MLX team to implement L-BFGS under mlx.optimizers, but I would be interested in giving it a try by coding a basic functionality using the Python API.

The key challenge is maintaining compatibility with mx.compile.

Before getting started, I would be thankful if @awni could give me a high-level skeleton of the steps I should follow to ensure that the implementation will be as efficient as possible given that L‑BFGS involves iterative, stateful updates (tracking curvature approximations and doing line searches) that don’t always fit neatly into a compiled, pure function framework. OR, if it is simply not a good idea to go down this path please let me know to avoid wasting time.

@awni
Copy link
Member
awni commented Mar 17, 2025

You might want to check out some of the optimizers in mlx-optimizers. There are several which approximate the hessian and may work as well as Adam + L-BFGS

@sck-at-ucy
Copy link
Author

Good idea, thanks!

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

No branches or pull requests

2 participants
0