这是indexloc提供的服务,不要输入任何密码
Skip to content

tf.nn.conv2d_transpose crashes with "Illegal instruction (core dumped)" #93733

@jiren-the-gray

Description

@jiren-the-gray

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)

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions