Re: [Yade-dev] Do we want low precision float in the gitlab CI pipeline?

2020-03-02 Thread Janek Kozicki (yade)
OK, thanks :)

And thanks for the link to sudoDEM :)

Bruno Chareyre said: (by the date of Sun, 1 Mar 2020 21:48:19 +0100)

> (sorry for previous empty message)
> Hi,
> I don't think DEM can realistically work with floats. If 100 particles in a
> row are elongated by 0.01%, the relative displacement between the 99th and
> 100th particles is 1e-6 times the positions. With single precision it would
> already produce substantial numerical noise in terms of contact force.
> I mentioned single precision in relation with solving linear systems with
> cholmod, and that part does not support HP.
> I think we can skip the float pipeline. :)
> Cheers
> Bruno
> 
> 
> 
> On Sun, 1 Mar 2020 at 16:24, Janek Kozicki (yade) 
> wrote:
> 
> > 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)
> > ___
> > Mailing list: https://launchpad.net/~yade-dev
> > Post to : yade-dev@lists.launchpad.net
> > Unsubscribe : https://launchpad.net/~yade-dev
> > More help   : https://help.launchpad.net/ListHelp
> >
> 
> 
> -- 
> -- 
> ___
> Bruno Chareyre
> Associate Professor
> ENSE³ - Grenoble INP
> Lab. 3SR
> BP 53
> 38041 Grenoble cedex 9
> Tél : +33 4 56 52 86 21
> 
> 
> Email too brief?
> Here's why: email charter
> 


-- 
--
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)

___
Mailing list: https://launchpad.net/~yade-dev
Post to : yade-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-dev
More help   : https://help.launchpad.net/ListHelp


Re: [Yade-dev] Do we want low precision float in the gitlab CI pipeline?

2020-03-01 Thread Bruno Chareyre
(sorry for previous empty message)
Hi,
I don't think DEM can realistically work with floats. If 100 particles in a
row are elongated by 0.01%, the relative displacement between the 99th and
100th particles is 1e-6 times the positions. With single precision it would
already produce substantial numerical noise in terms of contact force.
I mentioned single precision in relation with solving linear systems with
cholmod, and that part does not support HP.
I think we can skip the float pipeline. :)
Cheers
Bruno



On Sun, 1 Mar 2020 at 16:24, Janek Kozicki (yade) 
wrote:

> 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)
> ___
> Mailing list: https://launchpad.net/~yade-dev
> Post to : yade-dev@lists.launchpad.net
> Unsubscribe : https://launchpad.net/~yade-dev
> More help   : https://help.launchpad.net/ListHelp
>


-- 
-- 
___
Bruno Chareyre
Associate Professor
ENSE³ - Grenoble INP
Lab. 3SR
BP 53
38041 Grenoble cedex 9
Tél : +33 4 56 52 86 21


Email too brief?
Here's why: email charter

___
Mailing list: https://launchpad.net/~yade-dev
Post to : yade-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-dev
More help   : https://help.launchpad.net/ListHelp


Re: [Yade-dev] Do we want low precision float in the gitlab CI pipeline?

2020-03-01 Thread Bruno Chareyre
Hi,
I don't think DEM can in gener

On Sun, 1 Mar 2020 at 16:24, Janek Kozicki (yade) 
wrote:

> 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)
> ___
> Mailing list: https://launchpad.net/~yade-dev
> Post to : yade-dev@lists.launchpad.net
> Unsubscribe : https://launchpad.net/~yade-dev
> More help   : https://help.launchpad.net/ListHelp
>


-- 
-- 
___
Bruno Chareyre
Associate Professor
ENSE³ - Grenoble INP
Lab. 3SR
BP 53
38041 Grenoble cedex 9
Tél : +33 4 56 52 86 21


Email too brief?
Here's why: email charter

___
Mailing list: https://launchpad.net/~yade-dev
Post to : yade-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-dev
More help   : https://help.launchpad.net/ListHelp


[Yade-dev] Do we want low precision float in the gitlab CI pipeline?

2020-03-01 Thread Janek Kozicki (yade)
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