Skip to content

BUG: SciPy is seeing incorrect warnings on MacOS M1 (M2?) array * scalar #23996

Closed

Description

@seberg

CC @tylerjereddy. See scipy/scipy#18697, it seems MacOSX on arm optimizes the multiply in a way that leads to loading uninitialized values/zeros probably, so that 0 * inf triggers a warning.

I am not sure we should worry too much about it, since clang on MacOS X for arm doesn't properly support -ftrapping-math IIRC, which tends to make things difficult, but it is incorrect. The SciPy test should not show a warning in the specific multiplication.

Activity

  1. tylerjereddy commented on Jun 19, 2023

    @tylerjereddy
    Contributor

    Let me know if you want me to test anything specific.

  2. seberg commented on Jun 19, 2023

    @seberg
    MemberAuthor

    Thanks, no need... This is a trivial repro that works on my machine:

    np.arange(1, 12.) * np.inf
    
  3. seberg commented on Jun 20, 2023

    @seberg
    MemberAuthor

    Ping @Developer-Ecosystem-Engineering since maybe you can have a look at this and there is an easy fix.

  4. tylerjereddy commented on Jun 24, 2023

    @tylerjereddy
    Contributor

    See also:
    scipy/scipy#18737
    scipy/scipy#18738

    Flaky behavior, sometimes < 80 failures in 20,000 trials of the same calculation, so reproducing is a bit tricky.

    clang version:

    Apple clang version 14.0.3 (clang-1403.0.22.14.1)
    Target: arm64-apple-darwin22.5.0
    Thread model: posix
    InstalledDir: /Library/Developer/CommandLineTools/usr/bin
    
  5. Developer-Ecosystem-Engineering commented on Jun 26, 2023

    @Developer-Ecosystem-Engineering
    Contributor

    We understand the issue, please stand by

  6. Developer-Ecosystem-Engineering commented on Jun 26, 2023

    @Developer-Ecosystem-Engineering
    Contributor

    Please see #24054 for a proposed fix.

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