Priorities are ignored when stealing tasks
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 35/100
- Tipo de issue
- Error
- Claridad
- Bastante claro
- Estado de actividad
- Estancado
- Stack tecnológico
- python
- Área
- distributed-systems
Línea de trabajo
Empieza reproduciendo el escenario descrito de ocho tareas y dos workers, utilizando client.submit, priorities, worker-saturation y task stealing. Inspecciona primero el comportamiento del scheduler y de los workers al hacer task stealing; se considera terminado cuando las tareas priorizadas se seleccionan y ejecutan en el orden esperado al robar trabajo, y el entorno indicado está cubierto por una prueba de regresión.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Describe the issue:
There are a few issues actually (two of them related to stealing), so let's go through the whole process.
I use dask and distributed packages to run automation in my project.
To speed up test execution (the tests cannot be run on a single environment in parallel), I spin up multiple VMs (dask workers) and then create a queue of tests (tasks) and assign them to workers until the tasks are depleted. Each task is unique and run once unless it failed (then it’s rerun).
This works perfectly but I noticed that using priorities may speed up execution significantly.
I tried to use dask priorities but ultimately failed. Here are my findings (the first issue is not related to the topic but is a problem nevertheless):
- All of the tasks are consumed immediately by the first VM created; I would like to have no more than one task assigned to a VM at once - this would ensure that priorities are balanced better.
- Dask dashboard shows that priorities have been assigned correctly, but only tasks on the first VM are run according to the priority. The priorities seems to be ignored on the second VM (the one that stole tasks from the first).
- The VM that stole the tasks grab random tasks, not the highest priority ones.
I would prefer assigning only one task per VM instead of stealing, but if I were really to use stealing, than it should grab the highest priority tasks that are not being processed (now it grabs random tasks)
To resolve the first problem, I set distributed.scheduler.worker-saturation to 1.0 but it didn’t help, all of the tasks are consumed at once.
I tried using fifo-timeout to deal with the second one, but it wasn’t helpful (I thought that fifo-timeout is taken into consideration when stealing).
The whole process looks as follows:
- The agent (host) VM creates tasks (not dask → asyncio.create_task()) to create VMs from snapshots (every VM is identical). Please note that spinning up a VM and then setting it up takes several minutes, so the tasks are created before the workers exist.
1.1. Register set up VMs as workers with cmd (nthreads=1). - In the meantime, the agent schedules tests asynchronously:
2.1. Create a list of futures
2.2. Append (client.submit(test)) each test to the list of futures
2.3. Run as_completed to gather futures; if there are failed tests, readd them to the futures list - If there are any existing workers, they start to pick up the tasks
With the current behaviour I haven’t encountered a single situation where a lowest priority task was run last. My task lengths vary from between 20 seconds to 3 minutes; the whole runtime can increase significantly if the tasks are ordered improperly.
Example:
I tested it on a small scale (8 tasks, 2 VMs).
The priorities are equal to an estimated task runtime in seconds (actual runtime is about priority + 40 seconds). That ensures that the slowest tasks have the highest priority.
The first worker consumed all of the tasks immediately.
As soon as the second VM was created, it stole several tasks from the first worker.
Then the workers kept stealing work from each other.
Tasks on the second VM were run in random order.
After the first task was executed on the first VM, the other tasks (which were re-stolen from the second VM) were run in order they were stolen.
Environment:
- Dask version: 2024.12.1
- Distributed version: 2024.12.1
- Python version: 3.13.1
- Operating System: Windows Server 2022 on both scheduler and workers
- Install method: pip
Conclusion
What I only want to achieve here is to make prioritization work.
I am not sure if all of the work consumed by the first VM I create is due to a flaw in my setup process; if this can be fixed, then I could skip stealing altogether.
Still, priorities seem to be ignored when stealing tasks which is a real issue.
- Lenguaje dominante
- Python
- Estrellas
- 1.7k
- Forks
- 781
- Métricas de merge de PR
- Sin PR fusionados en 30 d
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 dask/distributed
-
needs triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
dask/distributed#9366 ·
-
Scipy's spmatrix deprecation keeps the Upstream nightly red after #9351 — all 14 test_serialize_scipy_sparse cases failPosiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abiertoneeds triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
dask/distributed#9353 · 1 comentario ·
-
documentation
Dificultad 1/5 1-3 horas Aptitud para principiantes 82/100
dask/distributed#8304 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
dask/distributed#4816 · 2 comentarios ·
-
Client.scheduler_info needs better documentationPosiblemente ocupada @nil68657 la tomó hace 7 días. Abiertodocumentation good first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
dask/distributed#2378 · 2 comentarios ·
Todos los issues de dask/distributed
Issues similares
-
Issue Triage-Needed
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
pulp/pulp_container#2581 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 85/100
521xueweihan/HelloGitHub#4040 ·
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 64/100
ClanGenOfficial/clangen#6313 ·
Los mantenedores suelen responder en 2 días
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
Los mantenedores suelen responder en 1 día
-
bug(trainer): CustomTrainer func_args with non literal values fail inside the TrainJobPosiblemente ocupada @avanishkasar la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
kubeflow/sdk#879 · 1 comentario ·
Los mantenedores suelen responder en 1 día