Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add libtorch #5209

Closed
abirbasak opened this issue Jan 22, 2019 · 10 comments · Fixed by #17199
Closed

Add libtorch #5209

abirbasak opened this issue Jan 22, 2019 · 10 comments · Fixed by #17199
Assignees
Labels
category:new-port The issue is requesting a new library to be added; consider making a PR!

Comments

@abirbasak
Copy link

It will be nice to have libtorch (c++ library from PyTorch ) on vcpkg,
The github repo https://github.com/pytorch/pytorch

@PhoebeHui PhoebeHui added the category:new-port The issue is requesting a new library to be added; consider making a PR! label Jan 24, 2019
@Fleischner
Copy link

Currently I'm blocked by the fact that during cmake configure step it needs an python installation with yaml package. How do you handle those cases normally?
Is it up to the user to install an suitable python setup?

@Fleischner
Copy link

Will start an pull request for cooperate work soon. Some updates so far:

  • Trying to build with cuda and cudadnn, otherwise it's deadly slow. cudadnn needs to be installed by hand.

  • Currently used Eigen Version 3.3.4 has incompatibilites with GPU __half types. The current compatible Eigen branch is d41dc4dd74. There would be an option to build with hidden dependency

  • Protobuf needs patches. There are problems with nvcc in the generated files with "constexpr kIndexInFileMessages" static variables. pytorch has options DBUILD_CUSTOM_PROTOBUF and DCAFFE2_LINK_LOCAL_PROTOBUF to use hidden dependency protobuf and link statically against it.

  • I fear pytorch has incompatibility with caffe2 port. It uses caffe2 internally and is strongly coupled to this. There seems to be no option to use an system installed caffe2

@Fleischner
Copy link

Fleischner commented Jun 16, 2019

From 1.0 release pytorch seems to be a fusion of torch+pytorch+caffe2+onnx in a single package.
Caffe2_PyTorch_1_0

So I suggest to discontinue caffe2 port and continue only with libtorch (c++ frontend of pytorch)

Edit:
libtorch build includes caffe2 build.
Currently no vcpkg ports depend on caffe2

@Fleischner
Copy link

If build without python, libtorch shouldn't depend on pybind11. But still it tries to include some pybind headers.

Building with pybind11 now. However libtorch build process requires python.exe. If set to the python executable in tools directory, pybind11 complains that this executable is 32bit...

Since I'm not sure if downloading and installing an x64 portable python will result in linking to the wrong libraries, I will change the python3 port to build with the python3.exe as tools

@Fleischner
Copy link

pytorch build needs an python.exe to be set. But then pybind11 cmake targets wrongly search libraries relative to this exe instead of using the correct libraries from the python3 port.

I got it to build with an very ugly port file, many hacks and some hidden deps....
But eigen3, protobuf and pybind need patches. No way around.

@jasjuang
Copy link
Contributor

jasjuang commented Jul 6, 2019

@Fleischner could you share what you have so far? I am interested in this too. Is it easy to build it without python?

@JackBoosY
Copy link
Contributor

We can’t reopen this issue until a PR is opened, unfortunately, consider making a pull request!

@soroshsabz
Copy link
Contributor

I need this, please consider again.

@zhaofeng-shu33
Copy link
Contributor

Need this also

@Bzz2745
Copy link

Bzz2745 commented Jan 31, 2023

I want to know if libtorch could build with CUDA and CUDNN on vcpkg now ?I didn't see any dependencies about that when I run 'vcpkg search libtorch'.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:new-port The issue is requesting a new library to be added; consider making a PR!
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants