-
Notifications
You must be signed in to change notification settings - Fork 121
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
WIP: Use FillArrays and LazyArrays to reduce memory footprint #258
Conversation
Currently sparse vectors and matrices are used in many places, but this can cause memory usage to skyrocket in certain circumstances. See for example issue 254. This change uses LazyArrays and FillArrays to express matrix structures which don't need to be mutated or immediately materialized, leading to significant memory savings.
Note that this requires tags of both LazyArrays and FillArrays. Local testing was done using the master branches of both packages. |
Any measurements? |
Right now this is just "throw laziness at the wall and see what sticks"; I'm mostly making sure that this approach doesn't full-on break anything. Doing long-running computations and monitoring |
Unfortunately, for the simplest problem: x = Variable(1)
p = minimize(2.0 * x, [x >= 2, x <= 4]) this PR provides a pretty modest benefit in terms of memory use but a regression in terms of execution time. Master:
PR:
Pretty disappointing. I'll keep at this. |
Observation: LazyArrays has some facilities to act as a computation graph in some scenarios, e.g. with |
Closing as stale. Moving more to MOI (e.g., #393) seems like a better way of dealing with the memory issues. |
Currently sparse vectors and matrices are used in many places, but this can cause memory usage to skyrocket in certain circumstances. See for example issue #254.
This change uses LazyArrays and FillArrays to express matrix structures which don't need to be mutated or immediately materialized, leading to significant memory savings.