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

Update FG for latest paddle and cuda #6812

Merged
merged 21 commits into from Sep 5, 2023
Merged

Conversation

DrownFish19
Copy link
Collaborator

@DrownFish19 DrownFish19 commented Aug 24, 2023

PR types

Bug fixes

PR changes

Others

Description

  • update -std=c++17 in CMakeList.txt for latest paddle inference libary.
  • update include files in paddlenlp/ops/fast_transformer/src/xxx.h for latest paddle inference libary.
  • replace codecvt with utf8cpp in demo/gpt.cc, since codecvt is deprecated in C++17.
  • config CMAKE_C_COMPILER and CMAKE_CXX_COMPILER in ci_case.sh to avoid system gcc 4.8.5 during cmake.

This resolves #3522

@codecov
Copy link

codecov bot commented Aug 24, 2023

Codecov Report

Merging #6812 (4e3d473) into develop (2f3eac3) will decrease coverage by 0.01%.
The diff coverage is 12.50%.

@@             Coverage Diff             @@
##           develop    #6812      +/-   ##
===========================================
- Coverage    59.92%   59.92%   -0.01%     
===========================================
  Files          547      547              
  Lines        81009    81015       +6     
===========================================
+ Hits         48546    48547       +1     
- Misses       32463    32468       +5     
Files Changed Coverage Δ
...dlenlp/ops/fast_transformer/transformer/encoder.py 9.44% <0.00%> (ø)
paddlenlp/ops/ext_utils.py 26.94% <14.28%> (-0.39%) ⬇️

@ZHUI ZHUI requested a review from guoshengCS August 25, 2023 08:35
@DrownFish19 DrownFish19 changed the title fix FG for new paddle and cuda env Update FG for latest paddle and cuda Aug 25, 2023
@DrownFish19 DrownFish19 marked this pull request as ready for review August 25, 2023 09:01
guoshengCS
guoshengCS previously approved these changes Aug 29, 2023
self.cmake_args += ["-DCMAKE_CXX_COMPILER={}".format(os.getenv("CXX_COMPILER_PATH"))]

self.cmake_args += ["-DPYTHON_LIBRARY={}".format(distutils.sysconfig.get_config_var("LIBDIR"))]
self.cmake_args += ["-DPYTHON_INCLUDE_DIR={}".format(distutils.sysconfig.get_python_inc())]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

是否可以直接使用sysconfig的一些方法拿到了,distutils之前因为deprecated有想要去掉

# copy form distutils.dep_util to avoid import distutils
def newer_group(sources, target, missing="error"):
    """Return true if 'target' is out-of-date with respect to any file
    listed in 'sources'.  In other words, if 'target' exists and is newer
    than every file in 'sources', return false; otherwise return true

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已经修改,distutils.sysconfig功能已经导入sysconfig,直接使用import sysconfig并实现了相同输出

GIT_TAG nccl_dependent_refine
PREFIX ${THIRD_PATH}
SOURCE_DIR ${THIRD_PATH}/source/${THIRD_PARTY_NAME}
UPDATE_COMMAND ${FT_UPDATE_COMMAND} # PATCH_COMMAND ${FT_PATCH_COMMAND}
BINARY_DIR ${THIRD_PATH}/build/${THIRD_PARTY_NAME}
INSTALL_COMMAND ""
CMAKE_ARGS -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DSM=${SM} -DBUILD_PD=ON -DBUILD_ENCODER=${WITH_ENCODER} -DPY_CMD=${PY_CMD} -DON_INFER=${ON_INFER} -DPADDLE_LIB=${PADDLE_LIB} -DWITH_MKL=${WITH_MKL} -DWITH_STATIC_LIB=${WITH_STATIC_LIB} -DBUILD_GPT=${WITH_PARALLEL} -DWITH_ONNXRUNTIME=${WITH_ONNXRUNTIME}
CMAKE_ARGS -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DCMAKE_C_COMPILER=/usr/local/gcc-12.2/bin/gcc -DCMAKE_CXX_COMPILER=/usr/local/gcc-12.2/bin/g++ -DSM=${SM} -DBUILD_PD=ON -DBUILD_ENCODER=${WITH_ENCODER} -DPY_CMD=${PY_CMD} -DON_INFER=${ON_INFER} -DPADDLE_LIB=${PADDLE_LIB} -DWITH_MKL=${WITH_MKL} -DWITH_STATIC_LIB=${WITH_STATIC_LIB} -DBUILD_GPT=${WITH_PARALLEL} -DWITH_ONNXRUNTIME=${WITH_ONNXRUNTIME}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里的CMAKE_CXX_COMPILER是否要明确写死这个路径了

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已经修改,通过环境变量设置gcc和g++

guoshengCS
guoshengCS previously approved these changes Aug 29, 2023
@ZHUI ZHUI merged commit 0283a6b into PaddlePaddle:develop Sep 5, 2023
9 checks passed
@DrownFish19 DrownFish19 deleted the dev-fixFG branch September 8, 2023 02:30
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

Successfully merging this pull request may close these issues.

[Question]: 中文摘要模型export加速build出错
3 participants