Skip to content
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

Remove R2 extra allocations #146

Open
MohamedLaghdafHABIBOULLAH opened this issue Sep 5, 2024 · 2 comments
Open

Remove R2 extra allocations #146

MohamedLaghdafHABIBOULLAH opened this issue Sep 5, 2024 · 2 comments

Comments

@MohamedLaghdafHABIBOULLAH
Copy link
Contributor

MohamedLaghdafHABIBOULLAH commented Sep 5, 2024

Three changes in order to make solve! of R2 non allocating.

  • Define $\rho_k$ as local instead of global variable.
  • Use the last version of ShiftedProximalOperatorsin order to use non allocating prox! of L0, L1, Rank and Nuclear norm.
  • Add test_allocs.jl file based on @wrappedallocs macro.
    @dpo @MaxenceGollier
@MohamedLaghdafHABIBOULLAH
Copy link
Contributor Author

MohamedLaghdafHABIBOULLAH commented Sep 5, 2024

Do you think it is beneficial to precise the type of statswithin R2 as follows ?

stats = GenericExecutionStats(reg_nlp.model, solver_specific = Dict{Symbol, Union{Float64, Vector{Float64}, Vector{Int64}}}())

@dpo
Copy link
Member

dpo commented Sep 9, 2024

@MohamedLaghdafHABIBOULLAH Yes it definitely would, but you don’t want to use Float64. Instead, use the element type of the NLPModel.

Also, just use Int instead of Int64 (Int = Int64 on 64-bit platforms).

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