Hacker GitHub

← All repos

google/highway

View on GitHub ↗ ★ 5,952 C++

Performance-portable, length-agnostic SIMD with runtime dispatch

107 mentions on Hacker News by 37 people: 7 stories, 100 comments · first 2020-08-04 · latest 2026-09-25

Mentions per year 107 mentions · busiest year 2023 (30)
20082026
  1. …GFNI for bit reversal and 8-bit shifts, and I just extended that to our 8-bit BroadcastSignBit ( https://github.com/google/highway/pull/1784 ).
    comment by janwas · 2023-09-27 · in Permuting Bits with GF2P8AFFINEQB
  2. …en.cppreference.com/w/cpp/experimental/simd/simd ), Eve ( https://github.com/jfalcou/eve ), Highway ( https://github.com/google/highway ), Vc ( https://github.com/VcDevel/Vc )...
    comment by jcelerier · 2023-08-19 · in Stable Diffusion in C/C++
  3. You could study Google's Highway library [1]. [1] https://github.com/google/highway
    comment by utopcell · 2023-07-07 · in {n} times faster than C
  4. …frequency reduction? Not since the first implementation on Skylake, and even there a non-issue, see https://github.com/google/highway/blob/master/hwy/contrib/so... . More cores? The shared-memory fabric is already bursting at the seams…
  5. …rare nor hard, it's a few dozen lines of boilerplate. You can even write your code just once: see https://github.com/google/highway#examples .
  6. Cool that you started with SIMD :) FYI github.com/google/highway allows you to write your code once and target many instruction sets. It also fills in many of the gaps, including reductions. Disclosure: I am the main author.
  7. …a net win for data sizes >= 100 KiB. - Startup overhead is a non-issue on Icelake and AMD Zen4. 1: https://github.com/google/highway/blob/master/hwy/contrib/so...
  8. …a net win for data sizes >= 100 KiB. - Startup overhead is a non-issue on Icelake and AMD Zen4. 1: https://github.com/google/highway/blob/master/hwy/contrib/so...
  9. …vqsort README says it is a non-issue on that generation CPU (Skylake-X) based on their benchmarks: https://github.com/google/highway/tree/master/hwy/contrib/so... At least on their low clock speed server CPU (<=3GHz), downclocking was hard…
  10. Happy to discuss, preferably via issue on github.com/google/highway, would you like to open one?
    comment by janwas · 2023-06-09 · in The Case of the Missing SIMD Code
  11. …count. [1] https://github.com/simd-everywhere/simde [2] https://github.com/ermig1979/Simd [3] https://github.com/google/highway [4] https://gitlab.com/libeigen/eigen [5] https://github.com/shibatch/sleef
    comment by wyldfire · 2023-06-09 · in The Case of the Missing SIMD Code
  12. …referring to function multiversioning, but that only helps choose/call the implementation, not generate it. github.com/google/highway supports compiling your single source code once into several versions, and then dispatching to the best…
    comment by janwas · 2023-06-05 · in Vectorization: Introduction
  13. …faster than this when running on AVX-512. Disclosure: I am the main author; happy to discuss. 0: https://github.com/google/highway/blob/master/hwy/contrib/so...
  14. …be as verbose and cryptic as intrinsics; wrapper functions can help a lot :) Is this more readable? https://github.com/google/highway/blob/master/hwy/contrib/so...
  15. Here is an example on how to do this using github.com/google/highway: https://gcc.godbolt.org/z/zP7MYe9Yf You write the code only once and do not have to worry about any #pragma/conditional compilation. Just copy-paste about a dozen lines…
  16. …all of those things except first-fault loads in a cross-platform way at reasonable cost in https://github.com/google/highway . If any of those is the one missing piece that's preventing you from vectorizing, then it's totally worthwhile to…
  17. …to allow reordering (e.g. Highway's ReorderWidenMulAccumulate [1]), it's only 2 instructions. 1: https://github.com/google/highway/blob/master/g3doc/quick_re...
    comment by janwas · 2023-05-02 · in SIMD with Zig
  18. Benchmark results using vqsort's bench_sort on Skylake workstation (patch: https://github.com/google/highway/pull/1140 ) vqsort is about 1.9x and 1.8x as fast on 1M keys and 100M uniform random keys, respectively. Note that this code did…
  19. …algorithm beyond what is described in our paper, e.g. special handling for 1..3 unique keys, see https://github.com/google/highway/blob/master/hwy/contrib/so... .
  20. …be interesting to see it benchmarked against the highway qsort[1] Google published last year. [1] https://github.com/google/highway/tree/master/hwy/contrib/so...
  21. …) Could also be interesting for you to run the vqsort benchmark: https://github.com/google/highway/blob/master/hwy/contrib/so...
  22. ▲ 98
    Efficient and performance-portable vector software
    story by signa11 · 2023-01-10 · 30 comments
  23. It would be simpler to use the portable intrinsics from github.com/google/highway (disclosure: I am the main author). You include a header, and use the same functions on all platforms; the library provides wrapper functions which boil down…
  24. …use 256 or 512-bit SIMD. You might give our vqsort a try, it's quite a bit faster than std::sort: https://github.com/google/highway/blob/master/hwy/contrib/so...
    comment by janwas · 2022-12-18 · in Sorting with SIMD
  25. …one general all-to-all permute which is more expensive than two simple shuffles). Also, vqsort ( https://github.com/google/highway/tree/master/hwy/contrib/so... ) almost entirely consists of operations not supported by the extensions, and…
  26. …checked, it also only worked in a recent version of GCC. We do indeed have cross-platform intrinsics here: github.com/google/highway. Disclosure: I am the main author.
  27. Here's a first draft, comments welcome: https://github.com/google/highway/pull/1078 .
    comment by janwas · 2022-12-06 · in AVX 512 will be the future
  28. …some distributions. It's useful both for sorting networks and quicksort partitioning. Code here: https://github.com/google/highway/tree/master/hwy/contrib/so... (disclosure: I'm one of the co-authors).
  29. ▲ 2
    Highway: Performance-portable, length-agnostic SIMD with runtime dispatch
    story by kristianp · 2022-11-29 · 0 comments
  30. https://github.com/google/highway
    comment by kristianp · 2022-11-29 · in AVX 512 will be the future
  31. …to be a collection of prewritten kernels, so it only helps if the function you want to write is among them. github.com/google/highway seems to be closer to what is requested here. It provides around 200 portable intrinsics using which you…
    comment by janwas · 2022-11-28 · in AVX 512 will be the future
  32. Good news, you can use portable intrinsics (github.com/google/highway) and write your code only once. (Disclosure: I am the main author.)
    comment by janwas · 2022-09-15 · in Escaping strings faster with AVX-512
  33. :) For anyone interested, here's a brief discussion of tail handling: https://github.com/google/highway#strip-mining-loops (Overlapping is indeed cool where it works - idempotent operations.)
    comment by janwas · 2022-09-15 · in Escaping strings faster with AVX-512
  34. …yet clear whether the compiler will be smart enough to (peephole-?)optimize away the duplicates. 1: https://github.com/google/highway/blob/master/g3doc/instruct...
  35. Indeed a nice speedup! As to libraries: I'm the main author of github.com/google/highway which provides 'portable intrinsics' so you only have to write your code once for all platforms. It includes ready to use sorting and searching…
  36. github.com/google/highway is arguably such a collection of tricks, the x86_256-inl.h header does emulate some missing AVX-512 instructions such as this one or compressstoreu. (In this case we currently use a constant.)
  37. …may be possible to use unaligned loads/stores to handle the fringe in a single (final) iteration: https://github.com/google/highway#strip-mining-loops It is actually feasible to write vector-style code using SIMD instructions. Yes, the…
    comment by janwas · 2022-06-28 · in tolower() in bulk at speed
  38. …good solution when you can arrange it. In Highway we also use the blending/bit-select you mention: https://github.com/google/highway/blob/master/hwy/ops/generi... If HWY_MEM_OPS_MIGHT_FAULT, which is true if using ASAN or AVX2 (because AMD…
    comment by janwas · 2022-06-28 · in tolower() in bulk at speed
  39. …SVE will enable (properly written) software to benefit from future wider vectors without even recompiling. github.com/google/highway (disclosure: I am the main author) lets you write your code only once, and target newer instructions…
  40. Response here because I'm not on Twitter: https://github.com/google/highway/issues/736 In short, what is being compared is O(1) djbsort sorting network, vs our full quicksort with pivot sampling, partitioning, then sorting network. This is…
  41. …along the same lines, what can people do (or rather, what do you do) about situations like this: https://github.com/google/highway/blob/master/hwy/examples/b... where things might get better in the future but for now we have to implement…
    comment by nickysielicki · 2022-06-04 · in Vectorized and performance-portable Quicksort
  42. …The interesting thing here is that they turn out to be slower than our approach using portable intrinsics (github.com/google/highway) :)
  43. …gives you wrapper functions over the platform's intrinsics, emulating missing functionality where required: github.com/google/highway. Disclosure: I am the main author.
  44. …to program for since vector sizes keep getting bigger This can be fixed with an abstraction layer such as github.com/google/highway (disclosure: I am the main author). The programming model is variable-length vectors and we can map that…
    comment by janwas · 2022-05-23 · in Faster CRC32 on the Apple M1
  45. …per x86 vector instruction. it would be annoying to rewrite that per platform, but we didn't have to - github.com/google/highway (disclosure: I am the main author) provides portable intrinsics.
  46. …with the x86 SIMD instructions Actually, when the code is expressed using "portable intrinsics" ( https://github.com/google/highway ), the source code looks the same but compiles to SSE4/AVX2/AVX-512 and NEON,SVE,SVE2 and RISC-V V…
    comment by janwas · 2022-02-14 · in Prefix Sum with SIMD
  47. Yes, our github.com/google/highway does that for SSE4/AVX2/AVX-512. It targets at the level of instruction sets, though, not specific microarchitectures.
  48. …StoreInterleaved3 which is implemented similar to yours (more instructions but fewer constants): https://github.com/google/highway/blob/master/hwy/ops/x86_12... In my experience, integer mul are the hardest to bridge, but at least for dot…
  49. …benchmark does contain some boilerplate and extra code for measurements but a simple example is at https://github.com/google/highway/blob/master/hwy/examples/b... . Or how about https://github.com/google/highway/blob/master/hwy/examples/s..…
  50. …emulation is going to be way more expensive. Actually it uses exactly the same instruction :) https://github.com/google/highway/blob/master/hwy/ops/x86_25... Thanks for sharing the list! Out of curiosity, can you expand on what…