Skip to content

Implement "target time" for benchmarks #17

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

Merged
merged 13 commits into from
Nov 22, 2019

Conversation

bibikar
Copy link
Contributor

@bibikar bibikar commented Nov 12, 2019

On certain benchmarks, the predict method completes orders of magnitude faster than the fit method. Instead of requiring the user to manually select number of repetitions to run, this PR implements aiming for a certain target total time instead. This should help with measurement stability in these benchmarks.

The timing function first takes some "warmup" measurements and determines a good number of inner loops such that the total timing meets the overall time limit and includes about --goal-outer-loops outer loops. If the warmup measurement time exceeds the time limit, the timing function just returns the warmup time.

This PR also includes some refactoring of native benchmarks to use common functions for counting classes, printing tables, and timing.

One other change made here is to use tol=0 in all kmeans benchmarks unless otherwise specified on the command-line. This removes randomness in number of iterations in K-Means fit.

Using tol=0 means same number of iterations everywhere, allowing
apples-to-apples timing.
@bibikar bibikar merged commit de3ce51 into IntelPython:master Nov 22, 2019
@bibikar bibikar deleted the feature/time_limit branch November 22, 2019 20:43
razdoburdin pushed a commit to razdoburdin/scikit-learn_bench that referenced this pull request Jun 13, 2023
* do not generate code for distributed/streaming modes unless needed
* moving streaming and ditributed arg to pre-computed mechanism
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants