hive-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Zhenyu Zheng (Jira)" <>
Subject [jira] [Updated] (HIVE-23133) Numeric operations can have different result across hardware archs
Date Tue, 12 May 2020 09:25:00 GMT


Zhenyu Zheng updated HIVE-23133:
    Attachment: HIVE-23133.5.patch
        Status: Patch Available  (was: Open)

> Numeric operations can have different result across hardware archs
> ------------------------------------------------------------------
>                 Key: HIVE-23133
>                 URL:
>             Project: Hive
>          Issue Type: Sub-task
>            Reporter: Zhenyu Zheng
>            Assignee: Zhenyu Zheng
>            Priority: Major
>         Attachments: HIVE-23133.1.patch, HIVE-23133.2.patch, HIVE-23133.3.patch, HIVE-23133.4.patch,
> Currently, we have set up an ARM CI to test out how Hive works on ARM platform:
> []
> Among the failures, we have observed that some numeric operations can have different
result across hardware archs, such as:
> []
> []
> []
> we can see that the calculation results of log, exp, cos, toRadians etc is slitly different
than the .out file results that we are
> comparing(they are tested and wrote on X86 machines), this is because of we use [Math
Library|] for these kind of calculations.
> and according to the [illustration|]:
> _Unlike some of the numeric methods of class StrictMath, all implementations of the equivalent
functions of class Math are not_
> _defined to return the bit-for-bit same results. This relaxation permits better-performing
implementations where strict reproducibility_
> _is not required._
> _By default many of the Math methods simply call the equivalent method in StrictMath
for their implementation._
> _Code generators are encouraged to use platform-specific native libraries or microprocessor
instructions, where available,_
> _to provide higher-performance implementations of Math methods._
> so the result will have difference across hardware archs.
> On the other hand, JAVA provided another library [StrictMath|]
that will not have this kind of problem as according to its' [reference|]:
> _To help ensure portability of Java programs, the definitions of some of the numeric
functions in this package require that they produce_
> _the same results as certain published algorithms._
> So in order to fix the above mentioned problem, we have to consider switch to use StrictMath
instead of Math.

This message was sent by Atlassian Jira

View raw message