Skip to content
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

MacOS: three distribution tests are skipped #60347

Closed
mruberry opened this issue Jun 21, 2021 · 5 comments
Closed

MacOS: three distribution tests are skipped #60347

mruberry opened this issue Jun 21, 2021 · 5 comments
Labels
module: distributions Related to torch.distributions module: macos Mac OS related issues module: tests Issues related to tests (not the torch.testing module) triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module

Comments

@mruberry
Copy link
Collaborator

mruberry commented Jun 21, 2021

See https://app.circleci.com/pipelines/github/pytorch/pytorch/339308/workflows/261d5f9e-ed64-444f-a9ce-ff98a06d2daf/jobs/14261979 for a recent log showing the failures. #60348 has skipped these tests on MacOS to unblock the job.

These tests may just need a tolerance adjustment due to SciPy updates.

cc @ezyang @gchanan @zou3519 @bdhirsh @jbschlosser @anjali411 @fritzo @neerajprad @alicanb @nikitaved @mruberry @VitalyFedyunin @walterddr

@mruberry mruberry added high priority module: distributions Related to torch.distributions module: macos Mac OS related issues module: tests Issues related to tests (not the torch.testing module) labels Jun 21, 2021
@mruberry mruberry changed the title MacOS: three distribution tests are failing MacOS: three distribution tests are skipped Jun 21, 2021
@mruberry mruberry added triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module and removed high priority triage review labels Jun 21, 2021
@malfet malfet reopened this Sep 10, 2021
@malfet
Copy link
Contributor

malfet commented Sep 10, 2021

Reopening as the issue is not closed

@malfet
Copy link
Contributor

malfet commented Sep 10, 2021

I can transition test from passing to failing by changing scipy version:

$ pip install scipy==1.5.4; python test_distributions.py -v -k test_poisson_sample
Requirement already satisfied: scipy==1.5.4 in /Users/distiller/workspace/miniconda3/lib/python3.7/site-packages (1.5.4)
Requirement already satisfied: numpy>=1.14.5 in /Users/distiller/workspace/miniconda3/lib/python3.7/site-packages (from scipy==1.5.4) (1.18.5)
test_poisson_sample (__main__.TestDistributions) ... ok

----------------------------------------------------------------------
Ran 1 test in 0.128s

OK
static:distributions distiller$ pip install scipy==1.7.1; python test_distributions.py -v -k test_poisson_sample
Collecting scipy==1.7.1
  Using cached scipy-1.7.1-cp37-cp37m-macosx_10_9_x86_64.whl (32.6 MB)
Requirement already satisfied: numpy<1.23.0,>=1.16.5 in /Users/distiller/workspace/miniconda3/lib/python3.7/site-packages (from scipy==1.7.1) (1.18.5)
Installing collected packages: scipy
  Attempting uninstall: scipy
    Found existing installation: scipy 1.5.4
    Uninstalling scipy-1.5.4:
      Successfully uninstalled scipy-1.5.4
Successfully installed scipy-1.7.1
test_poisson_sample (__main__.TestDistributions) ... ERROR

======================================================================
ERROR: test_poisson_sample (__main__.TestDistributions)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "test_distributions.py", line 1333, in test_poisson_sample
    failure_rate=1e-3)
  File "test_distributions.py", line 805, in _check_sampler_discrete
    chisq, p = scipy.stats.chisquare(counts[msk], pmf[msk] * num_samples)
  File "/Users/distiller/workspace/miniconda3/lib/python3.7/site-packages/scipy/stats/stats.py", line 6853, in chisquare
    lambda_="pearson")
  File "/Users/distiller/workspace/miniconda3/lib/python3.7/site-packages/scipy/stats/stats.py", line 6694, in power_divergence
    raise ValueError(msg)
ValueError: For each axis slice, the sum of the observed frequencies must agree with the sum of the expected frequencies to a relative tolerance of 1e-08, but the percent differences are:
4.535600093557479e-05

----------------------------------------------------------------------
Ran 1 test in 0.065s

FAILED (errors=1)

@malfet
Copy link
Contributor

malfet commented Sep 10, 2021

Which I guess answers following esoteric question:

# TODO: Why is scipy pinned

@bdhirsh
Copy link
Contributor

bdhirsh commented Sep 20, 2021

@malfet pointed out: these 3 tests are currently running, but they're pinned to a version of scipy that allows them to pass. We should fix the tests and not rely on the pinned version of scipy.

@malfet
Copy link
Contributor

malfet commented Aug 30, 2023

Those tests has been unskipped a while back

@malfet malfet closed this as completed Aug 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
module: distributions Related to torch.distributions module: macos Mac OS related issues module: tests Issues related to tests (not the torch.testing module) triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module
Projects
None yet
Development

No branches or pull requests

3 participants