Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update cuda backend to the latest tfhe-rs version (0.10.0) #1178

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
181 changes: 181 additions & 0 deletions .github/workflows/concrete_compiler_benchmark_gpu.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,181 @@
name: concrete-compiler benchmark linux-gpu

on:
workflow_dispatch:
pull_request:
paths:
- .github/workflows/concrete_compiler_benchmark_gpu.yml
- backends/concrete-cuda/**
push:
branches:
- 'main'
- 'release/*'

env:
DOCKER_IMAGE_TEST: ghcr.io/zama-ai/concrete-compiler
CUDA_VERSION: 11.8
GCC_VERSION: 8
ACTION_RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
SLACK_CHANNEL: ${{ secrets.SLACK_CHANNEL }}
SLACK_USERNAME: ${{ secrets.BOT_USERNAME }}
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}

concurrency:
group: concrete_compiler_benchmark_gpu-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}

jobs:
setup-instance:
runs-on: ubuntu-latest
outputs:
runner-name: ${{ steps.start-instance.outputs.label }}
steps:
- name: Start instance
id: start-instance
uses: zama-ai/slab-github-runner@98f0788261a7323d5d695a883e20df36591a92b7 # v1.3.0
with:
mode: start
github-token: ${{ secrets.SLAB_ACTION_TOKEN }}
slab-url: ${{ secrets.SLAB_BASE_URL }}
job-secret: ${{ secrets.JOB_SECRET }}
backend: aws
profile: gpu-bench

build-and-run-benchmarks:
needs: setup-instance
runs-on: ${{ needs.setup-instance.outputs.runner-name }}
outputs:
bench_date: ${{ steps.benchmark-details.outputs.bench_date }}
commit_date: ${{ steps.benchmark-details.outputs.commit_date }}
commit_hash: ${{ steps.benchmark-details.outputs.commit_hash }}
env:
CUDA_SUPPORT: ON
CUDA_PATH: /usr/local/cuda-${{ github.env.CUDA_VERSION }}

Check failure on line 53 in .github/workflows/concrete_compiler_benchmark_gpu.yml

View workflow job for this annotation

GitHub Actions / action-lint

receiver of object dereference "cuda_version" must be type of object but got "string"

Check failure on line 53 in .github/workflows/concrete_compiler_benchmark_gpu.yml

View workflow job for this annotation

GitHub Actions / action-lint

receiver of object dereference "cuda_version" must be type of object but got "string"
CC: /usr/bin/gcc-${{ github.env.GCC_VERSION }}

Check failure on line 54 in .github/workflows/concrete_compiler_benchmark_gpu.yml

View workflow job for this annotation

GitHub Actions / action-lint

receiver of object dereference "gcc_version" must be type of object but got "string"

Check failure on line 54 in .github/workflows/concrete_compiler_benchmark_gpu.yml

View workflow job for this annotation

GitHub Actions / action-lint

receiver of object dereference "gcc_version" must be type of object but got "string"
CXX: /usr/bin/g++-${{ github.env.GCC_VERSION }}

Check failure on line 55 in .github/workflows/concrete_compiler_benchmark_gpu.yml

View workflow job for this annotation

GitHub Actions / action-lint

receiver of object dereference "gcc_version" must be type of object but got "string"

Check failure on line 55 in .github/workflows/concrete_compiler_benchmark_gpu.yml

View workflow job for this annotation

GitHub Actions / action-lint

receiver of object dereference "gcc_version" must be type of object but got "string"
CUDAHOSTCXX: /usr/bin/g++-${{ github.env.GCC_VERSION }}

Check failure on line 56 in .github/workflows/concrete_compiler_benchmark_gpu.yml

View workflow job for this annotation

GitHub Actions / action-lint

receiver of object dereference "gcc_version" must be type of object but got "string"

Check failure on line 56 in .github/workflows/concrete_compiler_benchmark_gpu.yml

View workflow job for this annotation

GitHub Actions / action-lint

receiver of object dereference "gcc_version" must be type of object but got "string"
CUDACXX: ${{ github.env.CUDA_PATH }}/bin/nvcc

Check failure on line 57 in .github/workflows/concrete_compiler_benchmark_gpu.yml

View workflow job for this annotation

GitHub Actions / action-lint

receiver of object dereference "cuda_path" must be type of object but got "string"

Check failure on line 57 in .github/workflows/concrete_compiler_benchmark_gpu.yml

View workflow job for this annotation

GitHub Actions / action-lint

receiver of object dereference "cuda_path" must be type of object but got "string"
steps:
- name: Setup GPU environment
run: |
echo "$CUDA_PATH/bin" >> "${GITHUB_PATH}"
echo "LD_LIBRARY_PATH=$CUDA_PATH/lib:$LD_LIBRARY_PATH" >> "${GITHUB_ENV}"
env
- name: Checkout concrete
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
submodules: recursive
fetch-depth: 0
- name: Ouput benchmark details
id: benchmark-details
run: |
{
echo "bench_date=$(date --iso-8601=seconds)";
echo "commit_date=$(git --no-pager show -s --format=%cd --date=iso8601-strict ${{ github.sha }})";
echo "commit_hash=$(git describe --tags --dirty)";
} >> "$GITHUB_OUTPUT"
- name: Set up home
# "Install rust" step require root user to have a HOME directory which is not set.
run: |
echo "HOME=/home/ubuntu" >> "${GITHUB_ENV}"
- name: Setup rust toolchain for concrete-cpu
uses: ./.github/actions/setup_rust_toolchain_for_concrete_cpu
- name: Build compiler benchmarks
run: |
set -e
git config --global --add safe.directory '*'
cd compilers/concrete-compiler/compiler
make BINDINGS_PYTHON_ENABLED=OFF CUDA_SUPPORT=${{ env.CUDA_SUPPORT }} build-benchmarks
- name: Run compiler benchmarks
run: |
set -e
cd compilers/concrete-compiler/compiler
make run-gpu-benchmarks
- name: Upload raw results artifact
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
with:
name: compiler-benchmarks-result
path: compilers/concrete-compiler/compiler/benchmarks_results.json
- name: Slack Notification
if: ${{ failure() && github.ref == 'refs/heads/main' }}
continue-on-error: true
uses: rtCamp/action-slack-notify@c33737706dea87cd7784c687dadc9adf1be59990
env:
SLACK_COLOR: ${{ job.status }}
SLACK_MESSAGE: "build-and-run-benchmarks finished with status: ${{ job.status }}. (${{ env.ACTION_RUN_URL }})"

parse-and-send-results:
name: Parse and send results
needs: [setup-instance, build-and-run-benchmarks]
runs-on: ${{ needs.setup-instance.outputs.runner-name }}
steps:
- name: Download compiler-benchmarks-result
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
name: compiler-benchmarks-result
- name: Parse results
shell: bash
run: |
# TODO output setup-instance (https://github.com/zama-ai/slab-github-runner/issues/38)
python3 ./ci/benchmark_parser.py benchmarks_results.json parsed_benchmark_results.json \
--database compiler_benchmarks \
--hardware "p3.8xlarge" \
--project-version ${{ needs.build-and-run-benchmarks.outputs.commit_hash}} \
--branch ${{ github.ref_name }} \
--commit-date "${{ needs.build-and-run-benchmarks.outputs.commit_date }}" \
--bench-date "${{ needs.build-and-run-benchmarks.outputs.bench_date }}" \
--throughput
- name: Upload parsed results artifact
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
with:
name: compiler-benchmarks-parsed-result
path: parsed_benchmark_results.json
- name: Checkout Slab repo
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
repository: zama-ai/slab
path: slab
token: ${{ secrets.CONCRETE_ACTIONS_TOKEN }}
- name: Send data to Slab
shell: bash
run: |
echo "Computing HMac on downloaded artifact"
SIGNATURE="$(slab/scripts/hmac_calculator.sh parsed_benchmark_results.json ${{ secrets.JOB_SECRET }})"
echo "Sending results to Slab..."
curl -v -k \
-H "Content-Type: application/json" \
-H "X-Slab-Repository: ${{ github.repository }}" \
-H "X-Slab-Command: store_data" \
-H "X-Hub-Signature-256: sha256=${SIGNATURE}" \
-d @parsed_benchmark_results.json \
${{ secrets.SLAB_URL }}
- name: Slack Notification
if: ${{ failure() && github.ref == 'refs/heads/main' }}
continue-on-error: true
uses: rtCamp/action-slack-notify@c33737706dea87cd7784c687dadc9adf1be59990
env:
SLACK_COLOR: ${{ job.status }}
SLACK_MESSAGE: "parse-and-send-results finished with status: ${{ job.status }}. (${{ env.ACTION_RUN_URL }})"

teardown-instance:
name: Teardown instance
needs: [ setup-instance, parse-and-send-results ]
if: ${{ always() && needs.setup-instance.result != 'skipped' }}
runs-on: ubuntu-latest
steps:
- name: Stop instance
id: stop-instance
uses: zama-ai/slab-github-runner@98f0788261a7323d5d695a883e20df36591a92b7 # v1.3.0
with:
mode: stop
github-token: ${{ secrets.SLAB_ACTION_TOKEN }}
slab-url: ${{ secrets.SLAB_BASE_URL }}
job-secret: ${{ secrets.JOB_SECRET }}
label: ${{ needs.setup-instance.outputs.runner-name }}
- name: Slack Notification
if: ${{ failure() }}
continue-on-error: true
uses: rtCamp/action-slack-notify@c33737706dea87cd7784c687dadc9adf1be59990
env:
SLACK_COLOR: ${{ job.status }}
SLACK_MESSAGE: "Instance teardown finished with status: ${{ job.status }}. (${{ env.ACTION_RUN_URL }})"
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,6 @@
[submodule "lattice-estimator"]
path = third_party/lattice-estimator
url = https://github.com/malb/lattice-estimator
[submodule "third_party/tfhe-rs"]
path = third_party/tfhe-rs
url = https://github.com/zama-ai/tfhe-rs.git
1 change: 1 addition & 0 deletions backends/concrete-cuda/implementation
86 changes: 0 additions & 86 deletions backends/concrete-cuda/implementation/CMakeLists.txt

This file was deleted.

3 changes: 0 additions & 3 deletions backends/concrete-cuda/implementation/CPPLINT.cfg

This file was deleted.

53 changes: 0 additions & 53 deletions backends/concrete-cuda/implementation/README.md

This file was deleted.

22 changes: 0 additions & 22 deletions backends/concrete-cuda/implementation/check_cuda.cu

This file was deleted.

7 changes: 0 additions & 7 deletions backends/concrete-cuda/implementation/format_concrete_cuda.sh

This file was deleted.

Loading
Loading