PaddleNLP [Bug]: 错误:在 'struct phi::Place::Hash' 中没有名为 'hash_policy' 的类型 typedef typename T::hash_policy type;

pgx2nnw8  于 7个月前  发布在  其他
关注(0)|答案(1)|浏览(117)

软件环境

  1. paddle-bfloat 0.1.7
  2. paddle2onnx 1.2.6
  3. paddlefsl 1.1.0
  4. paddlemix 0.1.0
  5. paddlenlp 3.0.0b0.post20240728
  6. paddlepaddle-gpu 2.6.1.post112

重复问题

  • 我已搜索了现有的问题

错误描述

  1. 按照https://github.com/PaddlePaddle/PaddleNLP/blob/develop/csrc/README.md
  2. 教程安装编译 Cuda 算子报错:no type named hash_policy
  3. '''
  4. !!
  5. self.initialize_options()
  6. [2024-07-30 22:04:02,198] [ INFO] dist.py:985 - running bdist_egg
  7. [2024-07-30 22:04:03,177] [ INFO] dist.py:985 - running egg_info
  8. [2024-07-30 22:04:03,618] [ INFO] egg_info.py:668 - writing paddlenlp_ops.egg-info/PKG-INFO
  9. [2024-07-30 22:04:03,623] [ INFO] egg_info.py:292 - writing dependency_links to paddlenlp_ops.egg-info/dependency_links.txt
  10. [2024-07-30 22:04:03,626] [ INFO] egg_info.py:292 - writing top-level names to paddlenlp_ops.egg-info/top_level.txt
  11. [2024-07-30 22:04:03,918] [ INFO] sdist.py:190 - reading manifest file 'paddlenlp_ops.egg-info/SOURCES.txt'
  12. [2024-07-30 22:04:03,928] [ INFO] util.py:328 - writing manifest file 'paddlenlp_ops.egg-info/SOURCES.txt'
  13. [2024-07-30 22:04:03,929] [ INFO] bdist_egg.py:161 - installing library code to build/paddlenlp_ops/bdist.linux-x86_64/egg
  14. [2024-07-30 22:04:03,930] [ INFO] dist.py:985 - running install_lib
  15. [2024-07-30 22:04:03,930] [ INFO] dist.py:985 - running build_ext
  16. Compiling user custom op, it will cost a few seconds.....
  17. [2024-07-30 22:04:04,628] [ INFO] build_ext.py:533 - building 'paddlenlp_ops' extension
  18. [2024-07-30 22:04:04,628] [ INFO] spawn.py:38 - /mnt/petrelfs/share/cuda-11.2/bin/nvcc -I/mnt/petrelfs/taitan/miniconda3/envs/paddle/lib/python3.9/site-packages/paddle/in
  19. clude -I/mnt/petrelfs/taitan/miniconda3/envs/paddle/lib/python3.9/site-packages/paddle/include/third_party -I/mnt/petrelfs/share/cuda-11.2/include -I/mnt/petrelfs/taitan/mi
  20. niconda3/envs/paddle/include/python3.9 -I/mnt/petrelfs/taitan/miniconda3/envs/paddle/include/python3.9 -c /mnt/petrelfs/taitan/projects/PaddleMIX/PaddleNLP/csrc/generation/
  21. dequant_int8.cu -o /mnt/petrelfs/taitan/projects/PaddleMIX/PaddleNLP/csrc/build/paddlenlp_ops/lib.linux-x86_64-cpython-39/dequant_int8.cu.o -DPADDLE_WITH_CUDA -DEIGEN_USE_GP
  22. U -ccbin cc -Xcompiler -fPIC --expt-relaxed-constexpr -DNVCC -O3 -std=c++11 -U__CUDA_NO_HALF_OPERATORS__ -U__CUDA_NO_HALF_CONVERSIONS__ -U__CUDA_NO_BFLOAT16_OPERATORS__ -U__C
  23. UDA_NO_BFLOAT16_CONVERSIONS__ -U__CUDA_NO_BFLOAT162_OPERATORS__ -U__CUDA_NO_BFLOAT162_CONVERSIONS__ -gencode arch=compute_80,code=sm_80 -w -DPADDLE_WITH_CUSTOM_KERNEL -D_GLIB
  24. CXX_USE_CXX11_ABI=1
  25. /mnt/petrelfs/taitan/miniconda3/envs/paddle/lib/python3.9/site-packages/paddle/include/paddle/utils/flat_hash_map.h: In instantiation of ‘struct paddle::detailv3::HashPolicy
  26. Selector<phi::Place::Hash, void>’:
  27. /mnt/petrelfs/taitan/miniconda3/envs/paddle/lib/python3.9/site-packages/paddle/include/paddle/utils/flat_hash_map.h:664:51: required from ‘class paddle::detailv3::sherwood
  28. _v3_table<std::pair<phi::Place, const phi::DeviceContext*>, phi::Place, phi::Place::Hash, paddle::detailv3::KeyOrValueHasher<phi::Place, std::pair<phi::Place, const phi::Devi
  29. ceContext*>, phi::Place::Hash>, std::equal_to<phi::Place>, paddle::detailv3::KeyOrValueEquality<phi::Place, std::pair<phi::Place, const phi::DeviceContext*>, std::equal_to<ph
  30. i::Place> >, std::allocator<std::pair<phi::Place, const phi::DeviceContext*> >, std::allocator<paddle::detailv3::sherwood_v3_entry<std::pair<phi::Place, const phi::DeviceCont
  31. ext*> > > >’
  32. /mnt/petrelfs/taitan/miniconda3/envs/paddle/lib/python3.9/site-packages/paddle/include/paddle/utils/flat_hash_map.h:1578:7: required from ‘class paddle::flat_hash_map<phi:
  33. :Place, const phi::DeviceContext*, phi::Place::Hash>’
  34. /mnt/petrelfs/taitan/miniconda3/envs/paddle/lib/python3.9/site-packages/paddle/include/paddle/phi/api/include/context_pool.h:86:75: required from here
  35. /mnt/petrelfs/taitan/miniconda3/envs/paddle/lib/python3.9/site-packages/paddle/include/paddle/utils/flat_hash_map.h:198:33: error: no type named ‘hash_policy’ in ‘struct phi
  36. ::Place::Hash’
  37. typedef typename T::hash_policy type;
  38. ^
  39. error: command '/mnt/petrelfs/share/cuda-11.2/bin/nvcc' failed with exit code 1

稳定复现步骤 & 代码

A100 80G
CDUA 11.2, V11.2.152
gcc version 11.2.0 (GCC)
Python 3.9.19

gkl3eglg

gkl3eglg1#

这里的gcc版本是否是conda的gcc版本,而不是系统的gcc版本?应该是系统gcc-4.6,切换到高版本gcc可以解决问题。

相关问题