Skip to content

Commit

Permalink
[docs] Centralize all images in docs/images/
Browse files Browse the repository at this point in the history
  • Loading branch information
silvasean committed Nov 4, 2022
1 parent 2846776 commit de4bcbf
Show file tree
Hide file tree
Showing 10 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Multiple Vendors use MLIR as the middle layer, mapping from platform frameworks

We have few paths to lower down to the Torch MLIR Dialect.

![Torch Lowering Architectures](docs/Torch-MLIR.png)
![Simplified Architecture Diagram for README](docs/images/readme_architecture_diagram.png)

- TorchScript
This is the most tested path down to Torch MLIR Dialect, and the PyTorch ecosystem is converging on using TorchScript IR as a lingua franca.
Expand Down
2 changes: 1 addition & 1 deletion docs/architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ halves interface at an abstraction layer that we call the "backend contract",
which is a subset of the `torch` dialect with certain properties appealing for
backends to lower from.

![Torch-MLIR Architecture](Torch-MLIR_Architecture.png)
![Torch-MLIR Architecture](images/architecture.png)

The frontend of Torch-MLIR is concerned with interfacing to PyTorch itself, and
then normalizing the program to the "backend contract". This part involves build
Expand Down
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes
8 changes: 4 additions & 4 deletions docs/ltc_backend.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ Generated files are created in this directory, which is ignored by version contr

## Architecture

![LTC Diagram](ltc_images/ltc_architecture.png)
![LTC Diagram](images/ltc_architecture.png)

### Tracing LTC graph

Expand All @@ -93,7 +93,7 @@ previously registered in `RegisterLazy.cpp`.
Next, `LazyNativeFunctions::tanh` from `LazyNativeFunctions.cpp` is called, which triggers the creation of a `Tanh` node, which is a subclass of `TorchMlirNode` and `torch::lazy::Node`, defined in `LazyIr.h`.
These nodes are then tracked internally by LTC as the computation graph is traced out.

![Tracing Tensors](ltc_images/tracing_tensors.png)
![Tracing Tensors](images/ltc_tracing_tensors.png)

### Syncing Tensors

Expand All @@ -109,15 +109,15 @@ creates an instance of `TorchMlirLoweringContext`. Here, the `TorchMlirNode`s ar
Next, `TorchMlirLoweringContext::Build` is executed and the final `jit::Graph` is sent to `torch_mlir::importJitFunctionAsFuncOp` to generate MLIR using the existing infrastructure from Torch-MLIR.
At this point, a `TorchMlirComputation` is created containing the final `mlir::FuncOp`.

![Syncing Tensors](ltc_images/syncing_tensors.png)
![Syncing Tensors](images/ltc_syncing_tensors.png)

### Final Compilation and Execution

The `TorchMlirComputation` is sent to the vendor specific implementation of `TorchMlirBackendImpl::Compile` to be handed off to the vendor's compilation stack (if applicable).

Finally, the compiled computation is sent to `TorchMlirBackendImpl::ExecuteComputation` to be executed on the vendor device, which produces some results to be send back to PyTorch.

![Vendor Execution](ltc_images/vendor_execution.png)
![Vendor Execution](images/ltc_vendor_execution.png)

## Implementing a custom backend

Expand Down

0 comments on commit de4bcbf

Please sign in to comment.