tromp / cuckoo

a memory-bound graph-theoretic proof-of-work system
Other
822 stars 173 forks source link

cuckaroo/mean.cu: small variance in edge indexes count after Round(0) #99

Closed xiongyw closed 5 years ago

xiongyw commented 5 years ago

Hi, Tromp,

I run cuda29 (of cuckaroo/mean.cu) on NV 1080Ti multiple times, with the same nonce (e.g., I use -n 671), and dump the bucket/indexes after SeedA()/SeedB()/Round(0), then use md5sum to check whether data changes during each run. So far I observed that:

Btw, my dump/print code can be found in a fork.

Thanks!

xiongyw commented 5 years ago

I guess I found the reason: FLUSHA=16 and FLUSHB=8 are not big enough, so some edges may lost when storing into the tmp[][] array. If these two values are doubled, the problem is gone!

tromp commented 5 years ago

Correct; when too many threads access the same tmp row in https://github.com/tromp/cuckoo/blob/master/src/cuckatoo/mean.cu#L120 for instance, multiple threads write to tmp[row][FLUSHA2-1], and all but one of the edges gets lost. This will also affect the bucket counts in all later trimming rounds.