From 3d783f082d6dc427954126c740c412e5aa40f951 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Test=C3=A9?= Date: Fri, 21 Feb 2025 08:42:41 +0100 Subject: [PATCH] docs: refactor and update benchmarks pages Benchmarks tables are rendered as descriptive SVG images. Sort results by backend to have a clearer view in tree of content. PBS benchmarks now display results for various p-fail and several precisions. --- .gitignore | 1 + tfhe/docs/SUMMARY.md | 10 +- ...ark_fheuint64_tuniform_2m64_ciphertext.svg | 100 +++++++ ...er_benchmark_tuniform_2m128_ciphertext.svg | 247 ++++++++++++++++++ ...ger_benchmark_tuniform_2m128_plaintext.svg | 196 ++++++++++++++ ...ger_benchmark_tuniform_2m64_ciphertext.svg | 247 ++++++++++++++++++ ...eger_benchmark_tuniform_2m64_plaintext.svg | 196 ++++++++++++++ .../cpu_pbs_benchmark_tuniform_2m128.svg | 42 +++ .../cpu_pbs_benchmark_tuniform_2m40.svg | 64 +++++ .../cpu_pbs_benchmark_tuniform_2m64.svg | 64 +++++ ...0x1_multi_bit_tuniform_2m64_ciphertext.svg | 247 ++++++++++++++++++ ...00x1_multi_bit_tuniform_2m64_plaintext.svg | 196 ++++++++++++++ ...0x2_multi_bit_tuniform_2m64_ciphertext.svg | 247 ++++++++++++++++++ ...00x2_multi_bit_tuniform_2m64_plaintext.svg | 196 ++++++++++++++ .../gpu_pbs_benchmark_tuniform_2m40.svg | 42 +++ .../gpu_pbs_benchmark_tuniform_2m64.svg | 42 +++ tfhe/docs/configuration/run_on_gpu.md | 2 +- .../benchmarks/{summary.md => README.md} | 8 +- .../getting_started/benchmarks/cpu/README.md | 12 + .../cpu_integer_operations.md} | 36 ++- .../cpu/cpu_programmable_bootstrapping.md | 42 +++ .../getting_started/benchmarks/gpu/README.md | 12 + .../benchmarks/gpu/gpu_integer_operations.md | 41 +++ .../gpu/gpu_programmable_bootstrapping.md | 29 ++ .../benchmarks/gpu_benchmarks.md | 35 --- tfhe/docs/getting_started/readme.md | 2 +- .../fine-grained-apis/shortint/parameters.md | 2 +- 27 files changed, 2293 insertions(+), 65 deletions(-) create mode 100644 tfhe/docs/_static/cpu_gpu_integer_benchmark_fheuint64_tuniform_2m64_ciphertext.svg create mode 100644 tfhe/docs/_static/cpu_integer_benchmark_tuniform_2m128_ciphertext.svg create mode 100644 tfhe/docs/_static/cpu_integer_benchmark_tuniform_2m128_plaintext.svg create mode 100644 tfhe/docs/_static/cpu_integer_benchmark_tuniform_2m64_ciphertext.svg create mode 100644 tfhe/docs/_static/cpu_integer_benchmark_tuniform_2m64_plaintext.svg create mode 100644 tfhe/docs/_static/cpu_pbs_benchmark_tuniform_2m128.svg create mode 100644 tfhe/docs/_static/cpu_pbs_benchmark_tuniform_2m40.svg create mode 100644 tfhe/docs/_static/cpu_pbs_benchmark_tuniform_2m64.svg create mode 100644 tfhe/docs/_static/gpu_integer_benchmark_h100x1_multi_bit_tuniform_2m64_ciphertext.svg create mode 100644 tfhe/docs/_static/gpu_integer_benchmark_h100x1_multi_bit_tuniform_2m64_plaintext.svg create mode 100644 tfhe/docs/_static/gpu_integer_benchmark_h100x2_multi_bit_tuniform_2m64_ciphertext.svg create mode 100644 tfhe/docs/_static/gpu_integer_benchmark_h100x2_multi_bit_tuniform_2m64_plaintext.svg create mode 100644 tfhe/docs/_static/gpu_pbs_benchmark_tuniform_2m40.svg create mode 100644 tfhe/docs/_static/gpu_pbs_benchmark_tuniform_2m64.svg rename tfhe/docs/getting_started/benchmarks/{summary.md => README.md} (60%) create mode 100644 tfhe/docs/getting_started/benchmarks/cpu/README.md rename tfhe/docs/getting_started/benchmarks/{cpu_benchmarks.md => cpu/cpu_integer_operations.md} (53%) create mode 100644 tfhe/docs/getting_started/benchmarks/cpu/cpu_programmable_bootstrapping.md create mode 100644 tfhe/docs/getting_started/benchmarks/gpu/README.md create mode 100644 tfhe/docs/getting_started/benchmarks/gpu/gpu_integer_operations.md create mode 100644 tfhe/docs/getting_started/benchmarks/gpu/gpu_programmable_bootstrapping.md delete mode 100644 tfhe/docs/getting_started/benchmarks/gpu_benchmarks.md diff --git a/.gitignore b/.gitignore index e757292b92..34faa79ce4 100644 --- a/.gitignore +++ b/.gitignore @@ -37,3 +37,4 @@ package-lock.json # Dir used for backward compatibility test data tests/tfhe-backward-compat-data/ +ci/ diff --git a/tfhe/docs/SUMMARY.md b/tfhe/docs/SUMMARY.md index 0ef4fcc78b..3845c34696 100644 --- a/tfhe/docs/SUMMARY.md +++ b/tfhe/docs/SUMMARY.md @@ -7,9 +7,13 @@ * [What is TFHE-rs?](getting_started/readme.md) * [Installation](getting_started/installation.md) * [Quick start](getting_started/quick_start.md) -* [Benchmarks](getting_started/benchmarks/summary.md) - * [CPU Benchmarks](getting_started/benchmarks/cpu_benchmarks.md) - * [GPU Benchmarks](getting_started/benchmarks/gpu_benchmarks.md) +* [Benchmarks](getting_started/benchmarks/README.md) + * [CPU Benchmarks](getting_started/benchmarks/cpu/README.md) + * [Integer](getting_started/benchmarks/cpu/cpu_integer_operations.md) + * [Programmable bootstrapping](getting_started/benchmarks/cpu/cpu_programmable_bootstrapping.md) + * [GPU Benchmarks](getting_started/benchmarks/gpu/README.md) + * [Integer](getting_started/benchmarks/gpu/gpu_integer_operations.md) + * [Programmable bootstrapping](getting_started/benchmarks/gpu/gpu_programmable_bootstrapping.md) * [Zero-knowledge proof benchmarks](getting_started/benchmarks/zk_proof_benchmarks.md) * [Security and cryptography](getting_started/security_and_cryptography.md) diff --git a/tfhe/docs/_static/cpu_gpu_integer_benchmark_fheuint64_tuniform_2m64_ciphertext.svg b/tfhe/docs/_static/cpu_gpu_integer_benchmark_fheuint64_tuniform_2m64_ciphertext.svg new file mode 100644 index 0000000000..32eca94168 --- /dev/null +++ b/tfhe/docs/_static/cpu_gpu_integer_benchmark_fheuint64_tuniform_2m64_ciphertext.svg @@ -0,0 +1,100 @@ + + + + Operation \ Size + CPU + GPU + + + + Negation (`-`) + + 106 ms + + 25.2 ms + + Add / Sub (`+`,`-`) + + 105 ms + + 25.2 ms + + Mul (`x`) + + 401 ms + + 237 ms + + Equal / Not Equal (`eq`, `ne`) + + 81.2 ms + + 17.7 ms + + Comparisons (`ge`, `gt`, `le`, `lt`) + + 102 ms + + 26.2 ms + + Max / Min (`max`,`min`) + + 145 ms + + 43.6 ms + + Bitwise operations (`&`, `|`, `^`) + + 20.7 ms + + 5.97 ms + + Div / Rem (`/`, `%`) + + 8.22 s + + 2.05 s + + Left / Right Shifts (`<<`, `>>`) + + 134 ms + + 86.7 ms + + Left / Right Rotations (`left_rotate`, `right_rotate`) + + 133 ms + + 86.8 ms + + Leading / Trailing zeros/ones + + 247 ms + + 62.3 ms + + Log2 + + 267 ms + + 73.9 ms + + + + + + + + + + + + + + + + + + + + diff --git a/tfhe/docs/_static/cpu_integer_benchmark_tuniform_2m128_ciphertext.svg b/tfhe/docs/_static/cpu_integer_benchmark_tuniform_2m128_ciphertext.svg new file mode 100644 index 0000000000..e1e50b2304 --- /dev/null +++ b/tfhe/docs/_static/cpu_integer_benchmark_tuniform_2m128_ciphertext.svg @@ -0,0 +1,247 @@ + + + + Operation \ Size + FheUint4 + FheUint8 + FheUint16 + FheUint32 + FheUint64 + FheUint128 + FheUint256 + + + + Negation (`-`) + + 33.4 ms + + 48.9 ms + + 57.4 ms + + 79.7 ms + + 105 ms + + 159 ms + + 183 ms + + Add / Sub (`+`,`-`) + + 33.5 ms + + 53.5 ms + + 59.8 ms + + 82.1 ms + + 109 ms + + 165 ms + + 187 ms + + Mul (`x`) + + 39.7 ms + + 97.5 ms + + 141 ms + + 213 ms + + 400 ms + + 1.14 s + + 3.79 s + + Equal / Not Equal (`eq`, `ne`) + + 34.3 ms + + 36.1 ms + + 56.3 ms + + 56.9 ms + + 81.4 ms + + 82.0 ms + + 104 ms + + Comparisons (`ge`, `gt`, `le`, `lt`) + + 37.4 ms + + 37.1 ms + + 54.8 ms + + 76.7 ms + + 99.0 ms + + 145 ms + + 175 ms + + Max / Min (`max`,`min`) + + 75.6 ms + + 76.9 ms + + 97.6 ms + + 121 ms + + 148 ms + + 194 ms + + 244 ms + + Bitwise operations (`&`, `|`, `^`) + + 20.2 ms + + 18.7 ms + + 19.7 ms + + 20.6 ms + + 22.9 ms + + 23.8 ms + + 26.3 ms + + Div / Rem (`/`, `%`) + + 295 ms + + 644 ms + + 1.49 s + + 3.44 s + + 8.49 s + + 20.9 s + + 54.6 s + + Left / Right Shifts (`<<`, `>>`) + + 34.7 ms + + 58.8 ms + + 81.9 ms + + 107 ms + + 142 ms + + 178 ms + + 248 ms + + Left / Right Rotations (`left_rotate`, `right_rotate`) + + 39.7 ms + + 59.7 ms + + 81.4 ms + + 107 ms + + 142 ms + + 186 ms + + 249 ms + + Leading / Trailing zeros/ones + + 77.1 ms + + 95.7 ms + + 159 ms + + 182 ms + + 255 ms + + 304 ms + + 345 ms + + Log2 + + 90.4 ms + + 114 ms + + 173 ms + + 199 ms + + 280 ms + + 327 ms + + 369 ms + + Select + + 27.8 ms + + 29.7 ms + + 32.0 ms + + 33.0 ms + + 36.1 ms + + 37.2 ms + + 49.6 ms + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tfhe/docs/_static/cpu_integer_benchmark_tuniform_2m128_plaintext.svg b/tfhe/docs/_static/cpu_integer_benchmark_tuniform_2m128_plaintext.svg new file mode 100644 index 0000000000..c9df5a9267 --- /dev/null +++ b/tfhe/docs/_static/cpu_integer_benchmark_tuniform_2m128_plaintext.svg @@ -0,0 +1,196 @@ + + + + Operation \ Size + FheUint4 + FheUint8 + FheUint16 + FheUint32 + FheUint64 + FheUint128 + FheUint256 + + + + Add / Sub (`+`,`-`) + + 33.5 ms + + 52.5 ms + + 60.6 ms + + 64.2 ms + + 89.3 ms + + 111 ms + + 181 ms + + Mul (`x`) + + 36.2 ms + + 74.8 ms + + 125 ms + + 175 ms + + 242 ms + + 453 ms + + 1.11 s + + Equal / Not Equal (`eq`, `ne`) + + 18.8 ms + + 32.2 ms + + 35.2 ms + + 55.2 ms + + 58.2 ms + + 79.0 ms + + 81.2 ms + + Comparisons (`ge`, `gt`, `le`, `lt`) + + 15.1 ms + + 37.2 ms + + 36.6 ms + + 56.0 ms + + 78.9 ms + + 101 ms + + 145 ms + + Max / Min (`max`,`min`) + + 32.9 ms + + 52.6 ms + + 57.0 ms + + 78.1 ms + + 103 ms + + 123 ms + + 171 ms + + Bitwise operations (`&`, `|`, `^`) + + 18.0 ms + + 18.9 ms + + 19.6 ms + + 21.4 ms + + 23.1 ms + + 24.1 ms + + 26.7 ms + + Div (`/`) + + 81.1 ms + + 139 ms + + 202 ms + + 280 ms + + 456 ms + + 912 ms + + 2.33 s + + Rem (`%`) + + 154 ms + + 275 ms + + 366 ms + + 536 ms + + 778 ms + + 1.37 s + + 3.13 s + + Left / Right Shifts (`<<`, `>>`) + + 22.3 ms + + 20.0 ms + + 20.3 ms + + 21.2 ms + + 23.2 ms + + 24.2 ms + + 26.5 ms + + Left / Right Rotations (`left_rotate`, `right_rotate`) + + 20.2 ms + + 19.5 ms + + 20.6 ms + + 21.1 ms + + 23.6 ms + + 24.1 ms + + 26.2 ms + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tfhe/docs/_static/cpu_integer_benchmark_tuniform_2m64_ciphertext.svg b/tfhe/docs/_static/cpu_integer_benchmark_tuniform_2m64_ciphertext.svg new file mode 100644 index 0000000000..4adbff901c --- /dev/null +++ b/tfhe/docs/_static/cpu_integer_benchmark_tuniform_2m64_ciphertext.svg @@ -0,0 +1,247 @@ + + + + Operation \ Size + FheUint4 + FheUint8 + FheUint16 + FheUint32 + FheUint64 + FheUint128 + FheUint256 + + + + Negation (`-`) + + 33.1 ms + + 48.7 ms + + 57.6 ms + + 81.2 ms + + 106 ms + + 168 ms + + 189 ms + + Add / Sub (`+`,`-`) + + 38.1 ms + + 59.9 ms + + 60.2 ms + + 82.2 ms + + 105 ms + + 168 ms + + 182 ms + + Mul (`x`) + + 40.6 ms + + 103 ms + + 143 ms + + 219 ms + + 401 ms + + 1.15 s + + 3.84 s + + Equal / Not Equal (`eq`, `ne`) + + 36.5 ms + + 37.1 ms + + 58.3 ms + + 59.0 ms + + 81.2 ms + + 82.3 ms + + 106 ms + + Comparisons (`ge`, `gt`, `le`, `lt`) + + 36.3 ms + + 37.4 ms + + 57.2 ms + + 80.1 ms + + 102 ms + + 145 ms + + 175 ms + + Max / Min (`max`,`min`) + + 79.4 ms + + 79.8 ms + + 99.8 ms + + 122 ms + + 145 ms + + 192 ms + + 246 ms + + Bitwise operations (`&`, `|`, `^`) + + 19.8 ms + + 19.4 ms + + 19.6 ms + + 20.5 ms + + 20.7 ms + + 23.3 ms + + 26.0 ms + + Div / Rem (`/`, `%`) + + 291 ms + + 693 ms + + 1.56 s + + 3.52 s + + 8.22 s + + 21.1 s + + 55.2 s + + Left / Right Shifts (`<<`, `>>`) + + 38.5 ms + + 61.2 ms + + 84.3 ms + + 109 ms + + 134 ms + + 174 ms + + 250 ms + + Left / Right Rotations (`left_rotate`, `right_rotate`) + + 40.4 ms + + 61.4 ms + + 82.6 ms + + 105 ms + + 133 ms + + 184 ms + + 259 ms + + Leading / Trailing zeros/ones + + 80.5 ms + + 100 ms + + 156 ms + + 183 ms + + 247 ms + + 298 ms + + 347 ms + + Log2 + + 100 ms + + 121 ms + + 182 ms + + 205 ms + + 267 ms + + 323 ms + + 369 ms + + Select + + 27.6 ms + + 30.9 ms + + 32.2 ms + + 33.3 ms + + 32.6 ms + + 37.2 ms + + 51.0 ms + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tfhe/docs/_static/cpu_integer_benchmark_tuniform_2m64_plaintext.svg b/tfhe/docs/_static/cpu_integer_benchmark_tuniform_2m64_plaintext.svg new file mode 100644 index 0000000000..3c9098d25a --- /dev/null +++ b/tfhe/docs/_static/cpu_integer_benchmark_tuniform_2m64_plaintext.svg @@ -0,0 +1,196 @@ + + + + Operation \ Size + FheUint4 + FheUint8 + FheUint16 + FheUint32 + FheUint64 + FheUint128 + FheUint256 + + + + Add / Sub (`+`,`-`) + + 39.8 ms + + 56.3 ms + + 61.5 ms + + 63.8 ms + + 88.4 ms + + 111 ms + + 178 ms + + Mul (`x`) + + 40.9 ms + + 80.3 ms + + 128 ms + + 173 ms + + 231 ms + + 452 ms + + 1.11 s + + Equal / Not Equal (`eq`, `ne`) + + 19.0 ms + + 38.6 ms + + 37.8 ms + + 58.5 ms + + 58.8 ms + + 81.7 ms + + 84.2 ms + + Comparisons (`ge`, `gt`, `le`, `lt`) + + 15.3 ms + + 40.9 ms + + 39.9 ms + + 57.6 ms + + 81.0 ms + + 103 ms + + 149 ms + + Max / Min (`max`,`min`) + + 32.9 ms + + 59.1 ms + + 60.0 ms + + 81.6 ms + + 103 ms + + 127 ms + + 175 ms + + Bitwise operations (`&`, `|`, `^`) + + 19.0 ms + + 19.5 ms + + 20.5 ms + + 21.0 ms + + 22.4 ms + + 23.9 ms + + 26.3 ms + + Div (`/`) + + 81.7 ms + + 149 ms + + 188 ms + + 281 ms + + 453 ms + + 844 ms + + 2.45 s + + Rem (`%`) + + 165 ms + + 278 ms + + 360 ms + + 503 ms + + 806 ms + + 1.32 s + + 2.98 s + + Left / Right Shifts (`<<`, `>>`) + + 18.8 ms + + 20.4 ms + + 20.4 ms + + 20.9 ms + + 21.8 ms + + 23.1 ms + + 26.2 ms + + Left / Right Rotations (`left_rotate`, `right_rotate`) + + 21.0 ms + + 20.2 ms + + 20.5 ms + + 21.0 ms + + 21.7 ms + + 23.0 ms + + 26.0 ms + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tfhe/docs/_static/cpu_pbs_benchmark_tuniform_2m128.svg b/tfhe/docs/_static/cpu_pbs_benchmark_tuniform_2m128.svg new file mode 100644 index 0000000000..a8077e29dd --- /dev/null +++ b/tfhe/docs/_static/cpu_pbs_benchmark_tuniform_2m128.svg @@ -0,0 +1,42 @@ + + + + Operation \ Precision(bits) + 2 + 4 + 6 + 8 + + + + PBS + + 9.61 ms + + 12.4 ms + + 111 ms + + 1.5 s + + KS - PBS + + 10.9 ms + + 14.6 ms + + 129 ms + + 1.44 s + + + + + + + + + + + + diff --git a/tfhe/docs/_static/cpu_pbs_benchmark_tuniform_2m40.svg b/tfhe/docs/_static/cpu_pbs_benchmark_tuniform_2m40.svg new file mode 100644 index 0000000000..a2d95d4eea --- /dev/null +++ b/tfhe/docs/_static/cpu_pbs_benchmark_tuniform_2m40.svg @@ -0,0 +1,64 @@ + + + + Operation \ Precision(bits) + 2 + 4 + 6 + 8 + + + + PBS + + 6.04 ms + + 11.3 ms + + 98.7 ms + + 458 ms + + MB-PBS + + 3.41 ms + + 4.58 ms + + 37.1 ms + + 156 ms + + KS - PBS + + 7.79 ms + + 14.2 ms + + 114 ms + + 536 ms + + KS - MB-PBS + + 5.53 ms + + 7.51 ms + + 47.8 ms + + 244 ms + + + + + + + + + + + + + + diff --git a/tfhe/docs/_static/cpu_pbs_benchmark_tuniform_2m64.svg b/tfhe/docs/_static/cpu_pbs_benchmark_tuniform_2m64.svg new file mode 100644 index 0000000000..1c725e2b82 --- /dev/null +++ b/tfhe/docs/_static/cpu_pbs_benchmark_tuniform_2m64.svg @@ -0,0 +1,64 @@ + + + + Operation \ Precision(bits) + 2 + 4 + 6 + 8 + + + + PBS + + 8.9 ms + + 11.8 ms + + 102 ms + + 649 ms + + MB-PBS + + 4.4 ms + + 4.43 ms + + 27.5 ms + + 248 ms + + KS - PBS + + 11.0 ms + + 14.9 ms + + 118 ms + + 873 ms + + KS - MB-PBS + + 5.97 ms + + 7.55 ms + + 44.0 ms + + 453 ms + + + + + + + + + + + + + + diff --git a/tfhe/docs/_static/gpu_integer_benchmark_h100x1_multi_bit_tuniform_2m64_ciphertext.svg b/tfhe/docs/_static/gpu_integer_benchmark_h100x1_multi_bit_tuniform_2m64_ciphertext.svg new file mode 100644 index 0000000000..8c6b9c9879 --- /dev/null +++ b/tfhe/docs/_static/gpu_integer_benchmark_h100x1_multi_bit_tuniform_2m64_ciphertext.svg @@ -0,0 +1,247 @@ + + + + Operation \ Size + FheUint4 + FheUint8 + FheUint16 + FheUint32 + FheUint64 + FheUint128 + FheUint256 + + + + Negation (`-`) + + 10.9 ms + + 11.2 ms + + 12.5 ms + + 17.7 ms + + 25.2 ms + + 51.1 ms + + 82.8 ms + + Add / Sub (`+`,`-`) + + 11.0 ms + + 11.3 ms + + 12.5 ms + + 17.7 ms + + 25.2 ms + + 51.2 ms + + 82.8 ms + + Mul (`x`) + + 18.0 ms + + 23.1 ms + + 37.2 ms + + 76.4 ms + + 237 ms + + 830 ms + + 3.24 s + + Equal / Not Equal (`eq`, `ne`) + + 7.53 ms + + 7.65 ms + + 11.5 ms + + 12.4 ms + + 17.7 ms + + 24.1 ms + + 37.7 ms + + Comparisons (`ge`, `gt`, `le`, `lt`) + + 11.1 ms + + 11.4 ms + + 15.3 ms + + 20.1 ms + + 26.2 ms + + 38.0 ms + + 58.3 ms + + Max / Min (`max`,`min`) + + 18.3 ms + + 18.9 ms + + 24.0 ms + + 30.6 ms + + 43.6 ms + + 68.5 ms + + 107 ms + + Bitwise operations (`&`, `|`, `^`) + + 3.45 ms + + 3.6 ms + + 4.01 ms + + 4.58 ms + + 5.97 ms + + 11.2 ms + + 18.9 ms + + Div / Rem (`/`, `%`) + + 78.1 ms + + 154 ms + + 318 ms + + 763 ms + + 2.05 s + + 6.35 s + + 22.8 s + + Left / Right Shifts (`<<`, `>>`) + + 17.7 ms + + 22.9 ms + + 30.4 ms + + 43.4 ms + + 86.7 ms + + 162 ms + + 280 ms + + Left / Right Rotations (`left_rotate`, `right_rotate`) + + 17.7 ms + + 22.9 ms + + 30.3 ms + + 43.4 ms + + 86.8 ms + + 162 ms + + 280 ms + + Leading / Trailing zeros/ones + + 29.0 ms + + 25.1 ms + + 33.8 ms + + 44.4 ms + + 62.3 ms + + 105 ms + + 195 ms + + Log2 + + 31.9 ms + + 35.5 ms + + 48.2 ms + + 55.2 ms + + 73.9 ms + + 113 ms + + 210 ms + + Select + + 7.16 ms + + 7.76 ms + + 8.72 ms + + 10.7 ms + + 17.5 ms + + 30.5 ms + + 48.8 ms + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tfhe/docs/_static/gpu_integer_benchmark_h100x1_multi_bit_tuniform_2m64_plaintext.svg b/tfhe/docs/_static/gpu_integer_benchmark_h100x1_multi_bit_tuniform_2m64_plaintext.svg new file mode 100644 index 0000000000..ca0624c521 --- /dev/null +++ b/tfhe/docs/_static/gpu_integer_benchmark_h100x1_multi_bit_tuniform_2m64_plaintext.svg @@ -0,0 +1,196 @@ + + + + Operation \ Size + FheUint4 + FheUint8 + FheUint16 + FheUint32 + FheUint64 + FheUint128 + FheUint256 + + + + Add / Sub (`+`,`-`) + + 11.1 ms + + 11.4 ms + + 12.6 ms + + 17.8 ms + + 25.4 ms + + 51.4 ms + + 83.1 ms + + Mul (`x`) + + 11.4 ms + + 18.1 ms + + 26.1 ms + + 46.6 ms + + 109 ms + + 330 ms + + 1.17 s + + Equal / Not Equal (`eq`, `ne`) + + 7.82 ms + + 7.81 ms + + 8.08 ms + + 12.0 ms + + 13.0 ms + + 18.8 ms + + 25.8 ms + + Comparisons (`ge`, `gt`, `le`, `lt`) + + 9.31 ms + + 9.61 ms + + 13.3 ms + + 17.4 ms + + 22.3 ms + + 29.0 ms + + 41.8 ms + + Max / Min (`max`,`min`) + + 16.5 ms + + 17.3 ms + + 21.9 ms + + 28.1 ms + + 39.7 ms + + 59.4 ms + + 90.7 ms + + Bitwise operations (`&`, `|`, `^`) + + 3.3 ms + + 3.63 ms + + 4.11 ms + + 4.65 ms + + 6.03 ms + + 11.2 ms + + 19.0 ms + + Div (`/`) + + 16.3 ms + + 28.4 ms + + 41.6 ms + + 83.7 ms + + 214 ms + + 664 ms + + 2.34 s + + Rem (`%`) + + 35.5 ms + + 56.5 ms + + 80.6 ms + + 149 ms + + 351 ms + + 1.04 s + + 3.68 s + + Left / Right Shifts (`<<`, `>>`) + + 3.49 ms + + 3.63 ms + + 4.1 ms + + 4.63 ms + + 6.03 ms + + 11.2 ms + + 19.0 ms + + Left / Right Rotations (`left_rotate`, `right_rotate`) + + 3.5 ms + + 3.63 ms + + 4.11 ms + + 4.64 ms + + 6.03 ms + + 11.3 ms + + 19.0 ms + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tfhe/docs/_static/gpu_integer_benchmark_h100x2_multi_bit_tuniform_2m64_ciphertext.svg b/tfhe/docs/_static/gpu_integer_benchmark_h100x2_multi_bit_tuniform_2m64_ciphertext.svg new file mode 100644 index 0000000000..c1c7625019 --- /dev/null +++ b/tfhe/docs/_static/gpu_integer_benchmark_h100x2_multi_bit_tuniform_2m64_ciphertext.svg @@ -0,0 +1,247 @@ + + + + Operation \ Size + FheUint4 + FheUint8 + FheUint16 + FheUint32 + FheUint64 + FheUint128 + FheUint256 + + + + Negation (`-`) + + 11.2 ms + + 11.4 ms + + 11.6 ms + + 16.4 ms + + 21.9 ms + + 36.7 ms + + 57.6 ms + + Add / Sub (`+`,`-`) + + 11.2 ms + + 11.4 ms + + 11.7 ms + + 16.4 ms + + 21.9 ms + + 36.7 ms + + 57.6 ms + + Mul (`x`) + + 18.4 ms + + 22.7 ms + + 31.3 ms + + 63.4 ms + + 164 ms + + 545 ms + + 2.11 s + + Equal / Not Equal (`eq`, `ne`) + + 7.81 ms + + 7.95 ms + + 11.6 ms + + 12.3 ms + + 16.8 ms + + 19.2 ms + + 30.2 ms + + Comparisons (`ge`, `gt`, `le`, `lt`) + + 11.6 ms + + 11.7 ms + + 15.3 ms + + 19.7 ms + + 24.6 ms + + 31.6 ms + + 45.8 ms + + Max / Min (`max`,`min`) + + 18.7 ms + + 18.9 ms + + 23.3 ms + + 28.7 ms + + 35.9 ms + + 50.0 ms + + 77.4 ms + + Bitwise operations (`&`, `|`, `^`) + + 3.52 ms + + 3.54 ms + + 3.66 ms + + 4.24 ms + + 4.82 ms + + 6.43 ms + + 12.0 ms + + Div / Rem (`/`, `%`) + + 122 ms + + 273 ms + + 580 ms + + 1.28 s + + 2.97 s + + 7.41 s + + 20.4 s + + Left / Right Shifts (`<<`, `>>`) + + 17.9 ms + + 21.8 ms + + 27.9 ms + + 36.5 ms + + 53.1 ms + + 106 ms + + 197 ms + + Left / Right Rotations (`left_rotate`, `right_rotate`) + + 17.9 ms + + 21.8 ms + + 27.9 ms + + 36.5 ms + + 53.2 ms + + 106 ms + + 197 ms + + Leading / Trailing zeros/ones + + 29.5 ms + + 25.5 ms + + 32.9 ms + + 42.9 ms + + 56.5 ms + + 78.5 ms + + 136 ms + + Log2 + + 32.6 ms + + 43.8 ms + + 57.7 ms + + 99.5 ms + + 280 ms + + 962 ms + + 4.78 s + + Select + + 7.08 ms + + 7.38 ms + + 7.98 ms + + 9.02 ms + + 11.3 ms + + 18.6 ms + + 32.8 ms + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tfhe/docs/_static/gpu_integer_benchmark_h100x2_multi_bit_tuniform_2m64_plaintext.svg b/tfhe/docs/_static/gpu_integer_benchmark_h100x2_multi_bit_tuniform_2m64_plaintext.svg new file mode 100644 index 0000000000..8e17088d70 --- /dev/null +++ b/tfhe/docs/_static/gpu_integer_benchmark_h100x2_multi_bit_tuniform_2m64_plaintext.svg @@ -0,0 +1,196 @@ + + + + Operation \ Size + FheUint4 + FheUint8 + FheUint16 + FheUint32 + FheUint64 + FheUint128 + FheUint256 + + + + Add / Sub (`+`,`-`) + + 11.2 ms + + 11.4 ms + + 11.7 ms + + 16.5 ms + + 22.0 ms + + 36.8 ms + + 57.8 ms + + Mul (`x`) + + 11.5 ms + + 18.1 ms + + 24.9 ms + + 41.7 ms + + 93.5 ms + + 271 ms + + 991 ms + + Equal / Not Equal (`eq`, `ne`) + + 8.04 ms + + 8.26 ms + + 8.53 ms + + 12.4 ms + + 13.2 ms + + 18.0 ms + + 21.3 ms + + Comparisons (`ge`, `gt`, `le`, `lt`) + + 9.6 ms + + 9.95 ms + + 13.7 ms + + 17.4 ms + + 21.7 ms + + 27.4 ms + + 35.3 ms + + Max / Min (`max`,`min`) + + 16.8 ms + + 17.0 ms + + 21.6 ms + + 26.4 ms + + 33.4 ms + + 46.2 ms + + 68.1 ms + + Bitwise operations (`&`, `|`, `^`) + + 3.41 ms + + 3.64 ms + + 3.79 ms + + 4.36 ms + + 4.91 ms + + 6.54 ms + + 12.1 ms + + Div (`/`) + + 15.7 ms + + 26.7 ms + + 39.4 ms + + 71.8 ms + + 176 ms + + 544 ms + + 1.99 s + + Rem (`%`) + + 36.4 ms + + 56.9 ms + + 77.4 ms + + 131 ms + + 292 ms + + 839 ms + + 2.97 s + + Left / Right Shifts (`<<`, `>>`) + + 3.54 ms + + 3.55 ms + + 3.7 ms + + 4.28 ms + + 4.82 ms + + 6.45 ms + + 11.9 ms + + Left / Right Rotations (`left_rotate`, `right_rotate`) + + 3.54 ms + + 3.55 ms + + 3.71 ms + + 4.28 ms + + 4.82 ms + + 6.46 ms + + 12.0 ms + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tfhe/docs/_static/gpu_pbs_benchmark_tuniform_2m40.svg b/tfhe/docs/_static/gpu_pbs_benchmark_tuniform_2m40.svg new file mode 100644 index 0000000000..44f5e2c11e --- /dev/null +++ b/tfhe/docs/_static/gpu_pbs_benchmark_tuniform_2m40.svg @@ -0,0 +1,42 @@ + + + + Operation \ Precision(bits) + 2 + 4 + 6 + 8 + + + + MB-PBS + + 3.2 ms + + 4.03 ms + + 22.1 ms + + N/A + + KS - MB-PBS + + 3.22 ms + + 4.02 ms + + 22.2 ms + + N/A + + + + + + + + + + + + diff --git a/tfhe/docs/_static/gpu_pbs_benchmark_tuniform_2m64.svg b/tfhe/docs/_static/gpu_pbs_benchmark_tuniform_2m64.svg new file mode 100644 index 0000000000..fa46b52104 --- /dev/null +++ b/tfhe/docs/_static/gpu_pbs_benchmark_tuniform_2m64.svg @@ -0,0 +1,42 @@ + + + + Operation \ Precision(bits) + 2 + 4 + 6 + 8 + + + + MB-PBS + + 3.38 ms + + 4.22 ms + + 23.0 ms + + N/A + + KS - MB-PBS + + 3.38 ms + + 4.22 ms + + 23.1 ms + + N/A + + + + + + + + + + + + diff --git a/tfhe/docs/configuration/run_on_gpu.md b/tfhe/docs/configuration/run_on_gpu.md index af1f1f1290..bfab3c2ea8 100644 --- a/tfhe/docs/configuration/run_on_gpu.md +++ b/tfhe/docs/configuration/run_on_gpu.md @@ -164,7 +164,7 @@ TFHE-rs supports platforms with multiple GPUs. There is **nothing to change in t ## Benchmark -Please refer to the [GPU benchmarks](../getting_started/benchmarks/gpu_benchmarks.md) for detailed performance benchmark results. +Please refer to the [GPU benchmarks](../getting_started/benchmarks/gpu/README.md) for detailed performance benchmark results. ## Warning diff --git a/tfhe/docs/getting_started/benchmarks/summary.md b/tfhe/docs/getting_started/benchmarks/README.md similarity index 60% rename from tfhe/docs/getting_started/benchmarks/summary.md rename to tfhe/docs/getting_started/benchmarks/README.md index 5652084e9f..dfa02a36a4 100644 --- a/tfhe/docs/getting_started/benchmarks/summary.md +++ b/tfhe/docs/getting_started/benchmarks/README.md @@ -1,8 +1,8 @@ # Benchmarks -This document summarizes the timings of some homomorphic operations over 64-bit encrypted integers, depending on the hardware. More details are given for [the CPU](cpu\_benchmarks.md), [the GPU](gpu\_benchmarks.md), or [zeros-knowledge proofs](zk\_proof\_benchmarks.md). +This document summarizes the timings of some homomorphic operations over 64-bit encrypted integers, depending on the hardware. More details are given for [the CPU](cpu/README.md), [the GPU](gpu/README.md), or [zeros-knowledge proofs](zk_proof_benchmarks.md). -The cryptographic parameters used for benchmarking follow a tweaked uniform (TUniform) noise distribution instead of a Gaussian. The main advantage of this distribution is to be bounded, whereas the usual Gaussian one is not. In some practical cases, this can simplify the use of homomorphic computation. See the [noise section](../security\_and\_cryptography.md#noise) of the Security and cryptography documentation page for more information on the noise distributions. +The cryptographic parameters used for benchmarking follow a tweaked uniform (TUniform) noise distribution instead of a Gaussian. The main advantage of this distribution is to be bounded, whereas the usual Gaussian one is not. In some practical cases, this can simplify the use of homomorphic computation. See the [noise section](../security_and_cryptography.md#noise) of the Security and cryptography documentation page for more information on the noise distributions. You can get the parameters used for benchmarks by cloning the repository and checking out the commit you want to use (starting with the v0.8.0 release) and run the following make command: @@ -10,6 +10,6 @@ You can get the parameters used for benchmarks by cloning the repository and che make print_doc_bench_parameters ``` -### Operation time (ms) over FheUint 64 +### Operation time over FheUint 64 -{% embed url="https://docs.google.com/spreadsheets/d/1OMdGSakEUbIFSEQKhAinTolJjvmPBbafi3DEe3UfzsQ/edit?usp=sharing" %} +![Click to enlarge](../../_static/cpu_gpu_integer_benchmark_fheuint64_tuniform_2m64_ciphertext.svg) diff --git a/tfhe/docs/getting_started/benchmarks/cpu/README.md b/tfhe/docs/getting_started/benchmarks/cpu/README.md new file mode 100644 index 0000000000..2b832eee04 --- /dev/null +++ b/tfhe/docs/getting_started/benchmarks/cpu/README.md @@ -0,0 +1,12 @@ +# Benchmarks over CPU + +This document details the CPU performance benchmarks of homomorphic operations using **TFHE-rs**. + +By their nature, homomorphic operations run slower than their cleartext equivalents. + +{% hint style="info" %} +All CPU benchmarks were launched on an `AWS hpc7a.96xlarge` instance equipped with an `AMD EPYC 9R14 CPU @ 2.60GHz` and 740GB of RAM. +{% endhint %} + +* [Integer operations](cpu_integer_operations.md) +* [Programmable Bootstrapping](cpu_programmable_bootstrapping.md) diff --git a/tfhe/docs/getting_started/benchmarks/cpu_benchmarks.md b/tfhe/docs/getting_started/benchmarks/cpu/cpu_integer_operations.md similarity index 53% rename from tfhe/docs/getting_started/benchmarks/cpu_benchmarks.md rename to tfhe/docs/getting_started/benchmarks/cpu/cpu_integer_operations.md index 0827d056ad..838da2813c 100644 --- a/tfhe/docs/getting_started/benchmarks/cpu_benchmarks.md +++ b/tfhe/docs/getting_started/benchmarks/cpu/cpu_integer_operations.md @@ -1,36 +1,38 @@ -# CPU Benchmarks +# Integer Operations over CPU -This document details the CPU performance benchmarks of homomorphic operations using **TFHE-rs**. +This document details the CPU performance benchmarks of homomorphic operations on integers using **TFHE-rs**. -By their nature, homomorphic operations run slower than their cleartext equivalents. The following are the timings for basic operations, including benchmarks from other libraries for comparison. +By their nature, homomorphic operations run slower than their cleartext equivalents. {% hint style="info" %} All CPU benchmarks were launched on an `AWS hpc7a.96xlarge` instance equipped with an `AMD EPYC 9R14 CPU @ 2.60GHz` and 740GB of RAM. {% endhint %} -## Integer operations - The following tables benchmark the execution time of some operation sets using `FheUint` (unsigned integers). The `FheInt` (signed integers) performs similarly. -The next table shows the operation timings on CPU when all inputs are encrypted +## Pfail: $$2^{-64}$$ + +The next table shows the operation timings on CPU when all inputs are encrypted: -{% embed url="https://docs.google.com/spreadsheets/d/1b_-72ArnSdaqfr-gJOnMmVdcBokYZohnylO4LUj2PMw/edit?usp=sharing" %} +![Click to enlarge](../../../_static/cpu_integer_benchmark_tuniform_2m64_ciphertext.svg) The next table shows the operation timings on CPU when the left input is encrypted and the right is a clear scalar of the same size: -{% embed url="https://docs.google.com/spreadsheets/d/1m3tjCi_2GSIHop2zZLAtVbhdDn5wqTGd2lOA3CcJe-U/edit?usp=sharing" %} +![Click to enlarge](../../../_static/cpu_integer_benchmark_tuniform_2m64_plaintext.svg) -All timings are based on parallelized Radix-based integer operations where each block is encrypted using the default parameters `PARAM_MESSAGE_2_CARRY_2_KS_PBS`. To ensure predictable timings, we perform operations in the `default` mode, which ensures that the input and output encoding are similar (i.e., the carries are always emptied). +## Pfail: $$2^{-128}$$ + +The next table shows the operation timings on CPU when all inputs are encrypted: -You can minimize operational costs by selecting from 'unchecked', 'checked', or 'smart' modes from [the fine-grained APIs](../../references/fine-grained-apis/quick_start.md), each balancing performance and correctness differently. For more details about parameters, see [here](../../references/fine-grained-apis/shortint/parameters.md). You can find the benchmark results on GPU for all these operations [here](../../configuration/run_on_gpu.md#benchmarks). +![Click to enlarge](../../../_static/cpu_integer_benchmark_tuniform_2m128_ciphertext.svg) -## Programmable bootstrapping +The next table shows the operation timings on CPU when the left input is encrypted and the right is a clear scalar of the same size: -The next table shows the execution time of a keyswitch followed by a programmable bootstrapping depending on the precision of the input message. The associated parameter set is given. The configuration is Concrete FFT + AVX-512. +![Click to enlarge](../../../_static/cpu_integer_benchmark_tuniform_2m128_plaintext.svg) -Note that these benchmarks use Gaussian parameters. +All timings are based on parallelized Radix-based integer operations where each block is encrypted using the default parameters `PARAM_MESSAGE_2_CARRY_2_KS_PBS`. To ensure predictable timings, we perform operations in the `default` mode, which ensures that the input and output encoding are similar (i.e., the carries are always emptied). -{% embed url="https://docs.google.com/spreadsheets/d/1o6MWpbzbYhDs3Pnoq-2hlNEgO9G8wGR5niW-OOZ6c_4/edit?usp=sharing" %} +You can minimize operational costs by selecting from 'unchecked', 'checked', or 'smart' modes from [the fine-grained APIs](../../../references/fine-grained-apis/quick_start.md), each balancing performance and correctness differently. For more details about parameters, see [here](../../../references/fine-grained-apis/shortint/parameters.md). You can find the benchmark results on GPU for all these operations [here](../../../configuration/run_on_gpu.md#benchmark). ## Reproducing TFHE-rs benchmarks @@ -43,12 +45,6 @@ AVX512 is now enabled by default for benchmarks when available The following example shows how to reproduce **TFHE-rs** benchmarks: ```shell -#Boolean benchmarks: -make bench_boolean - #Integer benchmarks: make bench_integer - -#Shortint benchmarks: -make bench_shortint ``` diff --git a/tfhe/docs/getting_started/benchmarks/cpu/cpu_programmable_bootstrapping.md b/tfhe/docs/getting_started/benchmarks/cpu/cpu_programmable_bootstrapping.md new file mode 100644 index 0000000000..08fb51f9d0 --- /dev/null +++ b/tfhe/docs/getting_started/benchmarks/cpu/cpu_programmable_bootstrapping.md @@ -0,0 +1,42 @@ +# Programmable bootstrapping over CPU + +This document details the CPU performance benchmarks of programmable bootstrapping and keyswitch operations using **TFHE-rs**. + +{% hint style="info" %} +All CPU benchmarks were launched on an `AWS hpc7a.96xlarge` instance equipped with an `AMD EPYC 9R14 CPU @ 2.60GHz` and 740GB of RAM. +{% endhint %} + +The next tables show the execution time of a single programmable bootstrapping as well as keyswitch followed by a programmable bootstrapping depending on the precision of the input message. The associated parameters set are given. The configuration is tfhe-fft + AVX-512. + +Note that these benchmarks use Gaussian parameters. `MB-PBS` stands for multi-bit programmable bootstrapping. + + +## P-fail: $$2^{-40}$$ + +![Click to enlarge](../../../_static/cpu_pbs_benchmark_tuniform_2m40.svg) + +## P-fail: $$2^{-64}$$ + +![Click to enlarge](../../../_static/cpu_pbs_benchmark_tuniform_2m64.svg) + +## P-fail: $$2^{-128}$$ + +![Click to enlarge](../../../_static/cpu_pbs_benchmark_tuniform_2m128.svg) + +## Reproducing TFHE-rs benchmarks + +**TFHE-rs** benchmarks can be easily reproduced from the [source](https://github.com/zama-ai/tfhe-rs). + +{% hint style="info" %} +AVX512 is now enabled by default for benchmarks when available +{% endhint %} + +The following example shows how to reproduce **TFHE-rs** benchmarks: + +```shell +#PBS benchmarks: +make bench_pbs + +#KS-PBS benchmarks: +make bench_ks_pbs +``` diff --git a/tfhe/docs/getting_started/benchmarks/gpu/README.md b/tfhe/docs/getting_started/benchmarks/gpu/README.md new file mode 100644 index 0000000000..e242a64c8e --- /dev/null +++ b/tfhe/docs/getting_started/benchmarks/gpu/README.md @@ -0,0 +1,12 @@ +# Benchmarks over GPU + +This document details the GPU performance benchmarks of homomorphic operations using **TFHE-rs**. + +By their nature, homomorphic operations run slower than their cleartext equivalents. + +{% hint style="info" %} +All CPU benchmarks were launched on H100 GPUs, and rely on the multithreaded PBS algorithm. +{% endhint %} + +* [Integer operations](gpu_integer_operations.md) +* [Programmable Bootstrapping](gpu_programmable_bootstrapping.md) diff --git a/tfhe/docs/getting_started/benchmarks/gpu/gpu_integer_operations.md b/tfhe/docs/getting_started/benchmarks/gpu/gpu_integer_operations.md new file mode 100644 index 0000000000..ae7a71fd4c --- /dev/null +++ b/tfhe/docs/getting_started/benchmarks/gpu/gpu_integer_operations.md @@ -0,0 +1,41 @@ +# Integer Operations over GPU + +This document details the GPU performance benchmarks of homomorphic operations on integers using **TFHE-rs**. + +{% hint style="info" %} +All CPU benchmarks were launched on H100 GPUs, and rely on the multithreaded PBS algorithm. +{% endhint %} + +The cryptographic parameters `PARAM_GPU_MULTI_BIT_MESSAGE_2_CARRY_2_GROUP_3_KS_PBS` were used. + +## 1xH100 +Below come the results for the execution on a single H100. +The following table shows the performance when the inputs of the benchmarked operation are encrypted: + +![Click to enlarge](../../../_static/gpu_integer_benchmark_h100x1_multi_bit_tuniform_2m64_ciphertext.svg) + +The following table shows the performance when the left input of the benchmarked operation is encrypted and the other is a clear scalar of the same size: + +![Click to enlarge](../../../_static/gpu_integer_benchmark_h100x1_multi_bit_tuniform_2m64_plaintext.svg) + +## 2xH100 + +Below come the results for the execution on two H100's. +The following table shows the performance when the inputs of the benchmarked operation are encrypted: + +![Click to enlarge](../../../_static/gpu_integer_benchmark_h100x2_multi_bit_tuniform_2m64_ciphertext.svg) + +The following table shows the performance when the left input of the benchmarked operation is encrypted and the other is a clear scalar of the same size: + +![Click to enlarge](../../../_static/gpu_integer_benchmark_h100x2_multi_bit_tuniform_2m64_plaintext.svg) + +## Reproducing TFHE-rs benchmarks + +**TFHE-rs** benchmarks can be easily reproduced from the [source](https://github.com/zama-ai/tfhe-rs). + +The following example shows how to reproduce **TFHE-rs** benchmarks: + +```shell +#Integer benchmarks: +make bench_integer_gpu +``` diff --git a/tfhe/docs/getting_started/benchmarks/gpu/gpu_programmable_bootstrapping.md b/tfhe/docs/getting_started/benchmarks/gpu/gpu_programmable_bootstrapping.md new file mode 100644 index 0000000000..612c2424a8 --- /dev/null +++ b/tfhe/docs/getting_started/benchmarks/gpu/gpu_programmable_bootstrapping.md @@ -0,0 +1,29 @@ +# Programmable bootstrapping over GPU + +This document details the GPU performance benchmarks of programmable bootstrapping and keyswitch operations using **TFHE-rs**. + +{% hint style="info" %} +All CPU benchmarks were launched on H100 GPUs, and rely on the multithreaded PBS algorithm with a grouping factor set to 3. +{% endhint %} + +## P-fail: $$2^{-40}$$ + +![Click to enlarge](../../../_static/gpu_pbs_benchmark_tuniform_2m40.svg) + +## P-fail: $$2^{-64}$$ + +![Click to enlarge](../../../_static/gpu_pbs_benchmark_tuniform_2m64.svg) + +## Reproducing TFHE-rs benchmarks + +**TFHE-rs** benchmarks can be easily reproduced from the [source](https://github.com/zama-ai/tfhe-rs). + +The following example shows how to reproduce **TFHE-rs** benchmarks: + +```shell +#PBS benchmarks: +make bench_pbs_gpu + +#KS-PBS benchmarks: +make bench_ks_pbs_gpu +``` diff --git a/tfhe/docs/getting_started/benchmarks/gpu_benchmarks.md b/tfhe/docs/getting_started/benchmarks/gpu_benchmarks.md deleted file mode 100644 index 4674a47f3e..0000000000 --- a/tfhe/docs/getting_started/benchmarks/gpu_benchmarks.md +++ /dev/null @@ -1,35 +0,0 @@ -# GPU Benchmarks - -This document details the GPU performance benchmarks of homomorphic operations using **TFHE-rs**. - -All GPU benchmarks presented here were obtained on H100 GPUs, and rely on the multithreaded PBS algorithm. The cryptographic parameters `PARAM_GPU_MULTI_BIT_MESSAGE_2_CARRY_2_GROUP_3_KS_PBS` were used. - -## 1xH100 -Below come the results for the execution on a single H100. -The following table shows the performance when the inputs of the benchmarked operation are encrypted: - -{% embed url="https://docs.google.com/spreadsheets/d/1xGWykMa8fZ7RWUjkCl-52FJ-BNge8cB-5CSHrVZ6XRo/edit?usp=sharing" %} - -The following table shows the performance when the left input of the benchmarked operation is encrypted and the other is a clear scalar of the same size: - -{% embed url="https://docs.google.com/spreadsheets/d/1MZfE9c-cQw3yAP55tu0i8uLl4lTAiH9zW3gRFp0ve7s/edit?usp=sharing" %} - -## 2xH100 - -Below come the results for the execution on two H100's. -The following table shows the performance when the inputs of the benchmarked operation are encrypted: - -{% embed url="https://docs.google.com/spreadsheets/d/1bcL0wgFk-cfR4asGSCWDFt7JaqDYJT-l4pH58A-yBkc/edit?usp=sharing" %} - - -The following table shows the performance when the left input of the benchmarked operation is encrypted and the other is a clear scalar of the same size: - -{% embed url="https://docs.google.com/spreadsheets/d/1_8VIoStixns22lQq_RBSjVm-0iFHjJpntQTrvEHZpSg/edit?usp=sharing" %} - -## Programmable bootstrapping - -The next table shows the execution time of a keyswitch followed by a programmable bootstrapping depending on the precision of the input message. The associated parameter set is given. - -Note that these benchmarks use Gaussian parameters. - -{% embed url="https://docs.google.com/spreadsheets/d/1KhElQ7sIsShUSVQw5bKFoP-x5BgMaWh1pZtrVAdC3T4/edit?usp=sharing" %} diff --git a/tfhe/docs/getting_started/readme.md b/tfhe/docs/getting_started/readme.md index 830769c49b..a1a77f66c0 100644 --- a/tfhe/docs/getting_started/readme.md +++ b/tfhe/docs/getting_started/readme.md @@ -34,7 +34,7 @@ FHE allows to compute on ciphertexts without revealing the content of the messag Zama's variant of TFHE is a fully homomorphic scheme that takes fixed-precision numbers as messages. It implements all homomorphic operations needed, such as addition and function evaluation via Programmable Bootstrapping. -Refer to the the [preliminary whitepaper](https://whitepaper.zama.ai/) for more details. +Refer to the [preliminary whitepaper](https://whitepaper.zama.ai/) for more details. Using **TFHE-rs** in Rust includes the following steps: diff --git a/tfhe/docs/references/fine-grained-apis/shortint/parameters.md b/tfhe/docs/references/fine-grained-apis/shortint/parameters.md index 22b8b78f01..925d3dbe27 100644 --- a/tfhe/docs/references/fine-grained-apis/shortint/parameters.md +++ b/tfhe/docs/references/fine-grained-apis/shortint/parameters.md @@ -34,7 +34,7 @@ fn main() { ## Impact of parameters on the operations -As shown [here](../../../getting\_started/benchmarks/cpu\_benchmarks.md), the choice of the parameter set impacts the operations available and their efficiency. +As shown [here](../../../getting_started/benchmarks/cpu/README.md), the choice of the parameter set impacts the operations available and their efficiency. ### Generic bi-variate functions.