openxla/xla

Workable example on normal DNN model

Opened this issue · 0 comments

Hello, I am new to XLA and trying to experiment with the aot + cpu settings. The only official document I found is https://openxla.org/xla/tf2xla/tfcompile which is based on https://github.com/tensorflow/tensorflow/tree/master/tensorflow/compiler/aot., but it only contains single operator examples (e.g., tfmatmul).

I have tried to use keras to train and save a model to tf format using model.save(model_save_path, save_format='tf'), according to https://www.tensorflow.org/tutorials/keras/save_and_load. It gives 2 files "keras_metadata.pb" and "saved_model.pb". I tried to use saved_model.pb for tfcompile but it gives the following error:

2024-05-07 21:59:52.126604: F tensorflow/compiler/aot/tfcompile_main.cc:95] Non-OK-status: status status: DATA_LOSS: Can't parse tensorflow/compiler/aot/custom/test_mnist.pb as binary proto
Target //tensorflow/compiler/aot/custom:test_mnist failed to build

Does anyone know how to solve this or provide a workable example on a normal DNN model? Thanks.