Hi Bhack
Thanks for the tip.
Yes I tried that, but did not work. It seems that that may work when you are using JIT (not AOT) in your tensorflow program (python), at least that is how I understand that example.
In my case I am using AOT and the tf_library macro. So I use bazel buil to call the macro and in this case I do not know how to pass the XLA_FLAGS. tf_library has an input option called flags but XLA_FLAG is not one of those. I did set the XLA_FLAG env variable, just in case, but did not work (don’t think that bazel will read linux env variables).
I am literally following this in order to the the graph compiled

  
      

      TensorFlow
  

  
    

Using AOT compilation  |  XLA  |  TensorFlow 2



  

  
    
    
  

  


  

      gist.github.com
  

  
    https://gist.github.com/carlthome/6ae8a570e21069c60708017e3f96c9fd 3

  tfcompile.ipynb
  {
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {
    "slideshow": {
     "slide_type": "slide"
    }
   },
   "source": [
    This file has been truncated. show original




  

  
    
    
  

  


In short, after preparing the frozen_graph, creating the graph.config.pbtxt and updating the BUILD with the tf_library macro info you call to:
bazel build --show_progress_rate_limit=600 @org_tensorflow//:graph
That works, the header file and the cc_library is generated but I can not get the llvm IR. And do not know how to pass in this case the XLA_FLAG
Any ideas? Maybe there is other way to use AOT and being able to pass that flag.
Thanks