Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Disco] Allow allocation that only exists on worker0 #16993

Conversation

Lunderberg
Copy link
Contributor

The disco.Session.scatter_from_worker0 function expects a DRef which an NDArray on worker 0, and NullOpt on all other workers. Prior to this commit, there was no method in the disco.Session that could be used to make such a DRef. As a result, every use of scatter_from_worker0 generated an error, stating that non-zero workers should have NullOpt as their send argument.

This commit adds a worker0_only: bool argument to disco.Session.empty. This can be used to generate an allocation that only exists on worker zero, suitable for use in scatter_from_worker0.

The `disco.Session.scatter_from_worker0` function expects a `DRef`
which an `NDArray` on worker 0, and `NullOpt` on all other workers.
Prior to this commit, there was no method in the `disco.Session` that
could be used to make such a `DRef`.  As a result, every use of
`scatter_from_worker0` generated an error, stating that non-zero
workers should have `NullOpt` as their `send` argument.

This commit adds a `worker0_only: bool` argument to
`disco.Session.empty`.  This can be used to generate an allocation
that only exists on worker zero, suitable for use in
`scatter_from_worker0`.
@Lunderberg Lunderberg merged commit c6a8a80 into apache:main May 14, 2024
19 checks passed
@Lunderberg Lunderberg deleted the disco_allow_dref_with_allocations_on_worker0_only branch May 14, 2024 14:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants