Skip to content
This repository has been archived by the owner on Aug 15, 2019. It is now read-only.

Fixing various nan related issues impacted by floating point precision and NaN #1116

Merged
merged 8 commits into from
Jun 22, 2018

Conversation

reighlan
Copy link
Contributor

@reighlan reighlan commented Jun 21, 2018

This is fixing issue: tensorflow/tfjs#291

On the newer macs we had issues computing pow, mod, acosh, and atanh due to various issues related to NaN not being properly handled at the GPU level.

In the case of acosh and mod the problem stemmed from Div not successfully dividing 3/3 (or 6/6, 7/7, etc). In those cases the result would be .99999 and when floor was applied we got 0 instead of 1.

In the case of pow the problem stemmed from log not catching NaN for negative numbers.

Lastly, atanh failed due to not checking the inputs for values outside of the range [-1, 1]. For those values atanh needed to just return NaN directly.


This change is Reviewable

…s (most likely due to gpu driver changes).
@reighlan reighlan requested a review from nsthorat June 21, 2018 21:45
@dsmilkov dsmilkov self-requested a review June 22, 2018 18:59
@dsmilkov
Copy link
Contributor

:lgtm_strong: Wohoo! Thanks for figuring this out. I didn't realize it's that involved !


Reviewed 3 of 3 files at r2.
Review status: :shipit: complete! 1 of 1 LGTMs obtained


Comments from Reviewable

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants