TVM 행렬 곱셈 최적화 - Step 7: cuBLAS Comparison

less than 1 minute read

Published:

Step 7: cuBLAS Comparison

결과

전체 비교 (평균)

구현성능cuBLAS 대비
NumPy (CPU)13 GFLOPS0.6%
TVM Step 61053 GFLOPS50.7%
cuBLAS (NVIDIA)2074 GFLOPS100%

크기별 상세

크기TVM Step 6cuBLASTVM/cuBLAS
512x5121115 GFLOPS1302 GFLOPS85.6%
1024x1024990 GFLOPS2846 GFLOPS34.8%

분석

TVM Step 6의 성능 특성

512x512 크기에서 85.6% 달성:

  • 작은 행렬 크기에서는 TVM의 최적화 기법이 효과적으로 작동
  • Tiling, Shared Memory, Software Pipelining이 잘 맞음

1024x1024 크기에서 34.8%:

  • 큰 행렬에서는 cuBLAS의 고급 최적화 기법이 더 효과적
  • cuBLAS는 Tensor Core 활용 등 추가 최적화 포함

실행

# cuBLAS 벤치마크
python benchmarks/cublas_baseline.py

# TVM vs cuBLAS 비교
python benchmarks/compare_all_with_cublas.py

코드는 https://github.com/kimm240/matrix-multiplication-optimization-with-tvm에서 찾아볼 수 있습니다.


시리즈 포스트

Language: English