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

ImportError libpymo in AIMET 1.32 Pytorch 2.1.2+cu118 #3163

Open
escorciav opened this issue Jul 11, 2024 · 7 comments
Open

ImportError libpymo in AIMET 1.32 Pytorch 2.1.2+cu118 #3163

escorciav opened this issue Jul 11, 2024 · 7 comments

Comments

@escorciav
Copy link

escorciav commented Jul 11, 2024

I'm getting the following import Error after using (binaries) wheels for AIMET & Pytorch installed via pip (binary) wheels

$ CUDA_VISIBLE_DEVICES=0 python aimet_calibrate.py --quant_config 8 16 32
Traceback (most recent call last):
  File "/work/work/aimet_calibrate.py", line 14, in <module>
    from aimet_torch.model_preparer import prepare_model
  File "/home/SERILOCAL/v.castillo/install/bin/miniconda3/envs/work_v2.0/lib/python3.10/site-packages/aimet_torch/model_preparer.py", line 139, in <module>
    from aimet_torch.utils import in_eval_mode
  File "/work/install/bin/miniconda3/envs/work_v2.0/lib/python3.10/site-packages/aimet_torch/utils.py", line 54, in <module>
    from aimet_common.defs import QuantScheme, QuantizationDataType, MAP_QUANT_SCHEME_TO_PYMO
  File "/work/install/bin/miniconda3/envs/work_v2.0/lib/python3.10/site-packages/aimet_common/defs.py", line 45, in <module>
    import aimet_common.libpymo as libpymo
ImportError: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.32' not found (required by /work/install/bin/miniconda3/envs/work_v2.0/lib/python3.10/site-packages/aimet_common/libpymo.cpython-310-x86_64-linux-gnu.so)

Questions

  1. Can it be fixed with a hack/patch? For ex. removing the GLIBC check from the binaries
  2. I've a Ubuntu 20.04 box, should I test it out in other env?

Environment

>>> torch.__version__
'2.1.2+cu118'

requirements.txt

@e-said
Copy link

e-said commented Jul 11, 2024

Hi @escorciav,
Could you check my last reply on this ticket ? that will probably help on fixing your issue

@escorciav
Copy link
Author

Thanks @e-said !

For reference, my dev env is built as follows:

conda create -n work_v2.0-public-wheels python=3.10
conda activate work_v2.0-public-wheels
conda install pytorch==2.1.2 torchvision torchaudio pytorch-cuda=11.8 -c pytorch -c nvidia
pip install onnx==1.12.0 onnxruntime==1.15.1 jsonschema==4.19.0 spconv==2.3.6 bokeh onnxsim
# pip install -r prj_deps.txt
# wget aimet-wheels
pip install ./aimet_torch_gpu_pt21-1.32.0.cu118-cp310-cp310-manylinux_2_34_x86_64.whl

I also used both Pro & public [wheels for 1.32.0][https://github.com/quic/aimet/releases/tag/1.32.0]

@e-said
Copy link

e-said commented Jul 11, 2024

Adding those lines after aimet-wheels installation should fix your issue:

# Install common debian packages:
cat /usr/local/lib/python3.10/dist-packages/aimet_torch/bin/reqs_deb_common.txt | xargs apt-get --assume-yes install
cat /usr/local/lib/python3.10/dist-packages/aimet_torch/bin/reqs_deb_torch_gpu.txt | xargs apt-get --assume-yes install
ln -s /usr/lib/x86_64-linux-gnu/libjpeg.so /usr/lib

@escorciav
Copy link
Author

escorciav commented Jul 11, 2024

It does not :(

cat /usr/local/lib/python3.10/dist-p
ackages/aimet_torch/bin/reqs_deb_common.txt | sudo xargs apt-get --assume-yes install
cat: /usr/local/lib/python3.10/dist-packages/aimet_torch/bin/reqs_deb_common.txt: No such file or directory
[dzdo] password for v.castillo:
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  apport-symptoms python3-systemd
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 325 not upgraded.

$ cat /usr/local/lib/python3.10/dist-p
ackages/aimet_torch/bin/reqs_deb_torch_gpu.txt | sudo xargs apt-get --assume-yes install
cat: /usr/local/lib/python3.10/dist-packages/aimet_torch/bin/reqs_deb_torch_gpu.txt: No such file or directory
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  apport-symptoms python3-systemd
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 325 not upgraded.

or should I point to the files in the conda env?

@escorciav
Copy link
Author

@e-said which version of Ubuntu are you using?
Are you using Docker?

@e-said
Copy link

e-said commented Jul 11, 2024

or should I point to the files in the conda env?

Ah yes you are right, you should point to conda in your case.

Are you using Docker?

I'm using ubuntu 22.04, it's the version recommended for aimet 1.32.
On my end I'm using this based image in docker: nvidia/cuda:11.8.0-devel-ubuntu22.04

@escorciav
Copy link
Author

escorciav commented Jul 11, 2024

I will update the paths, but I think that it's a Ubuntu 22.04 linking error.
Thanks!

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

2 participants