Driver update for ci, easier diagnosing

Summary: Bump the nvidia driver used in the conda tests. Add an environment variable (unused) to allow building without ninja. Print relative error on assertClose failure.

Reviewed By: nikhilaravi

Differential Revision: D21227373

fbshipit-source-id: 5dd8eb097151da27d3632daa755a1e7b9ac97845
This commit is contained in:
Jeremy Reizenstein
2020-04-25 16:01:41 -07:00
committed by Facebook GitHub Bot
parent 0cfa6a122b
commit 232e4a7e3d
5 changed files with 30 additions and 6 deletions

View File

@@ -138,7 +138,19 @@ class TestCaseMixin(unittest.TestCase):
)
if not close and msg is None:
max_diff = backend.abs(input - other).max()
self.fail(f"Not close. max diff {max_diff}.")
diff = backend.abs(input - other) + 0.0
ratio = diff / backend.abs(other)
try_relative = (diff <= atol) | (backend.isfinite(ratio) & (ratio > 0))
if try_relative.all():
if backend == np:
# Avoid a weirdness with zero dimensional arrays.
ratio = np.array(ratio)
ratio[diff <= atol] = 0
extra = f" Max relative diff {ratio.max()}"
else:
extra = ""
shape = tuple(input.shape)
max_diff = diff.max()
self.fail(f"Not close. Max diff {max_diff}.{extra} Shape {shape}.")
self.assertTrue(close, msg)