-
-
Notifications
You must be signed in to change notification settings - Fork 10.8k
ENH: Standalone benchmark script for the inner loops of ufunc #15987
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?
Conversation
Can we reuse our existing benchmark machinery here? |
@eric-wieser, I tried to use ASV but the result wasn't stable enough, check this patch and patch2 from #13516, the idea behind this patch is to benchmarking only the inner loop of ufunc in order to reduce the noises as much as possible, also ASV is kinda slow too. EDIT: I moved the two mentioned patches to separate pull-requests #15992 and #15990 |
It would be nice if we could at least hook into ASV for things like benchmark result comparisons and storage, rather than building our own version of those too. It might be worth starting a conversation with @pv about the best way to do that. |
@seiko2plus you are repeating the function run multiple times here within your EDIT: This got lost: "You are doing a few other things here that you are not doing in the asv version." For example, if you just define the |
3fb1562
to
28b0c07
Compare
@seberg, ASV already collect multiple samples for each benchmark, but still not stable enough even on idle CPU. This script is not providing a replacement for the current ASV implementation, the main reason behind it is to detect any performance changes in the inner loops of ufunc and removing the functionality of umath and multiarry from the equation in order to reduce the noises as much as possible, it also provides more testing cases like multiple strides, sizes and better control for the testing process.
The problem is ASV doesn't provide a way to specify the elapsed time manually. |
a58ab33
to
5f4bbde
Compare
@seberg, I moved the mentioned patches from #13516, into a separate pull #15992 and #15990. also modified the number of repeats and samples to be equal to the default settings of this script. |
5f4bbde
to
9b4245b
Compare
One reason that could be causing noise is turbo mode. In case you haven't already done, I would recommend disabling for benchmarking purposes (set |
@r-devulap, Before I run any benchmarks, I usually do:
Lately, I realized a python module called pyperf, provides a tool to tune the system with the above tips and many more via command However, it seems I should have an idle hardware in order to get almost stable ratios for ASV not just isolate some logical cores since any involved system calls that interpret the thread during collecting the benchmark samples will eliminate the benefits from isolating the logical cores via One of the things I don't like in ASV that its uses a separate process for each collected sample, |
a28f11e
to
230bc23
Compare
8408248
to
f17305e
Compare
dbce6f3
to
e62c951
Compare
a2ed2e5
to
a231322
Compare
ping @pv. Is there something here that we all are missing? |
This script only measuring the performance of inner loops of ufunc, the idea behind it is to remove umath object calls from the equation, in order to reduce the number of noises and provides stable ratios.
a231322
to
5e557b5
Compare
I ran this PR on a live environment without a desktop (Ubuntu Server), using the method in the PR description. The noise was around 3% and this PR had a performance impact of ±5%, so not too much of a difference. Whoops, had the wrong tab open. This comment was meant for #16247, copy pasting there. |
close/reopen |
ENH: A standalone benchmark script for the inner loops of ufunc
This script only measuring the performance of inner loops of ufunc,
the idea behind it is to remove umath object calls from the equation,
in order to reduce the number of noises and provides stable ratios.