Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SIMD optimization of iteration #37

Open
Aceeri opened this issue Sep 28, 2018 · 4 comments
Open

SIMD optimization of iteration #37

Aceeri opened this issue Sep 28, 2018 · 4 comments

Comments

@Aceeri
Copy link
Member

Aceeri commented Sep 28, 2018

Would be interesting to look at SIMD for optimizing the BitIter. Unsure if it would be worth it with some extensions like AVX512 due to it generally slowing down the cpu frequency, but SSE2 is probably worth exploring and benchmarking.

Some resources for that:
https://doc.rust-lang.org/stable/std/macro.is_x86_feature_detected.html
https://github.com/AdamNiederer/faster

@WaDelma
Copy link
Member

WaDelma commented Sep 28, 2018

You mean that we would provide simd_iter version of BitIter, which would construct a vectors of indices that are set, so SIMD operations can be done on them?

@Aceeri
Copy link
Member Author

Aceeri commented Sep 28, 2018

Yes, or even modifying the BitIter implementation (falling back to the current if no SSE2 exists on the system).

I think modifying the current implementation would be better, of course we should only actually merge this if it does mean that we get performance gains, especially in larger examples, since some SIMD instructions tend to lower cpu clock frequency (AVX512) which is not good for performance.

@WaDelma
Copy link
Member

WaDelma commented Sep 28, 2018

But iterator and simd_iterator have completely different APIs, so I don't see how modifying BitIter would be an option.

@Aceeri
Copy link
Member Author

Aceeri commented Sep 28, 2018

Oh I didn't mean implementing simd_iterator, I just mean having some more state in BitIter that allows for multiple index processing in one iteration (which we then use for the next iteration) or something similar.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants