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
ulpwise scan: static scan of a repository (a directory, a GitHub URL or owner/repo, cloned
with depth 1) for the floating point patterns behind the corpus bugs. Twelve rules with severity,
reason, replacement and upstream example: exp-of-square, sin-of-pi-times, softplus-by-hand, logsumexp-by-hand, hypot-by-hand, sqrt-of-difference, one-minus-cos, log1p-by-hand, expm1-by-hand, atan-of-quotient, small-angle-division, acos-for-angle. Findings carry
file, line, function and the source line; the report ends with the functions that do the most
elementary math. --report writes Markdown, --rules filters, --fail-on gates CI, --include-tests widens the walk. On kornia main the four small-angle-division and one-minus-cos lines are the ones kornia #4897 fixes.
ulpwise scan --run: imports the math-heavy module level functions and calls them on the same
grid in float32 and float64, reporting the largest error in ulps of the largest output and the
worst elementwise ulp distance with its input. Static methods run, instance methods and other
skips carry their reason. --run-limit bounds it, --run-installed imports the installed package
instead of the scanned tree.
ulp_distance, ulp_distances, ordered, max_ulp and assert_max_ulp take f16 and bf16, and flatten reads the dtype off float16 and bfloat16 numpy arrays and torch tensors.
Inputs that are not representable are rounded to nearest even first, so a bfloat16 tensor can be
measured against a float64 reference; without an explicit dtype the less precise of the two
inputs decides. Cross-checked against the numpy int16 view for float16 and the torch view for
bfloat16.
special("f16") and special("bf16"): the same 29 named edge values as f32 and f64, so edge_values, the edge_f16 and edge_bf16 pytest fixtures and ulpwise special f16 work.
Every value satisfies the same checks as the f32 and f64 tables, run through numpy for float16
and torch for bfloat16.
ulpwise corpus: runs the regression corpus against the installed packages without pytest and
prints one line per case, present, fixed or skipped, with the installed version and the upstream
reference. --repo filters by repository or case id, --fail-if-present makes a present bug exit 1.
Any exception from a repro counts as present, like the pytest run: several corpus bugs are crashes.