Repository navigation
Description
Issue type
Bug
Have you reproduced the bug with TensorFlow Nightly?
Yes
Source
source
TensorFlow version
tf 2.21.0
Custom code
Yes
OS platform and distribution
Ubuntu 24.04.3 LTS x86_64
Mobile device
No response
Python version
3.10.20
Bazel version
No response
GCC/compiler version
No response
CUDA/cuDNN version
NVIDIA driver version: 580.126.09
GPU model and memory
4 x NVIDIA GeForce RTX 2080 Ti, 11264 MiB each
Current behavior?
Current behavior
tf.raw_ops.LSTMBlockCell aborts the entire process with an internal CHECK failure when given an invalid-rank input tensor, instead of raising a normal recoverable TensorFlow exception.
The observed fatal error is:
F0000 tensor_shape.cc:362 Check failed: d < dims() (1 vs. 1)
This appears to be an input-validation robustness bug. Even if the provided input rank is invalid, TensorFlow should report the problem through a normal error such as InvalidArgumentError, rather than terminating the process.
Expected behavior
tf.raw_ops.LSTMBlockCell should reject invalid-rank inputs gracefully and return a recoverable error instead of triggering a fatal internal CHECK abort.
Standalone code to reproduce the issue
### Environment requirements
- Linux x86_64
- Python 3.10
- TensorFlow 2.21.0
- A TensorFlow runtime with GPU support
- Reproduced in local conda environment: `tf_test`
### Standalone code to reproduce the issue
Save the following as `repro.py`:
import tensorflow as tf
x = tf.constant([0.1, 0.2], dtype=tf.float16) # invalid rank: 1D
cs_prev = tf.constant([[0.5, 0.6]], dtype=tf.float16)
h_prev = tf.constant([[0.7, 0.8]], dtype=tf.float16)
w = tf.constant(
[[0.1, 0.2],
[0.3, 0.4],
[0.5, 0.6],
[0.7, 0.8]],
dtype=tf.float16,
)
wci = tf.constant([0.1, 0.2], dtype=tf.float16)
wcf = tf.constant([0.3, 0.4], dtype=tf.float16)
wco = tf.constant([0.5, 0.6], dtype=tf.float16)
b = tf.constant([0.1, 0.2, 0.3, 0.4], dtype=tf.float16)
tf.raw_ops.LSTMBlockCell(
x=x,
cs_prev=cs_prev,
h_prev=h_prev,
w=w,
wci=wci,
wcf=wcf,
wco=wco,
b=b,
forget_bias=1,
cell_clip=3.0,
use_peephole=False,
)
conda run --no-capture-output -n tf_test python repro.pyRelevant log output
(tf_test) user@user-Standard-PC-Q35-ICH9-2009:/home/lhj$ python /home/lhj/callChainBuild/src_tensorflow/output_tensorflow/targeted_mutation/generated_code/tf/tf_raw_ops_LSTMBlockCell/1.py
WARNING: All log messages before absl::InitializeLog() is called are written to STDERR
I0000 00:00:1774270215.246386 3734977 port.cc:153] oneDNN custom operations are on. You may see slightly different numerical results due to floating-point round-off errors from different computation orders. To turn them off, set the environment variable `TF_ENABLE_ONEDNN_OPTS=0`.
I0000 00:00:1774270215.319619 3734977 cpu_feature_guard.cc:227] This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations.
To enable the following instructions: AVX2 AVX512F AVX512_VNNI FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags.
WARNING: All log messages before absl::InitializeLog() is called are written to STDERR
I0000 00:00:1774270216.694490 3734977 port.cc:153] oneDNN custom operations are on. You may see slightly different numerical results due to floating-point round-off errors from different computation orders. To turn them off, set the environment variable `TF_ENABLE_ONEDNN_OPTS=0`.
I0000 00:00:1774270218.245818 3734977 gpu_device.cc:2043] Created device /job:localhost/replica:0/task:0/device:GPU:0 with 9606 MB memory: -> device: 0, name: NVIDIA GeForce RTX 2080 Ti, pci bus id: 0000:01:00.0, compute capability: 7.5
I0000 00:00:1774270218.247317 3734977 gpu_device.cc:2043] Created device /job:localhost/replica:0/task:0/device:GPU:1 with 9606 MB memory: -> device: 1, name: NVIDIA GeForce RTX 2080 Ti, pci bus id: 0000:02:00.0, compute capability: 7.5
I0000 00:00:1774270218.248784 3734977 gpu_device.cc:2043] Created device /job:localhost/replica:0/task:0/device:GPU:2 with 9606 MB memory: -> device: 2, name: NVIDIA GeForce RTX 2080 Ti, pci bus id: 0000:03:00.0, compute capability: 7.5
I0000 00:00:1774270218.250169 3734977 gpu_device.cc:2043] Created device /job:localhost/replica:0/task:0/device:GPU:3 with 9606 MB memory: -> device: 3, name: NVIDIA GeForce RTX 2080 Ti, pci bus id: 0000:04:00.0, compute capability: 7.5
E0000 00:00:1774270218.270822 3734977 util.cc:131] oneDNN supports DT_HALF only on platforms with AVX-512. Falling back to the default Eigen-based implementation if present.
F0000 00:00:1774270218.500487 3734977 tensor_shape.cc:362] Check failed: d < dims() (1 vs. 1)
*** Check failure stack trace: ***
@ 0x79dda4d1d314 absl::lts_20250814::log_internal::LogMessage::SendToLog()
@ 0x79dda4d1d296 absl::lts_20250814::log_internal::LogMessage::Flush()
@ 0x79dda494915c tensorflow::TensorShapeBase<>::dim_size()
@ 0x79dd88748a96 tensorflow::LSTMBlockCellOp<>::Compute()
@ 0x79dda4d876bc tensorflow::BaseGPUDevice::Compute()
@ 0x79dda280e778 tensorflow::(anonymous namespace)::SingleThreadedExecutorImpl::Run()
@ 0x79dda27db99d tensorflow::FunctionLibraryRuntimeImpl::RunSync()
@ 0x79dda27e6c26 tensorflow::ProcessFunctionLibraryRuntime::RunMultiDeviceSync()
@ 0x79dda27ecc60 tensorflow::ProcessFunctionLibraryRuntime::RunSync()
@ 0x79dd9b3f119d tensorflow::KernelAndDeviceFunc::Run()
@ 0x79dd9b3a00fb tensorflow::EagerKernelExecute()
@ 0x79dd9b3a981e tensorflow::ExecuteNode::Run()
@ 0x79dd9b96f7b4 tensorflow::EagerExecutor::SyncExecute()
@ 0x79dd9b39faa1 tensorflow::(anonymous namespace)::EagerLocalExecute()
@ 0x79dd9b39d1d0 tensorflow::DoEagerExecute()
@ 0x79dd9b3a0b2b tensorflow::EagerExecute()
@ 0x79dd9aece247 tensorflow::EagerOperation::Execute()
@ 0x79dd9b3edbb7 tensorflow::CustomDeviceOpHandler::Execute()
@ 0x79dd985004e5 TFE_Execute
@ 0x79dd6828e359 TFE_Py_ExecuteCancelable()
@ 0x79dd66d9d086 tensorflow::TFE_Py_ExecuteCancelable_wrapper()
@ 0x79dd66ddc54d pybind11::cpp_function::initialize<>()::{lambda()#1}::__invoke()
@ 0x79dd66db3fdd pybind11::cpp_function::dispatcher()
@ 0x599c029940c6 cfunction_call
Aborted (core dumped)
Activity
avmohansai commentedon Mar 24, 2026
Hi @Venkat6871 ,
I Was able to reproduce the issue(crash) on Colab using
TF v2.21.0andTF-nightlywith CPU and GPU,Please find the gist here for reference.Thank you.
fix: validate input rank before reading dims in LSTMBlockCell kernels
fix: validate input rank before reading dims in LSTMBlockCell kernels
fix: validate input rank before reading dims in LSTMBlockCell kernels
google-ml-butler commentedon Oct 9, 2026
Are you satisfied with the resolution of your issue?
Yes
No