-
Notifications
You must be signed in to change notification settings - Fork 1.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
Use hyperfine and jq to improve evaluate.sh #182
Use hyperfine and jq to improve evaluate.sh #182
Conversation
evaluate2.sh
Outdated
|
||
echo "" | ||
TEMP_FILE=$(mktemp) | ||
OPTS="--warmup 1 --runs 5 --export-json $TEMP_FILE" |
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.
Note: I configured 1 warmup run... this differs from evaluate.sh
so we could always change this to 0
I added output of the raw times in addition to the trimmed means, eg: fork,trimmed_mean
spullara,0.52814592528
royvanrijn,0.49758428661333337
fork,raw_times
spullara,0.51465599528,0.53491328628,0.52979903628,0.51972545328,0.53921453728
royvanrijn,0.49466057828000004,0.49655945328,0.49698236928,0.4992110372800001,0.50892974428 |
de445e7
to
363803b
Compare
Very cool! One problem I see is that this moves the location of time measurement from just the |
363803b
to
8a636e8
Compare
New look, based on: #105 (comment) |
8a636e8
to
5264787
Compare
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.
@gunnarmorling I updated the script, please see my review comments below with some callouts and questions
5264787
to
15acae6
Compare
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.
@hundredwatt, thanks, I think this is getting into great shape. A few comments inline. Apart from those, is there a way we can capture the output of the contenders? We'd need that to compare that to the expected output (see process_output.java
, which then of course wouldn't have to handle the output of time
any more).
@gunnarmorling Yes, we can do |
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.
Addressed all comments from previous reviews
Excellent, thx! It's invoked via |
Remaining TODO:
|
BTW bash uses builtin time, the GNU /usr/bin/time supports TIME environment variable, see https://man7.org/linux/man-pages/man1/time.1.html bash:
/usr/bin/time has quite verbose default format which could be reduced just to real to avoid any kind of parsing.
Note also that default sh in Ubuntu is dash
that does not have time
source sdk also does not work with dash. I.e. for the next challenge baseline should stick to |
Let me know if I missed anything 😄 |
Yepp, that sounds exactly right 👍 . |
Ugh, For now we'll only check the output of 1 run unless we can find a workaround |
So if we run this script multiple times for multiple contenders, will we check the output of the last run for all contenders (ok)? Or just the last run of the last contender (bad)? |
I've created #266 as a follow-up to this one, re-organizing the existing launch scripts to adhere to the structure established here. |
The former, we're ok 👍 |
ea63161
to
a492c37
Compare
a492c37
to
1170ae2
Compare
For fun, the |
Oops, forgot the SMT / turbo stuff |
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.
check_command_installed hyperfine | ||
check_command_installed jq | ||
|
||
# Check if SMT is enabled (we want it disabled) |
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.
That's awesome, really great stuff, @hundredwatt! I'm gonna squash everything into one commit and merge it. We can do any necessary fine-tuning in follow-up PRs. Thanks a lot for pulling through with this one! |
Wanted to suggest exactly that, but you beat me to it. Seems we can (re-)generate the leaderboard fully automatically with this change. Thanks again! |
My pleasure, happy to help out! Thanks for putting together such a fun,
challenging and educational contest @gunnarmorling!
Hopefully I’ll find some time to submit my own entry once we run out of
infra things to improve 😂
…On Tue, Jan 9, 2024 at 12:52 PM Gunnar Morling ***@***.***> wrote:
Merged #182 <#182> into main.
—
Reply to this email directly, view it on GitHub
<#182 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAWLOOOOTQJ3JJFL4JMSGLYNWNWVAVCNFSM6AAAAABBPYITNOVHI2DSMVQWIX3LMV45UABCJFZXG5LFIV3GK3TUJZXXI2LGNFRWC5DJN5XDWMJRGQZTIOBTGYYTONQ>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
then | ||
echo "Usage: evaluate2.sh <fork name> (<fork name 2> ...)" | ||
echo " for each fork, there must be a 'prepare_<fork name>.sh' script and a 'calculate_average_<fork name>.sh' script" | ||
echo " there may be an 'additional_build_steps_<fork name>.sh' script too" |
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.
Why do we need additional_build_steps_*.sh
? I think the stuff could be in prepare_*.sh
They run one after another and there is a single use only:
- https://github.com/gunnarmorling/1brc/blob/main/additional_build_steps_thomaswue.sh
- https://github.com/gunnarmorling/1brc/blob/main/prepare_thomaswue.sh
I don't see why we can not mv additional_build_steps_thomaswue.sh prepare_thomaswue.sh
and drop support for additional_build_steps_*.sh
.
From #105
For lack of a better name, I called this script
evaluate2.sh