PaddlePaddle/PaddleNLP

Mac M芯片的电脑怎么使用

Sinoftj opened this issue · 7 comments

请提出你的问题

在运行paddnlp的时候,出现:Please compile with MKLDNN first to use MKLDNN

请问运行的是哪份代码?

我尝试了页面中提供的所有示例代码 https://github.com/PaddlePaddle/PaddleNLP/tree/develop/model_zoo/uie

我试了一下m芯片上使用没问题:
image

以下是我的环境:

aiofiles==23.2.1
aiohttp==3.9.3
aiosignal==1.3.1
aistudio-sdk==0.2.3
altair==5.2.0
annotated-types==0.6.0
anyio==4.3.0
astor==0.8.1
async-timeout==4.0.3
asyncio-atexit==1.0.1
attrs==23.2.0
Babel==2.14.0
bce-python-sdk==0.9.4
blinker==1.8.1
Brotli==1.1.0
cairocffi==1.6.1
CairoSVG==2.7.1
certifi==2024.2.2
cffi==1.16.0
charset-normalizer==3.3.2
click==8.1.7
colorama==0.4.6
colorlog==6.8.2
contourpy==1.2.0
cssselect2==0.7.0
cycler==0.12.1
dataclasses-json==0.6.4
datasets==2.19.0
decorator==5.1.1
defusedxml==0.7.1
dill==0.3.4
distro==1.9.0
erniebot==0.5.3
erniebot_agent==0.5.1
exceptiongroup==1.2.0
fastapi==0.110.0
ffmpy==0.3.2
filelock==3.13.1
Flask==3.0.3
flask-babel==4.0.0
fonttools==4.49.0
frozenlist==1.4.1
fsspec==2024.2.0
future==1.0.0
gradio==4.19.2
gradio_client==0.10.1
h11==0.14.0
html5lib==1.1
httpcore==1.0.4
httpx==0.27.0
huggingface-hub==0.22.2
idna==3.6
importlib_resources==6.1.2
itsdangerous==2.2.0
jieba==0.42.1
Jinja2==3.1.3
joblib==1.3.2
jsonlines==4.0.0
jsonpatch==1.33
jsonpointer==2.4
jsonschema==4.21.1
jsonschema-path==0.3.2
jsonschema-specifications==2023.12.1
kiwisolver==1.4.5
langchain==0.1.9
langchain-community==0.0.24
langchain-core==0.1.27
langsmith==0.1.10
lazy-object-proxy==1.10.0
Markdown==3.5.2
markdown-it-py==3.0.0
MarkupSafe==2.1.5
marshmallow==3.21.0
matplotlib==3.8.3
mdurl==0.1.2
multidict==6.0.5
multiprocess==0.70.12.2
mypy-extensions==1.0.0
numpy==1.26.4
onnx==1.16.0
openai==1.13.3
openapi-schema-validator==0.6.2
openapi-spec-validator==0.7.1
opt-einsum==3.3.0
orjson==3.9.15
packaging==23.2
paddle2onnx==1.0.9
paddlefsl==1.1.0
paddlenlp==2.6.1
paddlepaddle==2.6.1
pandas==2.2.1
pathable==0.4.3
pillow==10.2.0
prettytable==3.10.0
protobuf==3.20.2
psutil==5.9.8
pyarrow==16.0.0
pyarrow-hotfix==0.6
pycparser==2.21
pycryptodome==3.20.0
pydantic==2.6.3
pydantic_core==2.16.3
pydub==0.25.1
pydyf==0.9.0
Pygments==2.17.2
pyparsing==3.1.1
pyphen==0.14.0
python-dateutil==2.8.2
python-multipart==0.0.9
pytz==2024.1
PyYAML==6.0.1
rarfile==4.2
referencing==0.31.1
regex==2023.12.25
requests==2.31.0
rfc3339-validator==0.1.4
rich==13.7.0
rpds-py==0.18.0
ruff==0.2.2
safetensors==0.4.3
scikit-learn==1.4.1.post1
scipy==1.12.0
semantic-version==2.10.0
sentencepiece==0.2.0
seqeval==1.2.2
shellingham==1.5.4
six==1.16.0
sniffio==1.3.1
SQLAlchemy==2.0.27
starlette==0.36.3
tenacity==8.2.3
threadpoolctl==3.3.0
tiktoken==0.6.0
tinycss2==1.2.1
tomlkit==0.12.0
toolz==0.12.1
tqdm==4.66.2
typer==0.9.0
typing-inspect==0.9.0
typing_extensions==4.10.0
tzdata==2024.1
urllib3==2.2.1
uvicorn==0.27.1
visualdl==2.5.3
wcwidth==0.2.13
WeasyPrint==52.5
webencodings==0.5.1
websockets==11.0.3
Werkzeug==3.0.2
xxhash==3.4.1
yarl==1.9.4
zhon==2.0.2
zopfli==0.2.3

我将我所有和您一样的库调成了相同版本,依旧在M2 Max芯片上出错,我并没有搭建虚拟环境,使用的是Mac系统自带的python3.9,在vscode下:
/Users/sinoftj/Library/Python/3.9/lib/python/site-packages/urllib3/init.py:35: NotOpenSSLWarning: urllib3 v2 only supports OpenSSL 1.1.1+, currently the 'ssl' module is compiled with 'LibreSSL 2.8.3'. See: urllib3/urllib3#3020
warnings.warn(
/Users/sinoftj/Library/Python/3.9/lib/python/site-packages/_distutils_hack/init.py:33: UserWarning: Setuptools is replacing distutils.
warnings.warn("Setuptools is replacing distutils.")
E0429 18:59:28.826329 4144151232 analysis_config.cc:653] Please compile with MKLDNN first to use MKLDNN
[2024-04-29 18:59:29,200] [ INFO] - We are using <class 'paddlenlp.transformers.ernie.tokenizer.ErnieTokenizer'> to load '/Users/sinoftj/.paddlenlp/taskflow/information_extraction/uie-base'.
/Users/sinoftj/Library/Python/3.9/lib/python/site-packages/paddlenlp/transformers/tokenizer_utils_base.py:2478: FutureWarning: The max_seq_len argument is deprecated and will be removed in a future version, please use max_length instead.
warnings.warn(
/Users/sinoftj/Library/Python/3.9/lib/python/site-packages/paddlenlp/transformers/tokenizer_utils_base.py:1878: FutureWarning: The pad_to_max_length argument is deprecated and will be removed in a future version, use padding=True or padding='longest' to pad to the longest sequence in the batch, or use padding='max_length' to pad to a max length. In this case, you can give a specific length with max_length (e.g. max_length=45) or leave max_length to None to pad to the maximal input size of the model (e.g. 512 for Bert).
warnings.warn(

这是warning,不用管,另外mac是不支持mkldnn

这是warning,不用管,另外mac是不支持mkldnn

好吧,我看你之前说m芯片可以,我就试了下,还是不行。现在已经用云服务器跑了

好的