Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

move more testing logic into scripts #139

Merged
merged 1 commit into from
Aug 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions .github/workflows/github-actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ jobs:
--file /tmp/env.yaml
- name: Type check legate-boost
run: |
mypy ./legateboost --config-file ./pyproject.toml --exclude=legateboost/test --exclude=install_info
ci/run_mypy.sh
- name: Build legate-boost
env:
CUDAARCHS: '70;80'
Expand All @@ -67,11 +67,10 @@ jobs:
python -m pip install --no-deps dist/*.whl
- name: Run cpu tests
run: |
legate --sysmem 28000 --module pytest legateboost/test/[!_]**.py -sv --durations=0
ci/run_pytests_cpu.sh
- name: Run gpu tests
run: |
nvidia-smi
legate --gpus 1 --fbmem 28000 --sysmem 28000 --module pytest legateboost/test/[!_]**.py -sv --durations=0 -k 'not sklearn'
ci/run_pytests_gpu.sh
- name: Build legate-boost docs
working-directory: docs
run: |
Expand Down
21 changes: 21 additions & 0 deletions ci/run_mypy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/bash

# [description]
#
# Run 'mypy' type-checker.
#
# This is intended for use by both CI and local development,
# so shouldn't rely on any CI-specific details.
#
# This is done in a separate script instead of via pre-commit because
# running it in a non-isolated environment where all of the project's dependencies
# are installed allows for more thorough type-checking.
#

set -e -E -u -o pipefail

mypy \
--config-file ./pyproject.toml \
--exclude=legateboost/test \
--exclude=install_info \
./legateboost
21 changes: 21 additions & 0 deletions ci/run_pytests_cpu.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/bash

# [description]
#
# Run CPU tests.
#
# This is intended for use by both CI and local development,
# so shouldn't rely on any CI-specific details.
#
# Additional arguments passed to this script are passed through to 'pytest'.
#

set -e -E -u -o pipefail

legate \
--sysmem 28000 \
--module pytest \
legateboost/test/[!_]**.py \
-sv \
--durations=0 \
"${@}"
26 changes: 26 additions & 0 deletions ci/run_pytests_gpu.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/bash

# [description]
#
# Run GPU tests.
#
# This is intended for use by both CI and local development,
# so shouldn't rely on any CI-specific details.
#
# Additional arguments passed to this script are passed through to 'pytest'.
#

set -e -E -u -o pipefail

nvidia-smi

legate \
--gpus 1 \
--fbmem 28000 \
--sysmem 28000 \
--module pytest \
legateboost/test/[!_]**.py \
-sv \
--durations=0 \
-k 'not sklearn' \
"${@}"
18 changes: 5 additions & 13 deletions contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,22 +25,13 @@ and install an editable wheel that uses it.
CPU:

```shell
legate \
--sysmem 28000 \
--module pytest \
legateboost/test
ci/run_pytests_cpu.sh
```

GPU:

```shell
legate \
--gpus 1 \
--fbmem 28000 \
--sysmem 28000 \
--module pytest \
legateboost/test/test_estimator.py \
-k 'not sklearn'
ci/run_pytests_gpu.sh
```

## Change default CUDA architectures
Expand Down Expand Up @@ -92,8 +83,9 @@ The following general principles should be followed when developing `legate-boos
- Avoid optimisation where possible in favour of clear implementation
- Favour cunumeric implementations where appropriate. e.g. elementwise or matrix operations
- Use mypy type annotations if at all possible. The typing can be checked by running the following command under the project root:
```
mypy ./legateboost --config-file ./pyproject.toml --exclude=legateboost/test --exclude=install_info

```shell
ci/run_mypy.sh
```

### Performance
Expand Down