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

Put benchmark boilerplate into subpackage #136

Merged
merged 12 commits into from
Jun 26, 2024
Merged

Put benchmark boilerplate into subpackage #136

merged 12 commits into from
Jun 26, 2024

Conversation

gdalle
Copy link
Collaborator

@gdalle gdalle commented Jun 24, 2024

Some code defining problem instances is used by tests and benchmarks, as well as external notebooks. Putting it in a package dispenses us from using include every time, and brings cleaner dependency management, at the cost of a Pkg.develop.

  1. Create a subpackage in benchmarks/SparseConnectivityTracerBenchmarks to put:
  • the Brusselator code
  • the NLPModels code
  • possibly the optimal power flow code or other stuff in the future
  1. Use PkgJogger.jl to define the benchmark and run each @benchmarkable just once in the test suite

@codecov-commenter
Copy link

codecov-commenter commented Jun 24, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 90.24%. Comparing base (34e6bec) to head (fb057af).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #136      +/-   ##
==========================================
+ Coverage   87.23%   90.24%   +3.00%     
==========================================
  Files          31       36       +5     
  Lines        1363     1455      +92     
==========================================
+ Hits         1189     1313     +124     
+ Misses        174      142      -32     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@gdalle gdalle added the run benchmark Run benchmarks in CI label Jun 24, 2024
@adrhill
Copy link
Owner

adrhill commented Jun 24, 2024

Isn't that what the benchmark folder is for? Why don't we move everything in there and add a module and Project.toml?

@gdalle
Copy link
Collaborator Author

gdalle commented Jun 24, 2024

No, the benchmark folder is for benchmarking only, and has deps like BenchmarkTools. This code is used in tests, benchmarks and other places too. And it needs to be in a package to be importable in e.g. a Pluto notebook (to which I can give the exact GitHub URL of libs/SparseConnectivityTracerBenchmarks)

@gdalle
Copy link
Collaborator Author

gdalle commented Jun 24, 2024

The name may be ill-chosen, perhaps SparseConnectivityTracerProblems would be better?

@adrhill
Copy link
Owner

adrhill commented Jun 24, 2024

No, the benchmark folder is for benchmarking only

Not trying to be snarky here, but isn't libs/SparseConnectivityTracerBenchmarks also about benchmarking?

and has deps like BenchmarkTools

Is that a big issue? I think removing some complexity at the cost of one dependency is acceptable.

to which I can give the exact GitHub URL of libs/SparseConnectivityTracerBenchmarks)

Wouldn't benchmark be a URL that's just as viable?

@adrhill
Copy link
Owner

adrhill commented Jun 24, 2024

At the very least, we could move this into benchmarks/libs/SparseConnectivityTracerBenchmarks if this somehow is necessary for Pluto.

@gdalle
Copy link
Collaborator Author

gdalle commented Jun 24, 2024

Not trying to be snarky here, but isn't libs/SparseConnectivityTracerBenchmarks also about benchmarking?

See my latest comment, here I meant "benchmarks" in the sense of "benchmark instance definitions", not "full specification of a benchmark suite with sizes and evals and so on". Hence the possibility of an alternative name like SparseConnectivityTracerProblems or SparseConnectivityTracerInstances.

@gdalle
Copy link
Collaborator Author

gdalle commented Jun 24, 2024

Is that a big issue? I think removing some complexity at the cost of one dependency is acceptable.

This is pretty much a constant-complexity PR. It's just replacing the include with a using

Wouldn't benchmark be a URL that's just as viable?

It's not just about giving a URL, it's about giving the URL of a package (as opposed to including a file)

@gdalle gdalle marked this pull request as ready for review June 25, 2024 09:07
@gdalle gdalle requested a review from adrhill June 25, 2024 09:07
test/nlpmodels.jl Outdated Show resolved Hide resolved
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
ReferenceTests = "324d217c-45ce-50fc-942e-d289b448e8cf"
SimpleDiffEq = "05bca326-078c-5bf0-a5bf-ce7c7982d7fd"
Copy link
Owner

Choose a reason for hiding this comment

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

Why did this have to be added?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

because it's used in the benchmarks

benchmark/benchmarks.jl Show resolved Hide resolved
@gdalle
Copy link
Collaborator Author

gdalle commented Jun 26, 2024

@adrhill the benchmarks work on this PR branch and fail on main but that's expected, this is good to merge

@adrhill adrhill merged commit b56207b into main Jun 26, 2024
5 of 6 checks passed
@adrhill adrhill deleted the gd/libs branch June 26, 2024 09:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
run benchmark Run benchmarks in CI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants