aes: SIMD-acceleration for WASM
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 45/100
- issue の種類
- 機能追加
- 明瞭さ
- おおむね明確
- 活発さ
- 静か
- 技術スタック
- rust, wasm
調査の方向性
まず、リンクされた実装コミットと既存の WASM AES fixslice64 パスを確認し、その後 wasm-harness で報告された測定値を再現します。完了条件は、ベンチマークカバレッジを備えた upstream 提出可能な SIMD 実装と、SIMD をデフォルトで有効にするかフラグの背後で有効にするかについての文書化された判断があり、Wasmtime の復号回帰も含まれていることです。
索引モデルが issue の本文から書いたものです。
説明
WASM targets currently use the software fixslice implementation which processes up to 4 blocks at a time (fixslice64). WebAssembly has had the simd128 proposal stabilized in the spec for a while now, and the corresponding intrinsics ([core::arch::wasm32::*]) have been stable in Rust since 1.33. Every major WebAssembly runtime ships simd128 support today.
We use AES extensively in our projects which target running in browsers, the throughput of AES in WASM is a major performance lever for us. Translating the existing fixslice64 implementation (AI assisted, not sure what your policy is on that) to use 128 bit lanes yields the expected >2x throughput increase in V8 (chromium), and >3x in SpiderMonkey (firefox).
(AMD Ryzen 7 5800X)
| Unit: MB/s | wasmtime soft | wasmtime simd128 | wasmtime relative | v8 soft | v8 simd128 | v8 relative | sm soft | sm simd128 | sm relative |
|---|---|---|---|---|---|---|---|---|---|
| AES-128 enc | 186 | 184 | 0.99× | 258 | 604 | 2.34× | 213 | 657 | 3.08× |
| AES-128 dec | 185 | 122 | 0.66× | 235 | 508 | 2.16× | 182 | 598 | 3.29× |
| AES-192 enc | 159 | 150 | 0.94× | 224 | 522 | 2.33× | 185 | 588 | 3.18× |
| AES-192 dec | 159 | 100 | 0.63× | 202 | 486 | 2.41× | 153 | 577 | 3.77× |
| AES-256 enc | 138 | 140 | 1.01× | 192 | 455 | 2.37× | 159 | 491 | 3.09× |
| AES-256 dec | 135 | 89 | 0.66× | 171 | 424 | 2.48× | 134 | 453 | 3.38× |
As you can see, this causes a regression in Wasmtime decrypt performance due to bad JIT by Cranelift. I haven't been able to mitigate that without incurring significant throughput loss in the browser runtimes. I'm not sure whether the right approach is to eat the regression by default, or to put the SIMD behind a flag.
Can reproduce the benchmarks using wasm-harness
Would love to upstream this if possible. If so, I will open a PR.
- 主要言語
- Rust
- スター
- 787
- フォーク
- 158
- 平均マージ
- 19時間 36分
- マージ済み PR(30日)
- 2
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
RustCrypto/block-ciphers のほかの issue
-
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
RustCrypto/block-ciphers#589 · コメント 5 件 ·
-
aes
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
RustCrypto/block-ciphers#548 · コメント 1 件 ·
-
SVE AES on aarch64オープンaes
難易度 5/5 1週間以上 初心者へのやさしさ 30/100
RustCrypto/block-ciphers#485 · コメント 7 件 ·
-
Add const time column to the algorithms table and mention const time properties in each crate READMEオープン
難易度 4/5 3〜5日 初心者へのやさしさ 42/100
RustCrypto/block-ciphers#480 · リアクション 1 件 ·
-
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
RustCrypto/block-ciphers#459 · コメント 7 件 ·
RustCrypto/block-ciphers の issue をすべて見る
似ている issue
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
needs: triage type: bug
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
メンテナーはふだん 1 日以内に返信
-
area:docs documentation P3
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
Raaif-Yousuf/Wingman#837 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 80/100
メンテナーはふだん 1 日以内に返信
-
priority: medium
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
storytold/photocraft#6759 ·
メンテナーはふだん 1 日以内に返信