← Back to team overview

yade-dev team mailing list archive

Do we want low precision float in the gitlab CI pipeline?

 

Hi,

The high precision tests are now running in the gitlab pipeline. And
we can be sure that `double` are not getting by accident into master.
(except for the modules which are not supported by HP right now [1],
in there some `double` could sneak in)

This work also makes low-precision possible. I didn't add this to the
pipeline, thinking it's not of much use. In some comment Bruno
mentioned that some people want to use float in the GPUs to get the
results faster. (Whether these results are correct is a topic for a
different discussion :)

I could prepare a merge request that adds float to the pipeline,
because it is compiling (so it works) but it is not passing the tests.

The disadvantage is that in many test scripts an exception will have
to be written using following distinction:
   if (yade.config.highPrecisionDecimalPlaces < 7):

That's because some of the tests produce different results when float
is used, which is not a surprise ;)

Currently yade --check has following failures on float:

7  checks are failed
  checkColliderConstantness.py
  checkViscElEng.py
  checkPotentialParticles.py
  checkColliderCorrectness.py
  checkJCFpm.py
  checkWirePM.py
  checkCapillaryModels.py

And yade --test also has similar errors due to only 6 available
decimal places. The log is longer, so I attach it.

And most of these failures are because the results are compared with
1e-8 precision, while float maximally can offer 6 decimal places.

best regards
Janek


[1] https://yade-dev.gitlab.io/-/trunk/-/jobs/455155443/artifacts/install/share/doc/yade-ci/html/HighPrecisionReal.html#supported-modules



--
Janek Kozicki, PhD. DSc. Arch. Assoc. Prof.
Gdańsk University of Technology
Faculty of Applied Physics and Mathematics
Department of Theoretical Physics and Quantum Information
--
http://yade-dem.org/
http://pg.edu.pl/jkozicki (click English flag on top right)
yade --test

======================================================================
ERROR: testMatchMakerCollisions (yade.TestMatchMaker)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/tmp/15-YADE/23-yade-install-bin/yade/trunk/lib/x86_64-linux-gnu/yade-2020-02-27.git-614be29/py/yade/tests/core.py", line 260, in testMatchMakerCollisions
    self.assertTrue((atan(O.interactions[id11,id12].phys.tangensOfFrictionAngle)-0.1)==0)
AttributeError: 'NoneType' object has no attribute 'tangensOfFrictionAngle'

======================================================================
FAIL: testMatrix3 (yade.TestEigenWrapper)
Math: Matrix3 operations
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/tmp/15-YADE/23-yade-install-bin/yade/trunk/lib/x86_64-linux-gnu/yade-2020-02-27.git-614be29/py/yade/tests/wrapper.py", line 143, in testMatrix3
    self.assertSeqAlmostEqual(m1*Vector3().UnitX,Vector3().UnitY)
  File "/tmp/15-YADE/23-yade-install-bin/yade/trunk/lib/x86_64-linux-gnu/yade-2020-02-27.git-614be29/py/yade/tests/wrapper.py", line 103, in assertSeqAlmostEqual
    for i in range(len(v1)): self.assertAlmostEqual(v1[i],v2[i],msg='Component '+str(i)+' of '+str(v1)+' and '+str(v2))
AssertionError: -1.1920928955078125e-07 != 0.0 within 7 places (1.1920928955078125e-07 difference) : Component 0 of Vector3(-1.192093e-07,1,0) and Vector3(0,1,0)

======================================================================
FAIL: testQuaternion (yade.TestEigenWrapper)
Math: Quaternion operations
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/tmp/15-YADE/23-yade-install-bin/yade/trunk/lib/x86_64-linux-gnu/yade-2020-02-27.git-614be29/py/yade/tests/wrapper.py", line 129, in testQuaternion
    self.assertSeqAlmostEqual(q1*x,y)
  File "/tmp/15-YADE/23-yade-install-bin/yade/trunk/lib/x86_64-linux-gnu/yade-2020-02-27.git-614be29/py/yade/tests/wrapper.py", line 103, in assertSeqAlmostEqual
    for i in range(len(v1)): self.assertAlmostEqual(v1[i],v2[i],msg='Component '+str(i)+' of '+str(v1)+' and '+str(v2))
AssertionError: -1.1920928955078125e-07 != 0.0 within 7 places (1.1920928955078125e-07 difference) : Component 0 of Vector3(-1.192093e-07,1,0) and Vector3(0,1,0)

======================================================================
FAIL: testKineticEnergy (yade.TestPBC)
PBC: utils.kineticEnergy considers only fluctuation velocity, not the velocity gradient
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/tmp/15-YADE/23-yade-install-bin/yade/trunk/lib/x86_64-linux-gnu/yade-2020-02-27.git-614be29/py/yade/tests/pbc.py", line 86, in testKineticEnergy
    self.assertAlmostEqual(Ek,utils.kineticEnergy())
AssertionError: 6544.984436035156 != 6544.984375 within 7 places (6.103515625e-05 difference)

======================================================================
FAIL: testStaticProperties (yade.TestSimpleClump)
Clump: mass, centroid, intertia
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/tmp/15-YADE/23-yade-install-bin/yade/trunk/lib/x86_64-linux-gnu/yade-2020-02-27.git-614be29/py/yade/tests/clump.py", line 43, in testStaticProperties
    self.assertEqual(bC.state.mass,b1.state.mass+b2.state.mass)
AssertionError: 4712.38916015625 != 4712.3887939453125

======================================================================
FAIL: testMathFunctions (yade.tests.testMath.SimpleTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/tmp/15-YADE/23-yade-install-bin/yade/trunk/lib/x86_64-linux-gnu/yade-2020-02-27.git-614be29/py/yade/tests/testMath.py", line 362, in testMathFunctions
    self.twoArgMathCheck(r,r3)
  File "/tmp/15-YADE/23-yade-install-bin/yade/trunk/lib/x86_64-linux-gnu/yade-2020-02-27.git-614be29/py/yade/tests/testMath.py", line 285, in twoArgMathCheck
    self.checkRelativeError(mth.pow(abs(r1),r2),mpmath.power(abs(r1),r2),functionName="pow")
  File "/tmp/15-YADE/23-yade-install-bin/yade/trunk/lib/x86_64-linux-gnu/yade-2020-02-27.git-614be29/py/yade/tests/testMath.py", line 137, in checkRelativeError
    self.assertLessEqual(abs( (mpmath.mpf(a)-mpmath.mpf(b))/mpmath.mpf(b) ),defaultToleranceForThisFunction)
AssertionError: inf not less than or equal to 6e-05

----------------------------------------------------------------------


Follow ups