Skip to content

Conversation

@syed-ahmed
Copy link
Collaborator

This PR changes the ATen CMakeLists.txt slightly, to enable standalone build of ATen inside PyTorch. Currently, the tests in ATen gets linked to libcaffe.so libcaffe2.so. As a result, ATen can't be built standalone without building from the root pytorch directory. I know that there is a big merge happening between caffe2 and pytorch and hence, the purpose of this PR is to really start a conversation on what would be the proper way of migrating the CMakeLists to enable clean builds. We should also follow up on this PR: #7275. For your reference, that PR has the explanation for why -Wl --no-as-need is needed. Moreover, without set(ATen_CUDA_SRCS ${all_cuda_cpp}), the standalone build will throw unresolved references.

@fmassa
Copy link
Member

fmassa commented Jul 12, 2018

cc @orionr

@orionr
Copy link
Contributor

orionr commented Jul 12, 2018

Thanks for kicking off this conversation, @syed-ahmed! As you alluded to, we're looking to merge / refactor Caffe2 and ATen tensors, registry, and operators under a new c10 directory. Effectively aten/ will become c10/ (living at pytorch/c10/ or pytorch/caffe2/c10/ - still TBD) and support both PyTorch and Caffe2 frontends.

@syed-ahmed, what is the use case where you need a separate ATen (and hopefully soon c10) build? We're definitely open to this (especially when c10 is mature), but I want to make sure what you're thinking is compatible with this new architectural split. In the meantime, we've stopped syncing to https://github.com/zdevito/ATen/ so it isn't impacted by the large changes coming.

cc @dzhulgakov @ezyang and @smessmer as well.

@syed-ahmed
Copy link
Collaborator Author

Thank you for the reply! I was just going by the readme and build ATen using cmake, since it mentioned of it being standalone. I like that ATen is standalone and I can build and test features without having to build from the root directory, but it's more of a personal choice. I don't currently have a use case for ATen/c10 to be standalone, but I have been poking around Tensor Comprehensions and it seems to have ATen as a dependency.

Copy link
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

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

@orionr has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

zdevito pushed a commit to zdevito/ATen that referenced this pull request Jul 12, 2018
Summary:
This PR changes the ATen `CMakeLists.txt` slightly, to enable standalone build of ATen inside PyTorch. Currently, the tests in ATen gets linked to `libcaffe.so libcaffe2.so`. As a result, ATen can't be built standalone without building from the root pytorch directory. I know that there is a big merge happening between caffe2 and pytorch and hence, the purpose of this PR is to really start a conversation on what would be the proper way of migrating the CMakeLists to enable clean builds. We should also follow up on this PR: pytorch/pytorch#7275. For your reference, that PR has the explanation for why `-Wl --no-as-need` is needed. Moreover, without `set(ATen_CUDA_SRCS ${all_cuda_cpp})`, the standalone build will throw unresolved references.
Pull Request resolved: pytorch/pytorch#9377

Reviewed By: smessmer

Differential Revision: D8825921

Pulled By: orionr

fbshipit-source-id: c521159b4885639fc7990a9819202051455d07db
@syed-ahmed syed-ahmed deleted the aten-standalone-build branch July 12, 2018 23:41
zdevito pushed a commit to zdevito/ATen that referenced this pull request Jul 13, 2018
Summary:
This PR changes the ATen `CMakeLists.txt` slightly, to enable standalone build of ATen inside PyTorch. Currently, the tests in ATen gets linked to `libcaffe.so libcaffe2.so`. As a result, ATen can't be built standalone without building from the root pytorch directory. I know that there is a big merge happening between caffe2 and pytorch and hence, the purpose of this PR is to really start a conversation on what would be the proper way of migrating the CMakeLists to enable clean builds. We should also follow up on this PR: pytorch/pytorch#7275. For your reference, that PR has the explanation for why `-Wl --no-as-need` is needed. Moreover, without `set(ATen_CUDA_SRCS ${all_cuda_cpp})`, the standalone build will throw unresolved references.
Pull Request resolved: pytorch/pytorch#9377

Reviewed By: smessmer

Differential Revision: D8825921

Pulled By: orionr

fbshipit-source-id: c521159b4885639fc7990a9819202051455d07db
goodlux pushed a commit to goodlux/pytorch that referenced this pull request Aug 15, 2018
Summary:
This PR changes the ATen `CMakeLists.txt` slightly, to enable standalone build of ATen inside PyTorch. Currently, the tests in ATen gets linked to `libcaffe.so libcaffe2.so`. As a result, ATen can't be built standalone without building from the root pytorch directory. I know that there is a big merge happening between caffe2 and pytorch and hence, the purpose of this PR is to really start a conversation on what would be the proper way of migrating the CMakeLists to enable clean builds. We should also follow up on this PR: pytorch#7275. For your reference, that PR has the explanation for why `-Wl --no-as-need` is needed. Moreover, without `set(ATen_CUDA_SRCS ${all_cuda_cpp})`, the standalone build will throw unresolved references.
Pull Request resolved: pytorch#9377

Reviewed By: smessmer

Differential Revision: D8825921

Pulled By: orionr

fbshipit-source-id: c521159b4885639fc7990a9819202051455d07db
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants