mirror of
https://github.com/zama-ai/concrete.git
synced 2026-02-08 11:35:02 -05:00
concrete-cuda(ci): first setup for the concrete-cuda ci
This commit is contained in:
130
.github/workflows/concrete_cuda_test.yml
vendored
Normal file
130
.github/workflows/concrete_cuda_test.yml
vendored
Normal file
@@ -0,0 +1,130 @@
|
||||
# Compile and test Concrete-cuda on an AWS instance
|
||||
name: AWS Cuda tests
|
||||
|
||||
on:
|
||||
workflow_call:
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
lint:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Set up Clang
|
||||
run: |
|
||||
sudo apt-get install clang-format-11
|
||||
- name: Format Concrete-cuda
|
||||
run: |
|
||||
cd backends/concrete-cuda
|
||||
./clang-format.sh
|
||||
- name: Check diff
|
||||
run: git diff --exit-code
|
||||
|
||||
start-runner:
|
||||
name: Start EC2 runner
|
||||
runs-on: ubuntu-20.04
|
||||
outputs:
|
||||
label: ${{ steps.start-ec2-runner.outputs.label }}
|
||||
ec2-instance-id: ${{ steps.start-ec2-runner.outputs.ec2-instance-id }}
|
||||
steps:
|
||||
- name: Configure AWS credentials
|
||||
uses: aws-actions/configure-aws-credentials@v1
|
||||
with:
|
||||
aws-access-key-id: ${{ secrets.AWS_IAM_ID }}
|
||||
aws-secret-access-key: ${{ secrets.AWS_IAM_KEY }}
|
||||
aws-region: us-east-1
|
||||
- name: Start EC2 runner
|
||||
id: start-ec2-runner
|
||||
uses: machulav/ec2-github-runner@v2.2.0
|
||||
with:
|
||||
mode: start
|
||||
github-token: ${{ secrets.CONCRETE_ACTIONS_TOKEN }}
|
||||
ec2-image-id: ami-0c4d39cb3dba0fcff
|
||||
ec2-instance-type: p3.2xlarge
|
||||
subnet-id: subnet-8123c9e7
|
||||
security-group-id: sg-0466d33ced960ba35
|
||||
|
||||
run-cuda-tests-linux:
|
||||
concurrency:
|
||||
group: ${{ github.head_ref }}
|
||||
cancel-in-progress: true
|
||||
name: Test code in EC2
|
||||
needs: start-runner
|
||||
runs-on: ${{ needs.start-runner.outputs.label }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
# explicit include-based build matrix, of known valid options
|
||||
matrix:
|
||||
include:
|
||||
# 20.04 supports CUDA 11.0+ (gcc >= 5 && gcc <= 10). SM < 52 deprecated since 11.0
|
||||
- os: ubuntu-20.04
|
||||
cuda: "11.3"
|
||||
cuda_arch: "70"
|
||||
gcc: 8
|
||||
env:
|
||||
CUDA_PATH: /usr/local/cuda-${{ matrix.cuda }}
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Export CUDA variables
|
||||
if: ${{ !cancelled() }}
|
||||
run: |
|
||||
echo "CUDA_PATH=$CUDA_PATH" >> "${GITHUB_ENV}"
|
||||
echo "$CUDA_PATH/bin" >> "${GITHUB_PATH}"
|
||||
echo "LD_LIBRARY_PATH=$CUDA_PATH/lib:$LD_LIBRARY_PATH" >> "${GITHUB_ENV}"
|
||||
# Specify the correct host compilers
|
||||
- name: Export gcc and g++ variables
|
||||
if: ${{ !cancelled() }}
|
||||
run: |
|
||||
echo "CC=/usr/bin/gcc-${{ matrix.gcc }}" >> "${GITHUB_ENV}"
|
||||
echo "CXX=/usr/bin/g++-${{ matrix.gcc }}" >> "${GITHUB_ENV}"
|
||||
echo "CUDAHOSTCXX=/usr/bin/g++-${{ matrix.gcc }}" >> "${GITHUB_ENV}"
|
||||
echo "CUDACXX=/usr/local/cuda-${{ matrix.cuda }}/bin/nvcc" >> "${GITHUB_ENV}"
|
||||
echo "HOME=/home/ubuntu" >> "${GITHUB_ENV}"
|
||||
- name: Build concrete-cuda
|
||||
if: ${{ !cancelled() }}
|
||||
run: |
|
||||
cd backends/concrete-cuda/implementation
|
||||
mkdir build
|
||||
cd build
|
||||
cmake ..
|
||||
make -j8
|
||||
- name: Test concrete-cuda
|
||||
if: ${{ !cancelled() }}
|
||||
run: |
|
||||
cd backends/concrete-cuda/implementation/build
|
||||
./test/test_concrete_cuda
|
||||
|
||||
- name: Slack Notification
|
||||
if: ${{ always() }}
|
||||
continue-on-error: true
|
||||
uses: rtCamp/action-slack-notify@12e36fc18b0689399306c2e0b3e0f2978b7f1ee7
|
||||
env:
|
||||
SLACK_COLOR: ${{ job.status }}
|
||||
SLACK_CHANNEL: ${{ secrets.SLACK_CHANNEL }}
|
||||
SLACK_ICON: https://pbs.twimg.com/profile_images/1274014582265298945/OjBKP9kn_400x400.png
|
||||
SLACK_MESSAGE: "Cuda AWS tests finished with status ${{ job.status }}. (${{ env.ACTION_RUN_URL }})"
|
||||
SLACK_USERNAME: ${{ secrets.BOT_USERNAME }}
|
||||
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
|
||||
|
||||
stop-runner:
|
||||
name: Stop EC2 runner
|
||||
needs:
|
||||
- start-runner
|
||||
- run-cuda-tests-linux
|
||||
runs-on: ubuntu-20.04
|
||||
if: ${{ always() && (needs.start-runner.result != 'skipped') }}
|
||||
steps:
|
||||
- name: Configure AWS credentials
|
||||
uses: aws-actions/configure-aws-credentials@v1
|
||||
with:
|
||||
aws-access-key-id: ${{ secrets.AWS_IAM_ID }}
|
||||
aws-secret-access-key: ${{ secrets.AWS_IAM_KEY }}
|
||||
aws-region: us-east-1
|
||||
- name: Stop EC2 runner
|
||||
uses: machulav/ec2-github-runner@v2.2.0
|
||||
with:
|
||||
mode: stop
|
||||
github-token: ${{ secrets.CONCRETE_ACTIONS_TOKEN }}
|
||||
label: ${{ needs.start-runner.outputs.label }}
|
||||
ec2-instance-id: ${{ needs.start-runner.outputs.ec2-instance-id }}
|
||||
17
.github/workflows/main.yml
vendored
17
.github/workflows/main.yml
vendored
@@ -19,6 +19,7 @@ jobs:
|
||||
compiler: ${{ steps.compiler.outputs.any_changed }}
|
||||
optimizer: ${{ steps.optimizer.outputs.any_changed }}
|
||||
concrete-cpu: ${{ steps.concrete-cpu.outputs.any_changed }}
|
||||
concrete-cuda: ${{ steps.concrete-cuda.outputs.any_changed }}
|
||||
test-all: ${{ steps.test-all.outputs.test-all }}
|
||||
steps:
|
||||
- name: Checkout the repository
|
||||
@@ -51,6 +52,12 @@ jobs:
|
||||
with:
|
||||
files: backends/concrete-cpu
|
||||
|
||||
- name: Get changed files in the concrete-cuda directory
|
||||
id: concrete-cpu
|
||||
uses: tj-actions/changed-files@7a453ffa2eb31a7e84f3281f88ef6d774c4d807d
|
||||
with:
|
||||
files: backends/concrete-cuda
|
||||
|
||||
- name: Set the test-all
|
||||
id: test-all
|
||||
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
|
||||
@@ -104,4 +111,12 @@ jobs:
|
||||
needs: file-change
|
||||
if: needs.file-change.outputs.concrete-cpu == 'true' || needs.file-change.outputs.test-all
|
||||
uses: ./.github/workflows/concrete_cpu_test.yml
|
||||
secrets: inherit
|
||||
secrets: inherit
|
||||
|
||||
#################################################
|
||||
# Concrete-cuda jobs ############################
|
||||
concrete-cuda:
|
||||
needs: file-change
|
||||
if: needs.file-change.outputs.concrete-cuda == 'true' || needs.file-change.outputs.test-all
|
||||
uses: ./.github/workflows/concrete_cuda_test.yml
|
||||
secrets: inherit
|
||||
|
||||
Reference in New Issue
Block a user