-
Notifications
You must be signed in to change notification settings - Fork 36
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
feat(workflows): cibuildwheel integration #45
Conversation
0ad231b
to
214813b
Compare
de7b5c6
to
2aab0d8
Compare
@@ -144,8 +144,7 @@ endif() | |||
unset(TORCH_LIBRARIES) | |||
|
|||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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). |
@@ -243,7 +243,7 @@ cd TorchOpt | |||
CONDA_OVERRIDE_CUDA=11.7 conda env create --file conda-recipe.yaml | |||
|
|||
conda activate torchopt | |||
pip3 install -e . | |||
pip3 install --no-build-isolation --editable . |
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
cibuildwheel
to buildmanylinux
wheels in GitHub Actions and update the contribution guide.Types of changes
What types of changes does your code introduce? Put an
x
in all the boxes that apply:Checklist
Go over all the following points, and put an
x
in 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 test
pass. (required)