Skip to content

Commit

Permalink
test build ROCm
Browse files Browse the repository at this point in the history
  • Loading branch information
doichanj committed Mar 15, 2024
1 parent 76b1042 commit d56a02f
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 941 deletions.
173 changes: 19 additions & 154 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,162 +1,27 @@
name: Build
on:
push:
branches: [main, 'stable/*']
pull_request:
branches: [main, 'stable/*']
concurrency:
group: ${{ github.repository }}-${{ github.ref }}-${{ github.head_ref }}-${{ github.workflow }}
cancel-in-progress: true
jobs:
standalone:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: ["macOS-latest", "ubuntu-latest", "windows-2019"]
push

wheel-rocm:
runs-on: "ubuntu-latest"
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.8
uses: actions/setup-python@v2
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
name: Install Python
with:
python-version: 3.8
- name: Install deps
run: pip install "conan<2.0.0"
- name: Install openblas
python-version: '3.8'
- name: Install cibuildwheel
run: |
set -e
sudo apt-get update
sudo apt-get install -y libopenblas-dev
shell: bash
if: runner.os == 'Linux'
- name: Add msbuild to PATH
uses: microsoft/[email protected]
if: runner.os == 'Windows'
- name: Compile Standalone Windows
run: |
set -e
mkdir out; cd out; cmake .. -DBUILD_TESTS=1
cmake --build . --config Release
shell: bash
if: runner.os == 'Windows'
- name: Compile Standalone
run: |
set -e
mkdir out; cd out; cmake .. -DBUILD_TESTS=1
make
shell: bash
if: runner.os != 'Windows'
- name: Run Unit Tests
run: |
cd out/bin
for test in test*
do echo $test
if ! ./$test
then
ERR=1
fi
done
if [ ! -z "$ERR" ]
then
exit 1
fi
shell: bash
- name: Run qobj
run: |
pip install -U qiskit
python tools/generate_qobj.py
cd out
Release/qasm_simulator ../qobj.json | python ../tools/verify_standalone_results.py
shell: bash
mpi_standalone:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: ["ubuntu-latest"]
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install deps
run: pip install "conan<2.0.0"
- name: Install openblas and mpi
run: |
set -e
sudo apt-get update
sudo apt-get install -y libopenblas-dev openmpi-bin libopenmpi-dev
shell: bash
- name: Compile Standalone
run: |
set -e
mkdir out; cd out; cmake .. -DBUILD_TESTS=1 -DAER_MPI=True
make
shell: bash
- name: Run Unit Tests with mpi
run: |
cd out/bin
for test in test*
do echo $test
if ! /usr/bin/mpirun.openmpi -host localhost:2 -np 2 ./$test
then
ERR=1
fi
done
if [ ! -z "$ERR" ]
then
exit 1
fi
shell: bash
- name: Run qobj
run: |
pip install -U qiskit
python tools/generate_qobj.py
cd out
/usr/bin/mpirun.openmpi -host localhost:2 -np 2 Release/qasm_simulator ../qobj.json | python ../tools/verify_standalone_results.py
python -m pip install cibuildwheel==2.16.2
- name: Build wheels
env:
USE_MPI: 1
shell: bash
wheel:
runs-on: ${{ matrix.os }}
needs: ["standalone"]
strategy:
matrix:
os: ["macOS-latest", "ubuntu-latest", "windows-2019"]
steps:
- uses: actions/checkout@v2
- name: Set up Python Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Add msbuild to PATH
uses: microsoft/[email protected]
if: runner.os == 'Windows'
- name: Install deps
run: python -m pip install -U cibuildwheel==2.16.5
- name: Build Wheels
env:
AER_CMAKE_OPENMP_BUILD: 1
run: cibuildwheel --output-dir wheelhouse
- uses: actions/upload-artifact@v2
with:
path: ./wheelhouse/*.whl
wheel-arm64:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: ["macOS-latest"]
steps:
- uses: actions/checkout@v2
- name: Set up Python Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install deps
run: python -m pip install -U cibuildwheel==2.16.2
- name: Build Wheels
env:
CIBW_ARCHS_MACOS: arm64
run: cibuildwheel --output-dir wheelhouse
- uses: actions/upload-artifact@v2
CIBW_BEFORE_ALL: "curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.rpm.sh | bash && yum install -y yum-utils git-lfs && mkdir -p ~/bin/ && curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo && chmod a+x ~/bin/repo && mkdir -p ~/ROCm/
cd ~/ROCm/ && ~/bin/repo init -u http://github.com/ROCm/ROCm.git -b roc-6.0.x && ~/bin/repo sync"
CIBW_SKIP: "*-manylinux_i686 pp* cp36* cp37* cp38* cp39* cp310* cp311* *musllinux*"
CIBW_ENVIRONMENT: QISKIT_AER_PACKAGE_NAME=qiskit-aer-rocm MAKE_VERBOSE_MAKEFILE=true AER_THRUST_BACKEND=ROCM AER_CIBUILD=true ROCM_PATH=~/ROCm
run: |
python -m cibuildwheel --output-dir wheelhouse
- uses: actions/upload-artifact@v3
with:
path: ./wheelhouse/*.whl

Loading

0 comments on commit d56a02f

Please sign in to comment.