-
Notifications
You must be signed in to change notification settings - Fork 162
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
93 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#!/bin/bash | ||
ncu_dir="/home/sosp/env/spack/opt/spack/linux-ubuntu22.04-zen2/gcc-11.4.0/cuda-12.4.0-ypujjdfaen2zwiplopzke4ud33wddscv/bin" | ||
|
||
root_dir=$(pwd) | ||
log_dir="$root_dir/logs" | ||
exe_path="cutlass/build/examples/41_fused_multi_head_attention/41_fused_multi_head_attention_fixed_seqlen" | ||
|
||
nheads=8 | ||
batch_size=32 | ||
head_size=128 | ||
length=1024 | ||
|
||
if [ ! -f cutlass_attn ]; then | ||
ln -s $exe_path cutlass_attn | ||
fi | ||
|
||
# 1. ncu test the mha benchmark | ||
echo "NCU profiling mha benchmark" | ||
$ncu_dir/ncu --section "MemoryWorkloadAnalysis" \ | ||
--csv --set full cutlass_attn --nheads="$nheads" \ | ||
--batch_size=$batch_size \ | ||
--head_size=$head_size \ | ||
--head_size_v=$head_size \ | ||
--seq_length="$length" \ | ||
--seq_length_kv=$length \ | ||
--causal=false > $log_dir/cutlass_attention_ncu.csv |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/bin/bash | ||
ncu_dir="/home/sosp/env/spack/opt/spack/linux-ubuntu22.04-zen2/gcc-11.4.0/cuda-12.4.0-ypujjdfaen2zwiplopzke4ud33wddscv/bin" | ||
|
||
root_dir=$(pwd) | ||
log_dir="$root_dir/logs" | ||
benchmark_dir="FractalTensor/benchmarks" | ||
mha_dir="$benchmark_dir/multi-head_attention/baseline" | ||
|
||
# 1. ncu test the mha benchmark | ||
echo "NCU profiling mha benchmark" | ||
$ncu_dir/ncu --section "MemoryWorkloadAnalysis" \ | ||
--csv --set full python3 $stack_rnn_path/$mha_dir/test_pt_model.py > $log_dir/flash2_attention_ncu.csv | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/bin/bash | ||
ncu_dir="/home/sosp/env/spack/opt/spack/linux-ubuntu22.04-zen2/gcc-11.4.0/cuda-12.4.0-ypujjdfaen2zwiplopzke4ud33wddscv/bin" | ||
|
||
root_dir=$(pwd) | ||
log_dir="$root_dir/logs" | ||
benchmark_dir="FractalTensor/benchmarks" | ||
|
||
# 1. ncu test the mha benchmark | ||
echo "NCU profiling mha benchmark" | ||
mha_dir="$benchmark_dir/multi-head_attention/fractaltensor/build" | ||
mha_exe="$mha_dir/main" | ||
$ncu_dir/ncu --section "MemoryWorkloadAnalysis" \ | ||
--csv --set full $mha_exe > $log_dir/ft_attention_ncu.csv | ||
|
||
# 2. ncu test the bigbird benchmark | ||
bigbird_dir="$benchmark_dir/blocked_sparse_attention/fractaltensor/build" | ||
echo "NCU profiling BigBird benchmark" | ||
$ncu_dir/ncu --section "MemoryWorkloadAnalysis" \ | ||
--csv --set full $bigbird_dir/bigbird > $log_dir/ft_bigbird_ncu.csv |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/bin/bash | ||
ncu_dir="/home/sosp/env/spack/opt/spack/linux-ubuntu22.04-zen2/gcc-11.4.0/cuda-12.4.0-ypujjdfaen2zwiplopzke4ud33wddscv/bin" | ||
|
||
root_dir=$(pwd) | ||
log_dir="$root_dir/logs" | ||
benchmark_dir="FractalTensor/benchmarks" | ||
mha_dir="$benchmark_dir/multi-head_attention/baseline" | ||
|
||
bigbird_dir="$benchmark_dir/blocked_sparse_attention/pytorch" | ||
|
||
# 2. ncu test the bigbird benchmark | ||
echo "NCU profiling BigBird benchmark" | ||
$ncu_dir/ncu --section "MemoryWorkloadAnalysis" \ | ||
--csv --set full python3 $bigbird_dir/main.py > $log_dir/pt_bigbird_ncu.csv | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#!/bin/bash | ||
ncu_dir="/home/sosp/env/spack/opt/spack/linux-ubuntu22.04-zen2/gcc-11.4.0/cuda-12.4.0-ypujjdfaen2zwiplopzke4ud33wddscv/bin" | ||
|
||
root_dir=$(pwd) | ||
log_dir="$root_dir/logs" | ||
benchmark_dir="FractalTensor/benchmarks" | ||
mha_dir="$benchmark_dir/multi-head_attention/baseline" | ||
|
||
# 1. ncu test the mha benchmark | ||
echo "NCU profiling mha benchmark" | ||
$ncu_dir/ncu --section "MemoryWorkloadAnalysis" \ | ||
--csv --set full python3 $stack_rnn_path/$mha_dir/test_triton_model.py > $log_dir/triton_attention_ncu.csv | ||
|
||
|
||
bigbird_dir="$benchmark_dir/blocked_sparse_attention/triton" | ||
# 2. ncu test the bigbird benchmark | ||
echo "NCU profiling BigBird benchmark" | ||
$ncu_dir/ncu --section "MemoryWorkloadAnalysis" \ | ||
--csv --set full python3 $bigbird_dir/main.py \ | ||
--default_test > $log_dir/triton_bigbird_ncu.csv |