Comments (3)
Getting LLVM IR out is a bit annoying because it is not even visible at the Python level. However, you can dump LLVM Dialect using https://github.com/google/iree-llvm-sandbox/blob/main/python/examples/core/harness.py#L123 and call mlir-translate
before calling llc
.
I am not sure what mlir-c-runner
refers to here, there is libmlir_c_runner_utils.so
and mlir-cpu-runner
.
from iree-llvm-sandbox.
There is also the tools/llvm-mca.py script that I use successfully to cross-compile and pipe through llvm-mca.
It generates all the interim files and can start from either the mlir in llvm-dialect form or from the jitt'ed .o
The part that is trickier is producing the .o without running as it needs to happen in ExecutionEngine.
Then there is the problem that the LLVM passes in the JIT will differ from what you do on the CLI:
I do not get the same binary using the llvm-mca.py if I start form .mlir or from .o and I do not have a good way to reconcile those atm.
Usage of llvm-mca.py:
(cd ${IREE_LLVM_SANDBOX_SOURCE_DIR}; python -m python.tools.llvm_mca -mlir-translate=${LLVM_BUILD_DIR}/bin/mlir-translate -llvm-objdump=${LLVM_BUILD_DIR}/bin/llvm-objdump \
-llvm-llc=${LLVM_BUILD_DIR}/bin/llc -llvm-opt=${LLVM_BUILD_DIR}/bin/opt -llvm-mca=${LLVM_BUILD_DIR}/bin/llvm-mca -mlir-file=/tmp/abc.mlir -f=transpose_2d_on_tensors; \
less /tmp/abc.mlir_llvm_mca.out)
You need to pass the proper -mlir-file=/tmp/abc.mlir
-f=transpose_2d_on_tensors
for your use case.
This will create all the /tmc/abc.mlirxxx
files needed (.ll
, .o
etc).
This should compose well with the other functionality that dump LLVM dialect to file.
from iree-llvm-sandbox.
This has also been done. Closing
from iree-llvm-sandbox.
Related Issues (20)
- Transforming linalg with multiple generic operations HOT 4
- PSA: Fixed configure.py boolean option handling in 64386aad49c73fee69e199c7b4894b648c204736 HOT 1
- Einseum-like spec for transposes HOT 1
- Failed to cancel out unrealized_conversion_cast HOT 2
- CI fails due to failure to install a Python dependency. HOT 1
- Support padding transpose in the transform dialect HOT 2
- PDL patterns HOT 1
- Segfault in some matmul cases HOT 8
- Error in PDL after Interpreter refactoring HOT 6
- Why the sandbox depends on Clang and its tools? HOT 3
- Tracking ops may fail if a pattern does not call replace. HOT 4
- PadOp sometimes does not compose HOT 2
- PSA: renamed python_package -> python_packages
- PSA: Integration with IREE for multi-target and whole model compilation HOT 6
- Fuse & Tile & Pad produces possibly inefficient vector code. HOT 26
- Conv2D benchmark failed with DoubleTiling methods
- python.examples.matmul.test failed with ModuleNotFoundError
- Collaboration on data analytics workloads in MLIR HOT 12
- RFC: improve stacked commit flow
- [Substrait] Decide how to check for number of ops in module.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from iree-llvm-sandbox.