The GitHub Actions job "Lint" on tvm.git/fix/llvm-math-overflow has failed. Run started by GitHub user swjng (triggered by swjng).
Head commit for run: e119e5bc29045db893475eb50fba7e12b5db50c4 / Soowon Jeong <[email protected]> [BugFix][Target][LLVM] Route sinh/cosh/atan/asinh/erf through libm extern Five LLVM legalize rules used inline mathematical identities that fail on representable inputs because the intermediate computation overflows or cancels, even though the true result is in range: - `sinh`/`cosh`: `(exp(x) ± exp(-x)) / 2` — `exp(89) > FLT_MAX` so `exp(x)` itself overflows. True `sinh(89) ≈ 2.24e38` fits in float32. (#19559) - `atan`: `asin(x / sqrt(x*x + 1))` — `x*x` overflows for `|x| > sqrt(FLT_MAX) ≈ 1.84e19`, then `sqrt(inf) = inf`, `x / inf = 0`, `asin(0) = 0`. (#19560) - `asinh`: `log(x + sqrt(x*x + 1))` — same `x*x` overflow. True `asinh(3e22) ≈ 52.45`. (#19561) - `erf`: Abramowitz–Stegun `1 - poly(t) * exp(-x*x)` — for small `|x|`, `poly * exp(-x*x) ≈ 1` and the subtraction cancels to 0 in float32, flushing `erf(3e-12)` to 0 instead of the true `~3.4e-12`. (#19562) All four route through the existing `DispatchPureExtern<FloatSuffix>` helper (i.e. `sinhf`, `coshf`, `atanf`, `asinhf`, `erff`), the same pattern already used by `asin`/`acos`. ULP-grade accuracy across representative ranges; `Atan` is re-enabled in `test_unary` since the overflow that previously broke it is fixed. Note for reviewers: if the inline identities were a deliberate fast-path (e.g. for autovectorization or to avoid extern call overhead in tight loops), please flag it and I'll switch to stable inline forms (`exp(x − ln 2) ± exp(−x − ln 2)` for sinh/cosh, range-reduced asinh, small-x Taylor for erf, etc.). I could not find evidence of such intent in the git history. Acosh shows the same `sqrt(x*x − 1)` overflow pattern but is not covered by any of the listed issues; happy to include it as a follow-up if maintainers want. Fixes #19559. Fixes #19560. Fixes #19561. Fixes #19562. Report URL: https://github.com/apache/tvm/actions/runs/25906396695 With regards, GitHub Actions via GitBox --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
