test_matrixCompare单测过不了
Created by: luotao1
最新的develop分支, 在GPU环境和MKL库下,跑test_matrixCompare,在Matrix.unary处挂了:
12: Test command: /home/luotao/Paddle/build/paddle/math/tests/test_matrixCompare
12: Test timeout computed to be: 9.99988e+06
12: WARNING: Logging before InitGoogleLogging() is written to STDERR
12: I1107 17:20:58.170979 12290 hl_dso_loader.cc:51] Try to find cuda library: libcudart.so from default system path.
12: I1107 17:20:58.172441 12290 Util.cpp:155] commandline: /home/luotao/Paddle/build/paddle/math/tests/test_matrixCompare
12: I1107 17:20:58.292949 12290 hl_dso_loader.cc:51] Try to find cuda library: libcublas.so from default system path.
12: I1107 17:20:58.435550 12290 hl_dso_loader.cc:51] Try to find cuda library: libcurand.so from default system path.
12: I1107 17:20:58.448356 12290 hl_dso_loader.cc:51] Try to find cuda library: libcudnn.so from default system path.
12: I1107 17:20:59.391186 12290 Util.cpp:130] Calling runInitFunctions
12: I1107 17:20:59.391809 12290 Util.cpp:143] Call runInitFunctions done.
12: [==========] Running 24 tests from 3 test cases.
12: [----------] Global test environment set-up.
12: [----------] 21 tests from Matrix
12: [ RUN ] Matrix.projection
12: [ OK ] Matrix.projection (812 ms)
12: [ RUN ] Matrix.maxSequence
12: [ OK ] Matrix.maxSequence (240 ms)
12: [ RUN ] Matrix.unary
12: /home/luotao/Paddle/paddle/math/tests/test_matrixCompare.cpp:90: Failure
12: Value of: 0
12: Expected: count
12: Which is: 157
12: There are 157 different element.
12: [ FAILED ] Matrix.unary (2254 ms)
12: [ RUN ] Matrix.softmax
12: [ OK ] Matrix.softmax (125 ms)
...
具体是testMatrixInverse
中657行没过:
outputCheck->copyFrom(*gpuI);
MatrixCheckErr(*cpuI, *outputCheck);
打印了一下cpuI和outputCheck的值,发现小数点后三位开始不同:
12: I1107 18:05:41.903053 400 test_matrixCompare.cpp:86] 4.37313,4.37211
12: I1107 18:05:41.903162 400 test_matrixCompare.cpp:86] -4.36522,-4.36408
12: I1107 18:05:41.903209 400 test_matrixCompare.cpp:86] -3.97099,-3.96996
12: I1107 18:05:41.903218 400 test_matrixCompare.cpp:86] -3.99913,-3.99811
12: I1107 18:05:41.903224 400 test_matrixCompare.cpp:86] 3.8104,3.80938
12: I1107 18:05:41.903231 400 test_matrixCompare.cpp:86] 5.36973,5.36836
12: I1107 18:05:41.903239 400 test_matrixCompare.cpp:86] -4.05777,-4.05671
12: I1107 18:05:41.903245 400 test_matrixCompare.cpp:86] 3.68704,3.68603
12: I1107 18:05:41.903288 400 test_matrixCompare.cpp:86] -4.9984,-4.9972
12: I1107 18:05:41.903296 400 test_matrixCompare.cpp:86] -4.67913,-4.678
12: I1107 18:05:41.903303 400 test_matrixCompare.cpp:86] 4.2865,4.28546
12: I1107 18:05:41.903309 400 test_matrixCompare.cpp:86] 4.11046,4.10944
12: I1107 18:05:41.903316 400 test_matrixCompare.cpp:86] 4.84822,4.84704
...