Skip to content

Disable FAST_COMPILE on windows again #4011

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 1 commit into from
Jul 27, 2020

Conversation

aseyboldt
Copy link
Member

Revert the workaround to use FAST_COMPILE on Windows. This has unacceptable performance implications, and setting no-c++11-narrowing should be enough.
A better solution would be to fix the code that is generated by theano.

@codecov
Copy link

codecov bot commented Jul 14, 2020

Codecov Report

Merging #4011 into master will increase coverage by 0.01%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #4011      +/-   ##
==========================================
+ Coverage   86.65%   86.66%   +0.01%     
==========================================
  Files          88       88              
  Lines       14090    14087       -3     
==========================================
- Hits        12210    12209       -1     
+ Misses       1880     1878       -2     
Impacted Files Coverage Δ
pymc3/__init__.py 100.00% <100.00%> (+4.76%) ⬆️

@twiecki
Copy link
Member

twiecki commented Jul 27, 2020

Why is this in draft status? I think we might want to get this in for 3.7.3?

@michaelosthege michaelosthege added this to the 3.9.3 milestone Jul 27, 2020
@michaelosthege
Copy link
Member

michaelosthege commented Jul 27, 2020

I ran tests on my machine. It seems to be mostly fine. Unfortunately pytest didn't tell me which tests failed:

=========================================================================================================== test session starts ============================================================================================================
platform win32 -- Python 3.6.10, pytest-5.4.3, py-1.8.1, pluggy-0.13.1
rootdir: C:\Users\osthege\Repos\pymc3-dev, inifile: setup.cfg
collected 3593 items

test_coords.py .                                                                                                                                                                                                                      [  0%]
test_data_container.py .............                                                                                                                                                                                                  [  0%]
test_dist_math.py ......s......F                                                                                                                                                                                                      [  0%]
test_distribution_defaults.py ..........                                                                                                                                                                                              [  1%]
test_distributions.py ..........X............................F..........................................................................................................                                                              [  5%]
test_distributions_random.py ................s.....x................................................................................................................................................................................. [ 10%]
..................................................................................................................................................................................................................................... [ 17%]
..................................................................................................................................................................................................................................... [ 23%]
..................................................................................................................................F.....................s...xF
(pm3-dev2) C:\Users\osthege\Repos\pymc3-dev\pymc3\tests>

They could also be unrelated as I didn't run the tests from the master branch before..

The one from test_dist_math.py is TypeError: data type "float128" not understood.

From test_distributions.py - also unrelated:

test_distributions.py ..........X............................F..........................................................................................................                                                              [100%]

================================================================================================================= FAILURES =================================================================================================================
______________________________________________________________________________________________________ TestMatchesScipy.test_weibull _______________________________________________________________________________________________________

self = <pymc3.tests.test_distributions.TestMatchesScipy object at 0x000002118046A710>

    @pytest.mark.xfail(
        condition=(theano.config.floatX == "float32"),
        reason="Fails on float32 due to inf issues",
    )
    def test_weibull(self):
        self.pymc3_matches_scipy(
            Weibull,
            Rplus,
            {"alpha": Rplusbig, "beta": Rplusbig},
>           lambda value, alpha, beta: sp.exponweib.logpdf(value, 1, alpha, scale=beta),
        )

test_distributions.py:968:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
test_distributions.py:538: in pymc3_matches_scipy
    self.check_logp(model, value, domain, paramdomains, logp, decimal=decimal)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <pymc3.tests.test_distributions.TestMatchesScipy object at 0x000002118046A710>, model = <pymc3.model.Model object at 0x00000211FFA2EBE0>, value = value, domain = <pymc3.tests.test_distributions.Domain object at 0x00000211F9FD8C18>
paramdomains = {'alpha': <pymc3.tests.test_distributions.Domain object at 0x00000211F9FE07F0>, 'beta': <pymc3.tests.test_distributions.Domain object at 0x00000211F9FE07F0>}
logp_reference = <function TestMatchesScipy.pymc3_matches_scipy.<locals>.logp at 0x00000211FEE7E950>, decimal = 6

    def check_logp(
        self, model, value, domain, paramdomains, logp_reference, decimal=None
    ):
        domains = paramdomains.copy()
        domains["value"] = domain
        logp = model.fastlogp
        for pt in product(domains, n_samples=100):
            pt = Point(pt, model=model)
            if decimal is None:
                decimal = select_by_precision(float64=6, float32=3)
            assert_almost_equal(
>               logp(pt), logp_reference(pt), decimal=decimal, err_msg=str(pt)
            )
E           AssertionError:
E           Arrays are not almost equal to 6 decimals
E           {'alpha': array(20.), 'beta': array(0.9), 'value': array(100.)}
E           Mismatched elements: 1 / 1 (100%)
E           Max absolute difference: 3.86856262e+25
E           Max relative difference: 4.70326902e-16
E            x: array(-8.225263e+40)
E            y: array(-8.225263e+40)

test_distributions.py:551: AssertionError

test_distributions_random.py:

================================================================================================================= FAILURES =================================================================================================================
______________________________________________________________________________________________ TestScalarParameterSamples.test_beta_binomial _______________________________________________________________________________________________

self = <pymc3.tests.test_distributions_random.TestScalarParameterSamples object at 0x0000017AF7DDB518>

    def test_beta_binomial(self):
        pymc3_random_discrete(pm.BetaBinomial, {'n': Nat, 'alpha': Rplus, 'beta': Rplus},
>                             ref_rand=self._beta_bin)

test_distributions_random.py:639:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
test_distributions_random.py:73: in pymc3_random_discrete
    e = ref_rand(size=size, **pt)
test_distributions_random.py:642: in _beta_bin
    return st.binom.rvs(n, st.beta.rvs(a=alpha, b=beta, size=size))
..\..\..\..\appdata\local\continuum\miniconda3\envs\pm3-dev2\lib\site-packages\scipy\stats\_distn_infrastructure.py:2969: in rvs
    return super(rv_discrete, self).rvs(*args, **kwargs)
..\..\..\..\appdata\local\continuum\miniconda3\envs\pm3-dev2\lib\site-packages\scipy\stats\_distn_infrastructure.py:980: in rvs
    vals = self._rvs(*args)
..\..\..\..\appdata\local\continuum\miniconda3\envs\pm3-dev2\lib\site-packages\scipy\stats\_discrete_distns.py:43: in _rvs
    return self._random_state.binomial(n, p, self._size)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

>   ???
E   TypeError: Cannot cast array data from dtype('int64') to dtype('int32') according to the rule 'safe'

mtrand.pyx:3347: TypeError

@twiecki twiecki marked this pull request as ready for review July 27, 2020 15:49
@twiecki
Copy link
Member

twiecki commented Jul 27, 2020

@michaelosthege I would strongly expect those to be unrelated, which OS did you test this under? Travis seems fine.

@michaelosthege
Copy link
Member

@twiecki Yes, I think they are unrelated. Windows.
Makes a great argument in favor of #3954 though.

@twiecki twiecki merged commit c7afc21 into pymc-devs:master Jul 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants