openvinotoolkit / openvino.genai

Run Generative AI models using native OpenVINO C++ API
Apache License 2.0
115 stars 152 forks source link

looking for verified/fixed version of python packages in llm_bench/python/requirements.txt #233

Closed maoyuech closed 3 months ago

maoyuech commented 7 months ago

(openvino.genai) E:\projects\openvino.genai\text_generation\causal_lm\cpp>python ......\llm_bench\python\convert.py --model_id TinyLlama/TinyLlama-1.1B-Chat-v1.0 --output_dir .\TinyLlama-1.1B-Chat-v1.0\ --precision FP16 --stateful INFO:nncf:NNCF initialized successfully. Supported frameworks detected: torch, onnx, openvino No CUDA runtime is found, using CUDA_HOME='C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.6' Traceback (most recent call last): File "D:\anaconda\envs\openvino.genai\lib\site-packages\transformers\utils\import_utils.py", line 1364, in _get_module return importlib.import_module("." + module_name, self.name) File "D:\anaconda\envs\openvino.genai\lib\importlib__init__.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "", line 1050, in _gcd_import File "", line 1027, in _find_and_load File "", line 1006, in _find_and_load_unlocked File "", line 688, in _load_unlocked File "", line 883, in exec_module File "", line 241, in _call_with_frames_removed File "D:\anaconda\envs\openvino.genai\lib\site-packages\optimum\exporters\onnx__main__.py", line 33, in from .convert import export_models, validate_models_outputs File "D:\anaconda\envs\openvino.genai\lib\site-packages\optimum\exporters\onnx\convert.py", line 49, in from transformers.pytorch_utils import is_torch_less_than_1_11 ImportError: cannot import name 'is_torch_less_than_1_11' from 'transformers.pytorch_utils' (D:\anaconda\envs\openvino.genai\lib\site-packages\transformers\pytorch_utils.py)

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "E:\projects\openvino.genai\llm_bench\python\convert.py", line 27, in from optimum.exporters.openvino import export_models File "D:\anaconda\envs\openvino.genai\lib\site-packages\optimum\exporters\openvino__init.py", line 1, in from .main import main_export File "D:\anaconda\envs\openvino.genai\lib\site-packages\optimum\exporters\openvino__main.py", line 24, in from optimum.exporters.onnx import main__ as optimum_main File "", line 1075, in _handle_fromlist File "D:\anaconda\envs\openvino.genai\lib\site-packages\transformers\utils\import_utils.py", line 1352, in getattr__ value = self._get_module(name) File "D:\anaconda\envs\openvino.genai\lib\site-packages\transformers\utils\import_utils.py", line 1366, in _get_module raise RuntimeError( RuntimeError: Failed to import optimum.exporters.onnx.main because of the following error (look up to see its traceback): cannot import name 'is_torch_less_than_1_11' from 'transformers.pytorch_utils' (D:\anaconda\envs\openvino.genai\lib\site-packages\transformers\pytorch_utils.py)

Request: Maybe fix the version of all python packages instead of using ">=" or "no given version" for converting model.

Wovchena commented 7 months ago

Unfortunately we can't freeze them for now. master was updated to work with the latest dependencies. Here's the environment that works for me: OpenVINO 20203.3.0 GenAI commit: https://github.com/openvinotoolkit/openvino.genai/commit/1c369fc7a0940904a9cbbd2941070dbff622db73

pip freeze: about-time==4.2.1 accelerate==0.27.2 aiohttp==3.9.3 aiosignal==1.3.1 alive-progress==3.1.5 attrs==23.2.0 auto_gptq==0.7.0 autograd==1.6.2 bitsandbytes==0.42.0 certifi==2024.2.2 charset-normalizer==3.3.2 cma==3.2.2 colorama==0.4.6 coloredlogs==15.0.1 contourpy==1.2.0 cycler==0.12.1 datasets==2.17.1 Deprecated==1.2.14 diffusers==0.26.3 dill==0.3.8 einops==0.7.0 filelock==3.13.1 fonttools==4.49.0 frozenlist==1.4.1 fsspec==2023.10.0 future==1.0.0 gekko==1.0.6 grapheme==0.6.0 huggingface-hub==0.20.3 humanfriendly==10.0 idna==3.6 importlib-metadata==7.0.1 Jinja2==3.1.3 joblib==1.3.2 jsonschema==4.21.1 jsonschema-specifications==2023.12.1 jstyleson==0.0.2 kiwisolver==1.4.5 markdown-it-py==3.0.0 MarkupSafe==2.1.5 matplotlib==3.8.3 mdurl==0.1.2 mpmath==1.3.0 multidict==6.0.5 multiprocess==0.70.16 natsort==8.4.0 networkx==3.1 ninja==1.10.2.4 nncf==2.8.1 numpy==1.26.4 onnx==1.15.0 openvino==2023.3.0 openvino-telemetry==2023.2.1 openvino-tokenizers @ file:///C:/Users/vzlobin/r/g/thirdparty/openvino_tokenizers optimum==1.16.2 optimum-intel @ git+https://github.com/huggingface/optimum-intel.git@552de65a9c5f7fa1a2f0ce6859ebdeedaeaabe53 packaging==23.2 pandas==2.1.4 peft==0.8.2 pillow==10.2.0 protobuf==4.25.3 psutil==5.9.8 pyarrow==15.0.0 pyarrow-hotfix==0.6 pydot==2.0.0 Pygments==2.17.2 pymoo==0.6.1.1 pyparsing==3.1.1 pyreadline3==3.4.1 python-dateutil==2.8.2 pytz==2024.1 PyYAML==6.0.1 referencing==0.33.0 regex==2023.12.25 requests==2.31.0 rich==13.7.0 rouge==1.0.1 rpds-py==0.18.0 safetensors==0.4.2 scikit-learn==1.4.1.post1 scipy==1.12.0 sentencepiece==0.2.0 six==1.16.0 sympy==1.12 texttable==1.7.0 threadpoolctl==3.3.0 tiktoken==0.6.0 timm==0.9.16 tokenizers==0.15.2 torch==2.2.1+cpu torchvision==0.17.1+cpu tqdm==4.66.2 transformers==4.37.2 transformers-stream-generator==0.0.4 typing_extensions==4.10.0 tzdata==2024.1 urllib3==2.2.1 wrapt==1.16.0 xxhash==3.4.1 yarl==1.9.4 zipp==3.17.0

peterchen-intel commented 3 months ago

https://github.com/openvinotoolkit/openvino.genai/blob/releases/2024/2/llm_bench/python/requirements_2024.2.txt