Skip to content

Conversation

ilia-cher
Copy link
Contributor

@ilia-cher ilia-cher commented Jun 13, 2019

Stack from ghstack:

Summary:
Adding std::future interface into ATen/Parallel for convenience

Test:
PARALLEL_BACKEND=NATIVE USE_CUDA=0 BLAS=MKL USE_MKLDNN=1 BUILD_BINARY=1 python setup.py develop --cmake
./build/bin/test_parallel
PARALLEL_BACKEND=OPENMP USE_CUDA=0 BLAS=MKL USE_MKLDNN=1 BUILD_BINARY=1 python setup.py develop --cmake
./build/bin/test_parallel
PARALLEL_BACKEND=NATIVE_TBB USE_TBB=1 USE_CUDA=0 BLAS=MKL USE_MKLDNN=1 BUILD_BINARY=1 python setup.py develop --cmake
./build/bin/test_parallel

Differential Revision: D15816658

Summary:
Adding std::future interface into ATen/Parallel for convenience
@pytorchbot pytorchbot added module: internals Related to internal abstractions in c10 and ATen module: openmp Related to OpenMP (omp) support in PyTorch labels Jun 13, 2019
ilia-cher added 4 commits June 13, 2019 16:50
Future interface for ATen/Parallel

Summary:
Adding std::future interface into ATen/Parallel for convenience

gh-metadata: pytorch pytorch 21764 gh/ilia-cher/28/head
Future interface for ATen/Parallel

Summary:
Adding std::future interface into ATen/Parallel for convenience

gh-metadata: pytorch pytorch 21764 gh/ilia-cher/28/head
Future interface for ATen/Parallel

Summary:
Adding std::future interface into ATen/Parallel for convenience

gh-metadata: pytorch pytorch 21764 gh/ilia-cher/28/head
Future interface for ATen/Parallel

Summary:
Adding std::future interface into ATen/Parallel for convenience

gh-metadata: pytorch pytorch 21764 gh/ilia-cher/28/head

std::future<void> intraop_launch_future(std::function<void()> func) {
auto func_promise = std::make_shared<std::promise<void>>();
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

std::function requires the functor to be copyable, so, unfortunately, we cannot just move std::promise into lambda

Future interface for ATen/Parallel

Summary:
Adding std::future interface into ATen/Parallel for convenience

gh-metadata: pytorch pytorch 21764 gh/ilia-cher/28/head
Future interface for ATen/Parallel

Summary:
Adding std::future interface into ATen/Parallel for convenience

gh-metadata: pytorch pytorch 21764 gh/ilia-cher/28/head
Future interface for ATen/Parallel

Summary:
Adding std::future interface into ATen/Parallel for convenience

gh-metadata: pytorch pytorch 21764 gh/ilia-cher/28/head
@ilia-cher ilia-cher requested a review from cpuhrsch June 17, 2019 18:17
ilia-cher added 5 commits June 17, 2019 13:19
Future interface for ATen/Parallel

Summary:
Adding std::future interface into ATen/Parallel for convenience

gh-metadata: pytorch pytorch 21764 gh/ilia-cher/28/head
Future interface for ATen/Parallel

Summary:
Adding std::future interface into ATen/Parallel for convenience

gh-metadata: pytorch pytorch 21764 gh/ilia-cher/28/head
Future interface for ATen/Parallel

Summary:
Adding std::future interface into ATen/Parallel for convenience

gh-metadata: pytorch pytorch 21764 gh/ilia-cher/28/head
Future interface for ATen/Parallel

Summary:
Adding std::future interface into ATen/Parallel for convenience

gh-metadata: pytorch pytorch 21764 gh/ilia-cher/28/head
Future interface for ATen/Parallel

Summary:
Adding std::future interface into ATen/Parallel for convenience

gh-metadata: pytorch pytorch 21764 gh/ilia-cher/28/head
@ilia-cher
Copy link
Contributor Author

using ivalue::Future

@zou3519 zou3519 deleted the gh/ilia-cher/28/head branch June 18, 2019 05:08
zdevito pushed a commit to zdevito/ATen that referenced this pull request Jun 18, 2019
Summary:
Pull Request resolved: pytorch/pytorch#21764
ghimport-source-id: fca083c09d814a0411020871f49429509fc0e8b5

Test Plan:
Imported from OSS
see pytorch/pytorch#21764

Differential Revision: D15816658

Pulled By: ilia-cher

fbshipit-source-id: 0e25ca6ff66a837d4f69f37a47e59927ab10e216
@ezyang ezyang added the merged label Jun 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
module: internals Related to internal abstractions in c10 and ATen module: openmp Related to OpenMP (omp) support in PyTorch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants