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

paddle-bfloat影响pip install安装paddle nightlybuild #40559

Closed
Meiyim opened this issue Mar 15, 2022 · 10 comments
Closed

paddle-bfloat影响pip install安装paddle nightlybuild #40559

Meiyim opened this issue Mar 15, 2022 · 10 comments
Assignees
Labels

Comments

@Meiyim
Copy link
Contributor

Meiyim commented Mar 15, 2022

尝试在centos 7机器上 通过pip install 安装 paddle nightly build: https://paddle-wheel.bj.bcebos.com/develop/linux/gpu-cuda10.1-cudnn7-mkl_gcc5.4/paddlepaddle_gpu-0.0.0.post101-cp37-cp37m-linux_x86_64.whl

系统版本:
CentOS Linux release 7.5.1804 (Core)
Python 3.7.10 (default, Feb 26 2021, 18:47:35)
[GCC 7.3.0] :: Anaconda, Inc. on linux

遇到paddle-bfloat 安装报错,信息如下:

Processing ./paddlepaddle_gpu-0.0.0.post101-cp37-cp37m-linux_x86_64.whl
Requirement already satisfied: protobuf>=3.1.0 in /ssd1/chenxuyi/conda/envs/pd-dev-2/lib/python3.7/site-packages (from paddlepaddle-gpu==0.0.0.post101) (3.18.1)
Requirement already satisfied: requests>=2.20.0 in /ssd1/chenxuyi/conda/envs/pd-dev-2/lib/python3.7/site-packages (from paddlepaddle-gpu==0.0.0.post101) (2.26.0)
Requirement already satisfied: Pillow in /ssd1/chenxuyi/conda/envs/pd-dev-2/lib/python3.7/site-packages (from paddlepaddle-gpu==0.0.0.post101) (8.3.2)
Collecting paddle-bfloat==0.1.2
  Using cached paddle_bfloat-0.1.2.tar.gz (553 kB)
