|
| 1 | +# Run all benchmarks displayed in the public documentation. |
| 2 | +name: benchmark_documentation |
| 3 | + |
| 4 | +on: |
| 5 | + workflow_dispatch: |
| 6 | + inputs: |
| 7 | + run-benchmarks: |
| 8 | + description: "Run benchmarks" |
| 9 | + type: boolean |
| 10 | + default: true |
| 11 | + generate-svgs: |
| 12 | + description: "Generate SVG tables" |
| 13 | + type: boolean |
| 14 | + default: true |
| 15 | + open-pr: |
| 16 | + description: "Open a PR with the benchmark results" |
| 17 | + type: boolean |
| 18 | + default: false |
| 19 | + |
| 20 | +permissions: {} |
| 21 | + |
| 22 | +jobs: |
| 23 | + run-benchmarks-cpu-integer: |
| 24 | + name: benchmark_documentation/run-benchmarks-cpu-integer |
| 25 | + uses: ./.github/workflows/benchmark_cpu_common.yml |
| 26 | + with: |
| 27 | + command: integer |
| 28 | + op_flavor: fast_default |
| 29 | + bench_type: both |
| 30 | + precisions_set: documentation |
| 31 | + secrets: |
| 32 | + BOT_USERNAME: ${{ secrets.BOT_USERNAME }} |
| 33 | + SLACK_CHANNEL: ${{ secrets.SLACK_CHANNEL }} |
| 34 | + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} |
| 35 | + REPO_CHECKOUT_TOKEN: ${{ secrets.REPO_CHECKOUT_TOKEN }} |
| 36 | + JOB_SECRET: ${{ secrets.JOB_SECRET }} |
| 37 | + SLAB_ACTION_TOKEN: ${{ secrets.SLAB_ACTION_TOKEN }} |
| 38 | + SLAB_URL: ${{ secrets.SLAB_URL }} |
| 39 | + SLAB_BASE_URL: ${{ secrets.SLAB_BASE_URL }} |
| 40 | + |
| 41 | + run-benchmarks-gpu-integer: |
| 42 | + name: benchmark_documentation/run-benchmarks-gpu-integer |
| 43 | + uses: ./.github/workflows/benchmark_gpu_common.yml |
| 44 | + with: |
| 45 | + profile: multi-h100-sxm5 |
| 46 | + hardware_name: n3-H100-SXM5x8 |
| 47 | + command: integer_multi_bit |
| 48 | + op_flavor: fast_default |
| 49 | + bench_type: both |
| 50 | + precisions_set: documentation |
| 51 | + secrets: |
| 52 | + BOT_USERNAME: ${{ secrets.BOT_USERNAME }} |
| 53 | + SLACK_CHANNEL: ${{ secrets.SLACK_CHANNEL }} |
| 54 | + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} |
| 55 | + REPO_CHECKOUT_TOKEN: ${{ secrets.REPO_CHECKOUT_TOKEN }} |
| 56 | + JOB_SECRET: ${{ secrets.JOB_SECRET }} |
| 57 | + SLAB_ACTION_TOKEN: ${{ secrets.SLAB_ACTION_TOKEN }} |
| 58 | + SLAB_URL: ${{ secrets.SLAB_URL }} |
| 59 | + SLAB_BASE_URL: ${{ secrets.SLAB_BASE_URL }} |
| 60 | + |
| 61 | + run-benchmarks-hpu-integer: |
| 62 | + name: benchmark_documentation/run-benchmarks-hpu-integer |
| 63 | + uses: ./.github/workflows/benchmark_hpu_common.yml |
| 64 | + with: |
| 65 | + command: integer_hpu |
| 66 | + op_flavor: default |
| 67 | + bench_type: both |
| 68 | + precisions_set: fast |
| 69 | + v80_pcie_dev: 24 |
| 70 | + v80_serial_number: XFL12NWY3ZKG |
| 71 | + secrets: |
| 72 | + BOT_USERNAME: ${{ secrets.BOT_USERNAME }} |
| 73 | + SLACK_CHANNEL: ${{ secrets.SLACK_CHANNEL }} |
| 74 | + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} |
| 75 | + REPO_CHECKOUT_TOKEN: ${{ secrets.REPO_CHECKOUT_TOKEN }} |
| 76 | + JOB_SECRET: ${{ secrets.JOB_SECRET }} |
| 77 | + SLAB_ACTION_TOKEN: ${{ secrets.SLAB_ACTION_TOKEN }} |
| 78 | + SLAB_URL: ${{ secrets.SLAB_URL }} |
| 79 | + SLAB_BASE_URL: ${{ secrets.SLAB_BASE_URL }} |
| 80 | + SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }} |
| 81 | + |
| 82 | + run-benchmarks-cpu-core-crypto: |
| 83 | + name: benchmark_documentation/run-benchmarks-cpu-core-crypto |
| 84 | + uses: ./.github/workflows/benchmark_cpu_common.yml |
| 85 | + with: |
| 86 | + command: pbs, ks_pbs |
| 87 | + bench_type: latency |
| 88 | + params_type: classical_documentation + multi_bit_documentation |
| 89 | + secrets: |
| 90 | + BOT_USERNAME: ${{ secrets.BOT_USERNAME }} |
| 91 | + SLACK_CHANNEL: ${{ secrets.SLACK_CHANNEL }} |
| 92 | + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} |
| 93 | + REPO_CHECKOUT_TOKEN: ${{ secrets.REPO_CHECKOUT_TOKEN }} |
| 94 | + JOB_SECRET: ${{ secrets.JOB_SECRET }} |
| 95 | + SLAB_ACTION_TOKEN: ${{ secrets.SLAB_ACTION_TOKEN }} |
| 96 | + SLAB_URL: ${{ secrets.SLAB_URL }} |
| 97 | + SLAB_BASE_URL: ${{ secrets.SLAB_BASE_URL }} |
| 98 | + |
| 99 | + run-benchmarks-gpu-core-crypto: |
| 100 | + name: benchmark_gpu_weekly/run-benchmarks-gpu-core-crypto |
| 101 | + uses: ./.github/workflows/benchmark_gpu_common.yml |
| 102 | + with: |
| 103 | + profile: multi-h100-sxm5 |
| 104 | + hardware_name: n3-H100-SXM5x8 |
| 105 | + command: pbs, ks_pbs |
| 106 | + bench_type: latency |
| 107 | + params_type: classical_documentation + multi_bit_documentation |
| 108 | + secrets: |
| 109 | + BOT_USERNAME: ${{ secrets.BOT_USERNAME }} |
| 110 | + SLACK_CHANNEL: ${{ secrets.SLACK_CHANNEL }} |
| 111 | + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} |
| 112 | + REPO_CHECKOUT_TOKEN: ${{ secrets.REPO_CHECKOUT_TOKEN }} |
| 113 | + JOB_SECRET: ${{ secrets.JOB_SECRET }} |
| 114 | + SLAB_ACTION_TOKEN: ${{ secrets.SLAB_ACTION_TOKEN }} |
| 115 | + SLAB_URL: ${{ secrets.SLAB_URL }} |
| 116 | + SLAB_BASE_URL: ${{ secrets.SLAB_BASE_URL }} |
| 117 | + |
| 118 | + generate-svgs-with-benchmarks-run: |
| 119 | + name: benchmark-documentation/generate-svgs-with-benchmarks-run |
| 120 | + if: inputs.run-benchmarks && inputs.generate-svgs |
| 121 | + needs: [ |
| 122 | + run-benchmarks-cpu-integer, run-benchmarks-gpu-integer, run-benchmarks-hpu-integer, |
| 123 | + run-benchmarks-cpu-core-crypto, run-benchmarks-gpu-core-crypto |
| 124 | + ] |
| 125 | + uses: ./.github/workflows/generate_svgs.yml |
| 126 | + with: |
| 127 | + time_span_days: 1 # This ensures extraction is performed on the last values stored in database/ |
| 128 | + secrets: |
| 129 | + DATA_EXTRACTOR_DATABASE_USER: ${{ secrets.DATA_EXTRACTOR_DATABASE_USER }} |
| 130 | + DATA_EXTRACTOR_DATABASE_HOST: ${{ secrets.DATA_EXTRACTOR_DATABASE_HOST }} |
| 131 | + DATA_EXTRACTOR_DATABASE_PASSWORD: ${{ secrets.DATA_EXTRACTOR_DATABASE_PASSWORD }} |
| 132 | + |
| 133 | + generate-svgs-without-benchmarks-run: |
| 134 | + name: benchmark-documentation/generate-svgs-without-benchmarks-run |
| 135 | + if: ${{ !inputs.run-benchmarks && inputs.generate-svgs }} |
| 136 | + uses: ./.github/workflows/generate_svgs.yml |
| 137 | + with: |
| 138 | + time_span_days: 60 |
| 139 | + secrets: |
| 140 | + DATA_EXTRACTOR_DATABASE_USER: ${{ secrets.DATA_EXTRACTOR_DATABASE_USER }} |
| 141 | + DATA_EXTRACTOR_DATABASE_HOST: ${{ secrets.DATA_EXTRACTOR_DATABASE_HOST }} |
| 142 | + DATA_EXTRACTOR_DATABASE_PASSWORD: ${{ secrets.DATA_EXTRACTOR_DATABASE_PASSWORD }} |
| 143 | + |
| 144 | + open-pr: |
| 145 | + name: benchmark-documentation/open-pr |
| 146 | + needs: [ generate-svgs-with-benchmarks-run, generate-svgs-without-benchmarks-run ] |
| 147 | + if: ${{ always() && inputs.open-pr && |
| 148 | + (needs.generate-svgs-with-benchmarks-run.result == 'success' || needs.generate-svgs-without-benchmarks-run.result == 'success') }} |
| 149 | + runs-on: ubuntu-latest |
| 150 | + permissions: |
| 151 | + contents: write # Needed to create a commit |
| 152 | + pull-requests: write # Needed to open a pull-request |
| 153 | + env: |
| 154 | + PATH_TO_DOC_ASSETS: tfhe/docs/.gitbook/assets |
| 155 | + steps: |
| 156 | + - name: Checkout tfhe-rs |
| 157 | + uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 |
| 158 | + with: |
| 159 | + persist-credentials: 'false' |
| 160 | + |
| 161 | + - name: Download SVG tables |
| 162 | + uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0 |
| 163 | + with: |
| 164 | + path: svg_tables |
| 165 | + merge-multiple: 'true' |
| 166 | + |
| 167 | + - name: Copy SVG tables to documentation location |
| 168 | + run: | |
| 169 | + cp -f svg_tables/*integer-benchmark*.svg "${PATH_TO_DOC_ASSETS}" |
| 170 | + cp -f svg_tables/*pbs-benchmark-tuniform*.svg "${PATH_TO_DOC_ASSETS}" |
| 171 | +
|
| 172 | + - name: Create pull-request |
| 173 | + uses: peter-evans/create-pull-request@271a8d0340265f705b14b6d32b9829c1cb33d45e # v7.0.8 |
| 174 | + with: |
| 175 | + sign-commits: true |
| 176 | + token: ${{ secrets.FHE_DIVISION_TOKEN }} # Sign commit as Zama Bot |
| 177 | + add-paths: ${{ env.PATH_TO_DOC_ASSETS }}/*.svg |
| 178 | + commit-message: | |
| 179 | + chore(docs): update benchmark results for all backends |
| 180 | + |
| 181 | + Automated documentation update from tfhe-rs CI pipeline. |
| 182 | + title: | |
| 183 | + [CI] chore(docs): update benchmark results for all backends |
| 184 | + body: | |
| 185 | + Documentation update triggered by GitHub workflow* |
| 186 | + labels: documentation |
0 commit comments