-
Notifications
You must be signed in to change notification settings - Fork 164
Benchmarking with asv #1761
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
base: main
Are you sure you want to change the base?
Benchmarking with asv #1761
Conversation
This reverts commit 0f5fa2a.
|
@erikvansebille On the topic of performance, are you also experiencing it taking something like 10s occasionally to run |
Yes, I also experience this slow import sometimes. Not sure why... |
|
Setting to draft until we have some actual benchmarks that we can include in this. |
|
From meeting: |
for more information, see https://pre-commit.ci
|
The Argo tutorial at https://docs.oceanparcels.org/en/latest/examples/tutorial_Argofloats.html is also a quite nice simulation for benchmarking, as it has a 'complex' kernel. It took approximately 20s to run on v3.1 in JIT mode, and no takes 50s on my local computer to run in Scipy-mode. @danliba or @willirath, could you add the Argo tutorial to the benchmark stack? |
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@danliba I've left a few comments.
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
|
Can we also use some of #1963? |
|
If you wish to use parts of #1963 and don't already have a Copernicus ocean account with the right access, email me and I can set up a quick way for you to download the circulation files |
for more information, see https://pre-commit.ci
|
So I've spent some time with this over the weekend. Here's a few insights:
My recommendation is to forget about anything along the lines of "automation", "continuous", etc. ASV provides a great way of defining benchmarks, running them against a bunch of similar well-behaved (i.e. no API changes or dependency changes) commits and then comparing the results with a rather narrow scope along the time / version axis. We should focus on this core functionality and leave the step of running and interpreting the benchmarks to the individual dev for now. |
Yes, I think this sounds good. I was talking with an xarray maintainer, and he mentioned that ASV isn't really used much in CI - the intermitency of github runners adds quite some noise which means that unless a regression degrades performance by a factor, it won't be obvious in output.
I think so as well. Allowing us to define benchmarks for v3, port them to v4, then work in v4 with them will allow devs to have a targeted lens on performance (even if its just local - which is perfectly fine). |
|
Another note: As part of this PR can we remove dependence on the Ideally once this is merged we can completely remove the |
Todo
asv_bench/benchmarks/benchmarks_integration.pyfor an example.)asv_bench/benchmarks/benchmarks_particle_execution.pyfor an example.)When applicable, split into different phases. We could, e.g., go for a
.setup()method for fieldset creating, and a.time_execute()method for the particle execution.This PR introduces benchmarking infrastructure to the project via asv. Benchmarks can be run on a pull request by adding the
run-benchmarkslabel to it. Two environments will be created in the CI runner with the prior and proposed changes, and both suites of benchmarks will be run and compared against each other.Note that this PR only has example benchmarks for the timebeing until we can discuss benchmarks of interest.
The running of the benchmarks in CI is only one aspect of the benchmarking (ie, only for core parcels functionality). Using asv, we can create different suites of benchmarks (e.g., one for CI, and one for more heavy simulations). The benefit of using asv is everything else that comes out of the box with it, some being:
Changes:
I have done some testing of the PR label workflow in VeckoTheGecko#10 . We can only test this for PRs in OceanParcels/parcels when its in master
Related to #1712