Requirement already satisfied: numpy>=1.13 in /ssd1/chenxuyi/conda/envs/pd-dev-2/lib/python3.7/site-packages (from paddlepaddle-gpu==0.0.0.post101) (1.21.2)
Requirement already satisfied: six in /ssd1/chenxuyi/conda/envs/pd-dev-2/lib/python3.7/site-packages (from paddlepaddle-gpu==0.0.0.post101) (1.16.0)
Requirement already satisfied: astor in /ssd1/chenxuyi/conda/envs/pd-dev-2/lib/python3.7/site-packages (from paddlepaddle-gpu==0.0.0.post101) (0.8.1)
Requirement already satisfied: decorator in /ssd1/chenxuyi/conda/envs/pd-dev-2/lib/python3.7/site-packages (from paddlepaddle-gpu==0.0.0.post101) (5.1.0)
Requirement already satisfied: idna<4,>=2.5 in /ssd1/chenxuyi/conda/envs/pd-dev-2/lib/python3.7/site-packages (from requests>=2.20.0->paddlepaddle-gpu==0.0.0.post101) (3.2)
Requirement already satisfied: certifi>=2017.4.17 in /ssd1/chenxuyi/conda/envs/pd-dev-2/lib/python3.7/site-packages (from requests>=2.20.0->paddlepaddle-gpu==0.0.0.post101) (2021.10.8)
Requirement already satisfied: charset-normalizer~=2.0.0 in /ssd1/chenxuyi/conda/envs/pd-dev-2/lib/python3.7/site-packages (from requests>=2.20.0->paddlepaddle-gpu==0.0.0.post101) (2.0.6)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in /ssd1/chenxuyi/conda/envs/pd-dev-2/lib/python3.7/site-packages (from requests>=2.20.0->paddlepaddle-gpu==0.0.0.post101) (1.26.7)
Building wheels for collected packages: paddle-bfloat
  Building wheel for paddle-bfloat (setup.py): started
  Building wheel for paddle-bfloat (setup.py): finished with status 'error'
  ERROR: Command errored out with exit status 1:
   command: /home/work/chenxuyi/conda/envs/pd-dev-2/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/ssd1/chenxuyi/.tmp/pip-install-iw1_6n0e/paddle-bfloat_fc879ebc4551498d8fce11f0e8dad0cd/setup.py'"'"'; __file__='"'"'/ssd1/chenxuyi/.tmp/pip-install-iw1_6n0e/paddle-bfloat_fc879ebc4551498d8fce11f0e8dad0cd/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /ssd1/chenxuyi/.tmp/pip-wheel-pf9tvnlb
       cwd: /ssd1/chenxuyi/.tmp/pip-install-iw1_6n0e/paddle-bfloat_fc879ebc4551498d8fce11f0e8dad0cd/
  Complete output (59 lines):
  running bdist_wheel
  running build
  running build_ext
  building 'paddle_bfloat' extension
  creating build
  creating build/temp.linux-x86_64-3.7
  gcc -pthread -B /home/work/chenxuyi/conda/envs/pd-dev-2/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/home/work/chenxuyi/conda/envs/pd-dev-2/include/python3.7m -I/home/work/chenxuyi/conda/envs/pd-dev-2/lib/python3.7/site-packages/numpy/core/include -c bfloat16.cc -o build/temp.linux-x86_64-3.7/bfloat16.o -std=c++11
  bfloat16.cc:71:28: error: expected type-specifier
     using Safe_PyObjectPtr = std::unique_ptr<PyObject, PyDecrefDeleter>;
                              ^
  bfloat16.cc:72:3: error: ‘Safe_PyObjectPtr’ does not name a type
     Safe_PyObjectPtr make_safe(PyObject *object)
     ^
  bfloat16.cc: In function ‘bool paddle::{anonymous}::CastToBfloat16(PyObject*, paddle::{anonymous}::bfloat16*)’:
  bfloat16.cc:180:5: error: ‘Safe_PyObjectPtr’ was not declared in this scope
       Safe_PyObjectPtr ref;
       ^
  bfloat16.cc:180:22: error: expected ‘;’ before ‘ref’
       Safe_PyObjectPtr ref;
                        ^
  bfloat16.cc:184:53: error: ‘make_safe’ was not declared in this scope
        ref = make_safe(PyArray_Cast(arr, npy_bfloat16));
                                                       ^
  bfloat16.cc:189:15: error: ‘std::ref’ does not have class type
        arg = ref.get();
                 ^
  bfloat16.cc: In function ‘bool paddle::{anonymous}::RegisterUFunc(PyObject*, const char*)’:
  bfloat16.cc:1023:4: error: ‘Safe_PyObjectPtr’ was not declared in this scope
      Safe_PyObjectPtr ufunc_obj = make_safe(PyObject_GetAttrString(numpy, name));
      ^
  bfloat16.cc:1023:21: error: expected ‘;’ before ‘ufunc_obj’
      Safe_PyObjectPtr ufunc_obj = make_safe(PyObject_GetAttrString(numpy, name));
                       ^
  bfloat16.cc:1024:9: error: ‘ufunc_obj’ was not declared in this scope
      if (!ufunc_obj)
           ^
  bfloat16.cc:1028:61: error: ‘ufunc_obj’ was not declared in this scope
      PyUFuncObject *ufunc = reinterpret_cast<PyUFuncObject *>(ufunc_obj.get());
                                                               ^
  bfloat16.cc: In function ‘bool paddle::Initialize()’:
  bfloat16.cc:1742:3: error: ‘Safe_PyObjectPtr’ was not declared in this scope
     Safe_PyObjectPtr numpy_str = make_safe(PyUnicode_FromString("numpy"));
     ^
  bfloat16.cc:1742:20: error: expected ‘;’ before ‘numpy_str’
     Safe_PyObjectPtr numpy_str = make_safe(PyUnicode_FromString("numpy"));
                      ^
  bfloat16.cc:1743:8: error: ‘numpy_str’ was not declared in this scope
     if (!numpy_str)
          ^
  bfloat16.cc:1747:20: error: expected ‘;’ before ‘numpy’
     Safe_PyObjectPtr numpy = make_safe(PyImport_Import(numpy_str.get()));
                      ^
  bfloat16.cc:1748:8: error: ‘numpy’ was not declared in this scope
     if (!numpy)
          ^
  bfloat16.cc:1892:64: error: ‘numpy’ was not declared in this scope
      RegisterUFunc<BinaryUFunc<bfloat16, bfloat16, ufuncs::Add>>(numpy.get(), "add") &&
                                                                  ^
  error: command 'gcc' failed with exit status 1
  ----------------------------------------
  ERROR: Failed building wheel for paddle-bfloat
  Running setup.py clean for paddle-bfloat
Failed to build paddle-bfloat
Installing collected packages: paddle-bfloat, paddlepaddle-gpu
    Running setup.py install for paddle-bfloat: started
    Running setup.py install for paddle-bfloat: finished with status 'error'
    ERROR: Command errored out with exit status 1:
     command: /home/work/chenxuyi/conda/envs/pd-dev-2/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/ssd1/chenxuyi/.tmp/pip-install-iw1_6n0e/paddle-bfloat_fc879ebc4551498d8fce11f0e8dad0cd/setup.py'"'"'; __file__='"'"'/ssd1/chenxuyi/.tmp/pip-install-iw1_6n0e/paddle-bfloat_fc879ebc4551498d8fce11f0e8dad0cd/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /ssd1/chenxuyi/.tmp/pip-record-5aqjbx8f/install-record.txt --single-version-externally-managed --compile --install-headers /home/work/chenxuyi/conda/envs/pd-dev-2/include/python3.7m/paddle-bfloat
         cwd: /ssd1/chenxuyi/.tmp/pip-install-iw1_6n0e/paddle-bfloat_fc879ebc4551498d8fce11f0e8dad0cd/
    Complete output (59 lines):
    running install
    running build
    running build_ext
    building 'paddle_bfloat' extension
    creating build
    creating build/temp.linux-x86_64-3.7
    gcc -pthread -B /home/work/chenxuyi/conda/envs/pd-dev-2/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/home/work/chenxuyi/conda/envs/pd-dev-2/include/python3.7m -I/home/work/chenxuyi/conda/envs/pd-dev-2/lib/python3.7/site-packages/numpy/core/include -c bfloat16.cc -o build/temp.linux-x86_64-3.7/bfloat16.o -std=c++11
    bfloat16.cc:71:28: error: expected type-specifier
       using Safe_PyObjectPtr = std::unique_ptr<PyObject, PyDecrefDeleter>;
                                ^
    bfloat16.cc:72:3: error: ‘Safe_PyObjectPtr’ does not name a type
       Safe_PyObjectPtr make_safe(PyObject *object)
       ^
    bfloat16.cc: In function ‘bool paddle::{anonymous}::CastToBfloat16(PyObject*, paddle::{anonymous}::bfloat16*)’:
    bfloat16.cc:180:5: error: ‘Safe_PyObjectPtr’ was not declared in this scope
         Safe_PyObjectPtr ref;
         ^
    bfloat16.cc:180:22: error: expected ‘;’ before ‘ref’
         Safe_PyObjectPtr ref;
                          ^
    bfloat16.cc:184:53: error: ‘make_safe’ was not declared in this scope
          ref = make_safe(PyArray_Cast(arr, npy_bfloat16));
                                                         ^
    bfloat16.cc:189:15: error: ‘std::ref’ does not have class type
          arg = ref.get();
                   ^
    bfloat16.cc: In function ‘bool paddle::{anonymous}::RegisterUFunc(PyObject*, const char*)’:
    bfloat16.cc:1023:4: error: ‘Safe_PyObjectPtr’ was not declared in this scope
        Safe_PyObjectPtr ufunc_obj = make_safe(PyObject_GetAttrString(numpy, name));
        ^
    bfloat16.cc:1023:21: error: expected ‘;’ before ‘ufunc_obj’
        Safe_PyObjectPtr ufunc_obj = make_safe(PyObject_GetAttrString(numpy, name));
                         ^
    bfloat16.cc:1024:9: error: ‘ufunc_obj’ was not declared in this scope
        if (!ufunc_obj)
             ^
    bfloat16.cc:1028:61: error: ‘ufunc_obj’ was not declared in this scope
        PyUFuncObject *ufunc = reinterpret_cast<PyUFuncObject *>(ufunc_obj.get());
                                                                 ^
    bfloat16.cc: In function ‘bool paddle::Initialize()’:
    bfloat16.cc:1742:3: error: ‘Safe_PyObjectPtr’ was not declared in this scope
       Safe_PyObjectPtr numpy_str = make_safe(PyUnicode_FromString("numpy"));
       ^
    bfloat16.cc:1742:20: error: expected ‘;’ before ‘numpy_str’
       Safe_PyObjectPtr numpy_str = make_safe(PyUnicode_FromString("numpy"));
                        ^
    bfloat16.cc:1743:8: error: ‘numpy_str’ was not declared in this scope
       if (!numpy_str)
            ^
    bfloat16.cc:1747:20: error: expected ‘;’ before ‘numpy’
       Safe_PyObjectPtr numpy = make_safe(PyImport_Import(numpy_str.get()));
                        ^
    bfloat16.cc:1748:8: error: ‘numpy’ was not declared in this scope
       if (!numpy)
            ^
    bfloat16.cc:1892:64: error: ‘numpy’ was not declared in this scope
        RegisterUFunc<BinaryUFunc<bfloat16, bfloat16, ufuncs::Add>>(numpy.get(), "add") &&
                                                                    ^
    error: command 'gcc' failed with exit status 1
    ----------------------------------------
