Skip to content

[WIP] Add sharded block-cyclic spilt tensor #267

[WIP] Add sharded block-cyclic spilt tensor

[WIP] Add sharded block-cyclic spilt tensor #267

# Copyright 2024 Advanced Micro Devices, Inc.
#
# Licensed under the Apache License v2.0 with LLVM Exceptions.
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
name: CI - libshortfin
on:
workflow_dispatch:
pull_request:
push:
branches:
- main
paths:
- '.github/workflows/ci_linux_x64-libshortfin.yml'
- 'libshortfin/**'
permissions:
contents: read
env:
IREE_REPO_DIR: ${{ github.workspace }}/iree
LIBSHORTFIN_DIR: ${{ github.workspace }}/libshortfin/
jobs:
build-and-test:
name: Build and test
runs-on: ubuntu-24.04
steps:
- name: Install dependencies
run: |
sudo apt update
sudo apt install clang lld cmake ninja-build
sudo apt install libspdlog-dev libxtensor-dev
- name: Checkout repository
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
submodules: false
- name: Checkout IREE repo
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
repository: iree-org/iree
path: ${{ env.IREE_REPO_DIR }}
submodules: false
ref: candidate-20240904.1006
- name: Initalize IREE submodules
run : |
cd ${{ env.IREE_REPO_DIR }}
git submodule update --init --depth 1 -- third_party/benchmark
git submodule update --init --depth 1 -- third_party/cpuinfo/
git submodule update --init --depth 1 -- third_party/flatcc
git submodule update --init --depth 1 -- third_party/googletest
git submodule update --init --depth 1 -- third_party/hip-build-deps/
- name: Setup Python
uses: actions/setup-python@39cd14951b08e74b54015e9e001cdefcf80e669f # v5.1.1
with:
python-version: "3.12"
cache: "pip"
- name: Install Python packages
# TODO: Switch to `pip install -r requirements.txt -e libshortfin/`.
run: |
pip install -r ${{ env.LIBSHORTFIN_DIR }}/requirements-tests.txt
pip install -r ${{ env.LIBSHORTFIN_DIR }}/requirements-iree-compiler.txt
pip freeze
- name: Build libshortfin (full)
run: |
mkdir ${{ env.LIBSHORTFIN_DIR }}/build
cd ${{ env.LIBSHORTFIN_DIR }}/build
cmake -GNinja \
-DCMAKE_C_COMPILER=clang-18 \
-DCMAKE_CXX_COMPILER=clang++-18 \
-DCMAKE_LINKER_TYPE=LLD \
-DSHORTFIN_BUNDLE_DEPS=ON \
-DSHORTFIN_IREE_SOURCE_DIR=${{ env.IREE_REPO_DIR }} \
-DSHORTFIN_BUILD_PYTHON_BINDINGS=ON \
..
cmake --build . --target all
pip install -v -e .
- name: Test libshortfin (full)
run: |
cd ${{ env.LIBSHORTFIN_DIR }}/build
ctest --timeout 30 --output-on-failure
cd ${{ env.LIBSHORTFIN_DIR }}
pytest -s
- name: Build libshortfin (host-only)
run: |
mkdir ${{ env.LIBSHORTFIN_DIR }}/build-host-only
cd ${{ env.LIBSHORTFIN_DIR }}/build-host-only
# In this configuration, also build static+dynamic in order to verify
# that path structurally works.
cmake -GNinja \
-DCMAKE_C_COMPILER=clang-18 \
-DCMAKE_CXX_COMPILER=clang++-18 \
-DCMAKE_LINKER_TYPE=LLD \
-DSHORTFIN_IREE_SOURCE_DIR=${{ env.IREE_REPO_DIR }} \
-DSHORTFIN_BUILD_PYTHON_BINDINGS=ON \
-DSHORTFIN_HAVE_AMDGPU=OFF \
-DSHORTFIN_BUILD_STATIC=ON \
-DSHORTFIN_BUILD_DYNAMIC=ON \
..
cmake --build . --target all