Skip to content

npu编译报错:error: ‘StringToDataLayout’ is not a member of ‘phi’ #850

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

Closed
shirwy opened this issue Dec 8, 2023 · 4 comments

Comments

@shirwy
Copy link

shirwy commented Dec 8, 2023

按照https://github.com/PaddlePaddle/PaddleCustomDevice/blob/develop/backends/npu/README_cn.md
指导编译时报错
/workspace/PaddleCustomDevice/backends/npu/kernels/batch_norm_kernel.cc: In function ‘void custom_kernel::BatchNormKernel(const Context&, const phi::DenseTensor&, const phi::DenseTensor&, const phi::DenseTensor&, const paddle::optionalphi::DenseTensor&, const paddle::optionalphi::DenseTensor&, bool, float, float, const string&, bool, bool, phi::DenseTensor*, phi::DenseTensor*, phi::DenseTensor*, phi::DenseTensor*, phi::DenseTensor*, phi::DenseTensor*)’:
/workspace/PaddleCustomDevice/backends/npu/kernels/batch_norm_kernel.cc:64:33: error: ‘StringToDataLayout’ is not a member of ‘phi’
const auto data_layout = phi::StringToDataLayout(data_layout_str);
^~~~~~~~~~~~~~~~~~
/workspace/PaddleCustomDevice/backends/npu/kernels/batch_norm_kernel.cc:64:33: note: suggested alternative: ‘DataLayout’
const auto data_layout = phi::StringToDataLayout(data_layout_str);
^~~~~~~~~~~~~~~~~~
DataLayout
/workspace/PaddleCustomDevice/backends/npu/kernels/batch_norm_kernel.cc: In function ‘void custom_kernel::BatchNormGradKernel(const Context&, const phi::DenseTensor&, const paddle::optionalphi::DenseTensor&, const paddle::optionalphi::DenseTensor&, const paddle::optionalphi::DenseTensor&, const paddle::optionalphi::DenseTensor&, const phi::DenseTensor&, const phi::DenseTensor&, const paddle::optionalphi::DenseTensor&, const phi::DenseTensor&, float, float, const string&, bool, bool, bool, phi::DenseTensor*, phi::DenseTensor*, phi::DenseTensor*)’:
/workspace/PaddleCustomDevice/backends/npu/kernels/batch_norm_kernel.cc:311:33: error: ‘StringToDataLayout’ is not a member of ‘phi’
const auto data_layout = phi::StringToDataLayout(data_layout_str);
^~~~~~~~~~~~~~~~~~
/workspace/PaddleCustomDevice/backends/npu/kernels/batch_norm_kernel.cc:311:33: note: suggested alternative: ‘DataLayout’
const auto data_layout = phi::StringToDataLayout(data_layout_str);
^~~~~~~~~~~~~~~~~~
DataLayout
CMakeFiles/paddle-custom-npu.dir/build.make:276: recipe for target 'CMakeFiles/paddle-custom-npu.dir/kernels/batch_norm_kernel.cc.o' failed
make[2]: *** [CMakeFiles/paddle-custom-npu.dir/kernels/batch_norm_kernel.cc.o] Error 1
make[2]: *** Waiting for unfinished jobs....
CMakeFiles/Makefile2:109: recipe for target 'CMakeFiles/paddle-custom-npu.dir/all' failed
make[1]: *** [CMakeFiles/paddle-custom-npu.dir/all] Error 2
Makefile:102: recipe for target 'all' failed
make: *** [all] Error 2

  • make_error=2
  • '[' 2 '!=' 0 ']'
  • echo 'Make Error Found !!!'
    Make Error Found !!!
  • exit 7
@duyongtju
Copy link

我遇到了同样的问题。
CPU aarch64 架构
paddle custom divice 版本 commit ID: 15d4633
npu-smi version: 23.0.rc3

@duyongtju
Copy link

image

@study-hard-forever
Copy link

study-hard-forever commented Dec 14, 2023

I had the same problem following https://github.com/PaddlePaddle/PaddleCustomDevice/blob/develop/backends/npu/README_cn.md 's process. Has it been solved?Is it the GCC and G++ compiler version? What version do you have? Mine is 7.3.0, and I see here https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/guides/hardware_support/npu_docs/paddle_install_cn.html that version 8.2+ is needed, is it related to this version? Is this the cause?

@qili93
Copy link
Collaborator

qili93 commented Feb 4, 2024

this issue has been fixed by PR #853, please try agian with latest code.

@qili93 qili93 closed this as completed Feb 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants