Repository navigation
Entry into the contest, calculate_average_mtopolnik.sh - #246
Conversation
248e5b0 to
7fb3e9b
Compare
|
Hey @mtopolnik, I see you still push commits here. Should I hold off with running this for some more? |
|
It's ready to merge, I just can't help fiddling some more while waiting :) I'll open another PR if I get anything worthwhile. |
|
Ok, gotcha. Getting this when running tests: |
|
Wow. Seems specific to that environment. I'll look into it. |
|
|
Yepp, it does. |
|
And just to make sure, how much GB RAM is available? |
|
128 GB.
Am Do., 11. Jan. 2024 um 11:27 Uhr schrieb Marko Topolnik <
***@***.***>:
… And just to make sure, how much GB RAM is available?
—
Reply to this email directly, view it on GitHub
<#246 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAG7RFGJHCIIEVMFCFTBSLYN65AJAVCNFSM6AAAAABBR3KE3OVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQOBWHAYDONBYGY>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
|
For one reason or another, it hits the |
|
I just noticed the error message states |
|
Hum, hum, interesting. Will look into it later today. |
|
Very interesting. I can't seem to reproduce this (also when adding back the Xmx256m). I printed the result of Runtime.availableProcessors() from your program when run in the evaluation loop, and it shows 8, as expected. But then, I also took a thread dump and don't see those suspiciously high thread names either (only up to "Thread-7"). It's a bit mysterious tbh. |
|
All looking good now. Kudos for pushing hard to support the larger key set, too! As discussed elsewhere, it would have been nice to do the same for the official challenge, but I don't think it should be changed now. Definitely a good learning for myself for the next time, I really appreciate it. We might also consider running the Top 10 or so on the full key set in the last week of the challenge or so (also want to run them on all the 64 cores of the testing machine). You come in at 00:03.539, really good! Congrats and thanks for participating! |
…#246) * calculate_average_mtopolnik * short hash (just first 8 bytes of name) * Remove unneeded checks * Remove archiving classes * 2x larger hashtable * Add "set" to setters * Simplify parsing temperature, remove newline search * Reduce the size of the name slot * Store name length and use to detect collision * Reduce memory loads in parseTemperature * Use short for min/max * Extract constant for semicolon * Fix script header * Explicit bash shell in shebang * Inline usage of broadcast semicolon * Try vectorization * Remove vectorization * Go Unsafe * Use SWAR temperature parsing by merykitty * Inline some things * Remove commented-out MemorySegment usage * Inline namesMem.asSlice() invocation * Try out JVM JIT flags * Implement strcmp * Remove unused instance variables * Optimize hashing * Put station name into hashtable * Reorder method * Remove usage of MemorySegment.getUtf8String Replace with UNSAFE.copyMemory() and new String() * Fix hashing bug * Remove outdated comments * Fix informative constants * Use broadcastByte() more * Improve method naming * More hashing * Revert more hashing * Add commented-out code to hash 16 bytes * Slight cleanup * Align hashtable at cacheline boundary * Add Graal Native image * Revert Graal Native image This reverts commit d916a42. * Simplify shell script (no SDK selection) * Move a constant, zero out hashtable on start * Better name comparison * Add prepare_mtopolnik.sh * Cleaner idiom in name comparison * AND instead of MOD for hashtable indexing * Improve word masking code * Fix formatting * Reduce memory loads * Remove endianness checks * Avoid hash == 0 problem * Fix subtle bug * MergeSort of parellel results * Touch up perf * Touch up perf * Remove -Xmx256m * Extract result printing method * Print allocation details on OOME * Single mmap * Use global allocation arena
…#246) * calculate_average_mtopolnik * short hash (just first 8 bytes of name) * Remove unneeded checks * Remove archiving classes * 2x larger hashtable * Add "set" to setters * Simplify parsing temperature, remove newline search * Reduce the size of the name slot * Store name length and use to detect collision * Reduce memory loads in parseTemperature * Use short for min/max * Extract constant for semicolon * Fix script header * Explicit bash shell in shebang * Inline usage of broadcast semicolon * Try vectorization * Remove vectorization * Go Unsafe * Use SWAR temperature parsing by merykitty * Inline some things * Remove commented-out MemorySegment usage * Inline namesMem.asSlice() invocation * Try out JVM JIT flags * Implement strcmp * Remove unused instance variables * Optimize hashing * Put station name into hashtable * Reorder method * Remove usage of MemorySegment.getUtf8String Replace with UNSAFE.copyMemory() and new String() * Fix hashing bug * Remove outdated comments * Fix informative constants * Use broadcastByte() more * Improve method naming * More hashing * Revert more hashing * Add commented-out code to hash 16 bytes * Slight cleanup * Align hashtable at cacheline boundary * Add Graal Native image * Revert Graal Native image This reverts commit d916a42. * Simplify shell script (no SDK selection) * Move a constant, zero out hashtable on start * Better name comparison * Add prepare_mtopolnik.sh * Cleaner idiom in name comparison * AND instead of MOD for hashtable indexing * Improve word masking code * Fix formatting * Reduce memory loads * Remove endianness checks * Avoid hash == 0 problem * Fix subtle bug * MergeSort of parellel results * Touch up perf * Touch up perf * Remove -Xmx256m * Extract result printing method * Print allocation details on OOME * Single mmap * Use global allocation arena
Check List:
./test.sh <username>shows no differences between expected and actual outputs)calculate_average_<username>.sh(make sure to match casing of your GH user name) and is executablecalculate_average_baseline.shI'm benchmarking on a Hetzner CCX3 in Helsinki, it uses the older Milan CPU generation (no AVX-512, i.e., matching the evaluation environment).
My primary focus was performance on the "new" dataset with 10,000 keys and names in the full range of 1-100 bytes. I find that the timing on that dataset degrades to 10.1 seconds.
You can generate the dataset with
create_measurements3.sh, and I encourage contestants to try it out and use as the optimization target. It's unquestionably a kick to see oneself at the top of the leaderboard, but it's more fun (and useful!) to design a solution that works well beyond the 416 station names of max length 26 chars.Here's an interesting way to compare the "old" and the "new" datasets:
perfstatistics.One thing pops out: the "old" dataset gets away with just 0.06 cache misses and 0.05 branch misses per row of input! All the live slots of the hashtable fit into the L1 cache. We can see a notable impact on instructions per cycle: 2.31 on the "old" set, 1.76 on the "new" one.