Commit Graph

2 Commits

Author SHA1 Message Date
Jeremy Lilley
35f357927d [futures] Add specific python unittest coverage for collect_all/wait_all (#40233)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/40233

There was a question earlier whether torch.futures.wait_all() would
raised if the underlying futures raise (it was supposed to, but no test
coverage). This change adds a couple very basic torch.futures.collect_all/
wait_all tests.
ghstack-source-id: 106168134

Test Plan: buck test mode/dev-nosan caffe2/test:futures

Differential Revision: D22120284

fbshipit-source-id: 3a8edae5dbf8c58c8361eff156c386a684ec5e86
2020-06-18 16:14:10 -07:00
Shen Li
bb0377bb24 Expose torch.futures.Future (#39008)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/39008

This commit adds a `torch.futures.Future` type and exposes its ctor,
`wait`, `then`, and `set_result` APIs. This type is currently a
wrapper of `c10::ivalue::Future` and mainly used by RPC for now. Later,
we could revamp c10d APIs to return this `Future` type as well. More
utils will be added into `torch.futures` package in followup PRs.

Test Plan: Imported from OSS

Differential Revision: D21723022

Pulled By: mrshenli

fbshipit-source-id: 92e56160544e9bf00d11db3e8347a1b9707882c9
2020-06-02 10:12:56 -07:00