You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After some digging, I found it's 'ImportError: .../lib/python3.7/site-packages/torch_discounted_cumsum_cpu.cpython-37m-x86_64-linux-gnu.so' suppressed by the try-catch statement which redirecting extension loading to nonexisting sources, hence errors.
A little more digging reveals the ImportError complaining undefined symbol is caused by building the extension against a mismatching PyTorch version (latest release 1.11 as of the time of writing).
When turning on --verbose with pip, the head of logs shows the following:
Collecting torch-discounted-cumsum
Downloading torch_discounted_cumsum-1.1.0.tar.gz (185 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 185.4/185.4 KB 2.0 MB/s eta 0:00:00
Running command pip subprocess to install build dependencies
Collecting setuptools>=38.2.5
Using cached setuptools-62.0.0-py3-none-any.whl (1.1 MB)
Collecting wheel
Using cached wheel-0.37.1-py2.py3-none-any.whl (35 kB)
Collecting torch>=1.5
Using cached torch-1.11.0-cp37-cp37m-manylinux1_x86_64.whl (750.6 MB)
...
It shows pip is using a freshly pulled PyTorch as opposed to the existing PyTorch installation, therefore incurring the undefined symbol issue when importing the so module.
I'd suggest removing the step to automatically pull the latest PyTorch during installation.
A temporary solution: adding the --no-build-isolation flag (and --no-cache-dir if you've failed once) can prevent pip from pulling a new PyTorch package to build against, assuming you already have all requirements properly installed.
Hello,
I had the same issue as #8 part (2) when installing with not-latest PyTorch versions (1.8.1, 1.9.1, etc).
Test environments: Ubuntu 20.04 + 18.04, python 3.7 + 3.8, GCC 7.5 + 9.4, PyTorch 1.8.1 + 1.9.1.
After some digging, I found it's
'ImportError: .../lib/python3.7/site-packages/torch_discounted_cumsum_cpu.cpython-37m-x86_64-linux-gnu.so'
suppressed by the try-catch statement which redirecting extension loading to nonexisting sources, hence errors.A little more digging reveals the ImportError complaining undefined symbol is caused by building the extension against a mismatching PyTorch version (latest release 1.11 as of the time of writing).
When turning on --verbose with pip, the head of logs shows the following:
It shows pip is using a freshly pulled PyTorch as opposed to the existing PyTorch installation, therefore incurring the undefined symbol issue when importing the so module.
I'd suggest removing the step to automatically pull the latest PyTorch during installation.
A temporary solution: adding the
--no-build-isolation
flag (and--no-cache-dir
if you've failed once) can prevent pip from pulling a new PyTorch package to build against, assuming you already have all requirements properly installed.(which coincides with what #8 did in part 1 🤣)
The text was updated successfully, but these errors were encountered: