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 #169
Add libtorch #169
Conversation
Sorry, the build is only launched for Early Access Program users. You can request access writing in this issue. |
Sorry, the build is only launched for Early Access Program users. You can request access writing in this issue. |
Sorry, the build is only launched for Early Access Program users. You can request access writing in this issue. |
Some configurations of 'libtorch/1.2.0' have failed:
|
I've checked this recipe and it's complex ... To build it from source, it requires other libraries. I've tried to create a generic version for any version here: uilianries@3b007a8 |
Some configurations of 'libtorch/1.2.0' have failed:
|
@uilianries may you create a PR to author's repo with your changes? (+ hook fixes) |
@SSE4 Niet, but I should. |
merge conan-io into my fork
Some configurations of 'libtorch/1.2.0' have failed:
|
Some configurations of 'libtorch/1.2.0' have failed:
|
There is a way of installing pytorch from sources
|
Some configurations of 'libtorch/1.2.0' have failed:
|
@PinkySan there is no way to install additional dependencies from python. All the resources should be in the recipe. There are some things missing in this PR, like the test_package recipe and the missing attributes |
Unfortunatly, that is true. |
@PinkySan, for what it's worth, I have put together a Conan recipe to build Libtorch from scratch. It works, but not consistently, often failing on this error: ( "You found a build system error: AVX512F, AVX512DQ, AVX512VL " "is defined (via e.g. -mavx512f, -mavx512dq, and -mavx512vl) " "but CAFFE2_PERF_WITH_AVX512 is not defined.") You can find the recipe here: https://github.com/forwardmeasure/conan/tree/master/recipes/conan-libtorch Regards, |
Some configurations of 'libtorch/1.2.0' failed in build 9 (
|
For what it's worth, I also have a WIP implementation of a libtorch recipe that reuses some packages: https://github.com/bmanga/conan-libtorch |
Thanks, Bruno. I got mine working soon after posting. Cheers! |
Some configurations of 'libtorch/1.2.0' failed in build 10 (
|
@PinkySan please address the issues reported above by the bot, otherwise the PR will be closed. Thanks! |
I guess this solution works better. Please close this PR
|
For what it's worth, I'm planning to cleanup my version and propose a barebone version for inclusion soon-ish. I think it would be good to converge and work on a single attempt (there seem to be at least 4 versions based on this PR alone) |
remove gcc4.8, gcc9, windows-debug jobs
@bmanga any updates on this? I did not find another open PR for libtorch, and as we migrate to conan, we might need it soon. Willing to help out 👍 |
settings = {"os": ["Windows","Linux"], | ||
"build_type": ["Debug", "Release", "RelWithDebInfo"], | ||
"compiler": {"gcc": {"version": None, | ||
"libcxx": ["libstdc++", "libstdc++11"]}, | ||
"Visual Studio": {"version": None}, | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
url_base = "https://download.pytorch.org/libtorch/" | ||
|
||
|
||
def getGPU(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
def getGPU(self): | |
def _getGPU(self): |
def getOS(self): | ||
if(self.settings.os == "Windows"): | ||
if(self.settings.build_type == "Debug"): | ||
return "libtorch-win-shared-with-deps-debug-" | ||
return "libtorch-win-shared-with-deps-" | ||
if(self.settings.os == "Linux"): | ||
if(self.settings.compiler.libcxx == "libstdc++11"): | ||
return "libtorch-cxx11-abi-shared-with-deps-" | ||
return "libtorch-shared-with-deps-" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
def getOS(self): | |
if(self.settings.os == "Windows"): | |
if(self.settings.build_type == "Debug"): | |
return "libtorch-win-shared-with-deps-debug-" | |
return "libtorch-win-shared-with-deps-" | |
if(self.settings.os == "Linux"): | |
if(self.settings.compiler.libcxx == "libstdc++11"): | |
return "libtorch-cxx11-abi-shared-with-deps-" | |
return "libtorch-shared-with-deps-" | |
def _getOS(self): | |
if self.settings.os == "Windows": | |
if self.settings.build_type == "Debug": | |
return "libtorch-win-shared-with-deps-debug-" | |
return "libtorch-win-shared-with-deps-" | |
if self.settings.os == "Linux": | |
if self.settings.compiler.libcxx == "libstdc++11": | |
return "libtorch-cxx11-abi-shared-with-deps-" | |
return "libtorch-shared-with-deps-" |
return "libtorch-shared-with-deps-" | ||
|
||
def source(self): | ||
url = self.url_base + self.getGPU() + self.getOS() + self.version + ".zip" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
url = self.url_base + self.getGPU() + self.getOS() + self.version + ".zip" | |
url = self.url_base + self._getGPU() + self._getOS() + self.version + ".zip" |
I'm working on a pytorch recipe, but if someone has a good recipe almost ready for a PR, I'll be happy to help. |
I am living with distributing binaries for now :-/ from conans import ConanFile, tools
class LibtorchConan(ConanFile):
name = "libtorch"
settings = "os", "arch"
url = "https://github.com/pytorch/pytorch"
description = "An open source machine learning framework that accelerates the path from research prototyping to production deployment."
license = "All rights reserved."
topics = ("computer-vision", "meta-data")
def build(self):
tools.get(**self.conan_data["binaries"][self.version][str(self.settings.arch)])
def package(self):
self.copy("*", src=self.name)
def package_info(self):
self.cpp_info.libs = tools.collect_libs(self)
binaries:
1.4.0:
x86_64:
url: https://download.pytorch.org/libtorch/cu101/libtorch-cxx11-abi-shared-with-deps-1.4.0.zip
sha256: f214bfde532877aa5d4e0803e51a28fa8edd97b6a44b6615f75a70352b6b542e |
@blackliner That is the same idea, i had at the beginning of this PR. I guess that is the best solution |
Yes, I guess some things are not meant to be built from scratch :D I forgot to mention, to use my previous recipe, you need to use the if(EXISTS "${CMAKE_BINARY_DIR}/conan_paths.cmake")
include("${CMAKE_BINARY_DIR}/conan_paths.cmake")
endif() |
Specify library name and version: lib/1.0
I've read the guidelines for contributing.
I've followed the PEP8 style guides for Python code in the recipes.
I've used the latest Conan client version.
I've tried at least one configuration locally with the
conan-center hook activated.
What should be inside the test_package folder?
conandata.yml? I am creating the url within the recipe