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

Benchmarking time | Differentiate an LP #233

Closed
akshay326 opened this issue Mar 17, 2023 · 5 comments
Closed

Benchmarking time | Differentiate an LP #233

akshay326 opened this issue Mar 17, 2023 · 5 comments

Comments

@akshay326
Copy link
Collaborator

Tried solving, differentiating and benchmarking a simple LP of 20 variables with equality and inequality constraints.

DiffOpt solution - https://colab.research.google.com/drive/1GWR45sbss5UhJvKomoDy4Zot9d0-046J#scrollTo=SvVLd_EFz5a1
cvxpylayer solution - https://colab.research.google.com/drive/1yvQPpwXs1ngPWt9-SzBOxhm2HjwjV1Qa#scrollTo=Ged5IdWhxPsQ

for 50 evaluations
diffopt takes ~0.7ms
cvxpylayer takes ~246ms

@odow
Copy link
Member

odow commented Mar 17, 2023

So diffopt is faster? Is this a problem?

I don't have permission to access the colab instances.

@blegat
Copy link
Member

blegat commented Mar 17, 2023

I think @akshay326 meant 0.7s for diffopt

@akshay326
Copy link
Collaborator Author

No, DiffOpt is faster (sorry just changed the access open to everyone)
This is not an issue per se, just some update.

@odow
Copy link
Member

odow commented Mar 19, 2023

You should double check that the benchmark is timing the same thing in each package. If the times are that different, then perhaps DiffOpt is just returning something from a cache, or cvxpylater is doing a whole lot of unrelated work.

Perhaps it's more fair to measure the total time from setup to returning the derivative?

@odow
Copy link
Member

odow commented Apr 12, 2023

I'm going to close this in favor of consolidating our benchmarking discussion in #11. I'll add a link there back to the colab notebooks for people to dig into in future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants