pytorch/test/cpp
Pritam Damania 267fc27d39 Ensure torch.futures.wait_all exits early on error. (#53953)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/53953

torch.futures.wait_all, would wait for all specified futures to
complete before it returned. As a result, if there was an error it would still
wait for a long time (ex: long running RPCs) before it returned an error to the
user.

This PR ensures `wait_all` returns and error as soon as any future runs into an
error and doesn't wait for all futures to complete.

I removed the logic _invoke_rpc_python_udf which raised an error in the unwrap
function, because ideally the error should be set on the Future and not be
raised to the user only when `wait()` is called. As an example, in the case of
`wait_all`, the user never calls `wait()` on the future that errored out but a
future down the chain and we should propagate these errors via `setError`
instead.
ghstack-source-id: 124721216

Test Plan:
1) Unit test added.
2) waitforbuildbot

Reviewed By: mrshenli

Differential Revision: D27032362

fbshipit-source-id: c719e2277c27ff3d45f1511d5dc6f1f71a03e3a8
2021-03-25 07:39:14 -07:00
..
api Add padding='same' mode to conv{1,2,3}d (#45667) 2021-03-18 16:22:03 -07:00
common
dist_autograd Forbid trailing whitespace (#53406) 2021-03-05 17:22:55 -08:00
jit Ensure torch.futures.wait_all exits early on error. (#53953) 2021-03-25 07:39:14 -07:00
lite_interpreter_runtime [PyTorch] Enable test_lite_interpreter_runtime running in android (#54579) 2021-03-24 14:45:27 -07:00
rpc Use type-erased union for Buffer. (#54251) 2021-03-19 04:58:09 -07:00
tensorexpr [TensorExpr] Add plumbing for conv2d fusion. (#54439) 2021-03-24 18:49:07 -07:00
__init__.py remediation of S205607 2020-07-17 17:19:47 -07:00