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

packed_simd v.s. portable_simd, which should be used? #1492

Closed
HaoYang670 opened this issue Mar 27, 2022 · 5 comments
Closed

packed_simd v.s. portable_simd, which should be used? #1492

HaoYang670 opened this issue Mar 27, 2022 · 5 comments
Labels
question Further information is requested

Comments

@HaoYang670
Copy link
Contributor

Describe your question
I think this is an old question, but I don't find a clear answer. So need your help!
Something that I find is that, the crate packed_simd has been in maintenance mode and no new features will be introduced: rust-lang/packed_simd#282 (comment)
https://github.com/rust-lang/packed_simd/blob/master/README.md

Also, protable_simd is planned to be the stable and standard library in the future, it is true?

My questions are:

  1. Is packed_simd_2 still a reliable crate?
  2. Do we need to migrate from packed_simd_2 to portable_simd?
  3. Which one could be stable in the future, packed_simd_2 or portable_simd?

I know these are old questions, but I don't find a clear answer. So need your help!

Re:
rust-lang/portable-simd#170

@HaoYang670 HaoYang670 added the question Further information is requested label Mar 27, 2022
@jhorstmann
Copy link
Contributor

Both currently require a nightly compiler and it will probably take a while until portable_simd gets stabilized. Longer term we should switch to portable_simd as it will become the standard and there won't be any updates to packed_simd. As far as I know packed_simd currently has no major issues that would force us to switch.

Portable_simd has first class support for bitmasks, which fits the arrow data model for boolean and validity very well and could lead to some code simplification. On AVX512 capable CPUs that leads to slightly better code than what we currently do manually. On non-AVX512 machines the code is currently worse. For intel compatible targets that has already been fixed in LLVM trunk, I think other architectures like arm neon or wasm are still affected. I don't actually know how good our current code simd works for arm or neon, but we should probably at least await the next llvm update in rust before we switch.

@HaoYang670
Copy link
Contributor Author

Thanks for your answer @jhorstmann! Very much looking forward to the day when we can migrate to std::simd. I will close this issue.

@alamb
Copy link
Contributor

alamb commented Apr 2, 2022

I believe @jorgecarleitao did some work in arrow2 to migrate it away from using packed_simd (and thus no longer require nightly rust), which might be worth looking into: jorgecarleitao/arrow2#747

@KonradHoeffner
Copy link

As of Rust nightly-1.78, packed_simd no longer works, see rust-lang/packed_simd#359.

@alamb
Copy link
Contributor

alamb commented Feb 21, 2024

Update here is that arrow-rs does not use simd intrinsics anymore, and instead relies on the Rust compiler's (quite good) auto vectorization capabilities

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

No branches or pull requests

4 participants