-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9041a72
commit a0ffc6c
Showing
2 changed files
with
112 additions
and
1 deletion.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,111 @@ | ||
name: CI HSA Linux | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
force_debug_with_tmate: | ||
type: boolean | ||
description: 'Run the build with tmate session' | ||
required: false | ||
default: false | ||
debug_with_tmate: | ||
type: boolean | ||
description: 'Run the build with a tmate session ONLY in case of failure' | ||
required: false | ||
default: false | ||
release: | ||
type: boolean | ||
description: 'Release to latest' | ||
required: false | ||
default: false | ||
pull_request: | ||
merge_group: | ||
push: | ||
branches: | ||
- amd-staging | ||
|
||
concurrency: | ||
group: ci-build-test-cpp-hsa-linux-${{ github.event.number || github.sha }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
build: | ||
name: Build HSA (linux) | ||
runs-on: nod-ai-shared-cpubuilder-manylinux-x86_64 | ||
steps: | ||
- name: Configure local git mirrors | ||
run: | | ||
/gitmirror/scripts/trigger_update_mirrors.sh | ||
/gitmirror/scripts/git_config.sh | ||
- name: "Checking out repository" | ||
env: | ||
BRANCH_NAME: ${{ github.ref }} | ||
REPO_ADDRESS: ${{ github.server_url }}/${{ github.repository }} | ||
run: | | ||
git init | ||
git remote add origin $REPO_ADDRESS | ||
git -c protocol.version=2 fetch --depth 1 origin $BRANCH_NAME | ||
git reset --hard FETCH_HEAD | ||
git -c submodule."third_party/torch-mlir".update=none -c submodule."third_party/stablehlo".update=none -c submodule."src/runtime_src/core/common/aiebu".update=none submodule update --init --recursive --depth 1 --single-branch -j 10 | ||
- name: Install deps | ||
run: | | ||
dnf install -y almalinux-release-devel | ||
yum install -y elfutils-libelf-devel p7zip p7zip-plugins \ | ||
sudo ncurses-compat-libs openssh vim-common | ||
# - name: Setup Cpp | ||
# uses: aminya/setup-cpp@v1 | ||
# with: | ||
# compiler: llvm-18 | ||
# cmake: true | ||
# ninja: true | ||
# | ||
- name: Build and install libnuma | ||
working-directory: ${{ github.workspace }}/third_party/ROCR-Runtime | ||
run: | | ||
curl --silent -L \ | ||
https://github.com/numactl/numactl/releases/download/v2.0.18/numactl-2.0.18.tar.gz \ | ||
-o numactl-2.0.18.tar.gz | ||
tar -xf numactl-2.0.18.tar.gz | ||
pushd numactl-2.0.18 | ||
./configure | ||
# i have no idea why this is necessary | ||
# but without it you get something about "can't cd into dir" | ||
sed -i '7563s/`cd "$dir" && pwd`/$dir/g' libtool | ||
make install | ||
popd | ||
- name: Hack ROCR | ||
working-directory: ${{ github.workspace }}/third_party/ROCR-Runtime | ||
run: | | ||
sed -i 's/amdgcn-amd-amdhsa/amdgcn-amd-amdhsa -nogpulib/g' runtime/hsa-runtime/core/runtime/blit_shaders/CMakeLists.txt | ||
sed -i 's/amdgcn-amd-amdhsa/amdgcn-amd-amdhsa -nogpulib/g' runtime/hsa-runtime/core/runtime/trap_handler/CMakeLists.txt | ||
sed -i 's/amdgcn-amd-amdhsa/amdgcn-amd-amdhsa -nogpulib/g' runtime/hsa-runtime/image/blit_src/CMakeLists.txt | ||
- name: Get Clang | ||
working-directory: ${{ github.workspace }}/third_party/ROCR-Runtime | ||
run: | | ||
pip download mlir==20.0.0.2024090301+amdgpu.b6597f52 -f https://makslevental.github.io/wheels | ||
unzip -q mlir-*.whl | ||
- name: Build ROCR distro | ||
working-directory: ${{ github.workspace }}/third_party/ROCR-Runtime | ||
run: | | ||
rocr_dir="$PWD" | ||
build_rocr_dir="$PWD/rocr-build" | ||
mkdir -p "$build_rocr_dir" | ||
build_rocr_dir="$(cd $build_rocr_dir && pwd)" | ||
rocr_install_dir="$PWD/rocr-install" | ||
cmake -GNinja \ | ||
-DCMAKE_BUILD_TYPE=Release \ | ||
-DCMAKE_INSTALL_PREFIX="$rocr_install_dir" \ | ||
-DClang_DIR=$PWD/mlir/lib/cmake/clang \ | ||
-DLLVM_DIR=$PWD/mlir/lib/cmake/mlir \ | ||
-DIMAGE_SUPPORT=OFF \ | ||
-S "$rocr_dir" -B "$build_rocr_dir" | ||
cmake --build "$build_rocr_dir" --target install | ||
tar -cf rocr-${GITHUB_SHA::8}.tar rocr-install |
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