Go to file
John Tromp 19a34fb648 fix README formatting 2016-10-27 14:56:25 -04:00
blake add solvers 2016-10-14 14:28:34 -04:00
blake2-avx2 Merge branch 'master' of github.com:tromp/equihash 2016-10-27 13:17:54 -04:00
blake2b new headernonce setup and many small changes 2016-10-23 22:29:22 -04:00
hide refactor types and reduce buckets from 2^16 to 2^12 2016-10-17 14:52:30 -04:00
.gitignore cleanup .gitignore and fix Makefile 2016-10-27 14:17:56 -04:00
LICENSE.txt obsolete faster by speeding up low-mem versions 2016-10-16 18:49:03 -04:00
Makefile cleanup .gitignore and fix Makefile 2016-10-27 14:17:56 -04:00
README.md fix README formatting 2016-10-27 14:56:25 -04:00
blake2b.cu obsolete faster by speeding up low-mem versions 2016-10-16 18:49:03 -04:00
dev_miner.cpp fix MAXSOLS bug 2016-10-26 11:18:52 -04:00
dev_miner.cu small cuda optimizations 2016-10-25 00:10:13 -04:00
dev_miner.h change 2nd stage bucketsort to slot linking 2016-10-27 13:17:41 -04:00
equi.c new headernonce setup and many small changes 2016-10-23 22:29:22 -04:00
equi.h new headernonce setup and many small changes 2016-10-23 22:29:22 -04:00
equi_dev_miner.cpp prepare blake2bip 2016-10-26 18:29:12 -04:00
equi_dev_miner.h Merge branch 'master' of github.com:tromp/equihash 2016-10-27 13:17:54 -04:00
equi_miner.cpp change 2nd stage bucketsort to slot linking 2016-10-27 13:17:41 -04:00
equi_miner.cu change 2nd stage bucketsort to slot linking 2016-10-27 13:17:41 -04:00
equi_miner.h allow AVX2 of course 2016-10-27 13:19:12 -04:00
osx_barrier.h add solvers 2016-10-14 14:28:34 -04:00

README.md

equihash

Equihash proof-of-work solvers

Build with "make all"

The executables ending in 1 are compiled without atomics and thus only suitable for single-threaded use (where they get some speedup over the generic version).

Options -h HEADER -n NONCE are self explanatory. Add option -r RANGESIZE to search a range of nonces. For benching, options -n 255 -r 100 are useful as it gets exactly 188 solutions from 100 runs.

My original submission was triggered by seeing how xenoncat's "has much of the same ideas as mine" so that making my open sourcing conditional on getting sufficient funding for the Cuckoo Cycle Bounty Fund no longer made sense.

https://forum.z.cash/t/tromps-solvers/2465/76

I noticed that we both use bucket sorting with tree nodes stored as a directed acyclic graph. Upon original submission, I wrote: Compared to xenoncat, my solver differs in

  • having way more buckets,
  • wasting some memory,
  • having simpler pair compression,
  • being multi-threaded,
  • and supporting (144,5).
  • And of course in not using any assembly.
  • Oh, and having some cool visualization of bucket size distribution...

David Jaenson gave me the idea to disable atomics for single threaded operation, which gave a nice speed boost for that case.

Since then I reduced the number of buckets in the cpu solver from 2^16 to 2^12, which allowed for reducing the bucket space overhead. I borrowed from xenoncat the idea to allocate all memory statically, and found a way to improve upon his memory layout, reducing waste by about 7%.

Seeing that my solver was spending 45% of runtime on hashing, I asked xenoncat if (s)he could make their assembly blake2b implementation available through a C binding, which s(he) very generously did.

Zooko had earlier suggested looking at Samuel Neves' blake2bp implemention for faster hashing. After initially rejecting this approach due to different blake2bp semantics, I came back to to it in search of a more portable way to gain speed. I managed to bridge the semantic gap and modify Samuel's source to serve Equihash's purposes.

On the morning of the submission deadline day, discussion on sorting with judge Solardiz made me realize that my 2nd stage bucket sort could benefit from linking rather than listing xor-able slots, which gave me the final speed boost.

More detailed documentation is available in the equi_miner.h source code.

Performance summary:

  • equi1: 4.6 Sol/s - 5.9 Sol/s (with AVX2)
  • equi -t 8: 16.7 Sol/s
  • 8 x equi1: 20.3 Sol/s
  • dev1: 6.5 Sol/s (xenoncat's blake)
  • 8 x dev1: 20.6 Sol/s
  • dev -t 8: 17.2 Sol/s
  • eqcuda: 23.6 Sol/s