JamesYang007 / adelie

A fast and flexible Python package for solving group lasso and elastic net problems.
https://jamesyang007.github.io/adelie/
MIT License
16 stars 1 forks source link

SNP matrices lost a tiny bit of efficiency due to USAN fix #122

Closed JamesYang007 closed 1 month ago

JamesYang007 commented 1 month ago

We had to fix the way we read the SNP buffers due to USAN issues. Specifically, we cannot read the buffer in any arbitrary location and interpret as a certain type since the address must be allgned. As a fix, we create a stack variable and perform std::memcpy. This seemed to introduce a minor (but non-negligible) slowdown. It would be nice to not rely on memcpy and just reinterpret the buffer. The only true solution is to pad the buffer cleverly then.

JamesYang007 commented 1 month ago

Hm never mind, upon comparing with v1.1.40 which was the last version that contained the old code (with USAN issues). The performance is identical.