Document and classify `n_jobs` related things to be done to be robust against oversubscription
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 38/100
- Tipo de issue
- Documentación
- Claridad
- Bastante claro
- Estado de actividad
- Activo
- Stack tecnológico
- machine-learning, python
- Área
- documentation, performance
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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
- Lenguaje dominante
- Python
- Estrellas
- 2.6k
- Forks
- 809
- Merge medio
- 1 d 1 h
- PR fusionados (30 d)
- 79
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de scverse/scanpy
-
Area - Plotting 🌺
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
scverse/scanpy#3576 · 1 comentario · 2 reacciones ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 64/100
Los mantenedores suelen responder en 1 día
-
Triage 🩺
Dificultad 4/5 3-5 días Aptitud para principiantes 48/100
Los mantenedores suelen responder en 1 día
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 25/100
scverse/scanpy#4564 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 18/100
scverse/scanpy#4563 · 1 comentario · 1 reacción ·
Los mantenedores suelen responder en 1 día
Todos los issues de scverse/scanpy
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
fossasia/eventyay-exhibition#465 · 3 comentarios · 1 reacción ·
Los mantenedores suelen responder en 3 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Los mantenedores suelen responder en 1 día
-
area/webapp comp/desktop P2 type/bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
NousResearch/hermes-agent#163341 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
cpp-best-practices/project_validator#609 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
smart-village-solutions/smart-speech-flow#765 ·
Los mantenedores suelen responder en 1 día