Skip to content

Error on Azure CI (Windows instance) with numpy 1.19.0 #16913

Closed
MacPython/openblas-libs
#35

Description

@mrava87

Hello,
I have recently started experiencing problems when running tests for my project on Azure Pipelines with a Windows instance (vmImage: 'windows-2019'). Digging a little bit deeper (see this conversation https://developercommunity.visualstudio.com/content/problem/1102472/azure-pipeline-error-with-windows-vm.html?childToView=1119179#comment-1119179) we realised that the problem originated when we install numpy 1.19.0 instead of numpy 1.8.5 - I can see that numpy 1.19.0 was put on PyPI on June 20 and this is around the time when our tests started to fail. Forcing the environment to install numpy 1.8.5 as in previously successful builds seem to solve the problem.

I just wanted to report this as I assume this is something others may have started observing (but it is quite hard to pin-point that numpy is the issue... or at least looks like it is).

Looking forward to hearing from you,
and happy to do any change to my azure pipeline setup if that can help troubleshooting the problem.

Error message:

This build works fine with numpy 1.18.5: https://dev.azure.com/matteoravasi/PyLops/_build/results?buildId=46&view=logs&j=011e1ec8-6569-5e69-4f06-baf193d1351e
A build on the same commit with numpy 1.19.0 fails: https://dev.azure.com/matteoravasi/PyLops/_build/results?buildId=43&view=results

The error is very cryptic, what I explained above is more relevant I think. Here it is anyways:

2020-07-06T13:56:01.6879900Z Windows fatal exception: Current thread 0xaccess violation00001798
2020-07-06T13:56:01.6880280Z 
2020-07-06T13:56:01.6880589Z  (most recent call first):
2020-07-06T13:56:01.6880973Z   File "<__array_function__ internals>", line 6 in vdot
2020-07-06T13:56:05.3412520Z ##[debug]Exit code: -1073741819

Activity

  1. mattip commented on Jul 20, 2020

    @mattip
    Member

    Does it fail consistently or only once in a while? Do you have any windows developers who can try to build the project on a local machine?

  2. mrava87 commented on Jul 20, 2020

    @mrava87
    Author

    Hi,
    thanks!

    It failed consistently many times.. at that point I thought about asking Azure developers (my initial guess was that perhaps something had changed in their VMs setup).

    This link has the discussion I had with a Microsoft developer who spotted the problem could have been numpy: https://developercommunity.visualstudio.com/content/problem/1102472/azure-pipeline-error-with-windows-vm.html?childToView=1119179#comment-1119179

    Unfortunately I do not have anyone that can try building the project on a local windows machine :(

  3. mattip commented on Jul 20, 2020

    @mattip
    Member

    Then we will need a clear set of steps to reproduce

  4. mrava87 commented on Jul 20, 2020

    @mrava87
    Author

    Would the azure-pipelines.yml work?

    Here is what we use (https://github.com/equinor/pylops/blob/master/azure-pipelines.yml) commented out at the moment... you can see that it is a pretty standard setup, using Python 3.7, installing dependencies in requirements-dev.txt file (https://github.com/equinor/pylops/blob/master/requirements-dev.txt) and then running the tests.

    As I mentioned already, if I comment this out and force numpy 1.18.5 everything runs, seems like it is the new 1.19 to break

  5. bashtage commented on Jul 20, 2020

    @bashtage
    Contributor

    What is the windows version major and minor version of the image running on Azure? i.e., what does systeminfo print for OS Version?

  6. mrava87 commented on Jul 21, 2020

    @mrava87
    Author
  7. bashtage commented on Jul 21, 2020

    @bashtage
    Contributor

    It runs from the command line and dumps the output to terminal, so you can add it to your run as a command.

  8. bashtage commented on Jul 21, 2020

    @bashtage
    Contributor

    You could do this in a PR that runs on CI to see what it says. I am asking since there have been issues with the 19041 build of Windows and pip NumPy.

  9. bashtage commented on Jul 21, 2020

    @bashtage
    Contributor

    The answer was in the second link:

    OS Version: 10.0.17763 Build 1282

  10. bashtage commented on Jul 21, 2020

    @bashtage
    Contributor

    So my idea bears no fruit.

  11. mrava87 commented on Jul 21, 2020

    @mrava87
    Author

    You say you know there are some issues with the latest pip wheels for Windows, is it probably connected to that?

  12. bashtage commented on Jul 21, 2020

    @bashtage
    Contributor

    It is actually (probably) a Windows bug introduced in 19041. But you are on a much older version so this is not the issue.

    It doesn't affect Conda NumPy, only pip NumPy because it seems to be some issue with Windows and OpenBlas.

  13. mrava87 commented on Jul 22, 2020

    @mrava87
    Author

    I see :) I got an email that 1.9.1 has been released. I am going to try to retrigger the Azure pipeline which would now install the latest version and see if that works, will let you know

  14. bashtage commented on Jul 22, 2020

    @bashtage
    Contributor

    A bug in OpenBlas.

    Here is a reproducing example:

    import numpy as np
    nr = 12000
    v = np.random.randn(nr) + 1j * np.random.randn(nr)
    np.vdot(v, v)
    # also access violations
    v @ v
    # also access violations

    The no symbols debugging information is:

    Exception thrown at 0x0000000068DBB8F0 (libopenblas.NOIJJG62EMASZI6NYURL6JBKM4EVBGM7.gfortran-win_amd64.dll)
    in python.exe: 0xC0000005: Access violation reading location 0x0000000000000000.
    

    Note that the array has to be pretty big (10k passes, 12k does not) to trigger the bug.

  15. 29 remaining items

  16. larsoner commented on Jul 24, 2020

    @larsoner
    Contributor

    ... looks like there is no 32-bit OpenBLAS for 64-bit Windows in:

    https://anaconda.org/multibuild-wheels-staging/openblas-libs/files

    I guess I could add the tag to get it to use 64-bit OpenBLAS?

  17. bashtage commented on Jul 24, 2020

    @bashtage
    Contributor

    2 are there and 1 is still being built. Should be up within the hour.

  18. larsoner commented on Jul 24, 2020

    @larsoner
    Contributor

    In the meantime I added:

            NPY_USE_BLAS_ILP64: '1'
            OPENBLAS_SUFFIX: '64_'
    

    And it built just fine. No longer segfaults! I'll re-run it a few times just to be sure. Feel free to ping me when the 32-bit OpenBLAS Win64 libs are up and I can easily remove these lines and re-test.

  19. bashtage commented on Jul 24, 2020

    @bashtage
    Contributor

    Any change you run the full test suite :-)

    python -c "import numpy; numpy.test('full')"
    
  20. larsoner commented on Jul 24, 2020

    @larsoner
    Contributor

    Looks like the 32 bit ones are up, and that also works.

    I'll give the full test suite a run now

  21. bashtage commented on Jul 24, 2020

    @bashtage
    Contributor

    You shouldn't waste any more time on this other issue - I can wait until next week and test the weekly which will hopefully have the BLAS.

  22. charris commented on Jul 24, 2020

    @charris
    Member

    Note that we can run the nightly builds at anytime by pushing a commit to the master branch.

  23. bashtage commented on Jul 24, 2020

    @bashtage
    Contributor

    Ok, I'll wait until I see a new one to see if the issue with Windows 10 2004 is fixed.

  24. removed this from the 1.19.2 release milestone on Sep 8, 2020
  25. charris commented on Sep 8, 2020

    @charris
    Member

    @bashtage Any update on this?

  26. removed
    09 - Backport-Candidate
    on Sep 8, 2020
  27. bashtage commented on Sep 8, 2020

    @bashtage
    Contributor

    OpenBLAS is still broken on the most recent release of Windows. It is very nonstandard to even get good debugging information because of the mixed to tool chain, at least for me.

  28. larsoner commented on Jul 13, 2021

    @larsoner
    Contributor

    FYI with OpenBLAS 0.3.16 it seems like the OPENBLAS_CORETYPE=prescott workaround I had in place on Azure ended up being probelmatic, so if anyone is using that workaround and sees problems with the latest NumPy pip-pre wheels you might need to remove the workaround!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions