Skip to content

Python 3.13 triggers Numpy RuntimeWarning #21363

@matsumotosan

Description

@matsumotosan

Bug description

See this CI run

This is a known issue with Python 3.13 and numpy on Windows. Numpy 2.1.0 is lowest version that supports Python 3.13.

What version are you seeing the problem on?

master

Reproduced in studio

No response

How to reproduce the bug

Error messages and logs

<frozen importlib._bootstrap>:488: Warning: Numpy built with MINGW-W64 on Windows 64 bits is experimental, and only available for 
testing. You are advised not to use it for production. 

CRASHES ARE TO BE EXPECTED - PLEASE REPORT THEM TO NUMPY DEVELOPERS
D:\a\pytorch-lightning\pytorch-lightning\.venv\Lib\site-packages\numpy\core\getlimits.py:225: RuntimeWarning: invalid value encountered in exp2
  epsneg_f128 = exp2(ld(-113))
D:\a\pytorch-lightning\pytorch-lightning\.venv\Lib\site-packages\numpy\core\getlimits.py:226: RuntimeWarning: invalid value encountered in exp2
  tiny_f128 = exp2(ld(-16382))
D:\a\pytorch-lightning\pytorch-lightning\.venv\Lib\site-packages\numpy\core\getlimits.py:240: RuntimeWarning: invalid value encountered in exp2
  eps=exp2(ld(-112)),
D:\a\pytorch-lightning\pytorch-lightning\.venv\Lib\site-packages\numpy\core\getlimits.py:41: RuntimeWarning: invalid value encountered in nextafter
  self._smallest_subnormal = nextafter(
D:\a\pytorch-lightning\pytorch-lightning\.venv\Lib\site-packages\numpy\core\getlimits.py:52: RuntimeWarning: invalid value encountered in log10
  self.precision = int(-log10(self.eps))
D:\a\_temp\43801087-8219-40c5-8b18-db3112d66d40.sh: line 1:  1959 Segmentation fault      python utilities/test_warnings.py

Environment

Current environment
#- PyTorch Lightning Version (e.g., 2.5.0):
#- PyTorch Version (e.g., 2.5):
#- Python version (e.g., 3.12):
#- OS (e.g., Linux):
#- CUDA/cuDNN version:
#- GPU models and configuration:
#- How you installed Lightning(`conda`, `pip`, source):

More info

No response

cc @ethanwharris

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingneeds triageWaiting to be triaged by maintainersver: 2.5.x

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions