AdaptiveCpp / AdaptiveCpp/AdaptiveCpp
Low performance on PortBLAS vs DPC++
- 主要语言
- C++
- 星标
- 1.9k
- 派生
- 228
- 平均合并
- 4 天 1 小时
- 30 天内合并 PR
- 25
描述
Hi,
I've just built adaptivecpp on Nvidia GPU and then built PortBLAS. Compared the benchmarks to dpcpp.
```bash
git clone --recursive https://github.com/codeplaysoftware/portBLAS.git
cd portBLAS
mkdir build && cd build
```
Install dependencies for PortBLAS:
```bash
sudo apt install -y ninja-build libopenblas-dev
```
Build portBLAS with acpp:
```bash
export CC=clang-16
export CXX=acpp
export ACPP_TARGETS=generic
# select the right target
cmake -GNinja -DTUNING_TARGET=NVIDIA_GPU -DCMAKE_BUILD_TYPE=Release \
-DSYCL_COMPILER=adaptivecpp -DACPP_TARGETS=$ACPP_TARGETS \
-DBLAS_ENABLE_BENCHMARK=ON ..
ninja
```
To benchmark, I ran:
```bash
# For all GPUs
cat << EOF > params.csv
n,n,1024,1024,1024,1,0
n,n,2048,2048,2048,1,0
n,n,4096,4096,4096,1,0
EOF
./benchmark/portblas/bench_gemm --csv-param params.csv --benchmark_out=../results.json \
--benchmark_out_format=json --benchmark_format=console
```
This would yield following results:
```
[AdaptiveCpp Warning] from /home/sasank/code/AdaptiveCpp/src/runtime/ocl/ocl_hardware_manager.cpp:549 @ ocl_hardware_manager(): ocl_hardware_manager: Could not obtain platform list (error code = CL:-1001)
Device vendor: NVIDIA
Device name: NVIDIA GeForce GTX 1650 Ti
Device type: gpu
2024-03-25T16:44:54+05:30
Running ./benchmark/portblas/bench_gemm
Run on (12 X 3000 MHz CPU s)
CPU Caches:
L1 Data 32 KiB (x6)
L1 Instruction 32 KiB (x6)
L2 Unified 512 KiB (x6)
L3 Unified 4096 KiB (x2)
Load Average: 1.04, 2.62, 4.35
***WARNING*** CPU scaling is enabled, the benchmark real time measurements may be noisy and will incur extra overhead.
-------------------------------------------------------------------------------------------------------------
Benchmark Time CPU Iterations UserCounters...
-------------------------------------------------------------------------------------------------------------
BM_Gemm/n/n/1024/1024/1024/buffer/real_time 2667278 ns 2448435 ns 230 avg_event_time=2.47693M avg_overall_time=2.65955M batch_size=1 best_event_time=2.40205M best_overall_time=2.43685M be
ta=0 bytes_per_second=4.39352G/s bytes_processed=12.5829M items_per_second=805.515G/s k=1024 m=1024 n=1024 n_fl_ops=2.14853G total_event_time=569.694M total_overall_time=611.695M @backend=portBLAS,@datatype=floa
t,@library=portBLAS,device_name=NVIDIA GeForce GTX 1650 Ti,device_version=sm_75,driver_version=12030,git_hash=eff2458042246830fe35feec38c240a86a282d0a,git_hash_date=2024-03-04 13:40:34 +0000,vendor_name=NVIDIA
BM_Gemm/n/n/2048/2048/2048/buffer/real_time 20015802 ns 19772003 ns 35 avg_event_time=19.8115M avg_overall_time=20.0079M batch_size=1 best_event_time=19.6204M best_overall_time=19.7431M be
ta=0 bytes_per_second=2.3419G/s bytes_processed=50.3316M items_per_second=858.525G/s k=2.048k m=2.048k n=2.048k n_fl_ops=17.1841G total_event_time=693.404M total_overall_time=700.277M @backend=portBLAS,@datatype
=float,@library=portBLAS,device_name=NVIDIA GeForce GTX 1650 Ti,device_version=sm_75,driver_version=12030,git_hash=eff2458042246830fe35feec38c240a86a282d0a,git_hash_date=2024-03-04 13:40:34 +0000,vendor_name=NVI
DIA
BM_Gemm/n/n/4096/4096/4096/buffer/real_time 159947903 ns 159755614 ns 4 avg_event_time=159.796M avg_overall_time=159.937M batch_size=1 best_event_time=159.043M best_overall_time=159.211M be
ta=0 bytes_per_second=1.17226G/s bytes_processed=201.327M items_per_second=859.378G/s k=4.096k m=4.096k n=4.096k n_fl_ops=137.456G total_event_time=639.185M total_overall_time=639.749M @backend=portBLAS,@datatyp
e=float,@library=portBLAS,device_name=NVIDIA GeForce GTX 1650 Ti,device_version=sm_75,driver_version=12030,git_hash=eff2458042246830fe35feec38c240a86a282d0a,git_hash_date=2024-03-04 13:40:34 +0000,vendor_name=NV
IDIA
```
To summarize this:
```
test_name, gflops
BM_Gemm/n/n/1024/1024/1024/buffer/real_time 834 835
BM_Gemm/n/n/2048/2048/2048/buffer/real_time 863 863
BM_Gemm/n/n/4096/4096/4096/buffer/real_time 863 863
```
Data from my previous run with dpc++
```
test_name, gflops
BM_Gemm/n/n/1024/1024/1024/buffer/real_time 1284 1285
BM_Gemm/n/n/2048/2048/2048/buffer/real_time 2299 2300
BM_Gemm/n/n/4096/4096/4096/buffer/real_time 2475 2476
BM_Gemm/n/n/1024/1024/1024/usm/real_time 1281 1282
BM_Gemm/n/n/2048/2048/2048/usm/real_time 2295 2295
BM_Gemm/n/n/4096/4096/4096/usm/real_time 2413 2413
```
References: https://chsasank.com/portblas-portable-blas-across-gpus.html
贡献指南
评估
这个 Issue 还没有评估数据。