@@ -177,72 +177,60 @@ The wrapper automatically:
177177
178178#### Custom Compiler Flags
179179
180- You can pass custom IREE compiler flags using the ` FUSILLI_EXTRA_COMPILER_FLAGS `
181- environment variable or the ` --Xiree-compile ` flag with the Python benchmark
182- wrapper.
180+ Pass custom IREE compiler flags using:
181+ - ** C++ driver ** : ` FUSILLI_EXTRA_COMPILER_FLAGS ` environment variable
182+ - ** Python wrapper** : ` --Xiree-compile ` flag (which sets the environment variable internally)
183183
184- ** Using the C++ benchmark driver with environment variable:**
184+ ** Single flag examples:**
185+
186+ C++ driver:
185187``` shell
186188FUSILLI_EXTRA_COMPILER_FLAGS=" --iree-opt-level=O3" \
187189 build/bin/benchmarks/fusilli_benchmark_driver --iter 100 \
188- matmul -M 8192 -N 2048 -K 4096 --transA \
189- --a_type bf16 --b_type bf16 --out_type bf16
190+ matmul -M 8192 -N 2048 -K 4096 --transA --a_type bf16 --b_type bf16 --out_type bf16
190191```
191192
192- ** Using the Python benchmark wrapper:**
193+ Python wrapper:
193194``` shell
194195python benchmarks/run_benchmark.py \
195196 --Xiree-compile=" --iree-opt-level=O3" \
196- -o results.csv \
197- -f commands.txt
197+ -f commands.txt -o results.csv
198198```
199199
200- ** Passing multiple compiler flags:**
200+ ** Multiple flags:**
201201
202- Using environment variable :
202+ C++ driver (space-separated in one string) :
203203``` shell
204204FUSILLI_EXTRA_COMPILER_FLAGS=" --iree-opt-level=O3 --iree-hal-dump-executable-files-to=/tmp/dump" \
205205 build/bin/benchmarks/fusilli_benchmark_driver ...
206206```
207207
208- Using Python wrapper:
208+ Python wrapper (repeat ` --Xiree-compile ` ) :
209209``` shell
210210python benchmarks/run_benchmark.py \
211211 --Xiree-compile=" --iree-opt-level=O3" \
212212 --Xiree-compile=" --iree-hal-dump-executable-files-to=/tmp/dump" \
213213 -f commands.txt -o results.csv
214214```
215215
216- > [ !NOTE]
217- > If an extra compiler flag is exposed via CLI but not the C API, please select
218- > the CLI backend (set ` FUSILLI_COMPILE_BACKEND_USE_CLI=1 ` ). Currently,
219- > ` --iree-codegen-tuning-spec-path ` requires this since it is not exposed
220- > through the C API. This limitation is being addressed and will be lifted
221- > shortly.
222-
223216#### Tuning Specs
224217
225- IREE tuning specs (transform dialect libraries) specify optimal compiler code
226- generation parameters such as workgroup sizes, tile sizes, MMA intrinsics, and
227- shared memory allocation suited for specific workloads. You can pass tuning
228- specs using the custom compiler flags feature described above.
218+ IREE tuning specs (transform dialect libraries) specify compiler code generation
219+ parameters like workgroup sizes, tile sizes, and MMA intrinsics for specific workloads.
220+ Pass tuning specs using the custom compiler flags shown above:
229221
230- ** Example with C++ benchmark driver:**
222+ C++ driver:
231223``` shell
232- FUSILLI_COMPILE_BACKEND_USE_CLI=1 \
233224FUSILLI_EXTRA_COMPILER_FLAGS=" --iree-codegen-tuning-spec-path=/path/to/tuning_spec.mlir" \
234225 build/bin/benchmarks/fusilli_benchmark_driver --iter 100 \
235- matmul -M 8192 -N 2048 -K 4096 --transA \
236- --a_type bf16 --b_type bf16 --out_type bf16
226+ matmul -M 8192 -N 2048 -K 4096 --transA --a_type bf16 --b_type bf16 --out_type bf16
237227```
238228
239- ** Example with Python benchmark wrapper:**
229+ Python wrapper:
240230``` shell
241- FUSILLI_COMPILE_BACKEND_USE_CLI=1 \
242- python benchmarks/run_benchmark.py \
231+ python benchmarks/run_benchmark.py \
243232 --Xiree-compile=" --iree-codegen-tuning-spec-path=/path/to/tuning_spec.mlir" \
244- -o results.csv \
245- -f commands.txt
233+ -f commands.txt -o results.csv
246234```
247235
248236### Sanitizers
@@ -361,7 +349,7 @@ Alternatively, one may call the logging API directly as needed:
361349
362350| Environment Variable | Description
363351| ---------------------------------------- | -----------
364- | ` FUSILLI_COMPILE_BACKEND_USE_CLI ` | Enables the use of the CLI tool to invoke compilation, otherwise uses CAPI
352+ | ` FUSILLI_COMPILE_BACKEND_USE_CLI ` | Enables the use of the CLI tool to invoke compilation instead of C API (for debugging purposes; default: use C API)
365353| ` FUSILLI_EXTERNAL_IREE_COMPILE ` | Path to ` iree-compile ` binary
366354| ` FUSILLI_EXTERNAL_IREE_COMPILER_LIB ` | Path to the IREE compiler dynamic library
367355| ` FUSILLI_EXTERNAL_ROCM_AGENT_ENUMERATOR ` | Path to ` rocm_agent_enumerator ` binary
0 commit comments