Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

根据官网教程在因特尔CPU以及昆仑2代芯片编译安装XPU出现 Built target extern_mkldnn 错误 #62398

Closed
kivenyangming opened this issue Mar 5, 2024 · 5 comments
Assignees
Labels
status/close 已关闭 type/build 编译/安装问题

Comments

@kivenyangming
Copy link

问题描述 Issue Description

现阶段已根据官网教程进行从源码编译支持昆仑 XPU 的包。执行的cmake指令如下:
cmake .. -DPY_VERSION=3.8 -DCMAEK_BUILD_TYPE=Release -DWITH_GPU=OFF -DWITH_XPU=ON -DON_INFER=ON -DWITH_PYTHON=ON -DWITH_AVX=ON -DWITH_MKL=ON -DWITH_MKLDNN=ON -DWITH_XPU_BKCL=ON -DWITH_DISTRIBUTE=ON -DWITH_NCCL=OFF

在执行过程中出现了如下信息:
[100%] Built target dnnl_cpu_x64
[100%] Built target dnnl_cpu
Scanning dependencies of target dnnl
[100%] Linking CXX shared library libdnnl.so
[100%] Built target dnnl
[ 2%] Performing install step for 'extern_mkldnn'
-- extern_mkldnn install command succeeded. See also /home/dl/Paddle/build/third_party/mkldnn/src/extern_mkldnn-stamp/extern_mkldnn-install-*.log
[ 2%] Completed 'extern_mkldnn'
[ 2%] Built target extern_mkldnn
make: *** [Makefile:130: all] Error 2
请问我应该修改哪里可以正常编译安装。

版本&环境信息 Version & Environment Information

python版本: 3.8
cmake版本:cmake version 3.16.3

