Conversation
0ad231b to
214813b
Compare
de7b5c6 to
2aab0d8
Compare
| foreach(VAR_PATH ${TORCH_LIBRARY_PATH}) | ||
| file(GLOB TORCH_LIBRARY "${VAR_PATH}/*.so") | ||
| list(APPEND TORCH_LIBRARIES "${TORCH_LIBRARY}") | ||
| list(APPEND TORCH_LIBRARIES "${VAR_PATH}/libtorch_python.so") |
There was a problem hiding this comment.
See #46 (comment).
We only need to link libtorch_python.so instead of globbing for all shared libraries.
|
I think this is ready to merge now @Benjamin-eecs @JieRen98. I can build py310 wheels on my local machine (inside docker). The build errors may be resolved in the next PyTorch minor release (1.12.1). |
|
|
||
| conda activate torchopt | ||
| pip3 install -e . | ||
| pip3 install --no-build-isolation --editable . |
There was a problem hiding this comment.
Wondering what is no-build-isolation, seem a bit complicated for new users or ones who didn't go through readme.
There was a problem hiding this comment.
Wondering what is
no-build-isolation
We list torch == 1.12.0 as our build dependency to get torch libs and includes at build time. Now the default behavior for pip install -e will build a wheel in an isolated environment before installation. If the user does not set environment variable PIP_EXTRA_INDEX_URL=https://download.pytorch.org/whl/cu116", pip will install torch from PyPI, which is torch == 1.12.0+cu102, for building our C++ extension.
seem a bit complicated for new users or ones who didn't go through readme.
We only link libtorch_python.so now, the user can use pip3 install -e . without any problem.
The case to add the --no-build-isolation option is to reduce unnecessary downloads for torch wheels from PyPI. The wheel builder can use the already installed torch for compilation.
Description
Describe your changes in detail.
Motivation and Context
Use
cibuildwheelto buildmanylinuxwheels in GitHub Actions and update the contribution guide.Types of changes
What types of changes does your code introduce? Put an
xin all the boxes that apply:Checklist
Go over all the following points, and put an
xin all the boxes that apply.If you are unsure about any of these, don't hesitate to ask. We are here to help!
make format(required)make lint(required)make testpass. (required)