Remove cuda from autograd profiler (#15898)
authorZachary DeVito <zdevito@fb.com>
Wed, 16 Jan 2019 00:25:28 +0000 (16:25 -0800)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Wed, 16 Jan 2019 00:43:11 +0000 (16:43 -0800)
commitb2eb98f6c371cca2689908d66d9771a26c69f90a
tree10f3db5bd4f0e8bdcc8cbe68ec1de95bb9a6ba7f
parent2824cb6e9c4a38e0d46b0fe842f61945893e7f37
Remove cuda from autograd profiler (#15898)

Summary:
This puts stubs in the autograd profiler for the use of cuda APIs allowing the cuda parts of libtorch to be linked separately from the CPU parts.

This also edits the buck build.

Previous:

For GPU builds:
_C -> csrc -> caffe2
For CPU builds:
_C -> csrc-cpu -> caffe2

Now:
GPU:
_C -> libtorch_cuda -> (libtorch -> caffe2, for CPU)

Pull Request resolved: https://github.com/pytorch/pytorch/pull/15898

Reviewed By: ailzhang

Differential Revision: D13617991

Pulled By: zdevito

fbshipit-source-id: 6d84a50bb356a54b4217f93219902755601b00e1
tools/build_variables.py
torch/CMakeLists.txt
torch/csrc/api/include/torch/nn/parallel/data_parallel.h
torch/csrc/autograd/functions/comm.cpp
torch/csrc/autograd/functions/comm.h
torch/csrc/autograd/profiler.cpp
torch/csrc/autograd/profiler.h
torch/csrc/autograd/profiler_cuda.cpp [new file with mode: 0644]
torch/csrc/cuda/comm.cpp
torch/csrc/cuda/comm.h
torch/csrc/cuda/cuda_check.h