From ee7f43529b5bef0f4af4e5e4fe20e5803e8b25b2 Mon Sep 17 00:00:00 2001 From: He Jia Date: Thu, 14 Feb 2019 15:05:00 -0800 Subject: [PATCH 1/5] Update meta.yaml --- platform/pytorch-cpu/meta.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/platform/pytorch-cpu/meta.yaml b/platform/pytorch-cpu/meta.yaml index 0e09712..1a1b450 100644 --- a/platform/pytorch-cpu/meta.yaml +++ b/platform/pytorch-cpu/meta.yaml @@ -1,11 +1,11 @@ package: name: pytorch-cpu - version: 0.4.0 + version: 1.1.0 source: # use git checkout to recursively get the submodule dependencies # the release tarballs do not carry dependencies. - git_rev: v0.4.0 + git_rev: ec8b1c9 git_url: https://github.com/pytorch/pytorch/ build: From f940d32d54e750e8e8605f23a96fab2c6ed43a89 Mon Sep 17 00:00:00 2001 From: He Jia Date: Thu, 14 Feb 2019 15:05:39 -0800 Subject: [PATCH 2/5] Delete gloo-SPEED_UNKNOWN.patch --- platform/pytorch-cpu/gloo-SPEED_UNKNOWN.patch | 37 ------------------- 1 file changed, 37 deletions(-) delete mode 100644 platform/pytorch-cpu/gloo-SPEED_UNKNOWN.patch diff --git a/platform/pytorch-cpu/gloo-SPEED_UNKNOWN.patch b/platform/pytorch-cpu/gloo-SPEED_UNKNOWN.patch deleted file mode 100644 index b78f301..0000000 --- a/platform/pytorch-cpu/gloo-SPEED_UNKNOWN.patch +++ /dev/null @@ -1,37 +0,0 @@ -From b50a33617f8bfe0e2439c96b8cb6ccf70627fcaa Mon Sep 17 00:00:00 2001 -From: Yu Feng -Date: Wed, 13 Jun 2018 17:26:52 -0700 -Subject: [PATCH] define SPEED_UNKNOWN for compilation with anaconda compilers - -When compiling torch with anaconda compilers I ran into this error about SPEED_UNKNOWN undefined: - -https://github.com/pytorch/pytorch/issues/4499 - -I couldn't find the proper header to include -- even if found it is likely not portable. -Given that not too many people outside kernel uses this macro (gloo is one of the few results googling with 'SPEED_KNOWN'), it is -probably a good idea to define it if it is not defined on the system. - -Note that the comment on torch set the macro to -1. - -The correct value appears to be 0, see e.g. this commit to the kernel: -https://patchwork.kernel.org/patch/9573661/ ---- - gloo/common/linux.cc | 5 +++++ - 1 file changed, 5 insertions(+) - -diff --git a/gloo/common/linux.cc b/gloo/common/linux.cc -index dfd3cb81..f155d440 100644 ---- a/gloo/common/linux.cc -+++ b/gloo/common/linux.cc -@@ -31,6 +31,11 @@ - - #include "gloo/common/logging.h" - -+#ifndef SPEED_UNKNOWN -+/* some platforms doesn't define speed unknown in headers we included. */ -+#define SPEED_UNKNOWN 0 -+#endif -+ - namespace gloo { - - const std::set& kernelModules() { From b47ac1e814d3ab93c94195b1782228d0fd1a9ecc Mon Sep 17 00:00:00 2001 From: He Jia Date: Thu, 14 Feb 2019 15:17:22 -0800 Subject: [PATCH 3/5] Update build.sh --- platform/pytorch-cpu/build.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/platform/pytorch-cpu/build.sh b/platform/pytorch-cpu/build.sh index bdcc2ae..5220eba 100644 --- a/platform/pytorch-cpu/build.sh +++ b/platform/pytorch-cpu/build.sh @@ -3,5 +3,10 @@ export NO_CUDA=1 export CMAKE_PREFIX_PATH=$PREFIX export VERBOSE=1 -patch -p1 -d third_party/gloo < ${RECIPE_DIR}/gloo-SPEED_UNKNOWN.patch $PYTHON setup.py install + +echo -e "If you want to build libtorch, please do\n" +echo "cd " +echo "mkdir build_libtorch && cd build_libtorch" +echo "BUILD_TORCH=ON ONNX_NAMESPACE=onnx_torch bash ../tools/build_pytorch_libs.sh --use-nnpack caffe2" +echo -e "\nThen the output will be produced at torch/lib/tmp_install" From 02e5292eb7def1d5954acb08f2077cd4504f7b93 Mon Sep 17 00:00:00 2001 From: He Jia Date: Fri, 15 Feb 2019 10:48:34 -0800 Subject: [PATCH 4/5] Build libtorch --- platform/pytorch-cpu/build.sh | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/platform/pytorch-cpu/build.sh b/platform/pytorch-cpu/build.sh index 5220eba..3474efc 100644 --- a/platform/pytorch-cpu/build.sh +++ b/platform/pytorch-cpu/build.sh @@ -5,8 +5,14 @@ export CMAKE_PREFIX_PATH=$PREFIX export VERBOSE=1 $PYTHON setup.py install -echo -e "If you want to build libtorch, please do\n" -echo "cd " -echo "mkdir build_libtorch && cd build_libtorch" -echo "BUILD_TORCH=ON ONNX_NAMESPACE=onnx_torch bash ../tools/build_pytorch_libs.sh --use-nnpack caffe2" -echo -e "\nThen the output will be produced at torch/lib/tmp_install" +{ + { + mkdir build_libtorch + cd build_libtorch + BUILD_TORCH=ON ONNX_NAMESPACE=onnx_torch bash ../tools/build_pytorch_libs.sh --use-nnpack caffe2 + } && { + echo -e "\nSuccessfully built libtorch at `dirname $PWD`/torch/lib/tmp_install\n" + } +} || { + echo -e "\nError: failed to build libtorch" +} From f50f271bce3599d94bcf659e2a2bd871e8f4c388 Mon Sep 17 00:00:00 2001 From: He Jia Date: Fri, 15 Feb 2019 10:51:35 -0800 Subject: [PATCH 5/5] Update build.sh --- platform/pytorch-cpu/build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform/pytorch-cpu/build.sh b/platform/pytorch-cpu/build.sh index 3474efc..0600adf 100644 --- a/platform/pytorch-cpu/build.sh +++ b/platform/pytorch-cpu/build.sh @@ -14,5 +14,5 @@ $PYTHON setup.py install echo -e "\nSuccessfully built libtorch at `dirname $PWD`/torch/lib/tmp_install\n" } } || { - echo -e "\nError: failed to build libtorch" + echo -e "\nError: failed to build libtorch\n" }