Skip to content

Instantly share code, notes, and snippets.

@syed-ahmed
Last active July 16, 2019 07:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save syed-ahmed/4fdbab657b8b188b2a6558c6f125a063 to your computer and use it in GitHub Desktop.
Save syed-ahmed/4fdbab657b8b188b2a6558c6f125a063 to your computer and use it in GitHub Desktop.

Summary: Time (seconds) to get 134217728 randoms with varying number of threads

Best and Worst Average Times per Thread
Number of Randoms Number of Threads at::mt19937 (chunking) [best avg (s)] at::mt19937 (chunking) [worst avg (s)] std::mt19937 (chunking) [best avg (s)] std::mt19937 (chunking) [worst avg (s)] philox_simd (global) [best avg (s)] philox_simd (global) [worst avg (s)] philox (thread local) [best avg (s)] philox (thread local) [worst avg (s)] philox (global) (chunking) [best avg (s)] philox (global) (chunking) [worst avg (s)] philox_simd (global) (chunking) [best avg (s)] philox_simd (global) (chunking) [worst avg (s)] std::mt19937 [best avg (s)] std::mt19937 [worst avg (s)] pcg64 (chunking) [best avg (s)] pcg64 (chunking) [worst avg (s)] xoshiro256** [best avg (s)] xoshiro256** [worst avg (s)] pcg64 [best avg (s)] pcg64 [worst avg (s)] at::mt19937 [best avg (s)] at::mt19937 [worst avg (s)] xoshiro256** (chunking) [best avg (s)] xoshiro256** (chunking) [worst avg (s)] philox_simd (thread local) [best avg (s)] philox_simd (thread local) [worst avg (s)] philox (global) [best avg (s)] philox (global) [worst avg (s)]
134217728 1 0.377369 0.380408 0.680207 0.687023 0.174867 0.17489 0.437677 0.438034 0.419427 0.420261 0.165839 0.16627 1.63441 1.63521 0.0915272 0.092043 0.646487 0.647566 0.622447 0.623298 0.394635 0.396637 0.0769889 0.0770606 0.18466 0.1851 0.437661 0.4378
134217728 2 0.282107 0.283397 0.509677 0.515946 0.128764 0.130781 0.218835 0.219005 0.313244 0.315945 0.12443 0.124878 1.20159 1.20185 0.0686155 0.0686655 0.473004 0.474826 0.441374 0.441615 0.293529 0.296877 0.0577845 0.0578763 0.0912225 0.0938281 0.326613 0.328497
134217728 4 0.233121 0.234724 0.423613 0.42687 0.106326 0.108798 0.109846 0.137957 0.261033 0.2624 0.101303 0.102955 1.00202 1.01017 0.0563221 0.0564607 0.394889 0.398062 0.3656 0.367819 0.241225 0.247645 0.0446213 0.0481827 0.0456368 0.0675388 0.271517 0.273567
134217728 8 0.208936 0.220615 0.383152 0.383774 0.0970275 0.0979062 0.054797 0.0681235 0.233244 0.236166 0.184387 0.187277 0.899643 0.903044 0.050561 0.051615 0.353662 0.355993 0.325534 0.329834 0.219842 0.220289 0.0434593 0.0436347 0.0228703 0.0255357 0.243043 0.244799
134217728 16 0.201026 0.20227 0.361334 0.363595 0.0900852 0.0925092 0.0367542 0.0468242 0.217842 0.222249 0.349786 0.351992 0.848607 0.851972 0.0443996 0.046881 0.334806 0.337266 0.305162 0.311175 0.209102 0.210543 0.0409339 0.0410215 0.0162049 0.0167233 0.229333 0.231494
134217728 32 0.192129 0.194848 0.348957 0.351397 0.0872353 0.0898503 0.021248 0.0287329 0.214381 0.215218 0.682757 0.6855 0.826285 0.828924 0.0456992 0.047298 0.325641 0.328653 0.300571 0.304815 0.201235 0.201975 0.0398328 0.0398989 0.00839495 0.00873073 0.224985 0.22873
134217728 64 0.189685 0.192715 0.345576 0.34881 0.0856408 0.0867479 0.0142023 0.015602 0.424859 0.429997 1.34666 1.34895 0.815325 0.818679 0.0454623 0.0467461 0.32141 0.325227 0.295144 0.300178 0.198501 0.200765 0.0385562 0.0392101 0.00377689 0.00445647 0.219805 0.221426
134217728 128 0.187976 0.19055 0.340595 0.347045 0.0871208 0.0881895 0.00750217 0.0110993 0.843473 0.847659 2.67542 2.68307 0.809746 0.818892 0.0910683 0.0916369 0.316607 0.318276 0.294643 0.299078 0.196236 0.20009 0.0770691 0.0776664 0.00193248 0.00197437 0.218924 0.220474
134217728 256 7.93906e-08 8.09922e-08 6.77813e-08 7.22148e-08 0.0869167 0.0870339 0.00309767 0.00335373 7.14609e-08 7.60312e-08 8.38555e-08 8.48008e-08 0.807989 0.811839 1.0825e-07 1.10711e-07 0.320291 0.321807 0.295286 0.297657 0.199181 0.200566 1.15305e-07 1.18461e-07 0.000990963 0.00124968 0.218992 0.219953
134217728 512 7.6541e-08 7.81328e-08 6.81992e-08 7.03516e-08 0.0845753 0.0848294 0.00132239 0.00182248 7.1252e-08 7.31406e-08 7.85801e-08 8.05293e-08 0.828246 0.835351 1.08277e-07 1.09973e-07 0.325137 0.325716 0.30121 0.30193 0.197455 0.197761 1.07744e-07 1.15627e-07 0.000484275 0.000602021 0.21914 0.219614
134217728 1024 7.61729e-08 7.91328e-08 6.66367e-08 6.73906e-08 0.0842213 0.0851836 0.000692051 0.000773993 6.9752e-08 7.08916e-08 8.3083e-08 8.33516e-08 0.827847 0.828912 1.1019e-07 1.11117e-07 0.325239 0.326682 0.300919 0.30261 0.197764 0.19922 1.141e-07 1.17063e-07 0.000242874 0.000260194 0.218324 0.2199

Best and Worst Max Times
Number of Randoms Number of Threads at::mt19937 (chunking) [best max (s)] at::mt19937 (chunking) [worst max (s)] std::mt19937 (chunking) [best max (s)] std::mt19937 (chunking) [worst max (s)] philox_simd (global) [best max (s)] philox_simd (global) [worst max (s)] philox (thread local) [best max (s)] philox (thread local) [worst max (s)] philox (global) (chunking) [best max (s)] philox (global) (chunking) [worst max (s)] philox_simd (global) (chunking) [best max (s)] philox_simd (global) (chunking) [worst max (s)] std::mt19937 [best max (s)] std::mt19937 [worst max (s)] pcg64 (chunking) [best max (s)] pcg64 (chunking) [worst max (s)] xoshiro256** [best max (s)] xoshiro256** [worst max (s)] pcg64 [best max (s)] pcg64 [worst max (s)] at::mt19937 [best max (s)] at::mt19937 [worst max (s)] xoshiro256** (chunking) [best max (s)] xoshiro256** (chunking) [worst max (s)] philox_simd (thread local) [best max (s)] philox_simd (thread local) [worst max (s)] philox (global) [best max (s)] philox (global) [worst max (s)]
134217728 1 0.377369 0.380408 0.680207 0.687023 0.174867 0.17489 0.437677 0.438034 0.419427 0.420261 0.165839 0.16627 1.63441 1.63521 0.0915272 0.092043 0.646487 0.647566 0.622447 0.623298 0.394635 0.396637 0.0769889 0.0770606 0.18466 0.1851 0.437661 0.4378
134217728 2 0.377607 0.379229 0.681515 0.690743 0.174563 0.17484 0.218929 0.221912 0.419459 0.421475 0.165923 0.166831 1.60354 1.60395 0.09146 0.091609 0.633202 0.634358 0.588498 0.588791 0.394524 0.396329 0.0770358 0.0772186 0.0912964 0.0958624 0.437671 0.438918
134217728 4 0.377569 0.378618 0.682288 0.685458 0.174074 0.174701 0.110974 0.16858 0.420227 0.42112 0.165899 0.166705 1.60807 1.62651 0.0916363 0.0920206 0.635546 0.63841 0.588391 0.589702 0.39536 0.39662 0.0770728 0.0773106 0.0513826 0.0780998 0.437714 0.438297
134217728 8 0.37856 0.380388 0.683719 0.684171 0.174125 0.175912 0.0568266 0.0922186 0.419532 0.421371 0.332499 0.334618 1.60612 1.60849 0.0916336 0.0921456 0.63473 0.634794 0.589436 0.59438 0.395331 0.396012 0.0773182 0.0777389 0.0263618 0.0366725 0.43833 0.439938
134217728 16 0.378336 0.380258 0.684303 0.686614 0.174162 0.174325 0.0625736 0.0781179 0.419237 0.421821 0.664315 0.666295 1.60519 1.60943 0.0916143 0.0918778 0.634921 0.636534 0.589494 0.593694 0.395953 0.397419 0.0771283 0.0774196 0.0280734 0.0341406 0.437782 0.43921
134217728 32 0.377957 0.380449 0.684302 0.695243 0.174389 0.174488 0.06021 0.0666306 0.419516 0.420077 1.32934 1.33255 1.60643 1.61362 0.0918079 0.0921805 0.6372 0.638286 0.591101 0.592765 0.394976 0.397939 0.0773732 0.077602 0.0265322 0.031683 0.439696 0.442866
134217728 64 0.378382 0.379784 0.686002 0.687017 0.174078 0.175562 0.0508562 0.056251 0.840573 0.846176 2.65948 2.66442 1.60941 1.62093 0.0919737 0.0923596 0.639622 0.640611 0.590163 0.591428 0.395603 0.397095 0.0772936 0.0775571 0.0253874 0.0372989 0.439098 0.441515
134217728 128 0.378545 0.378954 0.685906 0.689712 0.17444 0.175881 0.0491568 0.0550864 1.67576 1.68394 5.31248 5.33059 1.61241 1.62658 0.183402 0.183947 0.637395 0.639627 0.591245 0.593895 0.39528 0.399158 0.154762 0.155213 0.0262233 0.0325169 0.438776 0.439744
134217728 256 0.00196562 0.00201154 0.00195293 0.00200619 0.174898 0.175016 0.0511026 0.052692 0.00197978 0.00204774 0.00196467 0.00197821 1.612 1.61774 0.00198332 0.00206348 0.640022 0.643695 0.590947 0.596686 0.398375 0.401163 0.00193543 0.00201192 0.0210527 0.0273304 0.439179 0.440613
134217728 512 0.00397593 0.00400801 0.00395125 0.0041022 0.171909 0.173238 0.0475991 0.0517675 0.00398475 0.00404269 0.00398602 0.00421877 1.65875 1.67207 0.00398005 0.00402991 0.652733 0.655791 0.604928 0.606408 0.397724 0.399425 0.00396711 0.00402537 0.0212661 0.0250079 0.441673 0.442426
134217728 1024 0.00815099 0.00828188 0.00807651 0.00817822 0.175027 0.177243 0.0491897 0.0573169 0.00810947 0.00831456 0.00807991 0.00811863 1.66205 1.66307 0.00808513 0.00841337 0.656302 0.659595 0.608799 0.611837 0.402014 0.404573 0.00813093 0.00819181 0.0223687 0.0232019 0.443983 0.445974

