Skip to content

Commit 4957412

Browse files
authored
[tuner] Use __main__.py for punet tuner example (#173)
Issue: #160
1 parent be16338 commit 4957412

File tree

3 files changed

+15
-10
lines changed

3 files changed

+15
-10
lines changed

tuner/examples/punet/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,16 +31,16 @@ cp ./dump-mmt/module_main_0_dispatch_0_rocm_hsaco_fb_benchmark.mlir test-benchma
3131
### Recommended Trial Run
3232
For an initial trial to test the tuning loop, use:
3333
```shell
34-
python -m tuner.examples.punet.punet_autotune test-benchmark.mlir --num-candidates=10
34+
python -m tuner.examples.punet test-benchmark.mlir --num-candidates=10
3535
```
3636

3737
### Dry Run Test
3838
To perform a dry run (no GPU required), use:
3939
```shell
40-
python -m tuner.examples.punet.punet_autotune test-benchmark.mlir --num-candidates=64 --num-model-candidates=10 --dry-run
40+
python -m tuner.examples.punet test-benchmark.mlir --num-candidates=64 --num-model-candidates=10 --dry-run
4141
```
4242

4343
### Basic Usage
4444
```shell
45-
python -m tuner.examples.punet.punet_autotune test-benchmark.mlir
45+
python -m tuner.examples.punet test-benchmark.mlir
4646
```

tuner/examples/punet/__main__.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Copyright 2024 Advanced Micro Devices, Inc.
2+
#
3+
# Licensed under the Apache License v2.0 with LLVM Exceptions.
4+
# See https://llvm.org/LICENSE.txt for license information.
5+
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6+
7+
from . import punet_autotune
8+
9+
punet_autotune.main()

tuner/examples/punet/punet_autotune.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,17 @@
77
"""
88
Sample Usage:
99
10-
python -m tuner.examples.punet.punet_autotune benchmark.mlir --lhs-dims=bmk --rhs-dims=bkn --tile-dims=*mnk --devices=hip://0,hip://1 --num-candidates=64
10+
python -m tuner.examples.punet benchmark.mlir --lhs-dims=bmk --rhs-dims=bkn --tile-dims=*mnk --devices=hip://0,hip://1 --num-candidates=64
1111
1212
1313
Recommended Trial Run:
1414
15-
python -m tuner.examples.punet.punet_autotune benchmark.mlir --num-candidates=1
15+
python -m tuner.examples.punet benchmark.mlir --num-candidates=1
1616
1717
1818
Dry Run Test (no gpu requried):
1919
20-
python -m tuner.examples.punet.punet_autotune benchmark.mlir --num-candidates=64 --num-model-candidates=10 --dry-run
20+
python -m tuner.examples.punet benchmark.mlir --num-candidates=64 --num-model-candidates=10 --dry-run
2121
2222
"""
2323

@@ -185,7 +185,3 @@ def main():
185185
libtuner.logging.debug(candidate)
186186
if args.verbose:
187187
print(candidate)
188-
189-
190-
if __name__ == "__main__":
191-
main()

0 commit comments

Comments
 (0)