Skip to content

Commit

Permalink
[tuner] Use __main__.py for punet tuner example
Browse files Browse the repository at this point in the history
  • Loading branch information
kuhar committed Sep 6, 2024
1 parent be16338 commit cf0daf7
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 10 deletions.
6 changes: 3 additions & 3 deletions tuner/examples/punet/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,16 @@ cp ./dump-mmt/module_main_0_dispatch_0_rocm_hsaco_fb_benchmark.mlir test-benchma
### Recommended Trial Run
For an initial trial to test the tuning loop, use:
```shell
python -m tuner.examples.punet.punet_autotune test-benchmark.mlir --num-candidates=10
python -m tuner.examples.punet test-benchmark.mlir --num-candidates=10
```

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

### Basic Usage
```shell
python -m tuner.examples.punet.punet_autotune test-benchmark.mlir
python -m tuner.examples.punet test-benchmark.mlir
```
9 changes: 9 additions & 0 deletions tuner/examples/punet/__main__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Copyright 2024 Advanced Micro Devices, Inc.
#
# Licensed under the Apache License v2.0 with LLVM Exceptions.
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

from . import punet_autotune

punet_autotune.main()
10 changes: 3 additions & 7 deletions tuner/examples/punet/punet_autotune.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@
"""
Sample Usage:
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
python -m tuner.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.punet_autotune benchmark.mlir --num-candidates=1
python -m tuner.examples.punet benchmark.mlir --num-candidates=1
Dry Run Test (no gpu requried):
python -m tuner.examples.punet.punet_autotune benchmark.mlir --num-candidates=64 --num-model-candidates=10 --dry-run
python -m tuner.examples.punet benchmark.mlir --num-candidates=64 --num-model-candidates=10 --dry-run
"""

Expand Down Expand Up @@ -185,7 +185,3 @@ def main():
libtuner.logging.debug(candidate)
if args.verbose:
print(candidate)


if __name__ == "__main__":
main()

0 comments on commit cf0daf7

Please sign in to comment.