intel / intel-extension-for-transformers

⚡ Build your chatbot within minutes on your favorite device; offer SOTA compression techniques for LLMs; run LLMs efficiently on Intel Platforms⚡
Apache License 2.0
2.05k stars 201 forks source link

pip install failure on python3.10-alpine image #1379

Open lrrountr opened 3 months ago

lrrountr commented 3 months ago

Trying to build a project using python3.10-alpine docker image as a base, the project has intel-extension-for-transformers as a dep and I hit this error:

9.175 Collecting intel-extension-for-transformers==1.3.2
9.193   Downloading intel-extension-for-transformers-1.3.2.tar.gz (97.2 MB)
11.55      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 97.2/97.2 MB 12.0 MB/s eta 0:00:00
24.33   Preparing metadata (setup.py): started
24.74   Preparing metadata (setup.py): finished with status 'error'
24.76   error: subprocess-exited-with-error
24.76
24.76   × python setup.py egg_info did not run successfully.
24.76   │ exit code: 1
24.76   ╰─> [6 lines of output]
24.76       Traceback (most recent call last):
24.76         File "<string>", line 2, in <module>
24.76         File "<pip-setuptools-caller>", line 34, in <module>
24.76         File "/tmp/pip-install-94ahtz4p/intel-extension-for-transformers_3eb309d42a2448019f5f90c4d6e2cba5/setup.py", line 62, in <module>
24.76           from cmake import CMAKE_BIN_DIR
24.76       ModuleNotFoundError: No module named 'cmake'
24.76       [end of output]
24.76
24.76   note: This error originates from a subprocess, and is likely not a problem with pip.
24.76 error: metadata-generation-failed

Tried the same steps in other non-alpine python images and installation succeeds.

DDEle commented 3 months ago

I'm not familiar with alpine but it sees that the pip channel (index-url) used in the docker image is somehow outdated. As a result, it tried to build from sdist.

However, as we have a build-time dependency of pytorch of specific index-url, users need to install the dependences manually before building. That's why you get this error message.

VincyZhang commented 3 months ago

Thanks for reporting the issue. We checked the installation issue, and find out the root cause, due to the OS not yet supported by PyTorch, which is one of key dependencies for Intel Extension for Transformers. See https://github.com/pytorch/pytorch/issues/71381. We will be monitoring the issue and follow up as long as this OS image can be supported by PyTorch.