You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
test_gradient_equivalence tolerance is tuned, not derived, and only holds without FMA #3078
The fp64 case asserts allclose(grad_u, grad_v, rtol=atol=1e-13) per point. The tolerance was tightened
from 1e-12 to 1e-13 and safe_math=True added on the day #1519 merged (Dec 2020) to make it pass under GCC
C99. It passes because, without contraction, the second time difference of a consistently rounded sequence
cancels under summation by parts; with FMA (g++ before #3074, nvc++, nvcc, clang) the per-point error roughly
doubles and the test sits at or above its tolerance (main passed the C++ jobs with 2% headroom; 13 of 17
small perturbations fail). The natural error scale eps*sum|terms| is up to 2.5e-11 per point, and doubling the
source amplitude alone pushes even the no-FMA case over 1e-13. The norm-relative difference is stable at
1-2e-15 in every configuration.
Proposal: assert ||grad_u - grad_v|| <= 1e-14 ||grad_v|| (and the same for grad_uv) together with a
relaxed per-point check (so a single wrong halo/boundary point still fails), and consider keeping 1/dt**k
outside the time-derivative sum in make_derivative, which makes the test FMA-robust (ratio 0.3 with FMA)
and slightly more accurate, at the cost of touching every time-stepping kernel and the op-count tests.
Activity