Repository navigation
Conversation
Based on changes in PyTorch[1] and hints from [ptrblck](https://github.com/ptrblck)[2]. 1: pytorch/pytorch#66391 2: https://discuss.pytorch.org/t/question-about-thc-thc-h/147145
Owner
|
Appreciate the effort. I think for the moment it is best that, we either create a section in installation file, with your instructions or simply provide a link to this PR. |
Author
|
Sure, I opened this PR for sharing/documentation only in case it helps anyone. |
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 ```torchandtorchvisionhad to be installed viapip install --pre torch torchvision -f https://download.pytorch.org/whl/nightly/cu117/torch_nightly.html, I read that thetorch+cu117syntax 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_CHECKmacro withTORCH_CHECKas 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.pyimport 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.tomlandsetup.pyto 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 constrainedmmcvto0.2.10because that worked for be, probably there's more versions that will work), s.t. the package can be more easily deloyed.