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

Failed to build feature_value_test.cc in Release/2.6 (8189a99) #60090

Closed
jeng1220 opened this issue Dec 17, 2023 · 7 comments
Closed

Failed to build feature_value_test.cc in Release/2.6 (8189a99) #60090

jeng1220 opened this issue Dec 17, 2023 · 7 comments
Assignees
Labels
fleet distributed training NVIDIA status/close 已关闭 type/build 编译/安装问题

Comments

@jeng1220
Copy link
Collaborator

jeng1220 commented Dec 17, 2023

问题描述 Issue Description

Build release/2.6 branch but triggers following error if -DWITH_TESTING=ON.
After manually resolving #60088, it triggers another error:

FAILED: test/CMakeFiles/feature_value_test.dir/__/paddle/fluid/distributed/test/feature_value_test.cc.o
...
/workspace/paddle/paddle/fluid/distributed/common/chunk_allocator.h:80:19: error: ignoring return value of 'int posix_memalign(void**, size_t, size_t)' declared with attribute 'warn_unused_result' [-Werror=unused-result]
   80 |     posix_memalign(reinterpret_cast<void**>(&chunk),
      |     ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   81 |                    std::max<size_t>(sizeof(void*), alignof(Chunk)),
      |                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   82 |                    sizeof(Chunk) + sizeof(Node) * _chunk_size);
      |                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

It's better to take a closer look before force-disabling -Werror=unused-result.

版本&环境信息 Version & Environment Information

CCACHE_DIR=/workspace/ccache_storage
ARCH_FLAGS="-march=sandybridge -mtune=broadwell"
CXX_FLAGS="$ARCH_FLAGS -Wno-error=range-loop-construct -Wno-error=maybe-uninitialized -Wno-error=switch -faligned-new=32"
CUDA_FLAGS="-t2 --forward-unknown-to-host-compiler -Xfatbin=-compress-all $ARCH_FLAGS -lineinfo"

SKIP_DOWNLOAD_INFERENCE_DATA=ON cmake -Bpaddle/build -Spaddle \
    -GNinja \
    -DINFERENCE_DEMO_INSTALL_DIR=/home/scratch.rjeng_sw/baidu/paddle/test_data \
    -DCMAKE_CXX_FLAGS="$CXX_FLAGS" \
    -DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
    -DCMAKE_BUILD_TYPE=Release \
    -DCMAKE_CUDA_FLAGS="$CUDA_FLAGS" \
    -DCUDA_ARCH_NAME=Manual \
    -DCUDA_ARCH_BIN="80" \
    -DWITH_INCREMENTAL_COVERAGE=OFF \
    -DWITH_INFERENCE_API_TEST=OFF \
    -DWITH_DISTRIBUTE=ON \
    -DWITH_COVERAGE=OFF \
    -DWITH_TENSORRT=OFF \
    -DWITH_TESTING=ON \
    -DWITH_CONTRIB=ON \
    -DWITH_ROCM=OFF \
    -DWITH_RCCL=OFF \
    -DWITH_STRIP=ON \
    -DWITH_MKL=OFF \
    -DWITH_AVX=OFF \
    -DWITH_GPU=ON \
    -DWITH_PYTHON=ON \
    -DWITH_CUDNN_FRONTEND=ON \
    -DPY_VERSION=$PYVER \
    -Wno-dev

cmake --build paddle/build -j$((`nproc`))
  • GCC 11.4.0
@jeng1220
Copy link
Collaborator Author

cc @onecatcn for vis

@winter-wang winter-wang added fleet distributed training status/following-up 跟进中 labels Dec 18, 2023
@paddle-bot paddle-bot bot removed the status/new-issue 新建 label Dec 18, 2023
@haohongxiang
Copy link
Contributor

haohongxiang commented Dec 18, 2023

您好,辛苦提供更多的版本&环境信息,如CUDA/Python/CMake version

@jeng1220
Copy link
Collaborator Author

@haohongxiang ,
這和CUDA/Python/CMake版本沒關係
是那段代碼設計確實有風險
posix_memalign 說明文檔
posix_memalign 返回 0 才代表有正確配置內存
反之代表配置失敗,例如alignment設定不正確等造成配置失敗
然而 chunk_allocator.h:80 並沒有檢查返回值
所以GCC依據-Werror=unused-result回報錯誤

@danleifeng
Copy link
Contributor

您好,感谢您的指正,已经提pr修复这个问题了:#60208

@jeng1220
Copy link
Collaborator Author

@danleifeng ,
能麻煩 cherry-pick 到 release/2.6 分支嗎?

@tianshuo78520a
Copy link
Contributor

@danleifeng , 能麻煩 cherry-pick 到 release/2.6 分支嗎?

#60495

@jeng1220
Copy link
Collaborator Author

jeng1220 commented Jan 8, 2024

感謝感謝

@jeng1220 jeng1220 closed this as completed Jan 8, 2024
@paddle-bot paddle-bot bot added status/close 已关闭 and removed status/following-up 跟进中 labels Jan 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fleet distributed training NVIDIA status/close 已关闭 type/build 编译/安装问题
Projects
None yet
Development

No branches or pull requests

5 participants