操作系统版本以及Ubuntu版本: Linux version 5.15.0-41-generic (buildd@lcy02-amd64-105) (gcc (Ubuntu 9.4.0-1ubuntu120.04.1) 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #4420.04.1-Ubuntu SMP Fri Jun 24 13:27:29 UTC 2022

paddle安装包教程中指定:git checkout release/2.3

@houj04
Copy link
Contributor

houj04 commented Mar 5, 2024

1、看起来这个版本有点古老:release/2.3,看能换比较新的版本试试吗?
2、从贴的片段里面没看到明确报错信息,看能把完整的编译日志贴上来不?

@kivenyangming
Copy link
Author

答复houj04
问题1:在这里根据官网教程上的指示进行,后面可以更换。
问题2:cmake 过程中没有问题,在make -j$(nproc) 过程中出现了上述的问题。我这边先替换一下版本试试。如仍有这个问题,我再将日志贴出

@houj04
Copy link
Contributor

houj04 commented Mar 5, 2024

如果使用的是release/2.3版本,那么很可能是这个问题:
https://github.com/PaddlePaddle/Paddle/blob/v2.3.0/cmake/external/xpu.cmake
这个文件的第38行,把baidu-kunlun-product.cdn.bcebos.com改成baidu-kunlun-product.su.bcebos.com。即,把cdn改成su
这个存储路径在很久之前调整过一次,因此还按照历史路径访问就会失败。

@kivenyangming
Copy link
Author

答复【houj04】
根据https://github.com/PaddlePaddle/Paddle/blob/v2.3.0/cmake/external/xpu.cmake中使用cdn替换su后问题依旧如初。后续更换paddle版本为release/2.5 按照官网教程以及适应对应python版本进行编译成功。成功信息如下所示。
make成功:
adding 'paddlepaddle_xpu-0.0.0.dist-info/RECORD'
removing build/bdist.linux-x86_64/wheel
[100%] Built target paddle_python

安装paddlepaddle-xpu:
dl@dl-2288H-V6:/Paddle/build/python/dist$ pwd
/home/dl/Paddle/build/python/dist
dl@dl-2288H-V6:
/Paddle/build/python/dist$ ls
paddlepaddle_xpu-0.0.0-cp38-cp38-linux_x86_64.whl
dl@dl-2288H-V6:~/Paddle/build/python/dist$ pip install -U paddlepaddle_xpu-0.0.0-cp38-cp38-linux_x86_64.whl
/usr/bin/pip:6: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
from pkg_resources import load_entry_point
Processing ./paddlepaddle_xpu-0.0.0-cp38-cp38-linux_x86_64.whl
Requirement already satisfied, skipping upgrade: httpx in /home/dl/.local/lib/python3.8/site-packages (from paddlepaddle-xpu==0.0.0) (0.27.0)
Requirement already satisfied, skipping upgrade: numpy>=1.13 in /home/dl/.local/lib/python3.8/site-packages (from paddlepaddle-xpu==0.0.0) (1.24.4)
Requirement already satisfied, skipping upgrade: Pillow in /home/dl/.local/lib/python3.8/site-packages (from paddlepaddle-xpu==0.0.0) (10.2.0)
Requirement already satisfied, skipping upgrade: decorator in /home/dl/.local/lib/python3.8/site-packages (from paddlepaddle-xpu==0.0.0) (5.1.1)
Requirement already satisfied, skipping upgrade: astor in /home/dl/.local/lib/python3.8/site-packages (from paddlepaddle-xpu==0.0.0) (0.8.1)
Requirement already satisfied, skipping upgrade: opt-einsum==3.3.0 in /home/dl/.local/lib/python3.8/site-packages (from paddlepaddle-xpu==0.0.0) (3.3.0)
Requirement already satisfied, skipping upgrade: protobuf>=3.20.2; platform_system != "Windows" in /home/dl/.local/lib/python3.8/site-packages (from paddlepaddle-xpu==0.0.0) (4.25.3)
Requirement already satisfied, skipping upgrade: anyio in /home/dl/.local/lib/python3.8/site-packages (from httpx->paddlepaddle-xpu==0.0.0) (4.3.0)
Requirement already satisfied, skipping upgrade: certifi in /usr/lib/python3/dist-packages (from httpx->paddlepaddle-xpu==0.0.0) (2019.11.28)
Requirement already satisfied, skipping upgrade: httpcore==1.* in /home/dl/.local/lib/python3.8/site-packages (from httpx->paddlepaddle-xpu==0.0.0) (1.0.4)
Requirement already satisfied, skipping upgrade: idna in /usr/lib/python3/dist-packages (from httpx->paddlepaddle-xpu==0.0.0) (2.8)
Requirement already satisfied, skipping upgrade: sniffio in /home/dl/.local/lib/python3.8/site-packages (from httpx->paddlepaddle-xpu==0.0.0) (1.3.1)
Requirement already satisfied, skipping upgrade: exceptiongroup>=1.0.2; python_version < "3.11" in /home/dl/.local/lib/python3.8/site-packages (from anyio->httpx->paddlepaddle-xpu==0.0.0) (1.2.0)
Requirement already satisfied, skipping upgrade: typing-extensions>=4.1; python_version < "3.11" in /home/dl/.local/lib/python3.8/site-packages (from anyio->httpx->paddlepaddle-xpu==0.0.0) (4.10.0)
Requirement already satisfied, skipping upgrade: h11<0.15,>=0.13 in /home/dl/.local/lib/python3.8/site-packages (from httpcore==1.*->httpx->paddlepaddle-xpu==0.0.0) (0.14.0)
Installing collected packages: paddlepaddle-xpu
Successfully installed paddlepaddle-xpu-0.0.0

检验安装:
dl@dl-2288H-V6:~/Paddle/build/python/dist$ python
Python 3.8.10 (default, Nov 22 2023, 10:22:35)
[GCC 9.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.

import paddle
XCCL /home/dl/.local/lib/python3.8/site-packages/paddle/base/../libs/libbkcl.so loaded
XPURT /home/dl/.local/lib/python3.8/site-packages/paddle/base/../libs/libxpurt.so.1 loaded
paddle.utils.run_check()
Running verify PaddlePaddle program ...
I0305 13:17:35.218402 77217 program_interpreter.cc:212] New Executor is Running.
W0305 13:17:35.218564 77217 xpu_context.cc:151] Please NOTE: xpu device: 0
I0305 13:17:35.226167 77217 interpreter_util.cc:624] Standalone Executor is Used.
PaddlePaddle works well on 1 XPU.
PaddlePaddle is installed successfully! Let's start deep learning with PaddlePaddle now.

感谢【houj04】答复支持!谢谢!

@houj04
Copy link
Contributor

houj04 commented Mar 5, 2024

不客气,能用就好!

@paddle-bot paddle-bot bot added status/close 已关闭 and removed status/new-issue 新建 labels Mar 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status/close 已关闭 type/build 编译/安装问题
Projects
None yet
Development

No branches or pull requests

3 participants