Skip to content

Conversation

@geoffroyleconte
Copy link
Member

No description provided.

# define model
φk(d) = dot(∇fk, d)
mk(d) = φk(d) + ψ(d)
mk(d)::R = φk(d) + ψ(d)::R
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still some allocations here but I could not fix it, maybe it is more related to ProximalOperators.

mk(d) = φk(d) + ψ(d)
mk(d)::R = φk(d) + ψ(d)::R

prox!(s, ψ, mν∇fk, ν)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some allocations here as well, maybe also related to ProximalOperators.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably ShiftedProximalOperators?!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are the allocations gone now?

Copy link
Member Author

@geoffroyleconte geoffroyleconte Jul 7, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are still a few (16 per iteration on line 280 and 282), I could not get lower on my PRs in ShiftedProximalOperators.
The biggest number of allocations comes from ψ = shifted(h, xk, l_bound_m_x, u_bound_m_x, selected) (as you mentionned below) at the begging of R2, but it is not inside a loop. We should think about a way of preallocating the ShiftedProximalOperators.

@codecov
Copy link

codecov bot commented Jun 2, 2023

Codecov Report

Patch coverage: 96.96% and project coverage change: +1.38 🎉

Comparison is base (834bcbc) 59.26% compared to head (59a2590) 60.64%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #105      +/-   ##
==========================================
+ Coverage   59.26%   60.64%   +1.38%     
==========================================
  Files          11       11              
  Lines        1225     1263      +38     
==========================================
+ Hits          726      766      +40     
+ Misses        499      497       -2     
Impacted Files Coverage Δ
src/R2_alg.jl 92.44% <96.96%> (+2.88%) ⬆️

... and 1 file with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@github-actions
Copy link
Contributor

github-actions bot commented Jun 2, 2023

Here are the
demos-results

mk(d) = φk(d) + ψ(d)
mk(d)::R = φk(d) + ψ(d)::R

prox!(s, ψ, mν∇fk, ν)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably ShiftedProximalOperators?!

@. u_bound_m_x = u_bound - xk
ψ = shifted(h, xk, l_bound_m_x, u_bound_m_x, selected)
else
ψ = shifted(h, xk)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are also allocations here, right? We can think about it in a separate PR, but we should have an issue to track them.

Copy link
Member Author

@geoffroyleconte geoffroyleconte Jun 3, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I forgot this. We leave it as it is for this PR as you propose, and maybe create a function shifted! in ShiftedProximalOperators to allow us to preallocate the ShiftedProximalOperator structure?

@github-actions
Copy link
Contributor

github-actions bot commented Jun 6, 2023

Here are the
demos-results

@dpo dpo merged commit a023408 into JuliaSmoothOptimizers:master Jul 17, 2023
@geoffroyleconte geoffroyleconte deleted the inplace-r2 branch July 17, 2023 23:44
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

Successfully merging this pull request may close these issues.

2 participants