Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

MemoryError after exceeding OpenMP/OpenBLAS thread limit

Aperta
#99 3 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
35/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
python
Ambito
backend

Direzione di ricerca

Start by reading _find_modules_with_dl_iterate_phdr in threadpoolctl.py, where the traceback reaches the MemoryError, and inspect how it discovers loaded native modules. Reproduce the failure after exceeding an OpenMP or OpenBLAS thread limit, then check whether the reported error can be recovered without rebooting. Done means the example in the issue runs successfully after recovery.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Hello. I use threadpoolctl 2.2.0 which runs very well most of the time. However, after exceeding the OpenMP or OpenBLAS thread limit, threadpoolctl seems to have broken down. It does not recover even after the thread-limit-exceeding processes have been killed, or quite some time after that. The full error message of a simple example is shown below. Is there any way to reset threadpoolctl so it continues to function without having to reboot the computer?

Python 3.9.5 (default, Jun  4 2021, 12:28:51) 
Type 'copyright', 'credits' or 'license' for more information
IPython 7.24.1 -- An enhanced Interactive Python. Type '?' for help.

In [1]: from threadpoolctl import threadpool_limits
   ...: with threadpool_limits(limits=1):
   ...:     a=1
   ...: 
---------------------------------------------------------------------------
MemoryError                               Traceback (most recent call last)
<ipython-input-1-2121fc2c928d> in <module>
      1 from threadpoolctl import threadpool_limits
----> 2 with threadpool_limits(limits=1):
      3     a=1
      4 
~/.local/lib/python3.9/site-packages/threadpoolctl.py in __init__(self, limits, user_api)
    169             self._check_params(limits, user_api)
    170 
--> 171         self._original_info = self._set_threadpool_limits()
    172 
    173     def __enter__(self):

~/.local/lib/python3.9/site-packages/threadpoolctl.py in _set_threadpool_limits(self)
    266             return None
    267 
--> 268         modules = _ThreadpoolInfo(prefixes=self._prefixes,
    269                                   user_api=self._user_api)
    270         for module in modules:

~/.local/lib/python3.9/site-packages/threadpoolctl.py in __init__(self, user_api, prefixes, modules)
    338 
    339             self.modules = []
--> 340             self._load_modules()
    341             self._warn_if_incompatible_openmp()
    342         else:

~/.local/lib/python3.9/site-packages/threadpoolctl.py in _load_modules(self)
    373             self._find_modules_with_enum_process_module_ex()
    374         else:
--> 375             self._find_modules_with_dl_iterate_phdr()
    376 
    377     def _find_modules_with_dl_iterate_phdr(self):

~/.local/lib/python3.9/site-packages/threadpoolctl.py in _find_modules_with_dl_iterate_phdr(self)
    404             ctypes.c_int,  # Return type
    405             ctypes.POINTER(_dl_phdr_info), ctypes.c_size_t, ctypes.c_char_p)
--> 406         c_match_module_callback = c_func_signature(match_module_callback)
    407 
    408         data = ctypes.c_char_p(b"")

MemoryError: 
Lingua principale
Python
Stelle
434
Fork
38
Merge medio
2g 14h
PR unite (30g)
8

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di joblib/threadpoolctl

Tutte le issue di joblib/threadpoolctl

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.