Skip to content

Commit

Permalink
[tuner] Reorganize tuner directories
Browse files Browse the repository at this point in the history
Add a subdirectory for the tuner library. This is so that examples
do not have to be executed from the repo root and risk polluting it with
temporary files.
  • Loading branch information
kuhar committed Oct 4, 2024
1 parent aaad376 commit 3017102
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 7 deletions.
5 changes: 5 additions & 0 deletions tuner/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.venv/

# Tuning artifacts
tuning_*/

7 changes: 4 additions & 3 deletions tuner/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@
## Prerequisites
[Optional] Using virtual environments:
```shell
cd tuning
cd tuner
python -m venv .venv
source .venv/bin/activate
```
Install python dependencies:
```shell
pip install -r ./requirements-tuner.txt
pip install -r requirements-tuner.txt
pip install -r requirements-dev.txt
```
Using the IREE's Python bindings:
- Building with CMake
Expand Down Expand Up @@ -53,7 +54,7 @@ cp dump-winograd/*_141_*benchmark.mlir ./141.mlir
6. Run the tuning script.
- Example:
```shell
python punet_autotune.py 141.mlir --devices=hip://GPU-0,hip://GPU-4 --num-candidates=1024
python -m examples.punet 141.mlir --devices=hip://GPU-0,hip://GPU-4 --num-candidates=1024
```

7. Check the winner candidate in `result_summary.log`, find and copy the transform spec.
Expand Down
8 changes: 4 additions & 4 deletions tuner/examples/punet/punet_autotune.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,21 @@
"""
Sample Usage:
python -m tuner.examples.punet benchmark.mlir --lhs-dims=bmk --rhs-dims=bkn --tile-dims=*mnk --devices=hip://0,hip://1 --num-candidates=64
python -m examples.punet benchmark.mlir --lhs-dims=bmk --rhs-dims=bkn --tile-dims=*mnk --devices=hip://0,hip://1 --num-candidates=64
Recommended Trial Run:
python -m tuner.examples.punet benchmark.mlir --num-candidates=1
python -m examples.punet benchmark.mlir --num-candidates=1
Dry Run Test (no gpu requried):
python -m tuner.examples.punet benchmark.mlir --num-candidates=64 --num-model-candidates=10 --dry-run
python -m examples.punet benchmark.mlir --num-candidates=64 --num-model-candidates=10 --dry-run
"""

from ... import libtuner
from tuner import libtuner
from pathlib import Path


Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 3017102

Please sign in to comment.