Исходный код СУБД RuDB — свободной СУБД с открытым исходным кодом на базе PostgreSQL
rudb
2 days ago bd039d1e92813358c5c5a1e346b49074baf513f2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
echo "Benchmark Scaled Dot Product Attention (SDPA) performance on GPU:"
 
set CUDA_VISIBLE_DEVICES=0
python benchmark_mha.py --use_gpu
python benchmark_mha.py --use_gpu --use_cuda_graph
python benchmark_mha.py --use_gpu --torch
 
echo "Benchmark performance on GPU without attention bias"
python benchmark_mha.py --use_gpu -b 16
 
echo "Benchmark performance on GPU with attention bias"
python benchmark_mha.py --use_gpu -b 16 -r 1000 --has_attn_bias
python benchmark_mha.py --use_gpu -b 16 -r 1000 --has_attn_bias --broadcast_attn_bias_dim_0
python benchmark_mha.py --use_gpu -b 16 -r 1000 --has_attn_bias --broadcast_attn_bias_dim_0 --broadcast_attn_bias_dim_1
 
type benchmark_mha_gpu_*.csv > mha_gpu_benchmark_results.csv
 
echo "Benchmark performance on CPU with number of threads:"
set MKL_DYNAMIC=FALSE
set OMP_NUM_THREADS=1
python benchmark_mha.py --torch
 
set OMP_NUM_THREADS=2
python benchmark_mha.py --torch
 
set OMP_NUM_THREADS=4
python benchmark_mha.py --torch
 
set OMP_NUM_THREADS=8
python benchmark_mha.py --torch
 
set MKL_DYNAMIC=
set OMP_NUM_THREADS=
 
set ORT_DISABLE_FLASH_ATTENTION=0
python benchmark_mha.py --intra_op_num_threads 1
python benchmark_mha.py --intra_op_num_threads 2
python benchmark_mha.py --intra_op_num_threads 4
python benchmark_mha.py --intra_op_num_threads 8
 
echo "Benchmark performance on CPU with default threads settings:"
python benchmark_mha.py
 
python benchmark_mha.py --torch
 
python benchmark_mha.py --causal
python benchmark_mha.py --torch --causal
 
python benchmark_mha.py --causal --has_past
 
set ORT_DISABLE_FLASH_ATTENTION=1
python benchmark_mha.py
set ORT_DISABLE_FLASH_ATTENTION=
 
type benchmark_mha_cpu_*.csv > mha_cpu_benchmark_results.csv