Skip to content

Launching tasks within tasks without using the distributed scheduler #3235

Closed

Description

@shoyer

The pattern described here with dask.delayed doesn't actually seem to use/require the distributed scheduler in any way:
https://distributed.readthedocs.io/en/latest/task-launch.html#dask-delayed

Is there any reason not to encourage using this pattern within core dask collections? I can think of some examples where this would be useful, e.g., for indexing dask arrays with dask arrays in #3210.

Activity

  1. mrocklin commented on Mar 1, 2018

    @mrocklin
    Member

    One issue would be oversubscription of hardware because of using too many threads. The distributed scheduler has cleverness that avoids this sort of thing.

    Note that if you can install a modern version Tornado (which I understand is a big if in some places :) ) the dask.distributed scheduler is very lightweight when created with

    client = Client(processes=False)
    
  2. jakirkham commented on Mar 1, 2018

    @jakirkham
    Member

    If one doesn't start a Client instance, what happens to this example? Does it just block in the middle of the task? Is it able to start the next task? Other things to consider for this case?

  3. mrocklin commented on Mar 1, 2018

    @mrocklin
    Member

    My guess is that it would create a new ThreadPool and run the sub-computation as a blocking computation within this task.

  4. shoyer commented on Mar 1, 2018

    @shoyer
    MemberAuthor

    My guess is that it would create a new ThreadPool and run the sub-computation as a blocking computation within this task.

    Yeah, this is a non-starter. Now that I think about it, I recall running into these issues before.

    It might be worth noting somewhere in that example why this isn't a good idea with non-distributed dask.

  5. mrocklin commented on Mar 1, 2018

    @mrocklin
    Member

    Hrm, you probably could make this work with the modified ThreadPoolExecutor in dask.distributed rather than a vanilla ThreadPool. It has enough of the secede/rejoin logic to make this work.

    This would take modest effort though.

  6. mrocklin commented on Oct 24, 2018

    @mrocklin
    Member

    I'm going to go ahead and close this. It doesn't look like anyone cares enough about this to do this work near-term. The distributed scheduler also offers this functionality.

  7. jakirkham commented on Jun 24, 2019

    @jakirkham
    Member

    In a Python 3.5+ code base, would this be more achievable using async?

  8. mrocklin commented on Jun 24, 2019

    @mrocklin
    Member

    No. There's nothing we can do with async/await tahat we couldn't do with tornado.

    Why do you ask @jakirkham . Is this blocking you somewhere?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions