intel-analytics / ipex-llm

Accelerate local LLM inference and finetuning (LLaMA, Mistral, ChatGLM, Qwen, Baichuan, Mixtral, Gemma, Phi, MiniCPM, etc.) on Intel CPU and GPU (e.g., local PC with iGPU, discrete GPU such as Arc, Flex and Max); seamlessly integrate with llama.cpp, Ollama, HuggingFace, LangChain, LlamaIndex, GraphRAG, DeepSpeed, vLLM, FastChat, Axolotl, etc.
Apache License 2.0
6.44k stars 1.24k forks source link

Issue in QLora finetuning with ARC770 GPU #9554

Closed xiangyang-95 closed 9 months ago

xiangyang-95 commented 9 months ago

I am using the latest bigdl-llm[xpu]. Running the latest version with the qlora finetuning scripts will show the error log below. Commands to install:

pip install --pre --upgrade bigdl-llm[xpu] -f https://developer.intel.com/ipex-whl-stable-xpu

Error Log:

ImportError: cannot import name 'is_torch_xpu_available' from 'transformers.utils'

Attached with the pip list:

Package                     Version
--------------------------- ------------------
accelerate                  0.21.0
aiohttp                     3.8.6
aiosignal                   1.3.1
anyio                       4.0.0
argon2-cffi                 23.1.0
argon2-cffi-bindings        21.2.0
arrow                       1.3.0
asttokens                   2.4.1
async-lru                   2.0.4
async-timeout               4.0.3
attrs                       23.1.0
Babel                       2.13.1
beautifulsoup4              4.12.2
bigdl-core-xe               2.5.0b20231128
bigdl-core-xe-esimd         2.5.0b20231128
bigdl-llm                   2.5.0b20231128
bleach                      6.1.0
certifi                     2023.7.22
cffi                        1.16.0
charset-normalizer          3.3.0
comm                        0.2.0
datasets                    2.14.5
debugpy                     1.8.0
decorator                   5.1.1
defusedxml                  0.7.1
dill                        0.3.7
exceptiongroup              1.1.3
executing                   2.0.1
fastjsonschema              2.18.1
filelock                    3.12.4
fqdn                        1.5.1
frozenlist                  1.4.0
fsspec                      2023.6.0
huggingface-hub             0.17.3
idna                        3.4
importlib-metadata          6.8.0
intel-extension-for-pytorch 2.0.110+xpu
intel-openmp                2023.2.0
ipykernel                   6.26.0
ipython                     8.17.2
ipywidgets                  8.1.1
isoduration                 20.11.0
jedi                        0.19.1
Jinja2                      3.1.2
joblib                      1.3.2
json5                       0.9.14
jsonpointer                 2.4
jsonschema                  4.19.2
jsonschema-specifications   2023.7.1
jupyter                     1.0.0
jupyter_client              8.6.0
jupyter-console             6.6.3
jupyter_core                5.5.0
jupyter-events              0.9.0
jupyter-lsp                 2.2.0
jupyter_server              2.10.0
jupyter_server_terminals    0.4.4
jupyterlab                  4.0.8
jupyterlab-pygments         0.2.2
jupyterlab_server           2.25.0
jupyterlab-widgets          3.0.9
loguru                      0.7.2
MarkupSafe                  2.1.3
matplotlib-inline           0.1.6
mistune                     3.0.2
mpmath                      1.3.0
multidict                   6.0.4
multiprocess                0.70.15
nbclient                    0.8.0
nbconvert                   7.11.0
nbformat                    5.9.2
nest-asyncio                1.5.8
networkx                    3.2rc0
notebook                    7.0.6
notebook_shim               0.2.3
numpy                       1.26.0
overrides                   7.4.0
packaging                   23.2
pandas                      2.1.1
pandocfilters               1.5.0
parso                       0.8.3
peft                        0.5.0
pexpect                     4.8.0
Pillow                      10.0.1
pip                         23.2.1
platformdirs                3.11.0
prometheus-client           0.18.0
prompt-toolkit              3.0.39
protobuf                    4.24.4
psutil                      5.9.5
ptyprocess                  0.7.0
pure-eval                   0.2.2
py-cpuinfo                  9.0.0
pyarrow                     13.0.0
pycparser                   2.21
Pygments                    2.16.1
python-dateutil             2.8.2
python-json-logger          2.0.7
pytz                        2023.3.post1
PyYAML                      6.0.1
pyzmq                       25.1.1
qtconsole                   5.5.0
QtPy                        2.4.1
referencing                 0.30.2
regex                       2023.10.3
requests                    2.31.0
rfc3339-validator           0.1.4
rfc3986-validator           0.1.1
rpds-py                     0.12.0
safetensors                 0.4.0
scikit-learn                1.3.2
scipy                       1.11.3
Send2Trash                  1.8.2
sentencepiece               0.1.99
setuptools                  68.0.0
six                         1.16.0
sniffio                     1.3.0
soupsieve                   2.5
stack-data                  0.6.3
sympy                       1.12
tabulate                    0.9.0
terminado                   0.17.1
threadpoolctl               3.2.0
tinycss2                    1.2.1
tokenizers                  0.13.3
tomli                       2.0.1
torch                       2.0.1a0+cxx11.abi
torchvision                 0.15.2a0+cxx11.abi
tornado                     6.3.3
tqdm                        4.66.1
traitlets                   5.13.0
transformers                4.31.0
types-python-dateutil       2.8.19.14
typing_extensions           4.8.0
tzdata                      2023.3
uri-template                1.3.0
urllib3                     2.0.6
wcwidth                     0.2.9
webcolors                   1.13
webencodings                0.5.1
websocket-client            1.6.4
wheel                       0.41.2
widgetsnbextension          4.0.9
xxhash                      3.4.1
yarl                        1.9.2
zipp                        3.17.0
xiangyang-95 commented 9 months ago

It seems like somehow when installing the bigdl-llm, it will reset the transformers package version to 4.31.0 which will cause the error above to present. If I follow the guide to upgrade the transformers package version to 4.34.0, the issue is no longer available.

Nyceane commented 6 months ago

how did you upgrade the trasnformers?

qiuxin2012 commented 6 months ago

how did you upgrade the trasnformers?

Just pip install transformers==4.34.0, you can find all available versions on pypi.