Skip to content

Commit f309c22

Browse files
authored
Reduce number of slow tests and balance parts (#1569)
* Skip slow numba pad tests * Reduce number of Second tests * Update test.yml
1 parent 0fd160b commit f309c22

File tree

3 files changed

+22
-34
lines changed

3 files changed

+22
-34
lines changed

.github/workflows/test.yml

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -84,14 +84,12 @@ jobs:
8484
install-torch: [0]
8585
install-xarray: [0]
8686
part:
87-
- "tests --ignore=tests/tensor --ignore=tests/scan --ignore=tests/sparse --ignore=tests/xtensor"
87+
- "tests --ignore=tests/tensor --ignore=tests/scan --ignore=tests/xtensor"
8888
- "tests/scan"
89-
- "tests/sparse"
90-
- "tests/tensor --ignore=tests/tensor/conv --ignore=tests/tensor/rewriting --ignore=tests/tensor/test_math.py --ignore=tests/tensor/test_basic.py --ignore=tests/tensor/test_inplace.py --ignore=tests/tensor/test_blas.py --ignore=tests/tensor/test_elemwise.py --ignore=tests/tensor/test_math_scipy.py"
91-
- "tests/tensor/conv"
89+
- "tests/tensor --ignore=tests/tensor/rewriting --ignore=tests/tensor/test_math.py --ignore=tests/tensor/test_basic.py --ignore=tests/tensor/test_inplace.py --ignore=tests/tensor/conv --ignore=tests/tensor/test_blas.py --ignore=tests/tensor/test_elemwise.py --ignore=tests/tensor/test_math_scipy.py"
9290
- "tests/tensor/rewriting"
9391
- "tests/tensor/test_math.py"
94-
- "tests/tensor/test_basic.py tests/tensor/test_inplace.py"
92+
- "tests/tensor/test_basic.py tests/tensor/test_inplace.py tests/tensor/conv"
9593
- "tests/tensor/test_blas.py tests/tensor/test_elemwise.py tests/tensor/test_math_scipy.py"
9694
exclude:
9795
- python-version: "3.10"
@@ -123,14 +121,21 @@ jobs:
123121
numpy-version: "~=2.1.0"
124122
fast-compile: 0
125123
float32: 0
126-
part: "tests/link/numba"
124+
part: "tests/link/numba --ignore=tests/link/numba/test_slinalg.py"
127125
- install-numba: 1
128126
os: "ubuntu-latest"
129127
python-version: "3.13"
130128
numpy-version: "~=2.1.0"
131129
fast-compile: 0
132130
float32: 0
133-
part: "tests/link/numba"
131+
part: "tests/link/numba --ignore=tests/link/numba/test_slinalg.py"
132+
- install-numba: 1
133+
os: "ubuntu-latest"
134+
python-version: "3.13"
135+
numpy-version: "~=2.1.0"
136+
fast-compile: 0
137+
float32: 0
138+
part: "tests/link/numba/test_slinalg.py"
134139
- install-jax: 1
135140
os: "ubuntu-latest"
136141
python-version: "3.10"
@@ -207,7 +212,7 @@ jobs:
207212
if [[ $INSTALL_TORCH == "1" ]]; then micromamba install --yes -q -c conda-forge "python~=${PYTHON_VERSION}" pytorch pytorch-cuda=12.1 "mkl<=2024.0" -c pytorch -c nvidia; fi
208213
if [[ $INSTALL_XARRAY == "1" ]]; then micromamba install --yes -q -c conda-forge "python~=${PYTHON_VERSION}" xarray xarray-einstats; fi
209214
pip install pytest-sphinx
210-
215+
211216
pip install -e ./
212217
micromamba list && pip freeze
213218
python -c 'import pytensor; print(pytensor.config.__str__(print_doc=False))'
@@ -218,7 +223,7 @@ jobs:
218223
fi
219224
env:
220225
PYTHON_VERSION: ${{ matrix.python-version }}
221-
NUMPY_VERSION: ${{ matrix.numpy-version }}
226+
NUMPY_VERSION: ${{ matrix.numpy-version }}
222227
INSTALL_NUMBA: ${{ matrix.install-numba }}
223228
INSTALL_JAX: ${{ matrix.install-jax }}
224229
INSTALL_TORCH: ${{ matrix.install-torch}}
@@ -343,4 +348,3 @@ jobs:
343348
directory: ./coverage/
344349
fail_ci_if_error: true
345350
token: ${{ secrets.CODECOV_TOKEN }}
346-

tests/link/numba/test_pad.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@
1111
RTOL = ATOL = 1e-6 if floatX.endswith("64") else 1e-3
1212

1313

14+
@pytest.mark.skip(
15+
"Numba compilation is too slow and this is just a test for dispatch of OpFromGraph"
16+
)
1417
@pytest.mark.parametrize(
1518
"mode, kwargs",
1619
[

tests/tensor/test_basic.py

Lines changed: 5 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -191,42 +191,23 @@ def _numpy_second(x, y):
191191
name="SecondBroadcastTester",
192192
op=second,
193193
expected=_numpy_second,
194-
good=dict(
195-
itertools.chain(
196-
multi_dtype_checks((4, 5), (5,)),
197-
multi_dtype_checks((2, 3, 2), (3, 2)),
198-
multi_dtype_checks((2, 3, 2), (2,)),
199-
)
200-
),
201-
# I can't think of any way to make this fail at build time
202-
# Just some simple smoke tests
194+
good=dict(multi_dtype_checks((4, 2, 3, 2), (3, 2))),
203195
bad_runtime=dict(
204196
fail1=(random(5, 4), random(5)),
205197
fail2=(random(3, 2, 3), random(6, 9)),
206198
fail3=(integers(6, 2, 9), random(3, 2)),
207199
),
208200
)
209201

210-
# We exclude local_fill_to_alloc because it optimizes the "second" node
211-
# away from the graph.
202+
# We exclude local_fill_to_alloc because it optimizes the "second" node away from the graph.
212203
TestSecondSameRank = makeTester(
213204
name="SecondSameRankTester",
214205
op=second,
215206
expected=_numpy_second,
216-
good=dict(
217-
itertools.chain(
218-
multi_dtype_checks((4, 5), (4, 5)),
219-
multi_dtype_checks((1, 2), (3, 2)),
220-
multi_dtype_checks((3, 2), (1, 2)),
221-
)
222-
),
223-
# These sizes are not broadcastable to one another
224-
# and SHOULD raise an error, but currently don't.
207+
good=dict(multi_dtype_checks((4, 5), (4, 1))),
225208
bad_runtime=dict(
226-
itertools.chain(
227-
multi_dtype_checks((4, 5), (5, 4)),
228-
multi_dtype_checks((1, 5), (5, 4)),
229-
)
209+
fail1=(random(4, 5), random(5, 4)),
210+
fail2=(integers(1, 5), integers(5, 4)),
230211
),
231212
mode=get_default_mode().excluding("local_fill_to_alloc", "local_useless_fill"),
232213
)

0 commit comments

Comments
 (0)