[XLA] using auto-clustering with tf_xla_auto_jit causes multiple compilation with variable seq. len.
Note: I tried by decorating using `with tf.xla.experimental.jit_scope():`, and the same thing happens, basically, the compilation takes a crazy  amount of time and it feels like it's recompiling things over and over. After a good 50 minutes, it stops compiling and the training starts, but it has the same speed than without any XLA flag ... The latter is not true if I fix the batch - then the training is much faster.  @TParcollet 
From what I remember the XLA compilation does not support ragged tensors (variable length): [link](https://github.com/tensorflow/tensorflow/issues/56595)
I also found that initalizing the ragged tensors can sometimes take quite a lot of time if done through `tf.ragged.constant`. Depends on the use case obviously. @maksym33 Thanks! Well, if this is the case then how the hell am I supposed to switch it off... I tried the four versions (argument, context, config and jit_compile) and it STILL triggers XLA. I then compiled from the source without XLA support and it then crashed with this "Trying to access resource Resource..." error. Any version above 2.12 triggers XLA from one way or another on my code - even when TF is not compiled with it.  I usually change the XLA compile with keras.model.compile and set jit_compile=False Hi, @TParcollet !
Could you try to disable the auto-cluster by setting the tf_xla_auto_clustering_enabled environment variable to False and try with TF v2.14 ? Please let us know if it helped?
Thank you! This issue is stale because it has been open for 7 days with no activity. It will be closed if no further activity occurs. Thank you. This issue was closed because it has been inactive for 7 days since being marked as stale. Please reopen if you'd like to work on this further. Are you satisfied with the resolution of your issue?
<a href="https://docs.google.com/forms/d/e/1FAIpQLSfaP12TRhd9xSxjXZjcZFNXPGk4kc1-qMdv3gc6bEP90vY1ew/viewform?entry.85265664=Yes&entry.2137816233=https://github.com/tensorflow/tensorflow/issues/62198">Yes</a>
<a href="https://docs.google.com/forms/d/e/1FAIpQLSfaP12TRhd9xSxjXZjcZFNXPGk4kc1-qMdv3gc6bEP90vY1ew/viewform?entry.85265664=No&entry.2137816233=https://github.com/tensorflow/tensorflow/issues/62198">No</a>

### Issue type

Bug

### Have you reproduced the bug with TensorFlow Nightly?

No

### Source

binary

### TensorFlow version

2.13.1

### Custom code

Yes

### OS platform and distribution

_No response_

### Mobile device

_No response_

### Python version

_No response_

### Bazel version

_No response_

### GCC/compiler version

_No response_

### CUDA/cuDNN version

_No response_

### GPU model and memory

_No response_

### Current behavior?

I have a somewhat complex model that deals with variable length tensors as input. The feature dimension remains the same, only one of the dimension changes (time). If I fix this by giving always the same batch of features, I can use tf_xla_auto_jit and see that the training speed improves quite a lot. However, as soon as I throw the for `batch in train_dataset` in the mix, everything becomes infinitely slow and, looking at the warning, it feels like XLA keeps recompiling ... 

I don't really know what to expect here? 

### Standalone code to reproduce the issue

```shell
Impossible to share unfortunately.
```


### Relevant log output

_No response_