Skip to content

Commit

Permalink
remove marker for cpu, add marker for gpu (EleutherAI#128)
Browse files Browse the repository at this point in the history
Co-authored-by: James Chua <[email protected]>
  • Loading branch information
thejaminator and thejaminator committed Mar 15, 2023
1 parent 2c6a10a commit 62bc2b4
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 6 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/cpu_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ jobs:
- name: Type Checking
uses: jakebailey/pyright-action@v1

- name: Run CPU Tests
run: pytest -m cpu
- name: Run normal tests, excluding GPU tests
run: pytest -m "not gpu"

run-tests-python3_10:
runs-on: ubuntu-latest
Expand All @@ -42,5 +42,5 @@ jobs:
- name: Type Checking
uses: jakebailey/pyright-action@v1

- name: Run CPU Tests
run: pytest -m cpu
- name: Run normal tests, excluding GPU tests
run: pytest -m "not gpu"
1 change: 0 additions & 1 deletion tests/test_classifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
from elk.training.classifier import Classifier


@pytest.mark.cpu
def test_classifier_roughly_same_sklearn():
input_dims: int = 10
# make a classification problem of 1000 samples with input_dims features
Expand Down
10 changes: 10 additions & 0 deletions tests/test_gpu_example.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import pytest


@pytest.mark.gpu
def test_gpu_example():
"""Will only run if the `gpu` mark is specified
This is just an example test to show how to use the `gpu` mark
We'll need to implement a GPU runner in the CI for actual GPU tests
GPU tests can be run with `pytest -m gpu`"""
assert True
1 change: 0 additions & 1 deletion tests/test_math.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
# ...and the total sum of the floats
st.integers(min_value=1, max_value=int(np.finfo(np.float32).max)),
)
@pytest.mark.cpu
def test_stochastic_rounding(num_parts: int, total: int):
# Randomly sample the breakdown of the total into floats
rng = np.random.default_rng(42)
Expand Down

0 comments on commit 62bc2b4

Please sign in to comment.