Speed up AVX-512 byte and fixed-width array scans - #55
Conversation
📊 Benchmark Comparison Results
➖ 51 benchmarks within noise (click to expand)
Legend: ✅ Faster (>5%) · ⛔ This PR has severe performance regressions (>20% slower). Please investigate before merging. |
Capture CPU metadata and run Criterion plus end-to-end Python benchmarks three times on the same AVX2 or AVX-512 machine. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 01071e57-12fd-4f42-bc67-e2b274d0b007
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 01071e57-12fd-4f42-bc67-e2b274d0b007
302f001 to
9067fd5
Compare
|
C4 AVX-512 hardware is now available and the initial three-run benchmark archive has been captured on an Intel Xeon Platinum 8581C (Emerald Rapids) with Initial median findings:
Commit |
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 01071e57-12fd-4f42-bc67-e2b274d0b007
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 01071e57-12fd-4f42-bc67-e2b274d0b007
|
Masked short-input experiment
The implementation removes the premature AVX2 fallback and uses the AVX-512 BITALG masked-tail code that was already present for residual bytes. The next experiment is cross-record SIMD for 16- and 32-byte catalogs. |
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 01071e57-12fd-4f42-bc67-e2b274d0b007
|
Preliminary cross-record scanner results for
All nine cases improved; after-run ranges were generally 1.4%-4.2%, with one 8.3% |
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 01071e57-12fd-4f42-bc67-e2b274d0b007
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 01071e57-12fd-4f42-bc67-e2b274d0b007
|
The hybrid cross-record scanner in
The small 16B index-0 trade-off is accepted in exchange for the 3.24x-4.07x full-scan gains. |
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 01071e57-12fd-4f42-bc67-e2b274d0b007
What
Improves the AVX-512 BITALG paths identified in #51 and adds a repeatable three-run x86 benchmark harness.
nativeoravx512when AVX-512 BITALG is available.Advances the AVX-512 portion of #51. AVX2-only tuning remains a separately measured follow-up.
Performance
Three-run medians on a Google Cloud
c4-standard-4, Intel Xeon Platinum 8581C (Emerald Rapids), withavx2,avx512bw, andavx512_bitalgexposed.Python fixed-width scans
Short AVX-512 byte inputs
The hybrid scanner scalar-checks the first record before batching. The accepted worst-case trade-off is approximately 0.5-0.6 ns for 16-byte
first/bestwhen an exact match is at index 0; full scans improve by 2.77x-4.07x in Rust and 2.50x-5.72x through Python.Testing
cargo test --lib --no-default-featureson the AVX-512 C4 VM — 72 testscargo test --no-default-featureson ARM64 — 76 unit and 2 doc testspython -m pytest test/ -k "not bench"— 80 passed, 3 skippedcargo fmt --checkgit diff --check