Summary: Time (seconds) for 1 threads to get varying number of randoms

Best and Worst Average Times per Thread
Number of Randoms Number of Threads std::mt19937 (chunking) [best avg (s)] std::mt19937 (chunking) [worst avg (s)] at::mt19937 (chunking) [best avg (s)] at::mt19937 (chunking) [worst avg (s)] philox (thread local) [best avg (s)] philox (thread local) [worst avg (s)] pcg64 (chunking) [best avg (s)] pcg64 (chunking) [worst avg (s)] philox (global) [best avg (s)] philox (global) [worst avg (s)] at::mt19937 [best avg (s)] at::mt19937 [worst avg (s)] philox_simd (thread local) [best avg (s)] philox_simd (thread local) [worst avg (s)] philox (global) (chunking) [best avg (s)] philox (global) (chunking) [worst avg (s)] pcg64 [best avg (s)] pcg64 [worst avg (s)] std::mt19937 [best avg (s)] std::mt19937 [worst avg (s)] xoshiro256** [best avg (s)] xoshiro256** [worst avg (s)] xoshiro256** (chunking) [best avg (s)] xoshiro256** (chunking) [worst avg (s)] philox_simd (global) (chunking) [best avg (s)] philox_simd (global) (chunking) [worst avg (s)] philox_simd (global) [best avg (s)] philox_simd (global) [worst avg (s)]
8 1 7.1e-08 1.56e-07 8e-08 2.59e-07 9e-08 1.78e-07 1.02e-07 1.93e-07 1.35e-07 2.68e-07 2.08e-07 1.149e-06 1.13e-07 3.79e-07 6.6e-08 1.63e-07 1.78e-07 2.81e-07 2.1e-07 1.197e-06 2.07e-07 2.8e-07 1.05e-07 4.48e-07 8.9e-08 1.34e-07 1.95e-07 3.95e-07
64 1 7.4e-08 9.2e-08 8e-08 1.28e-07 2.89e-07 3.75e-07 1e-07 1.03e-07 3.14e-07 3.54e-07 3.64e-07 7.46e-07 1.63e-07 2.61e-07 7.1e-08 9.8e-08 4.58e-07 4.83e-07 8.63e-07 1.696e-06 4.18e-07 4.54e-07 1.05e-07 1.15e-07 7.5e-08 1.09e-07 2.16e-07 2.77e-07
512 1 7.1e-08 1.05e-07 7.4e-08 1.11e-07 1.724e-06 1.817e-06 1.01e-07 1.02e-07 1.783e-06 1.857e-06 1.788e-06 2.079e-06 8e-07 8.84e-07 8.2e-08 1.04e-07 2.519e-06 2.543e-06 6.382e-06 6.687e-06 2.547e-06 2.592e-06 1.03e-07 1.12e-07 6.7e-08 1.01e-07 7.93e-07 8.74e-07
4096 1 7e-08 1.01e-07 7.8e-08 1.05e-07 1.3373e-05 1.4109e-05 1.03e-07 1.05e-07 1.3532e-05 1.4361e-05 1.2257e-05 1.4044e-05 5.685e-06 5.774e-06 7.3e-08 9.9e-08 1.9381e-05 1.9759e-05 4.9632e-05 5.3907e-05 2.0842e-05 2.2213e-05 1.04e-07 1.2e-07 6.7e-08 1.09e-07 5.472e-06 5.631e-06
32768 1 7.4e-08 1.02e-07 7.8e-08 1.05e-07 0.000106906 0.000107148 1.04e-07 1.14e-07 0.000106974 0.000113376 9.6614e-05 9.6919e-05 4.5088e-05 4.7749e-05 7.4e-08 9.9e-08 0.000145721 0.00015209 0.000399283 0.000404282 0.000155576 0.0001638 1.04e-07 1.05e-07 6.6e-08 1.1e-07 4.2612e-05 4.3816e-05
262144 1 7.3e-08 1.06e-07 8.1e-08 1.05e-07 0.000853988 0.000854336 1.1e-07 1.47e-07 0.000854688 0.000860683 0.00077122 0.000778922 0.000359971 0.000362902 7.1e-08 1.12e-07 0.00121524 0.00125616 0.00319339 0.00322739 0.00124724 0.00129682 9.3e-08 1.56e-07 7.1e-08 1.45e-07 0.000342799 0.000345344
2097152 1 0.0106223 0.010656 0.00590642 0.00590798 0.00683815 0.00684216 0.00142735 0.00143073 0.00683955 0.00684418 0.00616563 0.00617282 0.00287796 0.00291273 0.0130664 0.0134444 0.00972595 0.00972867 0.025565 0.0259931 0.0101779 0.0102642 0.00120179 0.00120536 0.0414675 0.0414744 0.00273043 0.00277744
16777216 1 0.084989 0.0855987 0.0472375 0.0479894 0.0547103 0.0548407 0.0114214 0.0114924 0.0547074 0.0547163 0.0493511 0.0496337 0.0230707 0.0231887 0.0521544 0.0525228 0.0778088 0.0778628 0.204664 0.205035 0.0808426 0.0812275 0.00963431 0.00965626 0.0414715 0.0417835 0.0218967 0.0222641
134217728 1 0.679921 0.68035 0.377709 0.377718 0.437664 0.437721 0.0913695 0.0914276 0.437626 0.437665 0.39457 0.39986 0.184513 0.185177 0.417881 0.420794 0.622279 0.62537 1.6358 1.63625 0.642651 0.650854 0.0769814 0.0779849 0.165832 0.166172 0.17482 0.17509
1073741824 1 5.43893 5.44127 3.02224 3.02443 3.50112 3.51576 0.730855 0.735545 3.50117 3.52293 3.15673 3.18391 1.47872 1.48356 3.34217 3.37272 4.97867 5.00871 13.0866 13.1129 5.15747 5.17517 0.615752 0.61588 1.32662 1.32875 1.39903 1.44687
8589934592 1 43.544 43.8115 24.1764 24.1774 28.008 28.0161 5.84687 5.88654 28.0094 28.2064 25.2565 25.3401 11.8235 11.9683 26.7336 26.8695 39.9349 40.0192 104.73 105.306 41.2196 41.5646 4.92864 4.97349 10.6136 10.6432 11.1938 11.6148

