Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DO NOT MERGE] Run perf optim on 6.3 release branch #881

Draft
wants to merge 1 commit into
base: release/rocm-rel-6.3
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
* @jzuniga-amd @tfalders @cgmb @qjojo @EdDAzevedo @jmachado-amd
* @jzuniga-amd @tfalders @cgmb @qjojo @EdDAzevedo @jmachado-amd @AGonzales-amd
# Documentation files
docs/* @ROCm/rocm-documentation @jzuniga-amd @tfalders @cgmb @qjojo @EdDAzevedo @jmachado-amd
*.md @ROCm/rocm-documentation @jzuniga-amd @tfalders @cgmb @qjojo @EdDAzevedo @jmachado-amd
*.rst @ROCm/rocm-documentation @jzuniga-amd @tfalders @cgmb @qjojo @EdDAzevedo @jmachado-amd
docs/* @ROCm/rocm-documentation @jzuniga-amd @tfalders @cgmb @qjojo @EdDAzevedo @jmachado-amd @AGonzales-amd
*.md @ROCm/rocm-documentation @jzuniga-amd @tfalders @cgmb @qjojo @EdDAzevedo @jmachado-amd @AGonzales-amd
*.rst @ROCm/rocm-documentation @jzuniga-amd @tfalders @cgmb @qjojo @EdDAzevedo @jmachado-amd @AGonzales-amd
# Header directory for Doxygen documentation
library/include/* @ROCm/rocm-documentation @jzuniga-amd @tfalders @cgmb @qjojo @EdDAzevedo @jmachado-amd
library/include/* @ROCm/rocm-documentation @jzuniga-amd @tfalders @cgmb @qjojo @EdDAzevedo @jmachado-amd @AGonzales-amd
55 changes: 55 additions & 0 deletions scripts/perf/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# rocSOLVER Performance Scripts

`rocSOLVER/scripts/perf` includes scripts to benchmark rocSOLVER functions and collects the results for analysis and display.

## Building rocSOLVER for Benchmarking

To prepare rocSOLVER for benchmarking, follow the instructions from [rocSOLVER API documentation](https://rocm.docs.amd.com/projects/rocSOLVER/en/latest/installation/installlinux.html#install-linux) to build and install the library and its clients.

## Benchmarking rocSOLVER with `perfoptim-suite`

The `perfoptim-suite` script executes the specified rocSOLVER functions, precision, and size cases. The results are written to csv files which are saved in the `rocsolver_customer01_benchmarks` directory.

Calling the script without any arguments
```
./perfoptim-suite
```
runs the default configuration which executes all available functions with real double precision and all the size cases.

Options can be passed to the script as arguments to modify its behaviour. The available options are:
```
benchmark to run
valid options are: (default will run all of them)
syevd -> eigensolver D&C + QR algorithm (heevd in complex precision)
syevdx -> eigensolver D&C + bisection (heevdx in complex precision)
syevj -> eigensolver Jacobi (heevj in complex precision)
syevjBatch -> eigensolver Jacobi batch version (heevjBatch in complex precision)
gesvd -> SVD QR algorithm
gesvdj -> SVD Jacobi
gesvdjBatch -> SVD Jacobi batch version
potrf -> Cholesky factorization
potrfBatch -> Cholesky factorization batch version
geqrf -> Orthogonal factorization
(note: several can be selected)

precisions to use
valid options are: (default is d)
s -> real single precision
d -> real double precision
c -> complex single precision
z -> complex double precision
(note: several can be selected)

size cases to run
valid options are: (default is large)
small -> see definitions in rocsolver-perfoptim-suite.py for included size values
medium -> see definitions in rocsolver-perfoptim-suite.py for included size values
large -> see definitions in rocsolver-perfoptim-suite.py for included size values
(note: select only one as small is a sub-set of medium which is a sub-set of large)
```

For example, benchmarking `geqrf` with real single and real double precisions on the medium and small size cases would look like this:
```
./perfoptim-suite geqrf s d medium
```
After completion, the results of the benchmark will have been written to `rocsolver_customer01_benchmarks/sgeqrf_benchmarks.csv` and `rocsolver_customer01_benchmarks/dgeqrf_benchmarks.csv` for the real single precision case and the real double precision case, respectively.
131 changes: 131 additions & 0 deletions scripts/perf/perfoptim-suite
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
#!/usr/bin/env bash
# Copyright (C) 2022-2024 Advanced Micro Devices, Inc.

#set -eux

# benchmarks to run
# valid options are: (default will run all of them)
# syevd -> eigensolver D&C + QR algorithm (heevd in complex precision)
# syevdx -> eigensolver D&C + bisection (heevdx in complex precision)
# syevj -> eigensolver Jacobi (heevj in complex precision)
# syevjBatch -> eigensolver Jacobi batch version (heevjBatch in complex precision)
# gesvd -> SVD QR algorithm
# gesvdj -> SVD Jacobi
# gesvdjBatch -> SVD Jacobi batch version
# potrf -> Cholesky factorization
# potrfBatch -> Cholesky factorization batch version
# geqrf -> Orthogonal factorization
# (note: several can be selected)
Slist="syevd syevdx syevj syevjBatch gesvd gesvdj gesvdjBatch potrf potrfBatch geqrf"

# precisions to use
# valid options are: (default is d)
# s -> real single precision
# d -> real double precision
# c -> complex single precision
# z -> complex double precision
# (note: several can be selected)
Plist="s d c z"

# size cases to run:
# valid options are: (default is large)
# small -> see definitions in rocsolver-perfoptim-suite.py for included size values
# medium -> see definitions in rocsolver-perfoptim-suite.py for included size values
# large -> see definitions in rocsolver-perfoptim-suite.py for included size values
# (note: select only one as small is a sub-set of medium which is a sub-set of large)
Clist="small medium large"


# Get and validate input arguments:
error=true
havecase=false
suite=""
precision=""
case=""

if [ $# == 0 ]; then
error=false
suite=$Slist
precision="d"
case="large"
else
args=$@
for a in $args; do
for s in $Slist; do
if [ $a == $s ]; then
new=true
error=false
for ss in $suite; do
if [ $a == $ss ]; then
new=false
break
fi
done
if $new; then
suite+="$s "
fi
break
fi
done
for p in $Plist; do
if [ $a == $p ]; then
new=true
error=false
for pp in $precision; do
if [ $a == $pp ]; then
new=false
break
fi
done
if $new; then
precision+="$p "
fi
break
fi
done
for c in $Clist; do
if [ $a == $c ]; then
if $havecase; then
error=true
else
error=false
havecase=true
case+="$c "
fi
break
fi
done
done
fi

if $error; then
echo "Incorrect arguments..."
exit 1
fi
if [ -z "$suite" ]; then
suite=$Slist
fi
if [ -z "$precision" ]; then
precision="d"
fi
if [ -z "$case" ]; then
case="large"
fi


# ensure this script is in the cwd
cd "$(dirname "${BASH_SOURCE[0]}")"

# setup output directory
output_dir=rocsolver_customer01_benchmarks
mkdir -p "$output_dir"

# run benchmarks
for s in $suite; do
for p in $precision; do
for c in $case; do
python3 rocsolver-perfoptim-suite.py -v -o "$output_dir/$p${s}_benchmarks.csv" $s $p $c
done
done
done

Loading