Skip to content
Merged
13 changes: 13 additions & 0 deletions cmake/external/flashattn.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,19 @@ else()
endif()

set(FLASHATTN_CMAKE_CUDA_FLAGS "-Xfatbin -compress-all")
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION
VERSION_GREATER_EQUAL 15.0)
# GCC 15 diagnoses template-body lookup failures in the vendored CUTLASS
# v2.9.0 matrix.h before the affected helpers are instantiated. Keep this
# warning local to FlashAttention until CUTLASS is upgraded or patched.
if(CMAKE_CUDA_COMPILER_ID STREQUAL "NVIDIA")
set(FLASHATTN_CMAKE_CUDA_FLAGS
"${FLASHATTN_CMAKE_CUDA_FLAGS} -Xcompiler=-Wno-template-body")
else()
set(FLASHATTN_CMAKE_CUDA_FLAGS
"${FLASHATTN_CMAKE_CUDA_FLAGS} -Wno-template-body")
endif()
endif()
set(FA_NVCC_ARCH_BIN "")
foreach(arch ${NVCC_ARCH_BIN})
string(STRIP ${arch} arch)
Expand Down
1 change: 1 addition & 0 deletions paddle/fluid/inference/api/paddle_analysis_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#pragma once

#include <cassert>
#include <cstdint>
#include <map>
#include <memory>
#include <string>
Expand Down
1 change: 1 addition & 0 deletions paddle/fluid/inference/api/paddle_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
*/

#include <cassert>
#include <cstdint>
#include <map>
#include <memory>
#include <string>
Expand Down
1 change: 1 addition & 0 deletions paddle/fluid/inference/api/paddle_inference_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ limitations under the License. */
#pragma once

#include <cassert>
#include <cstdint>
#include <map>
#include <memory>
#include <string>
Expand Down
2 changes: 1 addition & 1 deletion paddle/fluid/pybind/sot/eval_frame.c
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ static PyObject *_custom_eval_frame(PyThreadState *tstate,
#if PY_3_13_PLUS
frame_proxy->locals = f_locals;
#endif
PyObject *arg = frame_proxy;
PyObject *arg = (PyObject *)frame_proxy;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2 优先级:P2

这里把 PyInterpreterFrameProxy_New(frame) 返回的新引用显式作为 PyObject* 传给 callback,但 PyObject_CallOneArg 不会接管参数引用,后续成功和异常路径也没有释放 frame_proxy。SOT 打开后每个被拦截的 frame 都会走这里,长时间运行会持续泄漏 proxy 对象。请在 callback 返回后统一释放 Py3.11+ 分支创建的参数引用,再进入 result == NULL 的错误处理,例如:

PyObject *result = PyObject_CallOneArg(callback, arg);
#if PY_3_11_PLUS
Py_DECREF(arg);
#endif
if (result == NULL) {
  ...
}

#else
PyObject *arg = frame;
#endif
Expand Down
1 change: 1 addition & 0 deletions paddle/phi/kernels/strings/unicode.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ limitations under the License. */

#pragma once

#include <cstdint>
#include <cstring>
#include <memory>

Expand Down
20 changes: 19 additions & 1 deletion tools/dockerfile/build_scripts/install_gcc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,26 @@ elif [ "$1" == "gcc121" ]; then
cd .. && mkdir temp_gcc121 && cd temp_gcc121 && \
../gcc-12.1.0/configure --prefix=/usr/local/gcc-12.1 --enable-checking=release --enable-languages=c,c++ --disable-multilib && \
make -j8 && make install
cd .. && rm -rf temp_gcc122 gcc-12.1.0 gcc-12.1.0.tar.gz
cd .. && rm -rf temp_gcc121 gcc-12.1.0 gcc-12.1.0.tar.gz
cp ${lib_so_6} ${lib_so_6}.bak && rm -f ${lib_so_6} &&
ln -s /usr/local/gcc-12.1/lib64/libstdc++.so.6 ${lib_so_6} && \
cp /usr/local/gcc-12.1/lib64/libstdc++.so.6.0.30 ${lib_path}
elif [ "$1" == "gcc152" ]; then
GCC_VERSION=${GCC_VERSION:-15.2.0}
GCC_MAJOR_MINOR=$(echo ${GCC_VERSION} | cut -d. -f1,2)
GCC_PREFIX=/usr/local/gcc-${GCC_MAJOR_MINOR}
GCC_ARCHIVE=gcc-${GCC_VERSION}.tar.xz
wget -q https://ftp.gnu.org/gnu/gcc/gcc-${GCC_VERSION}/${GCC_ARCHIVE}
tar -xf ${GCC_ARCHIVE} && \
cd gcc-${GCC_VERSION} && \
unset LIBRARY_PATH CPATH C_INCLUDE_PATH PKG_CONFIG_PATH CPLUS_INCLUDE_PATH INCLUDE && \
./contrib/download_prerequisites && \
cd .. && mkdir temp_gcc152 && cd temp_gcc152 && \
../gcc-${GCC_VERSION}/configure --prefix=${GCC_PREFIX} --enable-checking=release --enable-languages=c,c++ --disable-multilib && \
make -j$(nproc) && make install
cd .. && rm -rf temp_gcc152 gcc-${GCC_VERSION} ${GCC_ARCHIVE}

This comment was marked as outdated.

cp ${lib_so_6} ${lib_so_6}.bak && rm -f ${lib_so_6} &&
ln -s ${GCC_PREFIX}/lib64/libstdc++.so.6 ${lib_so_6} && \
cp ${GCC_PREFIX}/lib64/libstdc++.so.6.* ${lib_path}

fi

This comment was marked as outdated.