Closed tjtanaa closed 3 weeks ago
Hi @tjtanaa, could you share a reproducer step by step? Thanks!
Hi @huiyan2021 . The following is the steps to reproduce the issue on Windows 11. Conda environment is required.
embeddedllm
.git clone https://github.com/EmbeddedLLM/embeddedllm.git --branch ipex-llm-win-tj
cd embeddedllm
conda create -n ellm python=3.10 libuv; conda activate ellm
ELLM_TARGET_DEVICE='ipex' python setup.py develop
C:\Users\<user>\anaconda3\envs\ellmifp\Lib\site-packages\ipex_llm\transformers\convert.py
of your conda environment to change the following line 56: _IS_VLLM_AVAILABLE = None
to _IS_VLLM_AVAILABLE = False
.pip install pyinstaller==6.9.0
.pyinstaller .\ellm_api_server.spec
.dist\ellm_api_server
..\ellm_api_server.exe --model_path 'C:\Users\path\to\meta-llama_Meta-Llama-3-8B-Instruct' --backend 'ipex' --device 'xpu'
pydantic\_internal\_fields.py:160: UserWarning: Field "model_path" has conflict with protected namespace "model_".
You may be able to resolve this warning by setting model_config['protected_namespaces'] = ('settings_',)
.
The system is Windows.
torchvision\io\image.py:13: UserWarning: Failed to load image Python extension: ''If you don't plan on using image functionality from torchvision.io
, you can ignore this warning. Otherwise, there might be something wrong with your environment. Did you have libjpeg
or libpng
installed before building torchvision
from source?
warn(
intel_extension_for_pytorch\xpu\lazy_init.py:80: UserWarning: XPU Device count is zero! (Triggered internally at C:/Users/arc/ruijie/2.1_RC3/python310/frameworks.ai.pytorch.ipex-gpu/csrc/gpu/runtime/Device.cpp:127.)
_C._initExtension()
2024-07-15 17:48:09,901 - INFO - intel_extension_for_pytorch auto imported
2024-07-15 17:48:10.057 | INFO | embeddedllm.backend.ipex_engine:init:43 - Model Context Lenght: 8192
2024-07-15 17:48:10.058 | INFO | embeddedllm.backend.ipex_engine:init:46 - Attempt to load fast tokenizer
Special tokens have been added in the vocabulary, make sure the associated word embeddings are fine-tuned or trained.
Loading checkpoint shards: 100%|████████████████████████████████████████████████████████████████████| 4/4 [00:00<00:00, 9.82it/s]
2024-07-15 17:48:11,547 - INFO - Converting the current model to sym_int4 format......
Hi @tjtanaa , We don't support PyInstaller and no bandwidth at the time being.
Hi @tjtanaa , We don't support PyInstaller and no bandwidth at the time being.
Hi, @huiyan2021 , could you give me some pointers as to which part of the code that is generates _C.cp310-win_amd64.pyd
, so that in the meantime, I could try to look into it on my end.
Steps to Reproduce
- Install
embeddedllm
.git clone https://github.com/EmbeddedLLM/embeddedllm.git --branch ipex-llm-win-tj
cd embeddedllm
conda create -n ellm python=3.10 libuv; conda activate ellm
ELLM_TARGET_DEVICE='ipex' python setup.py develop
- Go to
C:\Users\<user>\anaconda3\envs\ellmifp\Lib\site-packages\ipex_llm\transformers\convert.py
of your conda environment to change the following line 56:_IS_VLLM_AVAILABLE = None
to_IS_VLLM_AVAILABLE = False
.
@tjtanaa What's your environment to reproduce this issue. The Intel extension-for-pytorch version, oneAPI version, driver version?
What's the ipex_llm
is?
There is also this error when launching the
intel_extension_for_pytorch
.
intel_extension_for_pytorch\xpu\lazy_init.py
when loading extension_C._initExtension()
is causing the following error._C
is_C.cp310-win_amd64.pyd
intel_extension_for_pytorch\xpu\lazy_init.py:80: UserWarning: XPU Device count is zero! (Triggered internally at C:/Users/arc/ruijie/2.1_RC3/python310/frameworks.ai.pytorch.ipex-gpu/csrc/gpu/runtime/Device.cpp:127.) _C._initExtension()
@tjtanaa How did you install IPEX? What are these: "C:/Users/arc/ruijie/2.1_RC3/python310/frameworks.ai.pytorch.ipex-gpu/csrc/gpu/runtime/Device.cpp:127". I did not find any 'gpu' in IPEX source files (it's 'xpu'). And I did find out the file 'Device.cpp' in IPEX public source code. This is internal innersource code.
Hi @tjtanaa , We don't support PyInstaller and no bandwidth at the time being.
Hi, @huiyan2021 , could you give me some pointers as to which part of the code that is generates
_C.cp310-win_amd64.pyd
, so that in the meantime, I could try to look into it on my end.
@ashokei @min-jean-cho any insights?
UserWarning: XPU Device count is zero!
Could you please run command sycl-ls
after activating oneAPI environment to verify your GPU device is being detected?
@xiguiw
I installed ipex-llm
from pypi package
. The steps is based on this Ipex-llm: Install Windows GPU
which runs the command pip install --pre --upgrade ipex-llm[xpu] --extra-index-url https://pytorch-extension.intel.com/release-whl/stable/xpu/us/
When installing embeddedllm
it will run this same command pip install --pre --upgrade ipex-llm[xpu] --extra-index-url https://pytorch-extension.intel.com/release-whl/stable/xpu/us/
.
UserWarning: XPU Device count is zero!
Could you please run command
sycl-ls
after activating oneAPI environment to verify your GPU device is being detected?
@min-jean-cho I forgot to share my hardware setup. It is a Windows 11 PC with Hardware: Intel(R) Core(TM) Ultra 7 165H
The ipex-llm[xpu]
supports the use of iGPU
of Intel(R) Core(TM) Ultra 7 165H
.
The ipex-llm[xpu]
is able to detect and utilized the iGPU
when I run through python command.
However, after packaging it into executable using pyInstaller, the executable cannot detect and utilized the iGPU
and fail to run.
After tracing the error, I found that the only different in log message is when loading the _C
library of intel-extension-for-pytorch
and it says XPU device is not found.
@tjtanaa, Hello. I use pyinstaller once to make exe and succeed. You need to ensure that all dll including
you have in PATH or in your dist package. And of course, pyinstaller knows nothing about ipex package and its dependencies, so you need to do everything manually.
@tjtanaa, Hello. I use pyinstaller once to make exe and succeed. You need to ensure that all dll including
you have in PATH or in your dist package. And of course, pyinstaller knows nothing about ipex package and its dependencies, so you need to do everything manually.
@MaksimDanilov Thank you so much for the great news. Can u share the steps to include all the dll? Did you install the OneAPI DPC++ Compiler and OneAPI Math Kernel Library (oneMKL) from source? I can't seem to find the steps to build ipex-llm from source. Could you point me to some directions to compile ipex-llm from source?
@tjtanaa firstly, lets check if everything works fine. Try to launch your exe in console, but before that use Intel oneAPI setvars.bat as suggested at installation page. if you don't have oneAPI installed, then update PATH variable with installation path of anaconda packages, that correspond with above dependencies. If everything works fine, you are free-to-go to find all deps of your exe.
@MaksimDanilov Thank you very much for the confidence and pointers. I have managed to compile a pyinstaller executable.
I found that the latest Arc Driver is not compatible with ipex-llm
. The engine will hang. So I downgraded and tested that the driver version 32.0.101.5762
is working for me.
Describe the issue
I have no issue when running before packaging.
I encounter the same issue with pyinstaller compiled executable. The program exited within AutoModelForCausalLM without any error. I can observed that the progress bar of loading the weight is complete.
There is also this error when launching the
intel_extension_for_pytorch
.intel_extension_for_pytorch\xpu\lazy_init.py
when loading extension_C._initExtension()
is causing the following error._C
is_C.cp310-win_amd64.pyd