Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
(Dumping some of my initial notes about why I ended up picking this)
Airspeed Velocity (
asv
) seems to be the best existing way to run a few benchmarks and get progress over time. It's used bynumpy
,pandas
,scikit-image
,xarray
, and a few others.Basics: making these new configuration files, and running test benchmarks
asv
(which is added to thetest
requirements), ranasf quickstart
to make a templateasv.conf.json
, then filled it outasv machine
orasv machine --yes
to have it save info about the computer you are onasv run
will install the environment(s) that are specified, and these can be reused for future runs.asv publish
, and view locally withasv preview
Naming the benchmark tests
The benchmarks almost look like normal
pytest
orUnitTest
files, except all the names havetime_
ormem_
as the function names... And that's becauseasv
will use that to figure out what it's trackingtime_<blah>
will run a function (and call the result whatever you've named this function). and measure the runtimepeakmem_<blah>
records the peak memory usageUsing it in CI
This PR is attempting to have a nice way to trigger this on Github actions only if you want it run on specific PRs (which I do), rather than every single change/push.
This section of the new Github Action:
means that when you label a PR with "run-benchmark" it should kick off the
asv
workflow. If you add more commits, you'll need to remove and re-add if you want it run again. You can also go to the "Actions" tab to run it.Running on our big server
I started the
test_run_bench.sh
script for running on aurora, where I manually set the number of threads and useasv
s--cpu-affinity 0-15
option to really limit the number of cores.(The problem with only running this on the CI is that it'll be single CPU... we're also interested in how the main functions perform with access to multiple CPUs, since that's the more realistic setting. Open to discussing this part more.)
Examples repos' example usages