ERROR: Command errored out with exit status 1: /home/work/chenxuyi/conda/envs/pd-dev-2/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/ssd1/chenxuyi/.tmp/pip-install-iw1_6n0e/paddle-bfloat_fc879ebc4551498d8fce11f0e8dad0cd/setup.py'"'"'; __file__='"'"'/ssd1/chenxuyi/.tmp/pip-install-iw1_6n0e/paddle-bfloat_fc879ebc4551498d8fce11f0e8dad0cd/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /ssd1/chenxuyi/.tmp/pip-record-5aqjbx8f/install-record.txt --single-version-externally-managed --compile --install-headers /home/work/chenxuyi/conda/envs/pd-dev-2/include/python3.7m/paddle-bfloat Check the logs for full command output.
@paddle-bot-old
Copy link

您好,我们已经收到了您的问题,会安排技术人员尽快解答您的问题,请耐心等待。请您再次检查是否提供了清晰的问题描述、复现代码、环境&版本、报错信息等。同时,您也可以通过查看官网API文档常见问题历史IssueAI社区来寻求解答。祝您生活愉快~

Hi! We've received your issue and please be patient to get responded. We will arrange technicians to answer your questions as soon as possible. Please make sure that you have posted enough message to demo your request. You may also check out the APIFAQGithub Issue and AI community to get the answer.Have a nice day!

@LiuChiachi
Copy link
Contributor

@pangyoki 帮忙分析一下,thanks~

@LiuChiachi
Copy link
Contributor

HI. @Meiyim 可以尝试先直接pip安装paddle-bfloat

@SWHL
Copy link

SWHL commented Apr 13, 2022

  • 我也遇到同样的问题
  • 系统版本:
CentOS Linux release 7.9.2009 (Core)
Python 3.7.11
gcc version 7.3.1 20180303 (Red Hat 7.3.1-5) (GCC)
  • 单独安装paddle-bfloat命令:
pip install paddle-bfloat
  • 报错信息:
Collecting paddle-bfloat
  Using cached paddle_bfloat-0.1.2.tar.gz (553 kB)
