-
Notifications
You must be signed in to change notification settings - Fork 16
Dask annotations not working when connecting to an existing cluster #47
Comments
Ah this used to work and was the intended way to use annotations. I think this may be caused by PrefectHQ/prefect#6527 — it'll require further investigation though. |
@madkinsz I also encountered this while using |
We made an optimization to task submission but that means that tasks are submitted in the background now, which means that submission can actually occur outside of the context. I'm working on a fix. |
@madkinsz do you mind sharing the PR? I'd like to keep track of this issue and provide help if needed |
I just encountered this issue as well. I am using this config for the
And then submit task with:
This executes 5 tasks simultaneously on the same worker. As far as I can tell the limiting factor is the number of cores. Because if I set |
Also experiencing this problem with temporary clusters on ECS. Workers can be started with resources configures as @tibuch showed with
But using |
Hi @andreas-ntonas, thank you for the very detailed reproduction steps. I'm working on reproducing this issue, but in my testing with the latest On the special worker:
On the regular worker:
I know it's been some time since the original report, would you be willing to test this again using these versions:
And then let me know if you're still having the same trouble? |
I'm going to close this one out as fixed, as we're unable to reproduce this on our end. There were a LOT of improvements to how tasks are handled between November and today, and I believe this was fixed as a side-effect. If anyone is still having trouble with this, please open a new issue with repro steps. |
Hey @chrisguidry Although this is fixed, there is a race condition somewhere as I see different tasks having other task annotations, I can't really provide a reproducible example due to the nature of the problem but it occur in flows that looks like the below with annotate(priority=1000):
task1.map(...)
with annotate(priority=-1000):
task2.map(...) |
@BitTheByte thanks for the feedback, can you open a fresh issue with all the details you have available ( |
I have noticed that Prefect does not respect the dask resources annotations when using an existing cluster
Minimal reproducible example:
I have setup a local distributed cluster like this:
First I spin up a local scheduler:
And then I start 2 workers. The 1st one has 1 thread and 1 "annotation" resource available and the other one has 3 threads and no specified special resources available:
&
Suppose we have the following flow that gets executed 6 times and submits to Dask its tasks for execution:
I would expect
say_hello()
tasks to execute only on the special_worker and theshow_number()
tasks to whichever available.However this is not the case and I get:
On the 1st special worker:
On the 2nd only_regular_tasks worker:
As you can see the say_hello() tasks are getting executed on the 2nd worker that does not have the appropriate --resources "annotation=1" available
Relevant versions used in a
Python 3.10
env:prefect==2.6.5, prefect-dask==0.2.1, dask==2022.10.2, distributed==2022.10.2
The text was updated successfully, but these errors were encountered: