Skip to content

Commit

Permalink
Remove floatX="float32" tests
Browse files Browse the repository at this point in the history
If tests are concerned about float32 they should manually set it with `pytensor.config.change_flags`
  • Loading branch information
ricardoV94 committed Nov 1, 2023
1 parent cbc61fd commit 970006b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 25 deletions.
10 changes: 4 additions & 6 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,14 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
floatx: [float64]
python-version: ["3.9"]
test-subset:
- pymc_experimental/tests
fail-fast: false
runs-on: ${{ matrix.os }}
env:
TEST_SUBSET: ${{ matrix.test-subset }}
PYTENSOR_FLAGS: floatX=${{ matrix.floatx }},gcc__cxxflags='-march=native'
PYTENSOR_FLAGS: gcc__cxxflags='-march=native'
defaults:
run:
shell: bash -l {0}
Expand Down Expand Up @@ -77,21 +76,20 @@ jobs:
uses: codecov/codecov-action@v2
with:
env_vars: TEST_SUBSET
name: ${{ matrix.os }} ${{ matrix.floatx }}
name: ${{ matrix.os }}
fail_ci_if_error: false
windows:
strategy:
matrix:
os: [windows-latest]
floatx: [float32]
python-version: ["3.11"]
test-subset:
- pymc_experimental/tests
fail-fast: false
runs-on: ${{ matrix.os }}
env:
TEST_SUBSET: ${{ matrix.test-subset }}
PYTENSOR_FLAGS: floatX=${{ matrix.floatx }},gcc__cxxflags='-march=core2'
PYTENSOR_FLAGS: gcc__cxxflags='-march=core2'
defaults:
run:
shell: cmd
Expand Down Expand Up @@ -144,5 +142,5 @@ jobs:
uses: codecov/codecov-action@v2
with:
env_vars: TEST_SUBSET
name: ${{ matrix.os }} ${{ matrix.floatx }}
name: ${{ matrix.os }}
fail_ci_if_error: false
14 changes: 0 additions & 14 deletions pymc_experimental/tests/distributions/test_continuous.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,10 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import platform

import numpy as np
import pymc as pm

# general imports
import pytensor
import pytest
import scipy.stats.distributions as sp

Expand Down Expand Up @@ -47,10 +44,6 @@ class TestGenExtremeClass:
pm.logp(GenExtreme.dist(mu=0.,sigma=1.,xi=0.5),value=-0.01)
"""

@pytest.mark.xfail(
condition=(pytensor.config.floatX == "float32"),
reason="PyMC underflows earlier than scipy on float32",
)
def test_logp(self):
def ref_logp(value, mu, sigma, xi):
if 1 + xi * (value - mu) / sigma > 0:
Expand All @@ -69,13 +62,6 @@ def ref_logp(value, mu, sigma, xi):
ref_logp,
)

if pytensor.config.floatX == "float32":
raise Exception("Flaky test: It passed this time, but XPASS is not allowed.")

@pytest.mark.skipif(
(pytensor.config.floatX == "float32" and platform.system() == "Windows"),
reason="Scipy gives different results on Windows and does not match with desired accuracy",
)
def test_logcdf(self):
def ref_logcdf(value, mu, sigma, xi):
if 1 + xi * (value - mu) / sigma > 0:
Expand Down
5 changes: 0 additions & 5 deletions pymc_experimental/tests/distributions/test_multivariate.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import numpy as np
import pymc as pm
import pytensor
import pytest

import pymc_experimental as pmx
Expand Down Expand Up @@ -96,10 +95,6 @@ def phi_args(self, request, phi_args_base):
phi_args_base["importance_concentration"] = 10
return phi_args_base

@pytest.mark.skipif(
pytensor.config.floatX == "float32",
reason="pytensor.config.floatX == 'float32', https://github.com/pymc-devs/pymc/issues/6779",
)
def test_init(
self,
dims,
Expand Down

0 comments on commit 970006b

Please sign in to comment.