Document and classify `n_jobs` related things to be done to be robust against oversubscription
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 38/100
- Tipo di issue
- Documentazione
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- machine-learning, python
- Ambito
- documentation, performance
Direzione di ricerca
Start by reviewing the listed work items and the linked fast-array-utils issue #245, which the proposed scheduler guidance depends on. The issue calls for documenting LocalCluster setup and use, scheduler behavior, and BLAS oversubscription nuances; it does not name documentation files or tests. Done means those behaviors and recommendations are documented after the related kernel and scheduler work is complete.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Here I blissfuly ignore the fact that BLAS related oversubscriptions mainly because:
- They already exist, with or without my following suggestions
- It is caused by our usage of dask-ml and we can't do anything about it except to switch defaults from dask-ml. In their documentation they left the BLAS up to the user to set.
- We can wrap our
gram_blockwith thethreadpool_limits(1, user_api="blas")but we'd need concrete evidence it hurts performance before
If we release the GIL or parallelize ourselves all of our kernels, the reasons to use LocalCluster would narrow down to:
- .persist() of data larger than RAM. Only distributed can spill to disk and enforce memory limits
- h5py-backed lazy data. h5py takes a global lock, so threads read one at a time. Separate processes can each open the file.
This would then be a narrow use case IMO and since LocalCluster is the only case I can think of which causes oversubscription (this is true only after https://github.com/scverse/fast-array-utils/issues/245) , we can just explicitly document usage of LocalCluster as the following
import dask
dask.config.set({"distributed.nanny.pre-spawn-environ.NUMBA_NUM_THREADS": "1"})
cluster = LocalCluster(...) # must come after
Then we can safely have defaults which would maximize the utilization of cores.
Still need to do:
- Make the 29 numba kernels of scanpy to respect the n_jobs ( I think this is why no one actually complained about speed so far, even though the default is only 4)
- We can also make BLAS kernels respect
n_jobsbut I feel like this is ignored in general. The problem with BLAS kernals happens when they are inside dask tasks. - https://github.com/scverse/fast-array-utils/issues/245 for fixing oversubscribing via the dask scheduler=
threadedpath. - Set
nogil=Truein our scanpy cases like_sum_and_sum_squares_clipped - Document scheduler=
processesshould not be used unless you know what you are doing. (We can't say this atm, the user now needs to know implementation details to use process based scheduler is optimal for performance or not). When we fix https://github.com/scverse/fast-array-utils/issues/245, we can say we work optimally for scheduler=threadedfor all of our functions. - Document how to handle
LocalClusterand when to use it. - Document the BLAS related nuances for oversubscription, it happens only when
In short after these are done, for scanpy we can say:
- in-memory input: kernels on the main thread use
n_jobsthreads - dask input: chunk tasks are limited by dask's
num_workers, and each task runs serially after scverse/fast-array-utils#245
- Lingua principale
- Python
- Stelle
- 2.6k
- Fork
- 809
- Merge medio
- 1g 1h
- PR unite (30g)
- 79
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di scverse/scanpy
-
Area - Plotting 🌺
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
scverse/scanpy#3576 · 1 commento · 2 reazioni ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 64/100
I maintainer di solito rispondono entro 1 giorno
-
Triage 🩺
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
scverse/scanpy#4564 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 18/100
scverse/scanpy#4563 · 1 commento · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di scverse/scanpy
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
fossasia/eventyay-exhibition#465 · 3 commenti · 1 reazione ·
I maintainer di solito rispondono entro 3 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
I maintainer di solito rispondono entro 1 giorno
-
area/webapp comp/desktop P2 type/bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
NousResearch/hermes-agent#163341 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
cpp-best-practices/project_validator#609 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
smart-village-solutions/smart-speech-flow#765 ·
I maintainer di solito rispondono entro 1 giorno