Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This branch contains changes to make Pedestron work with CUDA 11.7.
IMPORTANT: This is not mergeable, as it breaks compilation for lower versions of CUDA and PyTorch, and it is not a trivially usable version, but it works for me, so I figured I'd share it here for reference & potential improvement by others.
I was trying to get Pedestron running and after struggling with older CUDA versions and compatibility to Ampere GPUs I figured I'd give porting the Code to the newer version instead a go, which in the end worked.
Deployment
Environment
Run on Debian 11 with CUDA 11.7 and a RTX3060Ti.
I created a virutalenv for the dependencies.
package list
``` ⇒ pip3 freeze addict==2.4.0 certifi==2022.9.24 charset-normalizer==2.1.1 contourpy==1.0.5 cycler==0.11.0 Cython==0.29.32 fonttools==4.37.3 idna==3.4 kiwisolver==1.4.4 matplotlib==3.6.0 mmcv==0.2.10 mmdet==0.6.0+746cdce mmengine==0.1.0 numpy==1.23.3 opencv-python==4.6.0.66 packaging==21.3 Pillow==9.2.0 pycocotools==2.0.5 pyparsing==3.0.9 python-dateutil==2.8.2 PyYAML==6.0 requests==2.28.1 scipy==1.9.1 six==1.16.0 termcolor==2.0.1 terminaltables==3.1.10 torch==1.13.0.dev20220929+cu117 torchvision==0.14.0.dev20220929+cu117 typing-extensions==4.3.0 urllib3==1.26.12 yapf==0.32.0 ```torch
andtorchvision
had to be installed viapip install --pre torch torchvision -f https://download.pytorch.org/whl/nightly/cu117/torch_nightly.html
, I read that thetorch+cu117
syntax should work to, but it didn't for me.Building
Activate the venv and run:
As a workaround for
pip3 install .
which didn't work, as the build environment was different from the venv.Execution
Run the demo as described in the project readme.
Hints for integration
This is a very rough changeset, little more than a proof of concept.
If someone were to try and refine it into proper support for more versions of CUDA & PyTorch, here are some hints for how to do that.
I applied three groups of changes to make Pedestron work with my CUDA & PyTorch versions:
AT_CHECK
macro withTORCH_CHECK
as described in Here's how to support cuda11/pytorch-1.10 #131along with some changes to the project setup.
The circular dependency issue may well be a non-issue due to the
tools/demo.py
import of the current working directory over the installed one which (I think) I removed later.The changes to CUDA & C++ code should be sanitized by providing headers which define appropriate functions/macros depending on the detected CUDA/PyTorch versions.
Moreover, someone with actual understanding should validate that there are no sideeffects introduced by the changes.
Lastly, I started changing the project description in
pyproject.toml
andsetup.py
to be more self-contained, currently these files don't reflect reality when it comes to supported versions, these should be explicitly encoded (e.g., there seems to be a PyTorch version beyond which the current code-base doesn't work, also I constrainedmmcv
to0.2.10
because that worked for be, probably there's more versions that will work), s.t. the package can be more easily deloyed.