-
-
Notifications
You must be signed in to change notification settings - Fork 50
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
Preserving libtorch_python in package #246
Conversation
Hi! This is the friendly automated conda-forge-linting service. I just wanted to let you know that I linted all conda-recipes in your PR ( |
@conda-forge-admin, please rerender |
Hi! This is the friendly automated conda-forge-webservice. I tried to rerender for you, but it looks like there was nothing to do. This message was generated by GitHub actions workflow run https://github.com/conda-forge/pytorch-cpu-feedstock/actions/runs/9851406294. |
recipe/build.sh
Outdated
@@ -218,7 +218,6 @@ if [[ "$PKG_NAME" == "libtorch" ]]; then | |||
for f in ATen caffe2 tensorpipe torch c10; do | |||
mv torch/include/$f ${PREFIX}/include/$f | |||
done | |||
rm ${PREFIX}/lib/libtorch_python.* |
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.
This won't work AFAIU; libtorch_python.so
depends on a specific python version, while the conda package libtorch
intentionally does not depend on python at all.
If we want to ship libtorch_python.so
, we should most likely package it in the pytorch
output (or perhaps create a separate output).
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.
Thank you for pointing out that libtorch
should not depend on Python. Moving it or creating a separate output seems like a viable solution.
I am relatively new to the build script of this feedstock and find it more complex than other packages I've worked with. Could you please provide some guidance on how to implement your suggestion?
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.
Could you please provide some guidance on how to implement your suggestion?
As a first approach, it should work to "install" libtorch_python.so
in build_pytorch.sh
, by copying from the build cache (that's created & populated during the execution of build.sh
) into $PREFIX/lib
.
you are asking for for the python specific library, you should be able to replace |
We genuinely don't seem to package |
in a typical workflow, people often are not linking to it, so i guess we left it in lib so it could be python specific. |
And a computer that has cuda120
|
I guess that stremlit should be taken with a grain of salt, in this case a 30MB package can't be empty ;) |
OK, my view of the world is restored (thanks @jaimergp 🙏): the files for It would be within the realm of possibility to move them to |
@jeongseok-meta can you comment as to whether or not you are able to link directly to the non-python libraries? it also seems that we do include the TorchConfig.cmake file
are you using conda-forge cmake or an other? |
@hmaarrfk Yes, I can link to other libraries by using However, the problem is that I want to link to By the way, thank you for the other comments. I will be AFK for the next few days, but I will catch up when I return. |
@jeongseok-meta thanks for giving more context. In my experience there is often little value in linking to the "Python library" when a "c" library exists. Its also unclear what those at pytorch meant to have as public vs private. I would consider what you need from the python side, and maybe just avoid using it for maintainability. One thing that would be helpful for us to understand is, does this work from packages from the pytorch channel? While we try to do it the "conda-forge way" we do try to follow upstream "intentions". So if it works with the pytorch + default channel, then it would give us one extra push to try to make it work here (but again, seems like a very niche usecase, so we would need your help to do it well -- some good suggestions came from h-vetinari) |
@jeongseok-meta, this is an issue with our split build. I think the best solution is to move |
Hi! This is the friendly automated conda-forge-linting service. I just wanted to let you know that I linted all conda-recipes in your PR ( |
@hmaarrfk Thank you for sharing your thoughts. Specifically, we need to use python_ivalue.h where the definitions are included in
It works with packages from the PyTorch channel, as we can build and import the Python binding linking to |
Hi @isuruf, your solution looks promising! However, I noticed some build failures in some jobs. Do you have any ideas on how to address them? |
@conda-forge-admin please rerender |
…nda-forge-pinning 2024.08.16.17.50.00
i thought i had access to the GPU runners... maybe they are down. the package fails to build in docker locally for me. |
i think perhaps a new flag was added in gcc 12.4 or something. perhaps we can try to set the upper bound to 12.3??? |
Can you post an error log?
The only thing that changed in our packaging was the way how meson sets a release flag, and we specifically didn't apply that change to 12.4, only 13.x and up. |
Here is the log, had to pull it out of my tmux |
76c9848
to
8ed8fec
Compare
I think some compilation issues might stem from libmagma having been updated to 2.8 from 2.7.2: conda-forge/libmagma-feedstock#18 That said, i'm not too sure. 2.4.0 seems to build fine with libmagma 2.8.0 https://github.com/conda-forge/pytorch-cpu-feedstock/actions/runs/10477101071/job/29017474679?pr=250#step:3:734 |
Our project requires linking to
libtorch_python
. Currently, the shared library is not included in the officialTorchConfig.cmake
, so we usefind_library()
to locate it. However, this method fails to findlibtorch_python
, although it successfully locates other symlinked libraries in the same directory (e.g., libtorch_cpu or libtorch_global_deps).This PR aims to prevent the removal of libtorch_python by this line. Instead, it moves the library to PREFIX/lib and creates a symbolic link in the torch lib folder, similar to other libraries, hoping this change resolves the issue with find_library() not finding the shared library.
Checklist
0
(if the version changed)conda-smithy
(Use the phrase@conda-forge-admin, please rerender
in a comment in this PR for automated rerendering)