Tensorflow 2.17 slow on apple silicon when training neural nets

I use a MacBook Pro (M2):
TF 2.15 (also tensorflow-macos) works perfectly fine with Apple Silicon (tensor flow-metal is also installed). Recently, I upgraded to TF 2.17 and got a dramatic decrease in performance when training neural nets. I have tried several variations (also tf 2.16) without success.

Note: The typical GPU test (convolutions) works in TF 2.17 (gpu is found, speedup 10.6x), but the training of neural nets is extremely slow.

Maybe Keras 3.0, which does not offer the legacy version of Adam might cause the decrease in perfomance.

Hi @Thomas_Bayer, If possible could you please share the code for which you are facing the performance issue. Thank You.