Best and Worst Max Times
Number of Randoms Number of Threads std::mt19937 (chunking) [best max (s)] std::mt19937 (chunking) [worst max (s)] at::mt19937 (chunking) [best max (s)] at::mt19937 (chunking) [worst max (s)] philox (thread local) [best max (s)] philox (thread local) [worst max (s)] pcg64 (chunking) [best max (s)] pcg64 (chunking) [worst max (s)] philox (global) [best max (s)] philox (global) [worst max (s)] at::mt19937 [best max (s)] at::mt19937 [worst max (s)] philox_simd (thread local) [best max (s)] philox_simd (thread local) [worst max (s)] philox (global) (chunking) [best max (s)] philox (global) (chunking) [worst max (s)] pcg64 [best max (s)] pcg64 [worst max (s)] std::mt19937 [best max (s)] std::mt19937 [worst max (s)] xoshiro256** [best max (s)] xoshiro256** [worst max (s)] xoshiro256** (chunking) [best max (s)] xoshiro256** (chunking) [worst max (s)] philox_simd (global) (chunking) [best max (s)] philox_simd (global) (chunking) [worst max (s)] philox_simd (global) [best max (s)] philox_simd (global) [worst max (s)]
8 1 7.1e-08 1.56e-07 8e-08 2.59e-07 9e-08 1.78e-07 1.02e-07 1.93e-07 1.35e-07 2.68e-07 2.08e-07 1.149e-06 1.13e-07 3.79e-07 6.6e-08 1.63e-07 1.78e-07 2.81e-07 2.1e-07 1.197e-06 2.07e-07 2.8e-07 1.05e-07 4.48e-07 8.9e-08 1.34e-07 1.95e-07 3.95e-07
64 1 7.4e-08 9.2e-08 8e-08 1.28e-07 2.89e-07 3.75e-07 1e-07 1.03e-07 3.14e-07 3.54e-07 3.64e-07 7.46e-07 1.63e-07 2.61e-07 7.1e-08 9.8e-08 4.58e-07 4.83e-07 8.63e-07 1.696e-06 4.18e-07 4.54e-07 1.05e-07 1.15e-07 7.5e-08 1.09e-07 2.16e-07 2.77e-07
512 1 7.1e-08 1.05e-07 7.4e-08 1.11e-07 1.724e-06 1.817e-06 1.01e-07 1.02e-07 1.783e-06 1.857e-06 1.788e-06 2.079e-06 8e-07 8.84e-07 8.2e-08 1.04e-07 2.519e-06 2.543e-06 6.382e-06 6.687e-06 2.547e-06 2.592e-06 1.03e-07 1.12e-07 6.7e-08 1.01e-07 7.93e-07 8.74e-07
4096 1 7e-08 1.01e-07 7.8e-08 1.05e-07 1.3373e-05 1.4109e-05 1.03e-07 1.05e-07 1.3532e-05 1.4361e-05 1.2257e-05 1.4044e-05 5.685e-06 5.774e-06 7.3e-08 9.9e-08 1.9381e-05 1.9759e-05 4.9632e-05 5.3907e-05 2.0842e-05 2.2213e-05 1.04e-07 1.2e-07 6.7e-08 1.09e-07 5.472e-06 5.631e-06
32768 1 7.4e-08 1.02e-07 7.8e-08 1.05e-07 0.000106906 0.000107148 1.04e-07 1.14e-07 0.000106974 0.000113376 9.6614e-05 9.6919e-05 4.5088e-05 4.7749e-05 7.4e-08 9.9e-08 0.000145721 0.00015209 0.000399283 0.000404282 0.000155576 0.0001638 1.04e-07 1.05e-07 6.6e-08 1.1e-07 4.2612e-05 4.3816e-05
262144 1 7.3e-08 1.06e-07 8.1e-08 1.05e-07 0.000853988 0.000854336 1.1e-07 1.47e-07 0.000854688 0.000860683 0.00077122 0.000778922 0.000359971 0.000362902 7.1e-08 1.12e-07 0.00121524 0.00125616 0.00319339 0.00322739 0.00124724 0.00129682 9.3e-08 1.56e-07 7.1e-08 1.45e-07 0.000342799 0.000345344
2097152 1 0.0106223 0.010656 0.00590642 0.00590798 0.00683815 0.00684216 0.00142735 0.00143073 0.00683955 0.00684418 0.00616563 0.00617282 0.00287796 0.00291273 0.0130664 0.0134444 0.00972595 0.00972867 0.025565 0.0259931 0.0101779 0.0102642 0.00120179 0.00120536 0.0414675 0.0414744 0.00273043 0.00277744
16777216 1 0.084989 0.0855987 0.0472375 0.0479894 0.0547103 0.0548407 0.0114214 0.0114924 0.0547074 0.0547163 0.0493511 0.0496337 0.0230707 0.0231887 0.0521544 0.0525228 0.0778088 0.0778628 0.204664 0.205035 0.0808426 0.0812275 0.00963431 0.00965626 0.0414715 0.0417835 0.0218967 0.0222641
134217728 1 0.679921 0.68035 0.377709 0.377718 0.437664 0.437721 0.0913695 0.0914276 0.437626 0.437665 0.39457 0.39986 0.184513 0.185177 0.417881 0.420794 0.622279 0.62537 1.6358 1.63625 0.642651 0.650854 0.0769814 0.0779849 0.165832 0.166172 0.17482 0.17509
1073741824 1 5.43893 5.44127 3.02224 3.02443 3.50112 3.51576 0.730855 0.735545 3.50117 3.52293 3.15673 3.18391 1.47872 1.48356 3.34217 3.37272 4.97867 5.00871 13.0866 13.1129 5.15747 5.17517 0.615752 0.61588 1.32662 1.32875 1.39903 1.44687
8589934592 1 43.544 43.8115 24.1764 24.1774 28.008 28.0161 5.84687 5.88654 28.0094 28.2064 25.2565 25.3401 11.8235 11.9683 26.7336 26.8695 39.9349 40.0192 104.73 105.306 41.2196 41.5646 4.92864 4.97349 10.6136 10.6432 11.1938 11.6148

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment