abseil / abseil/abseil-cpp

Discussion: the possibility to provide efficient SIMD implementation of Swiss Table on the Arm platform

Offen
#1,096 1 Kommentar 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
question
Vorherrschende Sprache
C++
Sterne
18.1k
Forks
3.2k
Ø Merge
20 Std. 36 Min.
Gemergte PRs (30 T.)
1

Beschreibung

The absl hash table on the x86 architecture uses SIMD (SSE2) instructions to help filter possible matching keys faster. However, I found that there is no corresponding SIMD implementation on the arm platform.

At first, I thought the absl community was not motivated to optimize it for the less-used arm platform. So, I tried to implement it myself using neon SIMD instructions on the arm architecture, but I quickly found a problem. When using the SSE instruction set, `_mm_movemask_epi8` can be implemented with only one instruction. Yet there is no direct counterpart in the neon instruction set, and every alternative I can find requires several more instructions, which introduces a much larger latency.

Anyway, I tried to achieve the same method using SIMD instructions on the arm platform. But as expected, the speed is slightly slower than the portable C++ code.

So I would like to ask Googlers if anyone has ever tried to implement a SIMD adaptation of the Swiss Table for the Arm architecture, and if they encountered similar problems. And is the reason why there is still no SIMD-optimized version for Arm, as I thought because the arm platform lacks instructions that can efficiently implement the Swiss Table.

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Das Issue behandelt die SIMD-Implementierung der absl-Hash-Tabelle. Sieh dir den vorhandenen SSE2-Code in der Codebasis an, wahrscheinlich in Dateien im Zusammenhang mit swiss_table oder Hash-Tabellen. Untersuche ARM-NEON-Intrinsics und die spezifische Herausforderung, _mm_movemask_epi8 effizient zu emulieren. Ein Benchmarking im Vergleich zur portablen C++-Implementierung ist erforderlich, um jeden neuen Ansatz zu validieren.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
cpp
Bereich
performance
Issue-Typ
Feature
Schwierigkeit
5/5
Geschätzter Aufwand
Über eine Woche
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
25/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.