From 08f24a31087c965fa0faac545c93d677642c79d2 Mon Sep 17 00:00:00 2001 From: GeminiCarrie Date: Mon, 14 Dec 2020 10:05:33 +0800 Subject: [PATCH] Fix precision problem (#29567) * Fix a bug when running on an operating system without "bash." * add execution condition * for ci-coverage * get cpu information to check the precision problem * Update compilation environment for musl version * update dependencies * remove test code check cpu info remove test code review * update alpine and third_party denpendencies * add newline for ci Code format --- CMakeLists.txt | 5 +++++ paddle/scripts/musl_build/Dockerfile | 2 +- paddle/scripts/musl_build/package.txt | 16 ++++++++-------- .../paddle/fluid/tests/unittests/CMakeLists.txt | 11 ----------- .../unittests/dygraph_to_static/CMakeLists.txt | 16 +--------------- 5 files changed, 15 insertions(+), 35 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e8e1d76913..a66a057622 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -51,6 +51,11 @@ message(STATUS "C compiler: ${CMAKE_C_COMPILER}, version: " "${CMAKE_C_COMPILER_ID} ${CMAKE_C_COMPILER_VERSION}") message(STATUS "AR tools: ${CMAKE_AR}") +# MUSL build turn off warnings +if(WITH_MUSL) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-error=deprecated-declarations -Wno-deprecated-declarations -Wno-error=pessimizing-move -Wno-error=deprecated-copy") +endif() + if(WIN32) option(MSVC_STATIC_CRT "use static C Runtime library by default" ON) diff --git a/paddle/scripts/musl_build/Dockerfile b/paddle/scripts/musl_build/Dockerfile index 120b47b21a..6621a90802 100644 --- a/paddle/scripts/musl_build/Dockerfile +++ b/paddle/scripts/musl_build/Dockerfile @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -FROM python:3.7-alpine3.10 +FROM python:3.7-alpine3.11 USER root diff --git a/paddle/scripts/musl_build/package.txt b/paddle/scripts/musl_build/package.txt index ed6796a0d3..464748419f 100644 --- a/paddle/scripts/musl_build/package.txt +++ b/paddle/scripts/musl_build/package.txt @@ -1,9 +1,9 @@ -linux-headers=4.19.36-r0 -freetype-dev=2.10.0-r1 -libjpeg-turbo-dev=2.0.4-r1 -zlib-dev=1.2.11-r1 -lapack-dev=3.8.0-r1 -openblas-dev=0.3.6-r0 -openssl-dev=1.1.1g-r0 -libuv-dev=1.29.1-r0 +linux-headers +freetype-dev +libjpeg-turbo-dev +zlib-dev +lapack-dev +openblas-dev +openssl-dev +libuv-dev graphviz diff --git a/python/paddle/fluid/tests/unittests/CMakeLists.txt b/python/paddle/fluid/tests/unittests/CMakeLists.txt index 10fb99dd97..60efa168ab 100644 --- a/python/paddle/fluid/tests/unittests/CMakeLists.txt +++ b/python/paddle/fluid/tests/unittests/CMakeLists.txt @@ -122,17 +122,6 @@ if(NOT WITH_DISTRIBUTE) LIST(REMOVE_ITEM TEST_OPS test_program_code_dist) endif() -if(WITH_MUSL) - # TODO: In the musl docker environment provided by SEC, - # the calculation accuracy of testcase in this unittest - # cannot meet the requirement, error like: - # AssertionError: - # 2.3044646853182973e-07 not less than or equal to 1e-07 - # SEC needs to follow up on this issue, and need to be - # resolved before CI requared - LIST(REMOVE_ITEM TEST_OPS test_sigmoid_focal_loss_op) -endif() - if(WIN32) LIST(REMOVE_ITEM TEST_OPS test_rnn_decode_api) LIST(REMOVE_ITEM TEST_OPS test_complex_matmul) diff --git a/python/paddle/fluid/tests/unittests/dygraph_to_static/CMakeLists.txt b/python/paddle/fluid/tests/unittests/dygraph_to_static/CMakeLists.txt index d2b0d52087..383ef29313 100644 --- a/python/paddle/fluid/tests/unittests/dygraph_to_static/CMakeLists.txt +++ b/python/paddle/fluid/tests/unittests/dygraph_to_static/CMakeLists.txt @@ -1,27 +1,13 @@ file(GLOB TEST_OPS RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "test_*.py") string(REPLACE ".py" "" TEST_OPS "${TEST_OPS}") -if(WITH_MUSL) - # TODO: In the musl docker environment provided by SEC, - # the test_yolov3 will randomly calculate the result of - # nan, error like: - # AssertionError: - # dygraph_loss: [15742.11914062 9392.61047363] - # static_loss: [nan, nan] - # SEC needs to follow up on this issue, and need to be - # resolved before CI requared - LIST(REMOVE_ITEM TEST_OPS test_yolov3) -endif() - foreach(TEST_OP ${TEST_OPS}) py_test_modules(${TEST_OP} MODULES ${TEST_OP}) endforeach(TEST_OP) set_tests_properties(test_se_resnet PROPERTIES TIMEOUT 900) set_tests_properties(test_tsm PROPERTIES TIMEOUT 900) -if(NOT WITH_MUSL) - set_tests_properties(test_yolov3 PROPERTIES TIMEOUT 900 LABELS "RUN_TYPE=EXCLUSIVE") -endif() +set_tests_properties(test_yolov3 PROPERTIES TIMEOUT 900 LABELS "RUN_TYPE=EXCLUSIVE") set_tests_properties(test_mobile_net PROPERTIES TIMEOUT 120) set_tests_properties(test_seq2seq PROPERTIES TIMEOUT 120) set_tests_properties(test_cycle_gan PROPERTIES TIMEOUT 120) -- GitLab