Skip to content
Snippets Groups Projects

WIP: Let's discuss single-precision tolerances

Closed Hadrien Benjamin Grasland requested to merge hgraslan/acts-core:f32-fixes into master

This MR is a preliminary output of my study on the single-precision portability of ACTS. It should probably not be merged as is, but is only meant as a strawman to get a discussion started.

It builds on top of !490 (merged), so you may want to explore it commit by commit and/or diff it locally against that branch in order to get a clean diff.

In this branch, I've been running the ACTS test suite under Verrou's single-precision emulation mode, and tuning up test tolerances until the test suite mostly passes. At this point, the test suite does not fully pass because it hits the same off-diagonal covariance term imprecision issues as !490 (merged), but it gets close enough to get the discussion started. => That problem is solved (also, found some room for doing with narrower tolerances, under investigation)

Here is my question before I go further in my single-precision studies: which of these tolerance changes would be acceptable (in the sense that we would still produce precise enough physics), and which wouldn't?

Depending on the answer to this question, I will next investigate specific areas of unacceptable imprecision, in order to figure out whether the relevant parts of ACTS should stay in double precision, or have a "precision bottleneck" somewhere that can easily be resolved to make single precision viable.

Edited by Hadrien Benjamin Grasland

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Hadrien Benjamin Grasland changed the description

    changed the description

  • added 43 commits

    • a865f33f...4cf178f5 - 18 commits from branch acts:master
    • 36d1b4c7 - Reform checkCloseXyz into unified CHECK_XYZ macros
    • 814763f5 - Replace BOOST_CHECK_CLOSE[_FRACTION] with CHECK_CLOSE
    • 48449cf1 - Replace Eigen's isApprox with CHECK_CLOSE
    • 90c96163 - Switch from CHECK_CLOSE to more appropriate comparisons
    • 05b3d96f - Instrument remaining propagation test failures
    • 07fe683b - Replace BOOST_CHECK_SMALL with CHECK_SMALL or CHECK_CLOSE_ABS
    • a12c4ea0 - Try to eradicate BOOST_TEST from ACTS tests
    • 7bc0c2b2 - Apply clang-format patch
    • ded9d62a - Rework comparison error reporting
    • 89e720b1 - Prefer CHECK_CLOSE_ABS(a, b, ...) over CHECK_SMALL(a-b, ...)
    • dd76d2af - Reduce precision of DiscTrapezoidalBounds output
    • 417eab3c - Tune up the on-surface tolerance a bit
    • d5d215c8 - Tune up SolenoidBField tolerance + express it more logically
    • 4f8f5fc8 - Tune up Jacobian tolerance a bit
    • 8a3d3ac5 - Tune up Propagator tolerance a bit
    • 8bceb28f - Adapt and homogeneize unit conversion tolerances
    • 29138bd6 - Tune up tolerances and homogeneize comparisons in BFieldMapUtilsTest
    • 180e489f - Tune up tolerances of CylinderVolumeBounds
    • e00a9f5c - 0.1µm is impossible in f32
    • 5d7df7c7 - 1e-6 relative precision can be too optimistic in f32
    • c72aa241 - 1 keV is unrealistic in f32
    • 3a225bde - Tune up ATLAS/Eigen comparison tolerance
    • 250f9fd5 - Let's get real
    • 2140bebd - 1 µm seems out of reach
    • 1e641d90 - Reduce covariance ambitions

    Compare with previous version

  • added 23 commits

    • 46dcd0c3 - Replace Eigen's isApprox with CHECK_CLOSE
    • 9d502f41 - Switch from CHECK_CLOSE to more appropriate comparisons
    • 4934aa12 - Instrument remaining propagation test failures
    • 5ca4e127 - Replace BOOST_CHECK_SMALL with CHECK_SMALL or CHECK_CLOSE_ABS
    • ad381f92 - Try to eradicate BOOST_TEST from ACTS tests
    • bebf92bb - Apply clang-format patch
    • cb4b45a5 - Rework comparison error reporting
    • dd41bee1 - Prefer CHECK_CLOSE_ABS(a, b, ...) over CHECK_SMALL(a-b, ...)
    • af934bed - Reduce precision of DiscTrapezoidalBounds output
    • 5bad5ac3 - Tune up the on-surface tolerance a bit
    • e13449a5 - Tune up SolenoidBField tolerance + express it more logically
    • ea8cfb7f - Tune up Jacobian tolerance a bit
    • ef1bd1c6 - Tune up Propagator tolerance a bit
    • 4fa8be06 - Adapt and homogeneize unit conversion tolerances
    • e0c677d1 - Tune up tolerances and homogeneize comparisons in BFieldMapUtilsTest
    • dbddf084 - Tune up tolerances of CylinderVolumeBounds
    • b1c123a0 - 0.1µm is impossible in f32
    • 81dff9a7 - 1e-6 relative precision can be too optimistic in f32
    • 60cf3d17 - 1 keV is unrealistic in f32
    • 1f6f6746 - Tune up ATLAS/Eigen comparison tolerance
    • 20a49f08 - Let's get real
    • 5eb02ff3 - 1 µm seems out of reach
    • b94a3abe - Reduce covariance ambitions

    Compare with previous version

  • added 18 commits

    • 66cdcfa4 - Apply clang-format patch
    • 605c025c - Rework comparison error reporting
    • 1133c437 - Prefer CHECK_CLOSE_ABS(a, b, ...) over CHECK_SMALL(a-b, ...)
    • 1dee3b19 - Reduce precision of DiscTrapezoidalBounds output
    • 85657eda - Tune up the on-surface tolerance a bit
    • 3c60ba7a - Tune up SolenoidBField tolerance + express it more logically
    • aee7079e - Tune up Jacobian tolerance a bit
    • cdfc617b - Tune up Propagator tolerance a bit
    • b29014f2 - Adapt and homogeneize unit conversion tolerances
    • ab04f565 - Tune up tolerances and homogeneize comparisons in BFieldMapUtilsTest
    • 9f67dac2 - Tune up tolerances of CylinderVolumeBounds
    • 6022edec - 0.1µm is impossible in f32
    • 72d79853 - 1e-6 relative precision can be too optimistic in f32
    • 39263719 - 1 keV is unrealistic in f32
    • 3cd03c9b - Tune up ATLAS/Eigen comparison tolerance
    • 81b7be11 - Let's get real
    • 81572df9 - 1 µm seems out of reach
    • 95717cfe - Reduce covariance ambitions

    Compare with previous version

  • added 122 commits

    • 95717cfe...98f2bdc5 - 101 commits from branch acts:master
    • f333e4e2 - Reform checkCloseXyz into unified CHECK_XYZ macros
    • c9007f6f - Replace BOOST_CHECK_CLOSE[_FRACTION] with CHECK_XYZ
    • 1b3adef9 - Replace Eigen's isApprox with CHECK_XYZ
    • 5a0aa684 - Replace BOOST_CHECK_SMALL with CHECK_SMALL or CHECK_CLOSE_ABS
    • c93ff56b - Reduce usage of binary BOOST_CHECK
    • 112849e1 - Try to eradicate BOOST_TEST from ACTS tests
    • ea781052 - Reduce precision of DiscTrapezoidalBounds output
    • 0b20983e - Tune up the on-surface tolerance a bit
    • 5bfb819e - Tune up SolenoidBField tolerance + express it more logically
    • a02c0312 - Tune up Jacobian tolerance a bit
    • 38e2fbe7 - Tune up Propagator tolerance a bit
    • bb249bca - Adapt and homogeneize unit conversion tolerances
    • f17223ec - Tune up tolerances and homogeneize comparisons in BFieldMapUtilsTest
    • 33299efd - Tune up tolerances of CylinderVolumeBounds
    • 5befd60a - 0.1µm is impossible in f32
    • 372de550 - 1e-6 relative precision can be too optimistic in f32
    • b8770297 - 1 keV is unrealistic in f32
    • 4c3e0e7a - Tune up ATLAS/Eigen comparison tolerance
    • 9af60559 - Let's get real
    • 7f50b225 - 1 µm seems out of reach
    • 7e477910 - Reduce covariance ambitions

    Compare with previous version

  • added 252 commits

    • 7e477910...b8e95b22 - 232 commits from branch acts:master
    • 684c1ec4 - Reform checkCloseXyz into unified CHECK_XYZ macros
    • 6fed8f07 - Replace BOOST_CHECK_CLOSE[_FRACTION] with CHECK_XYZ
    • 39f563c5 - Replace Eigen's isApprox with CHECK_XYZ
    • 1f88b139 - Replace BOOST_CHECK_SMALL with CHECK_SMALL or CHECK_CLOSE_ABS
    • a15cc8a2 - Reduce usage of binary BOOST_CHECK
    • e6a32573 - Try to eradicate BOOST_TEST from ACTS tests
    • fedd357d - Reduce precision of DiscTrapezoidalBounds output
    • e9fa6f28 - Tune up the on-surface tolerance a bit
    • 6ab4b424 - Tune up SolenoidBField tolerance + express it more logically
    • 4886317b - Tune up Jacobian tolerance a bit
    • 7b4a6529 - Tune up Propagator tolerance a bit
    • 8a4a4ede - Adapt and homogeneize unit conversion tolerances
    • 7648adb8 - Tune up tolerances and homogeneize comparisons in BFieldMapUtilsTest
    • 20947f43 - Tune up tolerances of CylinderVolumeBounds
    • 4f915032 - 0.1µm is impossible in f32
    • d37e5385 - 1e-6 relative precision can be too optimistic in f32
    • 28ab8854 - 1 keV is unrealistic in f32
    • 91c8c6eb - Tune up ATLAS/Eigen comparison tolerance
    • aaccfa8a - Let's get real
    • e770cfe7 - Reduce covariance ambitions

    Compare with previous version

  • added 13 commits

    • fafa74d1 - Add a dedicated comparison function for covariance matrices
    • 23d9531b - Reduce precision of DiscTrapezoidalBounds output
    • 1914864e - Tune up the on-surface tolerance a bit
    • 8feae16f - Tune up SolenoidBField tolerance + express it more logically
    • 963d04ff - Tune up Jacobian tolerance a bit
    • 5c70d3c2 - Adapt and homogeneize unit conversion tolerances
    • 3900da14 - Tune up tolerances and homogeneize comparisons in BFieldMapUtilsTest
    • b6dbb53c - Tune up tolerances of CylinderVolumeBounds
    • f70d18bd - 0.1µm is impossible in f32
    • b9225550 - 1e-6 relative precision can be too optimistic in f32
    • 214ff41a - 1 keV is unrealistic in f32
    • 3d71528e - Tune up ATLAS/Eigen comparison tolerance
    • 1fb4058f - Let's get real

    Compare with previous version

  • added 2 commits

    • 25d71ce3 - Single-eV tolerance over GeV quantities is a bit too optimistic
    • 3671fcb5 - Tune up propagation tolerances a little bit

    Compare with previous version

  • added 2 commits

    • a3e41c6c - Tune up covariance tolerance to match on-surface tolerance increase
    • 814efae7 - Tune up spatial tolerances a bit more too

    Compare with previous version

  • Hadrien Benjamin Grasland changed the description

    changed the description

  • For job clang_tidy on commit: 814efae7

    Static analysis results: Accepted

    ok pattern count limit
    readability-inconsistent-declaration-parameter-name 0 0
    readability-named-parameter 0 0
    readability-container-size-empty 0 0
    modernize-use-using 0 0
    readability-braces-around-statements 0 0
    modernize-use-override 0 0
    readability-implicit-bool-cast 0 0
    modernize-use-default-member-init 0 0
    performance-unnecessary-value-param 0 0
    modernize-use-equals-default 0 0
    modernize-use-nullptr 0 0

    Analysis results at: https://gitlab.cern.ch/api/v4/projects/14559/jobs/2986897/artifacts

  • added 30 commits

    • 814efae7...95174080 - 5 commits from branch acts:master
    • 0a8d7611 - Reform checkCloseXyz into unified CHECK_XYZ macros
    • aa77d20b - Replace BOOST_CHECK_CLOSE[_FRACTION] with CHECK_XYZ
    • 87642fe9 - Replace Eigen's isApprox with CHECK_XYZ
    • ab58d5a3 - Replace BOOST_CHECK_SMALL with CHECK_SMALL or CHECK_CLOSE_ABS
    • 3a58b25c - Reduce usage of binary BOOST_CHECK
    • 9686ff75 - Try to eradicate BOOST_TEST from ACTS tests
    • 7dc434fb - Add a dedicated comparison function for covariance matrices
    • 15cd8f9a - Tune down overly optimistic Kalman fitter tolerances
    • 1afc96dd - Add indices in test error output
    • 3eb2c500 - Remove useless dTheta << 0 assignments
    • dd14512e - Reduce precision of DiscTrapezoidalBounds output
    • f8834de1 - Tune up the on-surface tolerance a bit
    • f16dd703 - Tune up SolenoidBField tolerance + express it more logically
    • 41784e65 - Tune up Jacobian tolerance a bit
    • 89c7b40f - Adapt and homogeneize unit conversion tolerances
    • 51c6aacf - Tune up tolerances and homogeneize comparisons in BFieldMapUtilsTest
    • 9a8b3495 - Tune up tolerances of CylinderVolumeBounds
    • 4111f1b7 - 0.1µm is impossible in f32
    • f3a7daf2 - 1e-6 relative precision can be too optimistic in f32
    • ec9b2a66 - 1 keV is unrealistic in f32
    • c8f890b4 - Tune up ATLAS/Eigen comparison tolerance
    • 33d08258 - Single-eV tolerance over GeV quantities is a bit too optimistic
    • dfa3bc24 - Tune up propagation tolerances a little bit
    • f6628f5b - Tune up covariance tolerance to match on-surface tolerance increase
    • 73d8e138 - Tune up spatial tolerances a bit more too

    Compare with previous version

  • added 17 commits

    • 9128e69f - Add indices in test error output
    • c7240832 - Remove useless dTheta << 0 assignments
    • d63301fc - Reduce precision of DiscTrapezoidalBounds output
    • 36e0ed42 - Tune up the on-surface tolerance a bit
    • 3dcabc55 - Tune up SolenoidBField tolerance + express it more logically
    • efee84bc - Tune up Jacobian tolerance a bit
    • 91b041d5 - Adapt and homogeneize unit conversion tolerances
    • 80e040d7 - Tune up tolerances and homogeneize comparisons in BFieldMapUtilsTest
    • 5102775f - Tune up tolerances of CylinderVolumeBounds
    • a88ad280 - 0.1µm is impossible in f32
    • 773c2e3d - 1e-6 relative precision can be too optimistic in f32
    • 591cfa95 - 1 keV is unrealistic in f32
    • efbc7753 - Tune up ATLAS/Eigen comparison tolerance
    • c13e616e - Single-eV tolerance over GeV quantities is a bit too optimistic
    • dcbae578 - Tune up propagation tolerances a little bit
    • 7c700db6 - Tune up covariance tolerance to match on-surface tolerance increase
    • d34761dd - Tune up spatial tolerances a bit more too

    Compare with previous version

  • For job clang_tidy on commit: d34761dd

    Static analysis results: Accepted

    ok pattern count limit
    readability-inconsistent-declaration-parameter-name 0 0
    readability-named-parameter 0 0
    readability-container-size-empty 0 0
    modernize-use-using 0 0
    readability-braces-around-statements 0 0
    modernize-use-override 0 0
    readability-implicit-bool-cast 0 0
    modernize-use-default-member-init 0 0
    performance-unnecessary-value-param 0 0
    modernize-use-equals-default 0 0
    modernize-use-nullptr 0 0

    Analysis results at: https://gitlab.cern.ch/api/v4/projects/14559/jobs/3082047/artifacts

  • added 39 commits

    • d34761dd...1c53a20f - 14 commits from branch acts:master
    • 65e429f1 - Reform checkCloseXyz into unified CHECK_XYZ macros
    • 5fb59398 - Replace BOOST_CHECK_CLOSE[_FRACTION] with CHECK_XYZ
    • 80d27691 - Replace Eigen's isApprox with CHECK_XYZ
    • d4d67280 - Replace BOOST_CHECK_SMALL with CHECK_SMALL or CHECK_CLOSE_ABS
    • f5f11f00 - Reduce usage of binary BOOST_CHECK
    • 5c5c9d44 - Try to eradicate BOOST_TEST from ACTS tests
    • 52e589db - Add a dedicated comparison function for covariance matrices
    • 68a0e437 - Tune down overly optimistic Kalman fitter tolerances
    • 94c4bd76 - Add indices in test error output
    • 0c66667e - Remove useless dTheta << 0 assignments
    • e0905e04 - Reduce precision of DiscTrapezoidalBounds output
    • e68f4297 - Tune up the on-surface tolerance a bit
    • 8033e1e0 - Tune up SolenoidBField tolerance + express it more logically
    • c0e11be2 - Tune up Jacobian tolerance a bit
    • 7786619b - Adapt and homogeneize unit conversion tolerances
    • dce7acbf - Tune up tolerances and homogeneize comparisons in BFieldMapUtilsTest
    • 337ee4b9 - Tune up tolerances of CylinderVolumeBounds
    • 675d8920 - 0.1µm is impossible in f32
    • 6f657ffe - 1e-6 relative precision can be too optimistic in f32
    • a31039db - 1 keV is unrealistic in f32
    • 8f40683f - Tune up ATLAS/Eigen comparison tolerance
    • 4571529c - Single-eV tolerance over GeV quantities is a bit too optimistic
    • 3d7b0178 - Tune up propagation tolerances a little bit
    • 10001b42 - Tune up covariance tolerance to match on-surface tolerance increase
    • f49f0901 - Tune up spatial tolerances a bit more too

    Compare with previous version

  • For job clang_tidy on commit: f49f0901

    Static analysis results: Accepted

    ok pattern count limit
    readability-inconsistent-declaration-parameter-name 0 0
    readability-named-parameter 0 0
    readability-container-size-empty 0 0
    modernize-use-using 0 0
    readability-braces-around-statements 0 0
    modernize-use-override 0 0
    readability-implicit-bool-cast 0 0
    modernize-use-default-member-init 0 0
    performance-unnecessary-value-param 0 0
    modernize-use-equals-default 0 0
    modernize-use-nullptr 0 0

    Analysis results at: https://gitlab.cern.ch/api/v4/projects/14559/jobs/3090679/artifacts

  • added 20 commits

    • 5b87858f - Replace exact float comparison with approximate one
    • 88336499 - Tune down max step count
    • 9e3b0362 - Use an exact computation
    • 48614087 - Add some tolerance for end-of-world detection
    • 833a360d - Clarify which volumes are involved
    • fc3f8780 - Reduce precision of DiscTrapezoidalBounds output
    • a8f71933 - Tune up the on-surface tolerance a bit
    • 0008fce1 - Tune up SolenoidBField tolerance + express it more logically
    • dff12721 - Tune up Jacobian tolerance a bit
    • 0f231ffa - Adapt and homogeneize unit conversion tolerances
    • 31999821 - Tune up tolerances and homogeneize comparisons in BFieldMapUtilsTest
    • 67ae3a8f - Tune up tolerances of CylinderVolumeBounds
    • e1e169f9 - 0.1µm is impossible in f32
    • fe8795b4 - 1e-6 relative precision can be too optimistic in f32
    • adb30bda - 1 keV is unrealistic in f32
    • 3a81ba2e - Tune up ATLAS/Eigen comparison tolerance
    • bf73f886 - Single-eV tolerance over GeV quantities is a bit too optimistic
    • d5205425 - Tune up propagation tolerances a little bit
    • 74b732b5 - Tune up covariance tolerance to match on-surface tolerance increase
    • 48eeead9 - Tune up spatial tolerances a bit more too

    Compare with previous version

  • added 36 commits

    • 48eeead9...90aa1ce1 - 3 commits from branch acts:master
    • 12216f79 - Reform checkCloseXyz into unified CHECK_XYZ macros
    • 477e1a0c - Replace BOOST_CHECK_CLOSE[_FRACTION] with CHECK_XYZ
    • 9b8f18bb - Replace Eigen's isApprox with CHECK_XYZ
    • 176b2721 - Replace BOOST_CHECK_SMALL with CHECK_SMALL or CHECK_CLOSE_ABS
    • f5b83623 - Reduce usage of binary BOOST_CHECK
    • 55c34364 - Try to eradicate BOOST_TEST from ACTS tests
    • 8e4343ec - Add a dedicated comparison function for covariance matrices
    • 6418874c - Tune down overly optimistic Kalman fitter tolerances
    • 80642d8f - Add indices in test error output
    • 51e05711 - Remove useless dTheta << 0 assignments
    • ccc87c3f - Replace exact float comparison with approximate one
    • d196d080 - Tune up covariance tolerance
    • ab1900e6 - Tune down max step count
    • 2fedcac1 - Use an exact computation
    • c631d2bb - Add some tolerance for end-of-world detection
    • 08682b73 - Clarify which volumes are involved
    • 2e7329b1 - Clean up stepper a bit
    • db43b14d - Avoid endless oscillation
    • 396d8cf0 - Reduce precision of DiscTrapezoidalBounds output
    • c9c9b625 - Tune up the on-surface tolerance a bit
    • 9723461a - Tune up SolenoidBField tolerance + express it more logically
    • 47240cc8 - Tune up Jacobian tolerance a bit
    • 634b3dc0 - Adapt and homogeneize unit conversion tolerances
    • 71740fd0 - Tune up tolerances and homogeneize comparisons in BFieldMapUtilsTest
    • 3036185a - Tune up tolerances of CylinderVolumeBounds
    • 6fd912a7 - 0.1µm is impossible in f32
    • 8028dade - 1e-6 relative precision can be too optimistic in f32
    • 07d96b11 - 1 keV is unrealistic in f32
    • 0f19f045 - Tune up ATLAS/Eigen comparison tolerance
    • 2235cfe9 - Single-eV tolerance over GeV quantities is a bit too optimistic
    • 38e1185a - Tune up propagation tolerances a little bit
    • 10d9f9d5 - Tune up covariance tolerance to match on-surface tolerance increase
    • 072160b2 - Tune up spatial tolerances a bit more too

    Compare with previous version

  • added 18 commits

    • e3c7c5d3 - Clarify which volumes are involved
    • 512e2d65 - Clean up stepper a bit
    • b014eeb7 - Avoid endless oscillation
    • 75671498 - Reduce precision of DiscTrapezoidalBounds output
    • e8d95b32 - Tune up the on-surface tolerance a bit
    • 0a478fe7 - Tune up SolenoidBField tolerance + express it more logically
    • e6652226 - Tune up Jacobian tolerance a bit
    • d3a90ed9 - Adapt and homogeneize unit conversion tolerances
    • bd5b23bc - Tune up tolerances and homogeneize comparisons in BFieldMapUtilsTest
    • 768eadcb - Tune up tolerances of CylinderVolumeBounds
    • 9c10fadb - 0.1µm is impossible in f32
    • f21ba5b6 - 1e-6 relative precision can be too optimistic in f32
    • 8a3b1e1e - 1 keV is unrealistic in f32
    • b5964afe - Tune up ATLAS/Eigen comparison tolerance
    • 7baf4541 - Single-eV tolerance over GeV quantities is a bit too optimistic
    • 39760de1 - Tune up propagation tolerances a little bit
    • c5e209d8 - Tune up covariance tolerance to match on-surface tolerance increase
    • 46425e74 - Tune up spatial tolerances a bit more too

    Compare with previous version

  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
Please register or sign in to reply
Loading