Repository navigation
Closed
Labels
Description
Click to expand!
Issue Type
Bug
Source
binary
Tensorflow Version
tf 2.9 and 2.12.0-dev20221018
Custom Code
No
OS Platform and Distribution
Linux Ubuntu 20.04
Mobile device
No response
Python version
3.8
Bazel version
No response
GCC/Compiler version
No response
CUDA/cuDNN version
CUDA 11.5
GPU model and memory
No response
Current Behaviour?
A crash due to check fail can be trigerred.Standalone code to reproduce the issue
import os
os.environ['TF_ENABLE_ONEDNN_OPTS'] = '0'
import tensorflow as tf
import numpy as np
print(tf.__version__)
for _ in range(20):
try:
forget_bias = 112.66590343649887
cell_clip = 67.12389445926587
use_peephole = False
x = tf.saturate_cast(tf.random.uniform([2, 16], minval=0, maxval=64, dtype=tf.int64), dtype=tf.half)
cs_prev = tf.saturate_cast(tf.random.uniform([2, 0], minval=0, maxval=64, dtype=tf.int64), dtype=tf.half)
h_prev = tf.saturate_cast(tf.random.uniform([2, 0], minval=0, maxval=64, dtype=tf.int64), dtype=tf.half)
w = tf.saturate_cast(tf.random.uniform([16, 0], minval=0, maxval=64, dtype=tf.int64), dtype=tf.half)
wci = tf.saturate_cast(tf.random.uniform([5], minval=0, maxval=64, dtype=tf.int64), dtype=tf.half)
wcf = tf.saturate_cast(tf.random.uniform([16], minval=0, maxval=64, dtype=tf.int64), dtype=tf.half)
wco = tf.saturate_cast(tf.random.uniform([13], minval=0, maxval=64, dtype=tf.int64), dtype=tf.half)
b = tf.saturate_cast(tf.random.uniform([0], minval=0, maxval=64, dtype=tf.int64), dtype=tf.half)
res = tf.raw_ops.LSTMBlockCell(
forget_bias=forget_bias,
cell_clip=cell_clip,
use_peephole=use_peephole,
x=x,
cs_prev=cs_prev,
h_prev=h_prev,
w=w,
wci=wci,
wcf=wcf,
wco=wco,
b=b,
)
except:
passRelevant log output
F tensorflow/core/kernels/rnn/lstm_ops_gpu.cu.cc:277] Non-OK-status: GpuLaunchKernel( lstm_gates<T, false, gate_layout>, grid_dim_2d, block_dim_2d, 0, cu_stream, gates.data(), b.data(), cs_prev.data(), wci.data(), wcf.data(), wco.data(), o.data(), h.data(), ci.data(), cs.data(), co.data(), i.data(), f.data(), forget_bias, cell_clip, batch_size, cell_size) status: INTERNAL: invalid configuration argument
Aborted (core dumped)
Activity
bhack commentedon Oct 25, 2022
Same as the other issues. Can you try the same with the high level API?
tiruk007 commentedon Oct 26, 2022
@sushreebarsa
I was able to reproduce the issue on Colab using TF 2.10 GPU and it works fine inTF 2.10 CPU. Could you please find attached gists GPU and CPU for reference.
Thank you!
sachinprasadhs commentedon Dec 9, 2022
tf.raw_opsare basically designed to be consumed by downstream library users, not end users.Usually, these APIs are less strict in terms of validation etc which is fine since only library writers are supposed to use these symbols.
If available, please prefer high level API for general use case scenarios.
Refer this RFC for more details. Thanks!
mihaimaruseac commentedon Dec 9, 2022
While these are internal APIs, the check failure could lead to denial of service. In the past this used to be considered a vulnerability, but since the impact is bounded and preventable, now the policy is for these to be files as issues and resolved whenever someone from community wants to pick them up (they're very good first issues). Please don't auto-close these!
21 remaining items
SahilJain8 commentedon Mar 5, 2023
Hello good greetings my name is Sahil and would love to contribute to Tensorflow could anyone help me with it 😊😊
CrazyShenanigan commentedon Mar 12, 2023
The issue can be resolved by disabling the use of oneDNN optimizations in TensorFlow by setting the environment variable "TF_ENABLE_ONEDNN_OPTS" to 0 before importing TensorFlow. (see below code)
os.environ['TF_ENABLE_ONEDNN_OPTS'] = '0'
Explanation:
The provided code generates random values for inputs to the LSTMBlockCell operation and runs it in a loop for 20 iterations. The LSTMBlockCell operation implements the long short-term memory (LSTM) algorithm, which is a type of recurrent neural network commonly used for sequence processing tasks. The inputs to the LSTMBlockCell operation include the current input values, the previous cell state and output values, and the weights and biases of the LSTM cell.
CrazyShenanigan commentedon Mar 12, 2023
assign this issue to me
CrazyShenanigan commentedon Mar 12, 2023
import os
os.environ['TF_ENABLE_ONEDNN_OPTS'] = '0'
import tensorflow as tf
import numpy as np
Set random values for inputs
forget_bias = 112.66590343649887
cell_clip = 67.12389445926587
use_peephole = False
x = tf.saturate_cast(tf.random.uniform([2, 16], minval=0, maxval=64, dtype=tf.int64), dtype=tf.half)
cs_prev = tf.saturate_cast(tf.random.uniform([2, 0], minval=0, maxval=64, dtype=tf.int64), dtype=tf.half)
h_prev = tf.saturate_cast(tf.random.uniform([2, 0], minval=0, maxval=64, dtype=tf.int64), dtype=tf.half)
w = tf.saturate_cast(tf.random.uniform([16, 0], minval=0, maxval=64, dtype=tf.int64), dtype=tf.half)
wci = tf.saturate_cast(tf.random.uniform([5], minval=0, maxval=64, dtype=tf.int64), dtype=tf.half)
wcf = tf.saturate_cast(tf.random.uniform([16], minval=0, maxval=64, dtype=tf.int64), dtype=tf.half)
wco = tf.saturate_cast(tf.random.uniform([13], minval=0, maxval=64, dtype=tf.int64), dtype=tf.half)
b = tf.saturate_cast(tf.random.uniform([0], minval=0, maxval=64, dtype=tf.int64), dtype=tf.half)
Run LSTMBlockCell operation in a loop for 20 iterations
for _ in range(20):
try:
res = tf.raw_ops.LSTMBlockCell(
forget_bias=forget_bias,
cell_clip=cell_clip,
use_peephole=use_peephole,
x=x,
cs_prev=cs_prev,
h_prev=h_prev,
w=w,
wci=wci,
wcf=wcf,
wco=wco,
b=b,
)
except:
pass
This will be the corrected code for this issue.
pranjalisr commentedon Mar 16, 2023
@shijy16 is this issue still open? I would like provide solution for the same.
sachinprasadhs commentedon Mar 16, 2023
@pranjalsrv123 , Feel free to open a PR for this issue. Thanks!
varunk47 commentedon Mar 17, 2023
I can contribute if its still not solved
amangupta201 commentedon Mar 23, 2023
It runs fine on Google Colab
https://colab.research.google.com/drive/1IIORi_KbPeSZP3hU9-3UMCxZBn2Bi4Yk?usp=sharing
anuth212 commentedon Mar 29, 2023
I will also work on this issue.
surajraoo commentedon Apr 4, 2023
I will also work on this issue
google-ml-butler commentedon Apr 4, 2023
Are you satisfied with the resolution of your issue?
Yes
No
Also guard peephole weight rank and empty cs_prev in the grad op
Also guard peephole weight rank and empty cs_prev in the grad op
Also guard peephole weight rank and empty cs_prev in the grad op