From dev-return-5848-archive-asf-public=cust-asf.ponee.io@singa.apache.org Fri Jun 19 03:25:06 2020 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [207.244.88.153]) by mx-eu-01.ponee.io (Postfix) with SMTP id 7A26618065B for ; Fri, 19 Jun 2020 05:25:06 +0200 (CEST) Received: (qmail 28325 invoked by uid 500); 19 Jun 2020 03:25:05 -0000 Mailing-List: contact dev-help@singa.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@singa.apache.org Delivered-To: mailing list dev@singa.apache.org Received: (qmail 28315 invoked by uid 99); 19 Jun 2020 03:25:05 -0000 Received: from ec2-52-202-80-70.compute-1.amazonaws.com (HELO gitbox.apache.org) (52.202.80.70) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 19 Jun 2020 03:25:05 +0000 From: =?utf-8?q?GitBox?= To: dev@singa.apache.org Subject: =?utf-8?q?=5BGitHub=5D_=5Bsinga=5D_chrishkchris_opened_a_new_pull_request_?= =?utf-8?q?=23743=3A_Fix_some_GPU_test_cases_by_precsion_setting?= Message-ID: Date: Fri, 19 Jun 2020 03:25:05 -0000 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit chrishkchris opened a new pull request #743: URL: https://github.com/apache/singa/pull/743 Here is just a very minor fix of GPU test case, which needs to set the precision of test. For instance, the default precision of test is absolute tolerance atol=1e-6 if (we don't pass the argument), which is too tough. ``` root@d05828f767ee:~/dcsysh/singa/test/python# python3 test_api.py ......F.F................... ====================================================================== FAIL: test_batchnorm_testing_gpu (__main__.TestAPI) ---------------------------------------------------------------------- Traceback (most recent call last): File "test_api.py", line 195, in test_batchnorm_testing_gpu _run_testing(x_0, s_0, b_0, rm_0, rv_0, m_0=1.0) File "test_api.py", line 186, in _run_testing y_1, tensor.to_numpy(_cTensor_to_pyTensor(y_2_c)), decimal=5) File "/usr/local/lib/python3.6/dist-packages/numpy/testing/_private/utils.py", line 1047, in assert_array_almost_equal precision=decimal) File "/usr/local/lib/python3.6/dist-packages/numpy/testing/_private/utils.py", line 846, in assert_array_compare raise AssertionError(msg) AssertionError: Arrays are not almost equal to 5 decimals Mismatched elements: 4 / 16 (25%) Max absolute difference: 4.4822693e-05 Max relative difference: 4.482269e-06 x: array([[[[ 1. , 1. ], [ 1. , 1. ]], ... y: array([[[[ 1. , 1. ], [ 1. , 1. ]], ... ====================================================================== FAIL: test_batchnorm_training_gpu (__main__.TestAPI) ---------------------------------------------------------------------- Traceback (most recent call last): File "test_api.py", line 161, in test_batchnorm_training_gpu _run_training(x_0, s_0, b_0, rm_0, rv_0, m_0=0.2) File "test_api.py", line 132, in _run_training y_1, tensor.to_numpy(_cTensor_to_pyTensor(y_2_c)), decimal=5) File "/usr/local/lib/python3.6/dist-packages/numpy/testing/_private/utils.py", line 1047, in assert_array_almost_equal precision=decimal) File "/usr/local/lib/python3.6/dist-packages/numpy/testing/_private/utils.py", line 846, in assert_array_compare raise AssertionError(msg) AssertionError: Arrays are not almost equal to 5 decimals Mismatched elements: 21881 / 40000 (54.7%) Max absolute difference: 0.00010204 Max relative difference: 0.75810695 x: array([[[[-7.11059e-01, 1.31187e+00, 1.10835e+00, ..., 6.71445e-01, -4.11530e-01, 7.55671e-01], [ 2.34414e-01, 1.75757e-02, 1.53543e+00, ..., -3.24708e-01,... y: array([[[[-7.11130e-01, 1.31193e+00, 1.10839e+00, ..., 6.71459e-01, -4.11583e-01, 7.55690e-01], [ 2.34401e-01, 1.75493e-02, 1.53550e+00, ..., -3.24755e-01,... ---------------------------------------------------------------------- Ran 28 tests in 1.582s ``` ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: users@infra.apache.org