ROCm-Device-Libs icon indicating copy to clipboard operation
ROCm-Device-Libs copied to clipboard

j1 (both double and float) return NaN for "large" negative numbers

Open VinInn opened this issue 3 years ago • 9 comments

I suspect this is due to the use of "x" instead of "ax" in this portion of the code https://github.com/RadeonOpenCompute/ROCm-Device-Libs/blob/a1f82f37cf105f0091e0f9e850a0a75aabde6eb7/ocml/src/j1F.cl#L81

VinInn avatar Aug 17 '21 06:08 VinInn

Thanks, we'll take a look.

b-sumner avatar Aug 17 '21 14:08 b-sumner

Thanks again for reporting this. It will be fixed in a future release.

b-sumner avatar Aug 23 '21 14:08 b-sumner

@VinInn, if you don't mind my asking, how did you run across this and the previous issue you raised?

b-sumner avatar Sep 02 '21 17:09 b-sumner

@b-summer: by running an exhaustive search: see https://gitlab.inria.fr/zimmerma/math_accuracy/-/tree/master/ in particular https://gitlab.inria.fr/zimmerma/math_accuracy/-/blob/master/binary32_exhaustive/check_exhaustiveGPU.cc (it can be trivially hippified) and https://gitlab.inria.fr/zimmerma/math_accuracy/-/blob/master/latex/glibc234.tex We plan to publish this soon and to update it with ROCm/ocml results as soon as the new fixed versions will be released (We will of course send you the new version for comments before publishing)

VinInn avatar Sep 03 '21 06:09 VinInn

Thanks. We have exhaustive tests as well, or rather tests that can be made as exhaustive as desired using command line arguments, but those arguments hadn't been set up properly for some functions. We appreciate the chance to view your work prior to publication.

b-sumner avatar Sep 03 '21 15:09 b-sumner

@VinInn I noticed the paper mentions large errors for double precision acosh, atanh, and log1p, but for the inputs listed, I am seeing the library producing results with error below 1 ulp, e.g.

double log1p: Samples: 1......... 0.28 ulp at (0x1.10730dfffffffp-4): *0x1.07c565cc10592484p-4 vs 0x1.07c565cc10592p-4

I'm thinking you may be seeing a compiler problem in ROCm 3.7, and/or that the default optimization for HIP negatively affected the accuracy. Can you try with a more recent version of ROCm? Or perhaps try with low optimization?

b-sumner avatar Sep 06 '21 01:09 b-sumner

@b-sumner , the paper does not include results for ROCm yet. Which of the libraires are you referring too? I can anticipate that our results for ROCm for double log1p is 1.0 ulp @ -0x1.5efad5491a79bp-1022

I am using ROCm 4.3.1

VinInn avatar Sep 06 '21 06:09 VinInn

@b-summer : We have updated https://gitlab.inria.fr/zimmerma/math_accuracy/-/blob/master/latex/glibc234.tex to include ROCm results. We will wait a new release of ROCm that includes the new version to update it and officially published.

Any feedback is welcome.

BTW is there any paper or conference contribution that we can use as reference besides the README.md in git?

VinInn avatar Sep 09 '21 06:09 VinInn

we have published a new version of our comparison of the accuracy of mathematical libraries that includes ROCm results. https://members.loria.fr/PZimmermann/papers/accuracy.pdf

VinInn avatar Feb 11 '22 10:02 VinInn

This has been fixed.

b-sumner avatar Mar 28 '23 01:03 b-sumner