-
Notifications
You must be signed in to change notification settings - Fork 74.8k
Open
Labels
Description
Issue type
Bug
Have you reproduced the bug with TensorFlow Nightly?
No
Source
binary
TensorFlow version
tf 2.19
Custom code
Yes
OS platform and distribution
Ubuntu 24.04.2 LTS
Mobile device
No response
Python version
3.12
Bazel version
No response
GCC/compiler version
No response
CUDA/cuDNN version
12.6
GPU model and memory
No response
Current behavior?
When I run the following code setting the device as CPU with TF_ENABLE_ONEDNN_OPTS=1
, it crashes with this error message: "could not create a primitive descriptor for a convolution forward propagation primitive", then it raises the signal "Illegal instruction (core dumped)". I tried it with two different machines, both gave me the same error.
Standalone code to reproduce the issue
import tensorflow as tf
import numpy as np
rng = np.random.default_rng(40)
tf.config.experimental.enable_op_determinism()
with tf.device("/CPU:0"):
input_tensor = tf.constant(rng.uniform(-3.9808033, -3.0141976, (1, 4, 4, 5)), dtype=tf.float32)
weight_tensor = tf.constant(rng.uniform(2.0, 2.0, (4, 4, 4, 4)), dtype=tf.float32)
stride = 2
padding = 3
output_padding = 0
groups = 1
dilation = 1
input_tensor = tf.transpose(input_tensor, [0, 2, 3, 1])
weight_tensor = tf.transpose(weight_tensor, [2, 3, 1, 0])
batch_size = tf.shape(input_tensor)[0]
input_height = input_tensor.shape[1]
input_width = input_tensor.shape[2]
filter_height = weight_tensor.shape[0]
filter_width = weight_tensor.shape[1]
out_channels = weight_tensor.shape[3]
h_out = (input_height - 1) * stride - 2 * padding + dilation * (filter_height - 1) + 1 + output_padding
w_out = (input_width - 1) * stride - 2 * padding + dilation * (filter_width - 1) + 1 + output_padding
output_shape = [batch_size, h_out, w_out, out_channels]
output = tf.nn.conv2d_transpose(
input_tensor, weight_tensor, output_shape=output_shape, strides=[1, stride, stride, 1],
padding='VALID' if padding == 0 else 'SAME', dilations=[1, dilation, dilation, 1]
)
Relevant log output
could not create a primitive descriptor for a convolution forward propagation primitiveIllegal instruction (core dumped)