System Constraints and Limitations
- This is a specific guide for TensorFlow 2.6.5.
- Data types float64, complex64, complex128, and DT_VARIANT are not supported.
- Operations related to tf.Variable must be performed on the NPU.
- Function operators (tf.function) must be executed on the NPU.
- The tf.compat.v1 API must not be used together with eager APIs in TensorFlow 2.6.5.
- The TensorFlow 2.6.5 data preprocessing is performed on the host by default. However, variables need to be offloaded to the device for initialization. If the data preprocessing script contains variables, it may fail to be executed on the NPU. To solve this problem, you need to embed the data preprocessing code that contains variables in context.device('CPU:0') to ensure that the variables in the preprocessing code are initialized on the host.
1 2 3 4 5 6
import tensorflow as tf from tensorflow.python.eager import context with context.device('cpu:0'): # Write the data preprocessing code here. The following is only an example. x = tf.Variable([1, 2, 3]) y = tf.square(x)
- If you spawn processes using the Python package multiprocessing, you are advised to use the forkserver method as opposed to the fork method.
In Python versions 3.8 to 3.11, using the fork method may copy the lock state of the main process when a child process is created. If this child process subsequently attempts to acquire the lock, a deadlock may occur, which in turn causes the service process to hang.
Parent topic: Before You Start