Skip to content

Reduce number of slow tests and balance parts #1569

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

Merged
merged 3 commits into from
Aug 7, 2025
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
24 changes: 14 additions & 10 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,14 +84,12 @@ jobs:
install-torch: [0]
install-xarray: [0]
part:
- "tests --ignore=tests/tensor --ignore=tests/scan --ignore=tests/sparse --ignore=tests/xtensor"
- "tests --ignore=tests/tensor --ignore=tests/scan --ignore=tests/xtensor"
- "tests/scan"
- "tests/sparse"
- "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"
- "tests/tensor/conv"
- "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"
- "tests/tensor/rewriting"
- "tests/tensor/test_math.py"
- "tests/tensor/test_basic.py tests/tensor/test_inplace.py"
- "tests/tensor/test_basic.py tests/tensor/test_inplace.py tests/tensor/conv"
- "tests/tensor/test_blas.py tests/tensor/test_elemwise.py tests/tensor/test_math_scipy.py"
exclude:
- python-version: "3.10"
Expand Down Expand Up @@ -123,14 +121,21 @@ jobs:
numpy-version: "~=2.1.0"
fast-compile: 0
float32: 0
part: "tests/link/numba"
part: "tests/link/numba --ignore=tests/link/numba/test_slinalg.py"
- install-numba: 1
os: "ubuntu-latest"
python-version: "3.13"
numpy-version: "~=2.1.0"
fast-compile: 0
float32: 0
part: "tests/link/numba"
part: "tests/link/numba --ignore=tests/link/numba/test_slinalg.py"
- install-numba: 1
os: "ubuntu-latest"
python-version: "3.13"
numpy-version: "~=2.1.0"
fast-compile: 0
float32: 0
part: "tests/link/numba/test_slinalg.py"
- install-jax: 1
os: "ubuntu-latest"
python-version: "3.10"
Expand Down Expand Up @@ -207,7 +212,7 @@ jobs:
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
if [[ $INSTALL_XARRAY == "1" ]]; then micromamba install --yes -q -c conda-forge "python~=${PYTHON_VERSION}" xarray xarray-einstats; fi
pip install pytest-sphinx

pip install -e ./
micromamba list && pip freeze
python -c 'import pytensor; print(pytensor.config.__str__(print_doc=False))'
Expand All @@ -218,7 +223,7 @@ jobs:
fi
env:
PYTHON_VERSION: ${{ matrix.python-version }}
NUMPY_VERSION: ${{ matrix.numpy-version }}
NUMPY_VERSION: ${{ matrix.numpy-version }}
INSTALL_NUMBA: ${{ matrix.install-numba }}
INSTALL_JAX: ${{ matrix.install-jax }}
INSTALL_TORCH: ${{ matrix.install-torch}}
Expand Down Expand Up @@ -343,4 +348,3 @@ jobs:
directory: ./coverage/
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}

3 changes: 3 additions & 0 deletions tests/link/numba/test_pad.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
RTOL = ATOL = 1e-6 if floatX.endswith("64") else 1e-3


@pytest.mark.skip(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's just delete it inside of marking it as skip?

Maybe keep one simple smoke test (with basic settings) to make sure something upstream hasn't somehow broken something

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I want to come back to it when we implement numba caching, it's a good case of painfully slow (while it's like 2s on jax)

"Numba compilation is too slow and this is just a test for dispatch of OpFromGraph"
)
@pytest.mark.parametrize(
"mode, kwargs",
[
Expand Down
29 changes: 5 additions & 24 deletions tests/tensor/test_basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,42 +191,23 @@ def _numpy_second(x, y):
name="SecondBroadcastTester",
op=second,
expected=_numpy_second,
good=dict(
itertools.chain(
multi_dtype_checks((4, 5), (5,)),
multi_dtype_checks((2, 3, 2), (3, 2)),
multi_dtype_checks((2, 3, 2), (2,)),
)
),
# I can't think of any way to make this fail at build time
# Just some simple smoke tests
good=dict(multi_dtype_checks((4, 2, 3, 2), (3, 2))),
bad_runtime=dict(
fail1=(random(5, 4), random(5)),
fail2=(random(3, 2, 3), random(6, 9)),
fail3=(integers(6, 2, 9), random(3, 2)),
),
)

# We exclude local_fill_to_alloc because it optimizes the "second" node
# away from the graph.
# We exclude local_fill_to_alloc because it optimizes the "second" node away from the graph.
TestSecondSameRank = makeTester(
name="SecondSameRankTester",
op=second,
expected=_numpy_second,
good=dict(
itertools.chain(
multi_dtype_checks((4, 5), (4, 5)),
multi_dtype_checks((1, 2), (3, 2)),
multi_dtype_checks((3, 2), (1, 2)),
)
),
# These sizes are not broadcastable to one another
# and SHOULD raise an error, but currently don't.
good=dict(multi_dtype_checks((4, 5), (4, 1))),
bad_runtime=dict(
itertools.chain(
multi_dtype_checks((4, 5), (5, 4)),
multi_dtype_checks((1, 5), (5, 4)),
)
fail1=(random(4, 5), random(5, 4)),
fail2=(integers(1, 5), integers(5, 4)),
),
mode=get_default_mode().excluding("local_fill_to_alloc", "local_useless_fill"),
)
Expand Down