The session returned by cached_session uses soft placement, something we don't
want for XLA_* devices. With soft placement ops lacking XLA kernels silently
fall back and run on the CPU, misleading us into thinking we have more test
coverage than we actually do. With this test some tests (rightly) start failing
because they were testing ops with dtypes the XLA kernels do not support. I've
removed these dtypes from the tests.
This CL partially addresses b/132430685. It stubs out "cached_session" and
"test_session" to raise errors, so we have more confidence that the compiler is
being exercised. However, we still use XLA_* devices to exercise XLA, which has
a different code path than xla.compile and tpu.rewrite. This needs to be
incrementally fixed.
PiperOrigin-RevId: 248437673
In order to support tests running in eager mode we need to avoid
unnecessary use of Sessions in tests. This moves to remove some
of the uses of the `run` function in favor of `evaluate`.
PiperOrigin-RevId: 223009795
In order to support tests running in eager mode we need to avoid
unnecessary use of Sessions in tests. This moves to remove some
of the uses of the `run` function in favor of `evaluate`.
PiperOrigin-RevId: 222013881
self.test_session() has been deprecated in 9962eb5e84 as its name confuses readers of the test. Moving to cached_session() instead which is more explicit about:
* the fact that the session may be reused.
* the session is not closed even when doing a "with self.test_session()" statement.
PiperOrigin-RevId: 209837298
XLA is a compiler-based linear algebra execution engine that targets CPUs, GPUs and custom accelerators.
XLA is still experimental; we are releasing it early to get the community involved.
Change: 143990941