Compiler - Build and Test (GPU) #1556
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Compiler - Build and Test (GPU) | |
on: | |
workflow_dispatch: | |
inputs: | |
instance_id: | |
description: 'Instance ID' | |
type: string | |
instance_image_id: | |
description: 'Instance AMI ID' | |
type: string | |
instance_type: | |
description: 'Instance product type' | |
type: string | |
runner_name: | |
description: 'Action runner name' | |
type: string | |
request_id: | |
description: 'Slab request ID' | |
type: string | |
matrix_item: | |
description: 'Build matrix item' | |
type: string | |
# concurrency: | |
# group: compiler_build_and_test_gpu-${{ github.ref }} | |
# cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} | |
env: | |
DOCKER_IMAGE_TEST: ghcr.io/zama-ai/concrete-compiler | |
CUDA_PATH: /usr/local/cuda-12.3 | |
GCC_VERSION: 11 | |
jobs: | |
BuildAndTest: | |
name: Build and test compiler in EC2 with CUDA support | |
runs-on: ${{ github.event.inputs.runner_name }} | |
if: ${{ !cancelled() }} | |
steps: | |
- name: Instance configuration used | |
run: | | |
echo "IDs: ${{ inputs.instance_id }}" | |
echo "AMI: ${{ inputs.instance_image_id }}" | |
echo "Type: ${{ inputs.instance_type }}" | |
echo "Request ID: ${{ inputs.request_id }}" | |
echo "Matrix item: ${{ inputs.matrix_item }}" | |
# A SSH private key is required as some dependencies are from private repos | |
- name: Set up SSH agent | |
uses: webfactory/[email protected] | |
with: | |
ssh-private-key: ${{ secrets.CONCRETE_CI_SSH_PRIVATE }} | |
- name: Set up env | |
# "Install rust" step require root user to have a HOME directory which is not set. | |
run: | | |
echo "HOME=/home/ubuntu" >> "${GITHUB_ENV}" | |
echo "SSH_AUTH_SOCK_DIR=$(dirname $SSH_AUTH_SOCK)" >> "${GITHUB_ENV}" | |
- name: Fetch repository | |
uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
token: ${{ secrets.CONCRETE_ACTIONS_TOKEN }} | |
- name: Setup rust toolchain for concrete-cpu | |
uses: ./.github/workflows/setup_rust_toolchain_for_concrete_cpu | |
- name: Create build dir | |
run: mkdir build | |
- name: Build and test compiler | |
uses: addnab/docker-run-action@v3 | |
id: build-compiler | |
with: | |
registry: ghcr.io | |
image: ${{ env.DOCKER_IMAGE_TEST }} | |
username: ${{ secrets.GHCR_LOGIN }} | |
password: ${{ secrets.GHCR_PASSWORD }} | |
options: >- | |
-v ${{ github.workspace }}:/concrete | |
-v ${{ github.workspace }}/build:/build | |
-v ${{ github.workspace }}/wheels:/wheels | |
-v ${{ env.SSH_AUTH_SOCK }}:/ssh.socket | |
-e SSH_AUTH_SOCK=/ssh.socket | |
--gpus all | |
shell: bash | |
run: | | |
rustup toolchain install nightly-2024-01-31 | |
set -e | |
cd /concrete/compilers/concrete-compiler/compiler | |
rm -rf /build/* | |
mkdir -p /tmp/concrete_compiler/gpu_tests/ | |
make BINDINGS_PYTHON_ENABLED=OFF CCACHE=ON Python3_EXECUTABLE=$PYTHON_EXEC CUDA_SUPPORT=ON CUDA_PATH=${{ env.CUDA_PATH }} run-end-to-end-tests-gpu | |
echo "Debug: ccache statistics (after the build):" | |
ccache -s |