How can we use all the cores in a CPU for parallel processing in TensorFlow.
Hi @Amuthan_B
You can try using the tf.data.Dataset methods like map
, filter
, shuffle
, and prefetch
with the num_parallel_calls
argument to set the number of threads used for parallel function execution within these methods. You can also explore tf.distribute.Strategy API for distributed training or execution across multiple cores or devices. Thank you.
You have to set this environment variables:
TF_ENABLE_ONEDNN_OPTS=1
OMP_NUM_THREADS=4 or other value
if this doesn’t work with standard tensorflow installation try to install intel_tensorflow package or build tensorflow with omp support