Skip to content
This repository was archived by the owner on Jul 22, 2024. It is now read-only.
This repository was archived by the owner on Jul 22, 2024. It is now read-only.

submitting future objects by reference #3

Description

@jcmgray

Hi, this looks like a cool project - I'm looking forward to trying it more extensively.

In a few other distributed libraries (e.g. dask and ray) you can pass objects around indirectly just by re-submitting the future. E.g. something like:

def foo(x):
    return x + 1

def bar(x):
    return x**2

# get the first future
f1 = pool.submit(foo, 2)

# submit its answer by reference
f2 = pool.submit(bar, f1)

# get the final answer, without ever gathering f1.result()
f2.result()
# 9

I.e. the workers communicate the result of f1 directly without it passing through the main process, which can be a big efficiency saving for large return objects.

I guess my questions are:

  • I'm not totally sure how torcpy is designed, so would it still be beneficial here? and if so, how easy?

Activity

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