You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As I understand (partly from the white paper, and partly from reading the Glow source code), the IRGen stage is optional. For the sake of concreteness, let's focus on the CPU backend. After lowering has been performed, many of the operations are replaced with BLAS, which are currently implemented in the CPU backend libjit. After this, the optional IRGen is performed that compiles the high level IR to the low level IR.
My question is whether it is possible to output, in whatever format, the state of high level IR prior to IRGen? Ideally, is it possible to output it as C source code?
I do not see this in the current code base, but I wonder whether this is planned, or how difficult it may be to do.
The text was updated successfully, but these errors were encountered:
You're correct that IRGen is optional. For example our Habana backend skips low-level IR; Glow high-level Nodes are translated into Habana-specific IR and passed to the Habana stack.
We do not have functionality to output any level of the graph as C source code. Something like this was asked in #2585, you can see @nadavrot's suggestion there. You could iterate over either level of IR and do so. We do not have any plans for this currently.
We do have the ability to print out a dot file with a DAG of the high-level graph. This can be done via -dump-graph-DAG="file.dot". We also have a PR in progress to export a Glow high-level graph via ONNX in #3167. Otherwise we have some options for backends that use the low level IR, such as -dump-ir. And then there's also LLVM-specific options like -dump-llvm-ir and -dump-llvm-asm, which must be used with an LLVM-based backend like the CPU backend.
And just to make sure it's clear:
After lowering has been performed, many of the operations are replaced with BLAS, which are currently implemented in the CPU backend libjit.
libjit includes implementations for Instructions (our low-level IR), not for Nodes (high-level IR). There is often a 1-to-1 mapping from Nodes to Instructions during IRGen, but not always.
As I understand (partly from the white paper, and partly from reading the Glow source code), the IRGen stage is optional. For the sake of concreteness, let's focus on the CPU backend. After lowering has been performed, many of the operations are replaced with BLAS, which are currently implemented in the CPU backend
libjit
. After this, the optional IRGen is performed that compiles the high level IR to the low level IR.My question is whether it is possible to output, in whatever format, the state of high level IR prior to IRGen? Ideally, is it possible to output it as C source code?
I do not see this in the current code base, but I wonder whether this is planned, or how difficult it may be to do.
The text was updated successfully, but these errors were encountered: