Skip to content

Commit c8c9c4d

Browse files
committed
Document measured AVX-512 speedups
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 01071e57-12fd-4f42-bc67-e2b274d0b007
1 parent 3494c29 commit c8c9c4d

1 file changed

Lines changed: 44 additions & 1 deletion

File tree

README.rst

Lines changed: 44 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ Lastly, I wanted to minimize dependencies, meaning you do not need to install
6565
As of v3.0.0, ``hexhamming`` is written in Rust using `PyO3 <https://pyo3.rs>`_
6666
and `maturin <https://www.maturin.rs>`_, providing memory safety, GIL release
6767
during computation, and free-threaded Python support while maintaining the same
68-
SIMD-accelerated performance (SSE4.1, AVX2, NEON).
68+
SIMD-accelerated performance (SSE4.1, AVX2, AVX-512 BITALG, NEON).
6969

7070
Installation
7171
-------------
@@ -195,6 +195,49 @@ The script records CPU features and tool versions alongside Criterion output
195195
and end-to-end Python benchmark JSON. Compare results only between runs from
196196
the same machine.
197197

198+
AVX-512 results
199+
~~~~~~~~~~~~~~~~
200+
201+
Three-run medians on a Google Cloud ``c4-standard-4`` with an Intel Xeon
202+
Platinum 8581C (Emerald Rapids):
203+
204+
.. list-table::
205+
:header-rows: 1
206+
207+
* - Workload
208+
- Before
209+
- After
210+
- Speedup
211+
* - Python 1024x16 first, random/no-match
212+
- 3.222 us
213+
- 0.679 us
214+
- 4.75x
215+
* - Python 1024x16 best, random/no-match
216+
- 3.720 us
217+
- 0.651 us
218+
- 5.72x
219+
* - Python 1024x16 all, random/no-match
220+
- 3.466 us
221+
- 0.710 us
222+
- 4.88x
223+
* - Python 1024x32 first, random/no-match
224+
- 3.199 us
225+
- 1.278 us
226+
- 2.50x
227+
* - Python 1024x32 best, random/no-match
228+
- 3.729 us
229+
- 1.383 us
230+
- 2.70x
231+
* - Python 1024x32 all, random/no-match
232+
- 3.445 us
233+
- 1.377 us
234+
- 2.50x
235+
236+
The AVX-512 byte kernel also uses masked loads below 64 bytes, improving the
237+
measured 16-, 32-, 48-, and 63-byte Rust paths by 33%, 50%, 70%, and 194%
238+
respectively. AVX2-only tuning remains hardware-dependent and should be
239+
measured separately on a machine without AVX-512.
240+
198241
All benchmarks were run on an Apple M4 Max (ARM64, 16 logical cores, 64 GiB)
199242
with hexhamming v3.0.0, ``rustc`` 1.97.1, and Python 3.14.6. Values are the
200243
median of the means from three independent runs.

0 commit comments

Comments
 (0)