Minor improvements to CPU performance (#51) #168
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: legateboost build/test | |
concurrency: | |
group: ci-on-${{ github.event_name }}-from-${{ github.ref_name }} | |
cancel-in-progress: true | |
on: | |
push: | |
branches: | |
- "pull-request/[0-9]+" | |
- "branch-*" | |
- "main" | |
jobs: | |
build: | |
defaults: | |
run: | |
shell: bash -el {0} | |
runs-on: linux-amd64-cpu8 | |
env: | |
CONDA_PREFIX: /opt/conda | |
container: | |
image: rapidsai/devcontainers:23.06-cpp-cuda11.8-mambaforge-ubuntu22.04 | |
env: | |
DEFAULT_CONDA_ENV: legate | |
steps: | |
- name: Get Date | |
id: get-date | |
run: echo "week=$(/bin/date -u '+%Y.week%U')" >> $GITHUB_OUTPUT | |
- name: Cache Conda env | |
uses: actions/cache@v3 | |
with: | |
path: /opt/conda/envs/legate | |
# renew cache weekly with legate.core/cunumeric builds | |
key: | |
conda--${{ | |
steps.get-date.outputs.week }} | |
id: cache | |
- name: Checkout legate core | |
uses: actions/checkout@v3 | |
with: | |
repository: nv-legate/legate.core | |
path: legate.core | |
ref: branch-23.09 | |
- name: Install legate core | |
working-directory: ./legate.core | |
run: | | |
python scripts/generate-conda-envs.py --python 3.10 --ctk 11.8 --os linux --compilers --openmpi; | |
mamba env create -n legate -f environment-test-linux-py3.10-cuda11.8-compilers-openmpi-ucx.yaml; | |
mamba activate legate; | |
mamba install -y 'gcc<=10.0.0' build scikit-learn; | |
# install test dependencies | |
mamba install -y hypothesis pytest xgboost notebook seaborn matplotlib; | |
# workaround issue https://github.com/nv-legate/legate.core/issues/789 | |
mkdir -p _skbuild/linux-x86_64-3.10/cmake-build | |
./install.py --network ucx --cuda --arch RAPIDS --verbose; | |
if: steps.cache.outputs.cache-hit != 'true' | |
- name: Checkout cunumeric | |
uses: actions/checkout@v3 | |
with: | |
repository: nv-legate/cunumeric | |
path: cunumeric | |
ref: branch-23.09 | |
- name: Install cunumeric | |
working-directory: ./cunumeric | |
run: | | |
./install.py | |
# make the conda directory smaller for easier caching | |
# this removes unneeded files from the env | |
mamba clean -all -y | |
if: steps.cache.outputs.cache-hit != 'true' | |
- name: Checkout legateboost | |
uses: actions/checkout@v3 | |
- name: Build legateboost | |
run: | | |
python -m build -n --wheel | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: legateboost-wheel | |
path: dist/legateboost*.whl | |
test: | |
needs: build | |
defaults: | |
run: | |
shell: bash -el {0} | |
runs-on: linux-amd64-gpu-v100-latest-1 | |
container: | |
image: rapidsai/devcontainers:23.06-cpp-cuda11.8-mambaforge-ubuntu22.04 | |
env: | |
NVIDIA_VISIBLE_DEVICES: ${{ env.NVIDIA_VISIBLE_DEVICES }} # GPU jobs must set this container env variable | |
DEFAULT_CONDA_ENV: legate | |
steps: | |
- name: Get Date | |
id: get-date | |
run: echo "week=$(/bin/date -u '+%Y.week%U')" >> $GITHUB_OUTPUT | |
- name: Restore cached environment | |
id: cache-restore | |
uses: actions/cache/restore@v3 | |
with: | |
path: /opt/conda/envs/legate | |
key: conda--${{ | |
steps.get-date.outputs.today }} | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- uses: actions/download-artifact@v3 | |
with: | |
name: legateboost-wheel | |
- name: Install legateboost artifact | |
run: | | |
mamba activate legate | |
pip install $(find -name legateboost*.whl)[test] | |
- name: Build legateboost docs | |
working-directory: docs | |
run: | | |
pip install sphinx pydata-sphinx-theme myst-parser | |
# invoke sphinx build using legate | |
legate --module sphinx.cmd.build source build -b html | |
- uses: actions/upload-pages-artifact@v1 | |
with: | |
path: docs/build | |
- name: Run cpu tests | |
run: | | |
pip install hypothesis | |
legate --cpus 16 --sysmem 16000 --module pytest legateboost/test -sv --durations=0 | |
- name: Run cpu multi-node tests | |
run: | | |
# rapids container is run as root, tell mpi it is ok to run as root (we are in a container) | |
OMPI_ALLOW_RUN_AS_ROOT=1 OMPI_ALLOW_RUN_AS_ROOT_CONFIRM=1 legate --launcher mpirun --ranks-per-node 2 --module pytest legateboost/test -sv --durations=0 -k 'not sklearn' | |
if: ${{ false }} # disabled due to issue #5 | |
- name: Run gpu tests | |
run: | | |
legate --gpus 1 --fbmem 16000 --sysmem 16000 --module pytest legateboost/test -sv --durations=0 -k 'not sklearn' | |
deploy: | |
needs: test | |
# only main branch uploads docs | |
if: github.ref == 'refs/heads/main' && github.event_name == 'push' | |
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment | |
permissions: | |
pages: write # to deploy to Pages | |
id-token: write # to verify the deployment originates from an appropriate source | |
# Deploy to the github-pages environment | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
# Specify runner + deployment step | |
runs-on: ubuntu-latest | |
steps: | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v2 | |
pre-commit: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-python@v3 | |
- uses: pre-commit/[email protected] |