sci-libs/pytorch: add PyTorch 1.10.1#1123
Conversation
|
Thank you @Miezhiko ! @littlewu2508 would you like to give a review? |
|
@Miezhiko Can we use the system pybind headers and libs for compilation rather than using the third_party (stay the same as pytorch-1.8,1.9)? |
|
@littlewu2508 don't know, in this I'm just removing third party pylib in |
|
but you are right, I will try this: |
|
@littlewu2508 updated |
|
In This error also occurs in the 1.9.0 version. Have you encountered a similar issue? |
|
mhm, seems like building with |
Leave this to me. I've got a solution. I'll also update some patches for the ROCm. |
|
Okay, cool with me! |
| rm -rfv "${ED}/usr/${LIB}/cmake" | ||
|
|
||
| if use python; then | ||
| scanelf -r --fix "${BUILD_DIR}/caffe2/python" |
| python_foreach_impl python_optimize | ||
| fi | ||
|
|
||
| find "${ED}/usr/${LIB}" -name "*.a" -exec rm -fv {} \; |
|
|
||
| find "${ED}/usr/${LIB}" -name "*.a" -exec rm -fv {} \; | ||
|
|
||
| use test && rm -rfv "${ED}/usr/test" "${ED}"/usr/bin/test_{api,jit} |
There was a problem hiding this comment.
| use test && rm -rfv "${ED}/usr/test" "${ED}"/usr/bin/test_{api,jit} | |
| if use test; then | |
| rm -r "${ED}/usr/test" "${ED}"/usr/bin/test_{api,jit} || die | |
| fi |
| cp -rv "${WORKDIR}/${P}/third_party/pybind11/include/pybind11" "${ED}/usr/include/" | ||
|
|
||
| rm -fv "${ED}/usr/${LIB}/libtbb.so" | ||
| rm -rfv "${ED}/usr/${LIB}/cmake" |
There was a problem hiding this comment.
| rm -rfv "${ED}/usr/${LIB}/cmake" | |
| rm -r "${ED}/usr/${LIB}/cmake" || die |
|
|
||
| cp -rv "${WORKDIR}/${P}/third_party/pybind11/include/pybind11" "${ED}/usr/include/" | ||
|
|
||
| rm -fv "${ED}/usr/${LIB}/libtbb.so" |
There was a problem hiding this comment.
| rm -fv "${ED}/usr/${LIB}/libtbb.so" | |
| rm -v "${ED}/usr/${LIB}/libtbb.so" || die |
There was a problem hiding this comment.
And in the other lines above too.
If external commands are called we need to call die if they fail to stop the ebuild there. Also drop the -f argument, as this causes rm to exit successfully even if the file does not exist and therefore interferes with || die
| KEYWORDS="~x86 ~amd64" | ||
|
|
||
| IUSE="asan blas cuda +fbgemm ffmpeg gflags glog +gloo leveldb lmdb mkldnn mpi namedtensor +nnpack numa +observers opencl opencv +openmp +python +qnnpack redis rocm static test tools zeromq" | ||
| RESTRICT="!test? ( test )" |
There was a problem hiding this comment.
| RESTRICT="!test? ( test )" |
| SLOT="0" | ||
| KEYWORDS="~x86 ~amd64" | ||
|
|
||
| IUSE="asan blas cuda +fbgemm ffmpeg gflags glog +gloo leveldb lmdb mkldnn mpi namedtensor +nnpack numa +observers opencl opencv +openmp +python +qnnpack redis rocm static test tools zeromq" |
There was a problem hiding this comment.
| IUSE="asan blas cuda +fbgemm ffmpeg gflags glog +gloo leveldb lmdb mkldnn mpi namedtensor +nnpack numa +observers opencl opencv +openmp +python +qnnpack redis rocm static test tools zeromq" | |
| IUSE="asan blas cuda +fbgemm ffmpeg gflags glog +gloo leveldb lmdb mkldnn mpi namedtensor +nnpack numa +observers opencl opencv +openmp +python +qnnpack redis rocm static tools zeromq" |
|
|
||
| LICENSE="BSD" | ||
| SLOT="0" | ||
| KEYWORDS="~x86 ~amd64" |
There was a problem hiding this comment.
Please sort the keywords, it helps with some tools if they are in the expected order. And also, repoman will complain if they are not alphabetically.
| KEYWORDS="~x86 ~amd64" | |
| KEYWORDS="~amd64 ~x86" |
| # Copyright 1999-2021 Gentoo Authors | ||
| # Distributed under the terms of the GNU General Public License v2 | ||
|
|
||
| EAPI=7 |
There was a problem hiding this comment.
Can we bump this to EAPI=8 while we are touching this package anyway?
|
|
||
| EAPI=7 | ||
|
|
||
| PYTHON_COMPAT=( python3_{7..10} ) |
There was a problem hiding this comment.
| PYTHON_COMPAT=( python3_{7..10} ) | |
| PYTHON_COMPAT=( python3_{8..10} ) |
|
@AndrewAmmerlaan thank you for review but first I'd wait for python bindings fix from @littlewu2508 |
Hi, do you have a PR somewhere for this? |
I have some local changes that fixes python bindings and rocm related issues but not ready for PR yet. Recently all the rocm dependencies are finally merged into portage tree, so I suggest we can land pytorch into ::gentoo.
@Miezhiko You can refine your ebuild according to the review comments anyway, then merge it into master. I'll open another PR to sci to fix python bindings and rocm-4.3 support. After that let's consider landing it to ::gentoo |
Meanwhile, can open a PR for pytorch-1.9.1 to replace pytorch-1.9.0, which is also broken in python and rocm. |
|
@littlewu2508 If you are ready with the Python binding fix, just open a new PR based on this one. Just donot forget to acknownledge @Miezhiko. |
|
I'm getting a compile failure (happens both with default flags, and with all disabled): |
Signed-off-by: Miezhiko <[email protected]>
Signed-off-by: Miezhiko <[email protected]>
Signed-off-by: Miezhiko <[email protected]>
improve ebuild quality + switch to EAPI 8 Signed-off-by: Miezhiko <[email protected]>
|
@AndrewAmmerlaan updated ebuild, but it still has same problems with python and maybe some rocm patches? what @littlewu2508 said |
Signed-off-by: Miezhiko <[email protected]>
|
(fixed breakpad problem too) |
Signed-off-by: Miezhiko <[email protected]>
Thanks for fixing breakpad. I've compiling with rocm support, and if everything goes well I'll update the changes. |
Signed-off-by: Miezhiko <[email protected]>
|
@littlewu2508 please pull small fix for |
|
Also trying to update breakpad on upstream |
Other changes: 1. Pytorch seems to be work fine with different version of protobuf, so no need to specify 0/30; however when protobuf version changed torch should be rebuilt. 2. BUILD_NAMEDTENSOR is not an option now 3. Verbose mode for rm in src_install Package-Manager: Portage-3.0.22, Repoman-3.0.3 Signed-off-by: Yiyang Wu <[email protected]>
|
Masha#1 I create a PR to your branch for pushing python binding and rocm support |
sci-libs/pytorch: fix python and update rocm support
|
@littlewu2508 thank you, merged. |
|
With USE="python" I get this error: And with USE="opencl" I get this error: |
Signed-off-by: Miezhiko <[email protected]>
|
Thanks @Miezhiko and @littlewu2508 👍 USE="opencl" or USE="python" is not quite working yet, but I merged it anyway since it is such a huge improvement over the in-tree ebuild already (since those don't build at all). We can fix the python/opencl stuff in a separate PR |
|
@AndrewAmmerlaan thank you, but I haven't finished yet my own testing after PR merge, still building commit |
I can't reproduce this. Maybe you can provide more information? It seems like pytorch tries to search a third party dir.
I think dev-util/opencl-headers is missing. Should add some dependencies |
I have that installed, so that is not it.
It is probably related to either the python version or the setuptools version, I'm compiling with python3.10 and setuptools-59.8.0. |
According to the portage file list there are several packages providing
It seems that the That specific line fails if I just |
I*'m using python3.8 and setuptools-57.4.0-r2. Also, I noticed the that Let me try upgrading distutils and see if pytorch breaks. |
So it's true only with |
Backport an upstream PR: pytorch/pytorch#69904 Bug: gentoo#1123 (comment) Package-Manager: Portage-3.0.22, Repoman-3.0.3 Signed-off-by: Yiyang Wu <[email protected]>
Reference: pytorch/pytorch@0776756 Reference: #1123 (comment) Package-Manager: Portage-3.0.22, Repoman-3.0.3 Closes: #1130 Signed-off-by: Yiyang Wu <[email protected]> Signed-off-by: Benda Xu <[email protected]>
https://pytorch.org/blog/pytorch-1.10-released/