XLA_FLAGS and their outputs

808 views
Skip to first unread message

Seyed Hashemi

unread,
Jun 27, 2018, 12:14:25 PM6/27/18
to XLA development
I'm tying to figure out the HLO structure and how we can make our own compiler to compile HLO after optimization.
After going through the XLA flags, these 3 looked most relevant to me:

 
Dump all HLO modules as text into the provided directory path:
TF_XLA_FLAGS=--xla_generate_hlo_text_to=/home/XLA/output  python3 source.py



"Dump Hlo after all hlo passes are executed as proto binary into "
"this directory."),
TF_XLA_FLAGS=--xla_dump_optimized_hlo_proto_to=output2  python3 source.py



"Dump the compiler IR into this directory as individual files."),
TF_XLA_FLAGS=--xla_dump_ir_to=output3  python3 source.py


The output for each flag is in a different folder. 
The first folder has the HLO modules, which is easier to understand (I still have problems at fusion part)
The second folder is binary (which is unreadable-ish).
The third folder is compiler IR, I don't understand this one at all and I don't get the difference between HLO modules and compiler IR. (what is the flow of going from tf graph to binary?) tf.graph --> HLOmodules --> ... where is compiler IR in relation to HLOmodules here?
HLO_output.zip

Justin Lebar

unread,
Jun 27, 2018, 12:33:43 PM6/27/18
to s.mehr...@gmail.com, XLA development
> The second folder is binary (which is unreadable-ish).

You'll need to get a tool to deserialize binary protocol buffers.

Or, don't worry about it, because you have the HLO text, which contains the same information.

> The third folder is compiler IR, I don't understand this one at all and I don't get the difference between HLO modules and compiler IR. (what is the flow of going from tf graph to binary?) tf.graph --> HLOmodules --> ... where is compiler IR in relation to HLOmodules here?

XLA optimizes HLO and then generates LLVM IR.

You may want to watch any of the XLA intro videos floating around the web.

-Justin

--
You received this message because you are subscribed to the Google Groups "XLA development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to xla-dev+u...@googlegroups.com.
To post to this group, send email to xla...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/xla-dev/8686246d-85ec-434c-b087-7b7e9d177c8f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Seyed Hashemi

unread,
Jun 28, 2018, 6:09:31 PM6/28/18
to XLA development
Thank you, couple of questions about the HLO text output:

I realized there are 44 files for each cluster, does that mean there are 44 stages of optimization? (is this number independent of tf graph?)
Is there documentation about HLO that would help me understand the HLO text better?
I went through the other discussions here and learned a little bit, but still can't get my head around the code.
for example:
the line:
  %arg0.0.0 = s32[] parameter(0), metadata={op_name="XLA_Args"}, what does it do?
Reply all
Reply to author
Forward
0 new messages