-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
ci: Adding tests for numpy>=2
#7756
Conversation
pip3 install torch==2.5.0 -f https://download.pytorch.org/whl/torch_stable.html torchvision==0.20.0 | ||
else | ||
pip3 install torch==2.0.0 -f https://download.pytorch.org/whl/torch_stable.html torchvision==0.15.0 | ||
pip3 install torch==2.5.0 -f https://download.pytorch.org/whl/torch_stable.html torchvision==0.20.0 |
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.
Note that the if
condition installed a +cu
version, and the else
did not. In your change you have both if/else installing the same thing. Please either match the install pattern with the correct +cuXXX
variant, or double check whether this if/else is required if not. CC @fpetrini15 who might know a bit more about the if/else split here.
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.
@rmccorm4 I think this is a code segment we discussed a few months back. It seems like since Jacky has fixed my original error here; 23a6c21. I think for non-Jetson Linux tests, we want to continue installing the cuda-enabled version. That said, these tests were passing fine even with my logical error from months ago, so it's unclear to me what we achieve by installing the cuda-enabled version.
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.
If this doesn't break windows/jetson, I'm happy to keep it. If it might, we could also try making the change only on the linux non-jetson block. ex:
if not jetson/windows:
pip install numpy 2
pip install torch 2.5
else: # if windows/jetson
pip install numpy 1
pip install torch 2.0
fi
Let me know if you have a preference for minimal blast radius @fpetrini15
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.
I think we should align with the original intention of the script and install the cuda-enabled version.
CC @Tabrizian if you have any insight into why we preferred it originally?
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.
I believe PyTorch with CUDA was not supported on Jetson. We also don't support GPU tensors on Jetson with Python backend so it could be related to that.
@@ -440,4 +442,7 @@ else | |||
echo -e "\n***\n*** Example verification test FAILED.\n***" | |||
fi | |||
|
|||
pip3 uninstall -y numpy | |||
pip3 install "numpy<2" |
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.
In L0_backend_python, the way examples/test.sh
is called is along the lines of:
setup_virtualenv
set +e
(cd ${TEST} && bash -ex test.sh)
if [ $? -ne 0 ]; then
echo "Subtest ${TEST} FAILED"
RET=1
fi
set -e
deactivate_virtualenv
So re-installing a lower version of numpy is unnecessary here because the virtualenv created for the examples subtest is not re-used for future subtests.
Co-authored-by: Ryan McCormick <[email protected]>
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.
LGTM but let's make sure the variants like python3.8, etc don't fail from this change. If they do, we might need to better handle which torch version is installed for each python version.
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.
LGTM. +1 on adding the comment for python 3.8.
What does the PR do?
Modifying
L0_backend_python/examples/test.sh
to test the python backend whennumpy>=2
is installed in the environment. This is achieved by:numpy>=2.0
,torch==2.5.0
, andtorchvision==0.20.0
at the start of the subtestL0_backend_python/examples/test.sh
numpy>=2
and re-installingnumpy<2
so future subtests will still usenumpy 1.x
Reason for limited scope:
Support for
numpy>=2
proved to be more complicated than intended because older version of packages liketorch
,torchvision
, andtensorflow
do not support fornumpy 2.x
.Related PRs:
Python Backend PR: Link
Where should the reviewer start?