Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Lang] [test] Add ti.get_rel_eps() for maximal relative error tolerance on current backend #1798

Merged
merged 2 commits into from
Aug 28, 2020

Conversation

k-ye
Copy link
Member

@k-ye k-ye commented Aug 28, 2020

It turns out that #1779 doesn't play well on my device. Adding this to make the allclose tests pass again on Metal.

Related issue = #1779

[Click here for the format server]


@codecov
Copy link

codecov bot commented Aug 28, 2020

Codecov Report

Merging #1798 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1798   +/-   ##
=======================================
  Coverage   61.74%   61.74%           
=======================================
  Files          19       19           
  Lines        3850     3850           
  Branches      691      691           
=======================================
  Hits         2377     2377           
  Misses       1348     1348           
  Partials      125      125           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update da41c85...a443e34. Read the comment docs.

python/taichi/testing.py Outdated Show resolved Hide resolved
@k-ye k-ye requested a review from archibate August 28, 2020 14:10
Copy link
Collaborator

@archibate archibate left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM now. We may also find a proper ti.get_abs_eps for each backend.

@archibate archibate changed the title [test] Add default_epsilon_of_arch to make allclose tests pass on Metal [Lang] [test] Add ti.get_rel_eps() for maximal relative error tolerance on current backend Aug 28, 2020
@k-ye
Copy link
Member Author

k-ye commented Aug 28, 2020

We may also find a proper ti.get_abs_eps for each backend.

Actually, what's the difference between rel and abs in this case? I think i get it now after looking at the tests..

@archibate
Copy link
Collaborator

We may also find a proper ti.get_abs_eps for each backend.

Actually, what's the difference between rel and abs in this case?

IIUC it's roughly:

def erf(x):
  return max(abs_eps, rel_eps * x)

@k-ye k-ye merged commit 6045d82 into taichi-dev:master Aug 28, 2020
@k-ye k-ye deleted the fix-eps branch August 28, 2020 14:44
@yuanming-hu yuanming-hu mentioned this pull request Sep 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants