ring icon indicating copy to clipboard operation
ring copied to clipboard

aes-gcm: Enable AVX-512 implementation.

Open briansmith opened this issue 8 months ago • 3 comments

briansmith avatar Mar 05 '25 15:03 briansmith

Codecov Report

:x: Patch coverage is 30.50847% with 82 lines in your changes missing coverage. Please review. :white_check_mark: Project coverage is 96.14%. Comparing base (f4836b0) to head (eac2860). :warning: Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
src/aead/aes_gcm/vaesclmulavx512.rs 0.00% 36 Missing :warning:
src/cpu/x86_64.rs 54.76% 12 Missing and 7 partials :warning:
src/aead/gcm/vclmulavx512.rs 0.00% 16 Missing :warning:
src/aead/aes_gcm.rs 56.25% 6 Missing and 1 partial :warning:
src/aead/gcm.rs 0.00% 3 Missing :warning:
src/cpu.rs 80.00% 1 Missing :warning:
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2444      +/-   ##
==========================================
- Coverage   96.52%   96.14%   -0.38%     
==========================================
  Files         190      192       +2     
  Lines       20119    20217      +98     
  Branches      513      523      +10     
==========================================
+ Hits        19419    19437      +18     
- Misses        560      633      +73     
- Partials      140      147       +7     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

:rocket: New features to boost your workflow:
  • :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

codecov[bot] avatar Mar 05 '25 15:03 codecov[bot]

This is blocked on code coverage testing.

See also these pending changes upstream: https://boringssl-review.googlesource.com/c/boringssl/+/77168 https://boringssl-review.googlesource.com/c/boringssl/+/77167

See also issue #2469 regarding developing a workaround for this code to work in ancient binutils.

briansmith avatar Mar 10 '25 17:03 briansmith

The code coverage aspect of this comprises two parts:

  • Ensure that the aes-gcm-avx2 implementation is tested in the coverage job regardless of whether the GItHub Actions runner would normally use the avx512 version.
  • Ensure that the aes-gcm-avx512 implementation is tested in the coverage job regardless of whether the GItHub Actions runner would normally use the avx512 version.

I think GitHub is experimenting with some AVX-512-enabled actions runners so the tests might be flaky in the interim without explicitly using QEMU to target specific CPUs that would choose each implementation.

In PR #2464 I am experimenting with QEMU 9.2.2, which adds newer CPUs than are available in QEMU 8.2.2 used in GitHub Actions Ubuntu 24.04 runners.

briansmith avatar Mar 10 '25 17:03 briansmith

Hello and thanks so much for supporting Ring. I’ve run benchmarks with this PR and the AVX-512 instructions provide a meaningful performance boost. IIUC most of the PRs/issues reference by this PR are closed/resolved. Are there any remaining issues or blockers before merging this PR?

Scottmitch avatar Oct 21 '25 22:10 Scottmitch