dnbaker / dashing2

Dashing 2 is a fast toolkit for k-mer and minimizer encoding, sketching, comparison, and indexing.
MIT License
62 stars 7 forks source link

Silicon/M1/M2/arm64? #65

Closed gaboentropy closed 1 year ago

gaboentropy commented 1 year ago

Any chance these, dashing and dashing2, will be compiled for apple's "new" processors (arm64/M1/M2)? Apparently the NEON/SIMDe libraries take care of threads for all kinds of systems.

dnbaker commented 1 year ago

Hi!

I don't have a solution for this yet. I think we can probably port simde fairly easily; the limiting factor right now is the logarithmic truncation step, which currently requires long doubles (80bit or higher floats). Unfortunately, M1 doesn't support it at all and it aliases for a double, which doesn't have the precision necessary for some operations.

I can probably fix this with Boost::Multiprecision, but it will take a bit of time.

I'll work on this and get back to you when I've got a fix. Sorry for the delay,

Thanks,

Daniel

gaboentropy commented 1 year ago

Thanks.

dnbaker commented 1 year ago

Hi again,

I wanted to report that I've been able to add M1 support. I'm not sure on how runtimes will compare, but it compiles and runs on M1 now as of https://github.com/dnbaker/dashing2/pull/66. Please let me know if you run into any issues!

You'll need to a recursive submodule update or a fresh clone, since it required changes in some dependent libraries.

Take care, and thanks!

Daniel

gaboentropy commented 1 year ago

Thanks Daniel, I'll let you know how it works. Best!

michaelschwob commented 1 year ago

Just following up, I'm getting the following error with v2.1.19/dashing2_s128.xz: zsh: illegal hardware instruction /Users/schwob/Desktop/dashing2_s128 dist *.fastq

It seems that this version is not compatible with M1 chips. I've been trying to work around it with Rosetta2, but that has also not been successful.