feat: bump xla version #16
Workflow file for this run
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: Release | |
on: | |
push: | |
tags: | |
- "v*.*.*" | |
jobs: | |
create_draft_release: | |
if: github.ref_type == 'tag' | |
permissions: | |
contents: write | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Create draft release | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
if ! gh release list | grep -q ${{ github.ref_name }}; then | |
gh release create --title ${{ github.ref_name }} --draft ${{ github.ref_name }} | |
fi | |
linux: | |
name: "x86_64-linux-gnu-{cpu,tpu}" | |
needs: [create_draft_release] | |
permissions: | |
contents: write | |
# We intentionally build on ubuntu 20 to compile against | |
# an older version of glibc | |
runs-on: ubuntu-large | |
steps: | |
- name: Install libtool-bin | |
run: | | |
sudo apt-get update && sudo apt-get install -y libtool-bin | |
- uses: actions/checkout@v3 | |
- uses: erlef/setup-beam@v1 | |
with: | |
otp-version: "24" | |
elixir-version: "1.12.3" | |
# Setup the compilation environment | |
- uses: abhinavsingh/setup-bazel@v3 | |
with: | |
version: "6.1.2" | |
- uses: actions/setup-python@v2 | |
with: | |
python-version: "3.11" | |
- run: python -m pip install --upgrade pip numpy | |
# Build and upload the archives | |
- run: mix deps.get | |
- run: .github/scripts/compile_and_upload.sh ${{ github.ref_name }} | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
XLA_TARGET: cpu | |
- run: .github/scripts/compile_and_upload.sh ${{ github.ref_name }} | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
XLA_TARGET: tpu | |
macos: | |
name: "x86_64-darwin-cpu" | |
needs: [create_draft_release] | |
runs-on: macos-latest-large | |
steps: | |
- uses: actions/checkout@v3 | |
- run: brew install elixir | |
- run: mix local.hex --force | |
- name: use macos static | |
run: | | |
mv extension/static-lib-mac.bzl extension/static-lib.bzl | |
# Setup the compilation environment | |
- uses: abhinavsingh/setup-bazel@v3 | |
with: | |
version: "6.1.2" | |
- uses: actions/setup-python@v2 | |
with: | |
python-version: "3.11" | |
- run: python -m pip install --upgrade pip numpy | |
# Build and upload the archive | |
- run: mix deps.get | |
- run: .github/scripts/compile_and_upload.sh ${{ github.ref_name }} | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
XLA_TARGET: cpu | |
CC: gcc-9 | |
macos_arm: | |
name: "aarch64-darwin-cpu (cross-compiled)" | |
needs: [create_draft_release] | |
runs-on: macos-latest-xlarge | |
permissions: | |
contents: write | |
steps: | |
- uses: actions/checkout@v3 | |
- run: brew install elixir | |
- run: mix local.hex --force | |
- name: use macos static | |
run: | | |
mv extension/static-lib-mac.bzl extension/static-lib.bzl | |
# Setup the compilation environment | |
- uses: abhinavsingh/setup-bazel@v3 | |
with: | |
version: "6.1.2" | |
- uses: actions/setup-python@v2 | |
with: | |
python-version: "3.11" | |
- run: python -m pip install --upgrade pip numpy | |
# Build and upload the archive | |
- run: mix deps.get | |
- run: .github/scripts/compile_and_upload.sh ${{ github.ref_name }} | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
XLA_TARGET: cpu | |
XLA_TARGET_PLATFORM: "aarch64-darwin" | |
# Explicitly cross-compile for arm64 | |
BUILD_FLAGS: "--config=macos_arm64" | |
CC: gcc-9 | |
linux_cuda: | |
# Currently the build takes longer than the job time limit (6h), | |
# so we always build these off-CI | |
name: "x86_64-linux-gnu-${{ matrix.xla_target }}" | |
permissions: | |
contents: write | |
needs: [create_draft_release] | |
runs-on: ubuntu-large | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- container: nvidia/cuda:11.8.0-cudnn8-devel-ubuntu20.04 | |
xla_target: cuda118 | |
cuda_version: "11.8.0" | |
cudnn_version: "8.6.0" | |
python: "3.11" | |
- container: nvidia/cuda:12.0.0-cudnn8-devel-ubuntu20.04 | |
xla_target: cuda120 | |
cuda_version: "12.0.0" | |
cudnn_version: "8.8.0" | |
python: "3.11" | |
container: ${{ matrix.container }} | |
env: | |
# Set the missing UTF-8 locale, otherwise Elixir warns | |
LC_ALL: C.UTF-8 | |
# Make sure installing packages (like tzdata) doesn't prompt for configuration | |
DEBIAN_FRONTEND: noninteractive | |
steps: | |
# The base images are minimalistic, so we bring a few necessary system packages | |
- name: Install system packages | |
run: | | |
# We need to install "add-apt-repository" first | |
apt-get update && apt-get install -y software-properties-common | |
# Add repository with the latest git version for action/checkout to properly clone the repo | |
add-apt-repository ppa:git-core/ppa | |
# We run as root, so sudo is not necessary per se, but some actions (like setup-bazel) make use of it | |
apt-get update && apt-get install -y ca-certificates curl git sudo unzip wget libtool-bin | |
# Install GitHub CLI used by our scripts | |
curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | gpg --dearmor -o /usr/share/keyrings/githubcli-archive-keyring.gpg | |
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | tee /etc/apt/sources.list.d/github-cli.list > /dev/null | |
apt-get update && apt-get install -y gh | |
# Install a specific cuDNN version over the default one | |
cuda_version="${{ matrix.cuda_version }}" | |
cudnn_version="${{ matrix.cudnn_version }}" | |
cudnn_package_version="$(apt-cache madison libcudnn8 | grep "${cudnn_version}.*-1+cuda${cuda_version%.*}")" | |
apt-get install -y --allow-downgrades --allow-change-held-packages libcudnn8=$cudnn_package_version libcudnn8-dev=$cudnn_package_version | |
# Prevent git from checking the repository owner and erroring with "dubious ownership" | |
- run: git config --global --add safe.directory '*' | |
# Proceed with the regular steps | |
- uses: actions/checkout@v3 | |
- uses: erlef/setup-beam@v1 | |
with: | |
otp-version: "24" | |
elixir-version: "1.12.3" | |
# Setup the compilation environment | |
- uses: abhinavsingh/setup-bazel@v3 | |
with: | |
version: "6.1.2" | |
- uses: actions/setup-python@v2 | |
with: | |
python-version: ${{ matrix.python }} | |
env: | |
# Avoid permission errors for /github/home, in this case the directory | |
# is used for pip cache and is not relevant either way | |
HOME: /root | |
- run: python -m pip install --upgrade pip numpy | |
# Build and upload the archive | |
- run: mix deps.get | |
- run: .github/scripts/compile_and_upload.sh ${{ github.ref_name }} | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
XLA_TARGET: ${{ matrix.xla_target }} | |
linux_arm: | |
name: "aarch64-linux-gnu-cpu (cross-compiled)" | |
needs: [create_draft_release] | |
permissions: | |
contents: write | |
# We intentionally build on ubuntu 20 to compile against | |
# an older version of glibc | |
runs-on: ubuntu-large | |
steps: | |
- name: Install libtool-bin | |
run: | | |
sudo apt-get update && sudo apt-get install -y libtool-bin | |
- uses: actions/checkout@v3 | |
- uses: erlef/setup-beam@v1 | |
with: | |
otp-version: "24" | |
elixir-version: "1.12.3" | |
# Setup the compilation environment | |
- uses: abhinavsingh/setup-bazel@v3 | |
with: | |
version: "6.1.2" | |
- uses: actions/setup-python@v2 | |
with: | |
python-version: "3.11" | |
- run: python -m pip install --upgrade pip numpy | |
# Build and upload the archives | |
- run: mix deps.get | |
# Hide system OpenSSL as suggested in https://github.com/tensorflow/tensorflow/issues/48401#issuecomment-818377995 | |
- run: sudo mv /usr/include/openssl /usr/include/openssl.original | |
- run: .github/scripts/compile_and_upload.sh ${{ github.ref_name }} | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
XLA_TARGET: cpu | |
XLA_TARGET_PLATFORM: "aarch64-linux-gnu" | |
# Explicitly cross-compile for arm64 | |
BUILD_FLAGS: "--config=elinux_aarch64" | |
CC: gcc-9 |