Skip to content

Commit

Permalink
Install c10d headers with absolute path (pytorch#86257)
Browse files Browse the repository at this point in the history
pytorch#85780 updated all c10d headers in pytorch to use absolute path following the other distributed components. However, the headers were still copied to `${TORCH_INSTALL_INCLUDE_DIR}/torch`, thus external extentions still have to reference the c10d headers as `<c10d/*.h>`, making the usage inconsistent (the only exception was c10d/exception.h, which was copied to `${TORCH_INSTALL_INCLUDE_DIR}/torch/csrc/distributed/c10d`).

This patch fixes the installation step to copy all c10d headers to `${TORCH_INSTALL_INCLUDE_DIR}/torch/csrc/distributed/c10d`, thus external extensions can consistently reference c10d headers with the absolute path.

Pull Request resolved: pytorch#86257
Approved by: https://github.com/kumpera
  • Loading branch information
minsii authored and pytorchmergebot committed Oct 5, 2022
1 parent b67e022 commit 089a64e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
3 changes: 0 additions & 3 deletions caffe2/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1147,9 +1147,6 @@ endif()
install(DIRECTORY "${TORCH_SRC_DIR}/csrc"
DESTINATION ${TORCH_INSTALL_INCLUDE_DIR}/torch
FILES_MATCHING PATTERN "*.h" PATTERN "*.hpp")
install(DIRECTORY "${TORCH_SRC_DIR}/csrc/distributed/c10d"
DESTINATION ${TORCH_INSTALL_INCLUDE_DIR}
FILES_MATCHING PATTERN "*.h" PATTERN "*.hpp")
install(FILES
"${TORCH_SRC_DIR}/script.h"
"${TORCH_SRC_DIR}/extension.h"
Expand Down
5 changes: 2 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -1062,8 +1062,6 @@ def main():
'include/c10/cuda/impl/*.h',
'include/c10/hip/*.h',
'include/c10/hip/impl/*.h',
'include/c10d/*.h',
'include/c10d/*.hpp',
'include/caffe2/**/*.h',
'include/torch/*.h',
'include/torch/csrc/*.h',
Expand Down Expand Up @@ -1094,7 +1092,8 @@ def main():
'include/torch/csrc/deploy/*.h',
'include/torch/csrc/deploy/interpreter/*.h',
'include/torch/csrc/deploy/interpreter/*.hpp',
'include/torch/csrc/distributed/c10d/exception.h',
'include/torch/csrc/distributed/c10d/*.h',
'include/torch/csrc/distributed/c10d/*.hpp',
'include/torch/csrc/distributed/rpc/*.h',
'include/torch/csrc/jit/*.h',
'include/torch/csrc/jit/backends/*.h',
Expand Down

0 comments on commit 089a64e

Please sign in to comment.