3 ms·
For what it's worth, I've tested my AVX2 copy of their code on a couple of different machines, and found it faster than my POPCNT-based implementation. (See my
by dalke 7y ago
For what it's worth, I've tested my AVX2 copy of their code on a couple of different machines, and found it faster than my POPCNT-based implementation. (See my comments elsewhere here.)
Here's my laptop numbers for my benchmark:
2048 Tanimoto (RDKit Morgan radius=2) 1000 queries
chemfp search using threshold Tanimoto arena, index, single threaded (popcnt_128_128)
threshold T=0.4 popcnt 19.33 ms/query (T2: 19.81 ms check: 189655.09 run-time: 39.2 s) (allow specialized)
chemfp search using threshold Tanimoto arena, index, single threaded (avx2_256)
threshold T=0.4 avx2 12.63 ms/query (T2: 14.04 ms check: 189655.09 run-time: 26.7 s) (allow specialized)
That's 19.33 ms/query on 2048-bit (256 byte) bitstrings using POPCNT unrolled to two loops of 128 bytes each, and 12.63 ms/query using AVX2 specialized for 256 bytes.
My testing showed there was no advantage for a fully unrolled POPCNT implementation. One thing to know is that there is only one execution port for POPCNT on my Intel processor. An AMD processor with 4 execution ports (Ryzen, I think?) may be faster. I don't have that processor, and my limited understanding of the gcc-generated assembly suggests it isn't optimized for that case.
- robocat 7y ago> An AMD processor with 4 execution ports (Ryzen, I think?) may be faster. FYI m0zg agreed: "AMD can retire 4 (!) popcounts per cycle per core, if your code is able to feed it": https://news.ycombinator.com/item?id=20916023 https://news.ycombinator.com/item?id=20916023