Building wheels for collected packages: paddle-bfloat
  Building wheel for paddle-bfloat (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: /da2/miniconda3/envs/SWHL/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-tdm2doi4/paddle-bfloat_2c124a9020e4427e8200b6bc4d226716/setup.py'"'"'; __file__='"'"'/tmp/pip-install-tdm2doi4/paddle-bfloat_2c124a9020e4427e8200b6bc4d226716/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-cuklhg0m
       cwd: /tmp/pip-install-tdm2doi4/paddle-bfloat_2c124a9020e4427e8200b6bc4d226716/
  Complete output (13 lines):
  running bdist_wheel
  running build
  running build_ext
  building 'paddle_bfloat' extension
  creating build
  creating build/temp.linux-x86_64-3.7
  gcc -pthread -B /da2/miniconda3/envs/SWHL/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/da2/miniconda3/envs/SWHL/include/python3.7m -I/da2/miniconda3/envs/SWHL/lib/python3.7/site-packages/numpy/core/include -c bfloat16.cc -o build/temp.linux-x86_64-3.7/bfloat16.o -std=c++11
  creating build/lib.linux-x86_64-3.7
  g++ -pthread -shared -B /da2/miniconda3/envs/SWHL/compiler_compat -L/da2/miniconda3/envs/SWHL/lib -Wl,-rpath=/da2/miniconda3/envs/SWHL/lib -Wl,--no-as-needed -Wl,--sysroot=/ build/temp.linux-x86_64-3.7/bfloat16.o -o build/lib.linux-x86_64-3.7/paddle_bfloat.cpython-37m-x86_64-linux-gnu.so
  /da2/miniconda3/envs/SWHL/compiler_compat/ld: cannot find /usr/lib64/libmvec_nonshared.a
  /da2/miniconda3/envs/SWHL/compiler_compat/ld: cannot find /lib64/libmvec.so.1
  collect2: error: ld returned 1 exit status
  error: command 'g++' failed with exit status 1
  ----------------------------------------
  ERROR: Failed building wheel for paddle-bfloat
  Running setup.py clean for paddle-bfloat
Failed to build paddle-bfloat
Installing collected packages: paddle-bfloat
    Running setup.py install for paddle-bfloat ... error
    ERROR: Command errored out with exit status 1:
     command: /da2/miniconda3/envs/SWHL/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-tdm2doi4/paddle-bfloat_2c124a9020e4427e8200b6bc4d226716/setup.py'"'"'; __file__='"'"'/tmp/pip-install-tdm2doi4/paddle-bfloat_2c124a9020e4427e8200b6bc4d226716/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-wb2fwi08/install-record.txt --single-version-externally-managed --compile --install-headers /da2/miniconda3/envs/SWHL/include/python3.7m/paddle-bfloat
         cwd: /tmp/pip-install-tdm2doi4/paddle-bfloat_2c124a9020e4427e8200b6bc4d226716/
    Complete output (13 lines):
    running install
    running build
    running build_ext
    building 'paddle_bfloat' extension
    creating build
    creating build/temp.linux-x86_64-3.7
    gcc -pthread -B /da2/miniconda3/envs/SWHL/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/da2/miniconda3/envs/SWHL/include/python3.7m -I/da2/miniconda3/envs/SWHL/lib/python3.7/site-packages/numpy/core/include -c bfloat16.cc -o build/temp.linux-x86_64-3.7/bfloat16.o -std=c++11
    creating build/lib.linux-x86_64-3.7
    g++ -pthread -shared -B /da2/miniconda3/envs/SWHL/compiler_compat -L/da2/miniconda3/envs/SWHL/lib -Wl,-rpath=/da2/miniconda3/envs/SWHL/lib -Wl,--no-as-needed -Wl,--sysroot=/ build/temp.linux-x86_64-3.7/bfloat16.o -o build/lib.linux-x86_64-3.7/paddle_bfloat.cpython-37m-x86_64-linux-gnu.so
    /da2/miniconda3/envs/SWHL/compiler_compat/ld: cannot find /usr/lib64/libmvec_nonshared.a
    /da2/miniconda3/envs/SWHL/compiler_compat/ld: cannot find /lib64/libmvec.so.1
    collect2: error: ld returned 1 exit status
    error: command 'g++' failed with exit status 1
    ----------------------------------------
ERROR: Command errored out with exit status 1: /da2/miniconda3/envs/SWHL/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-tdm2doi4/paddle-bfloat_2c124a9020e4427e8200b6bc4d226716/setup.py'"'"'; __file__='"'"'/tmp/pip-install-tdm2doi4/paddle-bfloat_2c124a9020e4427e8200b6bc4d226716/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-wb2fwi08/install-record.txt --single-version-externally-managed --compile --install-headers /da2/miniconda3/envs/SWHL/include/python3.7m/paddle-bfloat Check the logs for full command output.
  • 猜测原因,可能丢失以下两个文件:
    /da2/miniconda3/envs/SWHL/compiler_compat/ld: cannot find /usr/lib64/libmvec_nonshared.a
    /da2/miniconda3/envs/SWHL/compiler_compat/ld: cannot find /lib64/libmvec.so.1

@Aganlengzi
Copy link
Contributor

Aganlengzi commented Apr 20, 2022

@Meiyim @SWHL hi, 请尝试这个页面是否有对应环境的预编译whl包可用?https://pypi.org/project/paddle-bfloat/0.1.2/#files
另外请贴一下pip的版本,是否是因为pip版本导致无法匹配whl包,
如果pip版本较低,可升级后(>20.3)再安装,此时会匹配预编译包paddle_bfloat-0.1.2-cp37-cp37m-manylinux_2_27_x86_64.whl而无需本地编译.

@Aganlengzi
Copy link
Contributor

Aganlengzi commented Apr 20, 2022

@lidanqing-intel @jakpiase hi, it seems local compiling is still needed in some environment, would you please help check?

@SWHL
Copy link

SWHL commented Apr 20, 2022

@Meiyim @SWHL hi, 请尝试这个页面是否有对应环境的预编译whl包可用?https://pypi.org/project/paddle-bfloat/0.1.2/#files 另外请贴一下pip的版本,是否是因为pip版本导致无法匹配whl包, 如果pip版本较低,可升级后(>20.3)再安装,此时会匹配预编译包paddle_bfloat-0.1.2-cp37-cp37m-manylinux_2_27_x86_64.whl而无需本地编译.

  • 之前我的pip版本是21.0.1,直接pip install paddle_bfloat,会报上面我贴的错误

  • 升级pip版本到pip==22.0.4,直接pip install paddle_bfloat,会报下面错误:

     (SWHL) [SWHL@gpu01 SWHL]$ pip install paddle_bfloat
      Collecting paddle_bfloat
        Using cached paddle_bfloat-0.1.3.tar.gz (558 kB)
        Preparing metadata (setup.py) ... done
      Building wheels for collected packages: paddle_bfloat
        Building wheel for paddle_bfloat (setup.py) ... error
        error: subprocess-exited-with-error
      
        × python setup.py bdist_wheel did not run successfully.
        │ exit code: 1
        ╰─> [13 lines of output]
            running bdist_wheel
            running build
            running build_ext
            building 'paddle_bfloat' extension
            creating build
            creating build/temp.linux-x86_64-3.7
            gcc -pthread -B /da2/miniconda3/envs/SWHL/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/da2/miniconda3/envs/SWHL/include/python3.7m -I/da2/miniconda3/envs/SWHL/lib/python3.7/site-packages/numpy/core/include -c bfloat16.cc -o build/temp.linux-x86_64-3.7/bfloat16.o -std=c++11
            creating build/lib.linux-x86_64-3.7
            g++ -pthread -shared -B /da2/miniconda3/envs/SWHL/compiler_compat -L/da2/miniconda3/envs/SWHL/lib -Wl,-rpath=/da2/miniconda3/envs/SWHL/lib -Wl,--no-as-needed -Wl,--sysroot=/ build/temp.linux-x86_64-3.7/bfloat16.o -o build/lib.linux-x86_64-3.7/paddle_bfloat.cpython-37m-x86_64-linux-gnu.so
            /da2/miniconda3/envs/SWHL/compiler_compat/ld: cannot find /usr/lib64/libmvec_nonshared.a
            /da2/miniconda3/envs/SWHL/compiler_compat/ld: cannot find /lib64/libmvec.so.1
            collect2: error: ld returned 1 exit status
            error: command 'g++' failed with exit status 1
            [end of output]
      
        note: This error originates from a subprocess, and is likely not a problem with pip.
        ERROR: Failed building wheel for paddle_bfloat
        Running setup.py clean for paddle_bfloat
      Failed to build paddle_bfloat
      Installing collected packages: paddle_bfloat
        Running setup.py install for paddle_bfloat ... error
        error: subprocess-exited-with-error
      
        × Running setup.py install for paddle_bfloat did not run successfully.
        │ exit code: 1
        ╰─> [13 lines of output]
            running install
            running build
            running build_ext
            building 'paddle_bfloat' extension
            creating build
            creating build/temp.linux-x86_64-3.7
            gcc -pthread -B /da2/miniconda3/envs/SWHL/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/da2/miniconda3/envs/SWHL/include/python3.7m -I/da2/miniconda3/envs/SWHL/lib/python3.7/site-packages/numpy/core/include -c bfloat16.cc -o build/temp.linux-x86_64-3.7/bfloat16.o -std=c++11
            creating build/lib.linux-x86_64-3.7
            g++ -pthread -shared -B /da2/miniconda3/envs/SWHL/compiler_compat -L/da2/miniconda3/envs/SWHL/lib -Wl,-rpath=/da2/miniconda3/envs/SWHL/lib -Wl,--no-as-needed -Wl,--sysroot=/ build/temp.linux-x86_64-3.7/bfloat16.o -o build/lib.linux-x86_64-3.7/paddle_bfloat.cpython-37m-x86_64-linux-gnu.so
            /da2/miniconda3/envs/SWHL/compiler_compat/ld: cannot find /usr/lib64/libmvec_nonshared.a
            /da2/miniconda3/envs/SWHL/compiler_compat/ld: cannot find /lib64/libmvec.so.1
            collect2: error: ld returned 1 exit status
            error: command 'g++' failed with exit status 1
            [end of output]
      
        note: This error originates from a subprocess, and is likely not a problem with pip.
      error: legacy-install-failure
      
      × Encountered error while trying to install package.
      ╰─> paddle_bfloat
      
      note: This is an issue with the package mentioned above, not pip.
      hint: See above for output from the failure.
  • 我尝试去paddle-bfloat 的pypi主页找符合我这里环境的包→paddle_bfloat-0.1.2-cp37-cp37m-manylinux_2_27_x86_64.whl,将它下载到本地,直接安装

    $ pip install paddle_bfloat-0.1.2-cp37-cp37m-manylinux_2_27_x86_64.whl
    
     # 报错如下:
     ERROR: paddle_bfloat-0.1.2-cp37-cp37m-manylinux_2_27_x86_64.whl is not a supported wheel on this platform.
  • paddle_bfloat-0.1.2-cp37-cp37m-manylinux_2_27_x86_64.whl名称改为paddle_bfloat-0.1.2-cp37-cp37m-linux_x86_64.whl

    (SWHL) [SWHL@gpu01 SWHL]$ pip install paddle_bfloat-0.1.2-cp37-cp37m-linux_x86_64.whl
    Processing ./paddle_bfloat-0.1.2-cp37-cp37m-linux_x86_64.whl
    Installing collected packages: paddle-bfloat
    Successfully installed paddle-bfloat-0.1.2
  • 总算是成功解决了,感谢感谢

@Aganlengzi
Copy link
Contributor

@Meiyim @SWHL 可以尝试直接使用pip安装了,已经联系包作者上传了更多的预编译包 https://pypi.org/project/paddle-bfloat/0.1.2/#files

@SWHL
Copy link

SWHL commented Apr 24, 2022

感谢感谢

@Aganlengzi
Copy link
Contributor

@Meiyim hi,我先close这个issue了,有问题欢迎随时reopen再联系我,谢谢!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants