Skip to content
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

The file setup.py does not import the sys library causing an error if torch is not found. #189

Closed
jyothisvjames opened this issue Oct 22, 2021 · 9 comments

Comments

@jyothisvjames
Copy link

Line 14 of the setup.py gives out an error if torch is not found in the system, since the sys library is not imported in the beginning.
sys.exit(1)

The following line should be moved to the beginning of the setup.py file to solve this issue.
import sys

@EikanWang
Copy link
Contributor

Thanks for your report. @jingxu10 could you please check it?

@jingxu10
Copy link
Contributor

jingxu10 commented Oct 22, 2021

Hi @jyothisvjames , thanks for your feedback. May I know how is your pytorch installed? If it is installed normally via pip, setup.py could find it.

@jyothisvjames
Copy link
Author

Hi @jingxu10. Yes, noticed that it is updated in setup.py on 1.9.0-rc. As per the documentation in the master branch, I tried to compile it from the source without the torch library installed, it was throwing a sys error. When I checked the setup.py file, I was able to find that the error is handled before importing sys. I guess in future releases it would automatically install if torch is not found.

@jyothisvjames
Copy link
Author

The main issue that I face is a bit different. As per the official documentation of Intel AI Analytics Toolkit, it is supported on CentOS7(https://www.intel.com/content/www/us/en/developer/articles/system-requirements/intel-oneapi-ai-analytics-toolkit-system-requirements.html). I tried to install Intel AI Analytics Toolkit in a conda environment using the command "conda create -n aikit-pt -c intel intel-aikit-pytorch". This installs AI Analytics Toolkit with IPEX 1.8.0 but throws an error that says glibc 2.23 is not found in the system when importing torch library using "import torch" in a program.

@jingxu10
Copy link
Contributor

jingxu10 commented Oct 22, 2021

Hi @jingxu10. Yes, noticed that it is updated in setup.py on 1.9.0-rc. As per the documentation in the master branch, I tried to compile it from the source without the torch library installed, it was throwing a sys error. When I checked the setup.py file, I was able to find that the error is handled before importing sys. I guess in future releases it would automatically install if torch is not found.

Yes, torch as well as other dependencies will all be installed automatically in setup.py in future releases. For usage of the current master branch, please take a reference at https://pytorch.org/tutorials/recipes/recipes/intel_extension_for_pytorch.html.

@jingxu10
Copy link
Contributor

The main issue that I face is a bit different. As per the official documentation of Intel AI Analytics Toolkit, it is supported on CentOS7(https://www.intel.com/content/www/us/en/developer/articles/system-requirements/intel-oneapi-ai-analytics-toolkit-system-requirements.html). I tried to install Intel AI Analytics Toolkit in a conda environment using the command "conda create -n aikit-pt -c intel intel-aikit-pytorch". This installs AI Analytics Toolkit with IPEX 1.8.0 but throws an error that says glibc 2.23 is not found in the system when importing torch library using "import torch" in a program.

Thanks for reporting this issue. I'll report it to AIKit team.

@jyothisvjames
Copy link
Author

This is the exact error.

(aikit-pt) [user@centos7 ~]$ conda list I grep torch
intel-aikit-pytorch 2021.3.0 0 intel
intel-extension-for-pytorch 1.8.0 py37_1 intel
pytorch 1.8.0 py37_1 intel
torch_ccl 1.1.0 py37_1 intel
torchvision 0.9.0 py37_0 intel
(aikit-pt) [user@centos7 ~]$ python
Python 3.7.11 (default, Sep 9 2021, 02:06:38)
[GCC 9.3.0] :: Intel Corporation on linux
Type "help", "copyright", "credits" or "license" for more information.
Intel(R) Distribution for Python is brought to you by Intel Corporation.
Please check out: https://software.intel.com/en-us/python-distribution

import torch
Traceback (most recent call last):
File "", line 1, in
File "/home/user/anaconda3/envs/aikit-pt/lib/python3.7/site-packages/torch/ init .py", line 196, in
from torch._C import *
ImportError: /1ib64/libm.so.6: version 'GLIBC_2.23' not found (required by /home/user/anaconda3/envs/aikit-pt/li b/python3.7/site-packages/torch/lib/libtorch_cpu.so)

This error is not present in CentOS 8, only in CentOS 7. It can be prevented by compiling IPEX=1.8.0 from source or by upgrading IPEX=1.9.0 manually.

@jingxu10
Copy link
Contributor

yes, this is because the Intel Extension for PyTorch 1.8.0 in AIKit was most likely not compiled on CentOS 7, and thus caused this glibc version incompatibility issue. I've reported this issue back to AIKit team. Please use the workaround you mentioned.
Thank you.

@jyothisvjames
Copy link
Author

Thanks for your help.

tenzen-y pushed a commit to tenzen-y/intel-extension-for-pytorch that referenced this issue Sep 17, 2022
* Revert "[LLGA] remove infer_shape due to backend change (intel#176)"

This reverts commit c1fe854.

* Revert "[LLGA] ww35 update backend (intel#175)"

This reverts commit eccafbe.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants