Command line¶
hexir¶
hexir [-emit=<stage>] [-o <file>] [-opt] [-placement=<op>=<device>,...] [input.mlir]
With no input file, the compiler builds a small program in C++
(compiler/Support/Builder.cpp) and compiles that instead.
-emit¶
Value |
Output |
|---|---|
|
the |
|
each compute op as a |
|
a loadable module (see |
|
accepted, but no affine pass is wired up |
|
after lowering to linalg on tensors |
|
linalg ops carrying their |
|
CUDA-placed ops as |
|
the LLVM dialect |
|
translated LLVM IR |
|
compile and run in this process |
Other options¶
-o <file>Output path for
-emit=hxb. Defaults toout.hxb.-optRun LLVM’s O3 pipeline before executing or printing.
-placement=<op>=<device>[,...]Override where an operation runs. Keys are graph-level op names (
hexir.linear,hexir.add,hexir.relu); devices arecpu,cuda, orgpuas an alias forcuda. An unsupported pair is rejected before any pass runs.
MLIR’s own pass-manager flags work too, including --print-ir-after-all and
--mlir-print-ir-after-failure.
Examples¶
hexir -emit=jit # built-in program, CPU
hexir -emit=mlir-tir -placement=hexir.linear=cuda # matmul as a GPU kernel
hexir -emit=hxb -o model.hxb mine.mlir # ship a file
hexir -emit=mlir-linalg --print-ir-after-all mine.mlir # watch every pass
hexir-run¶
hexir-run <module.hxb> [--device=cpu|cuda] [--entry=name] [--quiet]
hexir-run --selftest
--device=Which device to run on. Defaults to
cpu.cudais not implemented yet. A module is refused if it was compiled for a different device.--entry=Entry point name. Defaults to
main.--quietSuppress the module description and print only program output.
--selftestCheck the HAL without needing a module.
Exit codes¶
0 success · 1 load or execution failed · 2 bad arguments