-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
ENH: Add vbench #1070
ENH: Add vbench #1070
Conversation
I should reemphasize that the is still very much WIP. It's probably not worth reviewing yet. I just wanted to get it onto GH. |
Any questions that you anticipate having while I'm writing up some developer docs for this? Right now I have headings for Writing a good vbench which I think will suffice for most cases. I'll also write something up for Running the full suite which most people won't have to do. And then some notes on the implementation in case people need to change it down the line. Perhaps I can write up some vbench docs and push them to the vbench repo. |
So just to be clear, the process is we need a computer that checks git periodically and runs the vbench suite every time there's a commit. Then, we upload results and graph to a website somewhere, right? I have a couple always on machines that could be used for that. Long-term, or just for testing. Both run relatively recent version of ubuntu. |
@TomAugspurger Thanks again for working on this I only gave it a quick browse If you can link to documentation in other packages, then our documentation could be pretty short. Some question besides the general "How do you run it?" that I thought about How do we add benchmarks? Should they have a loop to run the same code several times (e.g. 10 OLS(..).fit() ) Can we make selective runs, additional to the scheduled runs? Related: In the test suite we have some unit tests marked as slow. Is it possible to run basic benchmarks on a higher frequency than slow benchmarks? I'm trying to figure out how we can handle benchmarks for the different submodules to the question by @vincentarelbundock Should we really run on every commit or periodically? |
Oh yeah, well the cron job can check github for new commits once a day or once a week. Doesn't have to be every second... |
There's actually two main ways to use vbench. I'll talk to the pandas people to get a better idea of how they use it for the long-term testing. But the thing that most contributors will use is the
where the columns are head (your PR), base, and the ratio. |
What would be nice is if the initial run could be taken at different points in the commit history, so we can "backfill" benchmark history. :) |
@vincentarelbundock If I'm understanding you correctly, then that should be possible. @josef-pkt I'll get those answered more formally later, but for now:
Basically you write a module (a single .py file) for a related suite of tests. Each of those test is run once, either for each commit in a specified date range, or just a diff between your current and some know good benchmark.
Yep. There's a few examples in the
Yes. This will be the I'll check about the running subsets. I think it's possible. |
Should I add a new Getting close on this. One thing is a bit weird, and I want to compare it to the pandas results before saying this is ready. But I'm hitting some error when running the pandas vbench, so I'm waiting on that. |
Okay this is probably about ready to go. I typed up some notes that will hopefully clear some questions up. I might clean them up and submit them to the vbench repo, but this should do for now. One question for now. Each benchmark takes a start_date argument for how far back you want to go. I've got it set to just a few months ago for testing, but we'll want to push that back. Any idea how far you want to go back? And obviously we need to expand the coverage. I basically just took the discrete examples and converted them into a benchmark. Anyone mind checkout out my branch and giving it a shot? You just need config file, see the notes I wrote up. |
For future reference: wesm/vbench#34 |
I wanted to look at it today, but didn't find time yet. make file for creating the html would be needed (maybe you have it already). The part to push them automatically on a webpage won't be necessary until we have decided how to publish them. |
No rush on my end. The steps to make the docs are
All from the |
The things we'll need to change are in It also expects config and credentials files. |
I'll give this a serious look next week if nobody has gotten around to it by then. Sorry I can't do it any sooner! |
Thanks! No rush. -Tom I'll give this a serious look next week if nobody has gotten around to it by then. Sorry I can't do it any sooner! — |
TMP_DIR = config.get('setup', 'tmp_dir') | ||
except: | ||
REPO_PATH = os.path.abspath(os.path.join(os.path.dirname(__file__), "../")) | ||
REPO_URL = 'git@github.com:statsmodels/statsmodels.git' |
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.
On my machine, I had to change git@ to a URL: https://github.com/statsmodels/statsmodels.git
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.
Thanks. I forgot to check the except
part of that block.
Build works well for me. I uploaded it to my website in case @jseabold and @josef-pkt want to have a look. http://umich.edu/~varel/vbench This looks really great and it's easy to use. Thanks a lot Tom! A couple things:
|
Also, can we include a download link to the raw benchmark database? |
re: sharing the raw database, I'll have to check how vbench hashes the runs (so that it doesn't have to rerun one that it's already done). As long as its not using anything specific to the local file system, that should be fine I think. I'm guessing that this won't work on windows right now. I've had a bit of trouble getting python setup on windows. I think my VM starves it of ram. I might have a bit of time later this week to look into that. |
Well, I do know that vbench won't re-run the same benchmarks if they're in the db already. Just try running the suite twice in a row :) Also, the build machine will likely be Linux or mac, so that shouldn't be a problem. |
@TomAugspurger You don't need to get a Windows VM just for this. I can look at the Windows specific problems when I try to run it. (the cheapest way to get a almost fully loaded python environment is https://code.google.com/p/winpython/ or pythonxy for integration with Windows. |
For the download link, it would just be a matter of inserting a line in make.py to copy benchmark.db somewhere in the build/html path, and then to include an appropriate link in the docs. |
Thanks to both, It looks good on the website that Vincent added. One question will be to figure out how noisy the results are, or how to reduce noise (spike before |
Not sure about noise, but it looks like this varies from run to run. I uploaded a new set and it doesn't have the big Sep 2013 spike (it has other new ones). I think I put my laptop to sleep in the middle of the initial run, so that might explain that. Might be sensitive to what else is going on on the computer. I plan to run this on an "at rest" computer tonight but I don't have that available to me now. Perhaps noise will disappear. |
(aside for this PR: |
Mostly self-contained in the `vb_suite` directory in the main statsmodels repo. Also added some docs under `/docs/source/vbench.rst` BUG: Change remote repo location to url. BUG: Just ignore any database BUG: Change repo location to url removed accidental addition of database. BUG: Change version to .__version__
Just pushed those two fixes (the version and the git vs. https url). Thanks for looking at this. What else needs to be done? Vincent mentioned a short write-up of what this is, how to use it. I can trim down the note I put in the docs to something more manageable. |
FYI I just added some for GLM, RLM, WLS, and a bit more for ARIMA. I'm running those now and if everything checks out I'll push them up too. |
Didn't forget about this (totally). Is this in decent shape? I was just thinking how I'd like some quick scripts that I can use to do some profiling. |
This looks ok to me. I made some changes locally, so I can add it to my cron jobs and push this along with the docs. I'm likely going to stick this in |
@TomAugspurger I moved all of your work here https://github.com/statsmodels/vbench Let me know if you'd like commit rights to this repo. |
@jseabold I think it would be better organized if we move the benchmarks into a subdirectory, to keep them separate from the vbench files. something like:
|
Go ahead and file an issue on the other repo. Feel free to make a PR. |
@jseabold Thanks. I've subscribed to the repo. I'll take a look this weekend to see if anything has gone stale. If you run into troubles go ahead and ping me. I'm happy to maintain it. |
One thing I didn't do is add any config file to the repo. It seemed the defaults were fine. I also never looked at the vbench code. I just updated the e-mail and upload stuff and ran it. |
Closes #936
Still a WIP atm. This is just the skeleton and I've got a few details to iron out over the next couple of days.
Do we know what kind of machine this will be running on? I can test in a windows VM if need be, I just need to setup a python environment.
I'm keeping some docs too.
Here's an example of the output!