Skip to content
This repository has been archived by the owner on Feb 1, 2020. It is now read-only.

Add support for asynchronous allgatherTensor. #48

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

gchanan
Copy link
Contributor

@gchanan gchanan commented Apr 13, 2017

Because allgatherTensor is a multi-stage process (allgather the sizes, allgather the data), we
can't easily perform it asynchronously. Instead, we complicated the API a bit to make each step
explicit. That is, instead of allgatherTensor(input, output) the API is now:

local tensordesc = mpi.newTensorDesc(mpi.size())
mpi.allgatherTensorDesc(input, tensordesc)
mpi.resizeTensorFromDesc(output, tensordesc)
local handle = mpi.allgatherTensor(input, output, tensordesc)
mpi.freeTensorDesc(tensordesc)

Note also that resizeTensorFromDesc can result in the storage for the output changing
(in case the provided storage is too small).

This could be improved to handle new/free internally, and to provide a single-function
synchronous version.

Because allgatherTensor is a multi-stage process (allgather the sizes, allgather the data), we
can't easily perform it asynchronously.  Instead, we complicated the API a bit to make each step
explicit.  That is, instead of allgatherTensor(input, output) the API is now:

local tensordesc = mpi.newTensorDesc(mpi.size())
mpi.allgatherTensorDesc(input, tensordesc)
mpi.resizeTensorFromDesc(output, tensordesc)
local handle = mpi.allgatherTensor(input, output, tensordesc)
mpi.freeTensorDesc(tensordesc)

Note also that resizeTensorFromDesc can result in the storage for the output changing
(in case the provided storage is too small).

This could be improved to handle new/free internally, and to provide a single-function
synchronous version.
@facebook-github-bot
Copy link
Contributor

Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign up at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need the corporate CLA signed.

If you have received this in error or have any questions, please contact us at cla@fb.com. Thanks!

@facebook-github-bot
Copy link
Contributor

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants