Skip to content
This repository has been archived by the owner on Nov 5, 2024. It is now read-only.

Commit

Permalink
Xrt loading (#8)
Browse files Browse the repository at this point in the history
  • Loading branch information
makslevental authored May 15, 2024
1 parent 16d74a1 commit e118a00
Show file tree
Hide file tree
Showing 36 changed files with 1,984 additions and 771 deletions.
47 changes: 44 additions & 3 deletions .github/workflows/base/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,19 @@ inputs:
ARCH:
description: 'matrix.arch'
required: true
PY_VERSION:
description: 'matrix.py_version'
required: true

description: ''

outputs:
BOOST_ROOT:
description: ''
value: ${{ steps.install_boost.outputs.BOOST_ROOT }}
BOOST_VERSION:
description: ''
value: 1.74.0

runs:
using: "composite"
Expand All @@ -22,12 +28,16 @@ runs:
uses: aminya/setup-cpp@v1
with:
compiler: gcc
vcvarsall: ${{ contains(inputs.OS, 'windows') }}
vcvarsall: ${{ contains(inputs.OS, 'windows') }} # evaluate to the string 'true'
msvc: ${{ contains(inputs.OS, 'windows') }}
choco: ${{ contains(inputs.OS, 'windows') }}
cmake: true
ninja: true

- uses: actions/setup-python@v4
with:
python-version: ${{ inputs.PY_VERSION }}

- uses: makslevental/mlir-wheels/actions/setup_ccache@d77bf5dc69c46a8c2738b44528749768888eb361
id: setup_ccache
with:
Expand All @@ -36,8 +46,39 @@ runs:
WORKSPACE_ROOT: ${{ github.workspace }}

- name: Install boost for XRT
if: contains(inputs.OS, 'windows') || contains(inputs.OS, 'ubuntu')
uses: MarkusJx/[email protected]
id: install_boost
with:
boost_version: 1.73.0
boost_version: 1.74.0

- name: Build and install system deps
shell: bash
run: |
if [ ${{ inputs.OS }} == 'windows-2019' ]; then
choco install -y pkgconfiglite protoc
else
sudo apt install -y libdrm-dev ocl-icd-opencl-dev rapidjson-dev libprotobuf-dev systemtap-sdt-dev uuid-dev python3-dev
fi
- name: Remove path limit and export VCTOOLSVERSION
if: contains(inputs.OS, 'windows')
shell: pwsh
run: |
pwsh.exe .\util\remove_path_limit.ps1
- name: export VCTOOLSVERSION
if: contains(inputs.OS, 'windows')
shell: bash
run: |
VCTOOLSVERSION=${VCTOOLSVERSION:0:4}
echo "VCTOOLSVERSION=$VCTOOLSVERSION" >> $GITHUB_ENV
- name: Install python deps
shell: bash
run: |
ls -lah
pip install -r requirements-dev.txt
65 changes: 22 additions & 43 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,20 +20,21 @@ jobs:
strategy:
fail-fast: false
matrix:
OS: [ ubuntu-20.04, windows-2019, macos-12 ]
OS: [ ubuntu-20.04, windows-2019 ]
PY_VERSION: [ "3.8", "3.9", "3.10", "3.11", "3.12" ]

defaults:
run:
shell: bash

steps:

- name: Checkout actions
uses: actions/checkout@v3
with:
submodules: true

- name: Get ELFIO
- name: Get Submodules
run: |
git submodule update --init --recursive
Expand All @@ -43,29 +44,18 @@ jobs:
with:
OS: ${{ matrix.OS }}
ARCH: ${{ matrix.ARCH }}

- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.PY_VERSION }}

- name: Build and install protoc
if: contains(matrix.OS, 'windows') || contains(matrix.OS, 'ubuntu')
run: |
if [ ${{ matrix.OS }} == 'windows-2019' ]; then
choco install -y pkgconfiglite protoc
else
sudo apt install libdrm-dev ocl-icd-opencl-dev rapidjson-dev libprotobuf-dev systemtap-sdt-dev
fi
PY_VERSION: ${{ matrix.PY_VERSION }}

- name: build wheel
env:
BOOST_ROOT: ${{ steps.base.outputs.BOOST_ROOT }}
BOOST_VERSION: 1.73.0
BOOST_VERSION: ${{ steps.base.outputs.BOOST_VERSION }}
run: |
pip install -r requirements-dev.txt
pip wheel . -v -w wheelhouse --no-build-isolation
REPO_SRC_DIR=$PWD bash patches/apply_patches.sh
CIBW_BUILD=${{ matrix.PY_VERSION }}
export CIBW_BUILD="cp${CIBW_BUILD//./}-*"
cibuildwheel --output-dir wheelhouse
- name: test
run: |
Expand All @@ -82,9 +72,9 @@ jobs:
- name: Test mwe
shell: bash
run: |
pushd examples
python e2e.py
python cdo.py
popd
test-linux-aarch64:
Expand All @@ -97,51 +87,39 @@ jobs:
PY_VERSION: [ "3.8", "3.9", "3.10", "3.11", "3.12" ]

steps:

- name: Checkout actions
uses: actions/checkout@v3
with:
submodules: true

- name: Get ELFIO
- name: Get Submodules
run: |
git submodule update --init --recursive
- name: Setup Cpp
uses: aminya/setup-cpp@v1
with:
compiler: gcc
cmake: true
ninja: true

- name: Set up QEMU
uses: docker/setup-qemu-action@v2
with:
platforms: aarch64

- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.PY_VERSION }}

- uses: ./.github/workflows/base
id: base
with:
OS: ${{ matrix.OS }}
ARCH: ${{ matrix.ARCH }}

- name: Install XRT deps
run: |
sudo apt install libdrm-dev ocl-icd-opencl-dev rapidjson-dev libprotobuf-dev systemtap-sdt-dev
PY_VERSION: ${{ matrix.PY_VERSION }}

- name: build wheel
env:
BOOST_ROOT: ${{ steps.base.outputs.BOOST_ROOT }}
BOOST_VERSION: 1.73.0
BOOST_VERSION: ${{ steps.base.outputs.BOOST_VERSION }}
run: |
pip install -r requirements-dev.txt
pip wheel . -v -w wheelhouse --no-build-isolation
REPO_SRC_DIR=$PWD bash patches/apply_patches.sh
CIBW_BUILD=${{ matrix.PY_VERSION }}
export CIBW_BUILD="cp${CIBW_BUILD//./}-*"
cibuildwheel --output-dir wheelhouse
- name: test
run: |
Expand All @@ -154,7 +132,8 @@ jobs:
- name: Test mwe
shell: bash
run: |
export LD_LIBRARY_PATH=/opt/xilinx/xrt/lib
pushd examples
python e2e.py
python cdo.py
popd
57 changes: 30 additions & 27 deletions .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ on:
push:
branches:
- main
pull_request:
types: [assigned, opened, synchronize, reopened]

concurrency:
group: test-${{ github.event.number || github.sha }}
cancel-in-progress: true

jobs:

Expand All @@ -23,12 +29,6 @@ jobs:
- OS: windows-2019
ARCH: AMD64

- OS: macos-12
ARCH: x86_64

- OS: macos-12
ARCH: arm64

defaults:
run:
shell: bash
Expand All @@ -40,34 +40,29 @@ jobs:
with:
submodules: true

- name: Get ELFIO
- name: Get Submodules
run: |
git submodule update --init --recursive
- uses: ./.github/workflows/base
if: contains(matrix.OS, 'windows')
id: base
with:
OS: ${{ matrix.OS }}
ARCH: ${{ matrix.ARCH }}

- name: Build and install protoc
if: contains(matrix.OS, 'windows')
run: |
choco install -y pkgconfiglite protoc
PY_VERSION: '3.10'

# build

- name: cibuildwheel python bindings
env:
BOOST_ROOT: ${{ steps.base.outputs.BOOST_ROOT }}
BOOST_VERSION: 1.73.0
BOOST_VERSION: ${{ steps.base.outputs.BOOST_VERSION }}
run: |
pip install cibuildwheel
cibuildwheel --output-dir wheelhouse
REPO_SRC_DIR=$PWD bash patches/apply_patches.sh
CIBW_BUILD="cp38-* cp39-* cp310-* cp311-* cp312-*" \
cibuildwheel --output-dir wheelhouse
# done

Expand All @@ -85,31 +80,39 @@ jobs:

steps:

- name: Set up QEMU
uses: docker/setup-qemu-action@v2
with:
platforms: aarch64

- name: Checkout actions
uses: actions/checkout@v3
with:
submodules: true

- name: Get ELFIO
- name: Get Submodules
run: |
git submodule update --init --recursive
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- uses: ./.github/workflows/base
id: base
with:
platforms: aarch64
OS: ubuntu-20.04
ARCH: aarch64
PY_VERSION: '3.10'

# build

- name: cibuildwheel python bindings aarch64
env:
BOOST_ROOT: ${{ steps.base.outputs.BOOST_ROOT }}
BOOST_VERSION: 1.73.0
BOOST_VERSION: ${{ steps.base.outputs.BOOST_VERSION }}
run: |
pip install cibuildwheel
cibuildwheel --output-dir wheelhouse
REPO_SRC_DIR=$PWD bash patches/apply_patches.sh
CIBW_BUILD="cp38-* cp39-* cp310-* cp311-* cp312-*" \
cibuildwheel --output-dir wheelhouse
# done

Expand All @@ -121,7 +124,7 @@ jobs:

upload_bindings_wheels:

if: github.event_name != 'pull_request' && github.ref_name == 'main'
if: github.event_name != 'pull_request'

needs: [build, build-linux-aarch64]

Expand All @@ -144,8 +147,8 @@ jobs:
with:
artifacts: "dist/*.whl"
token: "${{ secrets.GITHUB_TOKEN }}"
tag: "latest"
name: "latest"
tag: ${{ github.ref_name == 'main' && 'release' || 'dev' }}
name: ${{ github.ref_name == 'main' && 'release' || 'dev' }}
removeArtifacts: false
allowUpdates: true
replacesArtifacts: true
Expand Down
17 changes: 15 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -159,5 +159,18 @@ cython_debug/
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
.idea/
cmake-build-debug
cmake-build-release
cmake-build-*
.envrc
*.whl
*.zip
*.ilk
*.pyd
*.lib
*.exp
*.pdb
*.dll
*.json
*.pdi
*.bif
*.bin
*.xclbin
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@
[submodule "third_party/XRT"]
path = third_party/XRT
url = [email protected]:Xilinx/XRT.git
[submodule "third_party/bootgen"]
path = third_party/bootgen
url = [email protected]:Xilinx/bootgen.git
Loading

0 comments on commit e118a00

Please sign in to comment.