TensorFlow XLA 是否已弃用?

Is TensorFlow XLA deprecated?

我刚刚阅读 (here):

Deprecating XLA_CPU and XLA_GPU devices with this release. (TF 2.2.0)

现在是否已弃用 XLA?它不再使用了吗?有其他选择吗? 还是这一切都是内部自动处理的?这种弃用是什么意思?

不,XLA 没有被弃用,事实上还有其他关于它的发行说明:

  • XLA
    • XLA now builds and works on windows. All prebuilt packages come with XLA available.
    • XLA can be enabled for a tf.function with “compile or throw exception” semantics on CPU and GPU.

此说明实际上与您提到的弃用有关。不赞成使用字符串 XLA_CPUXLA_GPU 以及 tf.device. See the deprecation warning message:

XLA_GPU and XLA_CPU devices are deprecated and will be
removed in subsequent releases. Instead, use either
@tf.function(experimental_compile=True) for must-compile
semantics, or run with TF_XLA_FLAGS=--tf_xla_auto_jit=2
for auto-clustering best-effort compilation.

这就是另一个发行说明所说的内容,在 Explicit compilation with tf.function 下的 XLA 指南中提到。