General sparse matrix-matrix multiplication (SpGEMM) is a fundamental building block for numerous applications such as algebraic multigrid method (AMG), breadth first search and shortest path problem. Compared to other sparse BLAS routines, an efficient parallel SpGEMM implementation has to handle extra irregularity from three aspects: (1) the number of nonzero entries in the resulting sparse matrix is unknown in advance, (2) very expensive parallel insert operations at random positions in the resulting sparse matrix dominate the execution time, and (3) load balancing must account for sparse data in both input matrices.
In this work we propose a framework for SpGEMM on GPUs and emerging CPU-GPU heterogeneous processors. This framework particularly focuses on the above three problems. Memory pre-allocation for the resulting matrix is organized by a hybrid method that saves a large amount of global memory space and efficiently utilizes the very limited on-chip scratchpad memory. Parallel insert operations of the nonzero entries are implemented through the GPU merge path algorithm that is experimentally found to be the fastest GPU merge approach. Load balancing builds on the number of necessary arithmetic operations on the nonzero entries and is guaranteed in all stages.
Compared with the state-of-the-art CPU and GPU SpGEMM methods, our approach delivers excellent absolute performance and relative speedups on various benchmarks multiplying matrices with diverse sparsity structures. Furthermore, on heterogeneous processors, our SpGEMM approach achieves higher throughput by using re-allocatable shared virtual memory.
The source code of this work is available at https://github.com/bhSPARSE/Benchmark_SpGEMM_using_CSR
Performance Engineering for Real and Complex Tall & Skinny Matrix Multiplication Kernels on GPUs
在供应商提供的BLAS库中,具有双精度实数和复数项(DGEMM和ZGEMM)的一般矩阵-矩阵乘法最适合于方形矩阵,但对于高而宽的高而瘦的矩阵,性能往往很差。NVIDIA目前的CUBLAS实现仅提供了屋顶模型所示潜在性能的一小部分。我们描述的挑战和关键特征的实施,可以实现接近最佳性能。我们进一步评估不同的策略的并行化和线程分布,并设计一个灵活的,可配置的映射方案。为了确保灵活性并允许高度定制的实现,我们将代码生成与自动调优相结合。对于感兴趣领域中的大范围矩阵大小,我们实现了至少2/3的屋顶性能,并且在NVIDIA Volta GPGPU上的性能通常远远超过最先进的CUBLAS结果。
Energy efficiency of finite difference algorithms on multicore CPUs, GPUs, and Intel Xeon Phi processors
除了在高性能计算系统中常见的硬件空闲时间限制之外,未来的系统可能还将受到能量预算的限制。在目前的工作中,不同的计算和内存强度的有限差分算法的能源效率和运行时间的英特尔常春藤桥CPU节点,英特尔至强融核骑士登陆处理器,和NVIDIA特斯拉K40 c GPU进行评估。传统的方式存储的离散衍生物的解决方案的进步全球阵列被发现是低效的能源消耗和运行时间。相比之下,一类算法,其中离散化的衍生物进行评估的飞行或存储为线程/进程的本地变量(产生高计算强度)是最佳的能源消耗和运行时间。在考虑的所有三个硬件架构上,与存储器密集型算法相比,观察到高计算密集型算法的~2的加速和~2的节能。的能量消耗被发现是成比例的运行时间,无论消耗的功率和GPU相比,CPU节点上的相同的算法具有约5的节能。
Adaptive SpMV/SpMSpV on GPUs for Input Vectors of Varied Sparsity
尽管在现代硬件架构上进行了大量的工作来优化稀疏矩阵和向量乘法(SpMV)的性能,但很少对其稀疏对应物稀疏矩阵和稀疏向量乘法(SpMSpV)进行工作,更不用说处理不同稀疏度的输入向量了。关键的挑战是,根据稀疏性级别、数据分布和计算平台,SpMV/SpMSpV内核的最佳选择可能会有所不同,静态选择是不够的。在本文中,我们提出了一个自适应的SpMV/SpMSpV框架,它可以自动选择合适的SpMV/SpMSpV内核的GPU上的任何稀疏矩阵和向量在运行时。在系统分析计算模式、负载分配和回写策略等关键因素的基础上,将8个候选SpMV/SpMSpV内核封装到框架中,实现了高性能的无缝集成。从精度和开销两个方面对基于机器学习的核选择器进行了全面的研究,以选择核并适应输入和硬件的变化。实验表明,自适应框架在NVIDIA Tesla K40 m、P100和V100 GPU上的实际应用中的性能大大超过了之前的最先进水平。
Implementing Strassen's Algorithm with CUTLASS on NVIDIA Volta GPUs
Strassen算法的传统GPU实现(Strassen)通常依赖于现有的高性能矩阵乘法(GEMM),以空间换取时间。因此,这种方法只能实现实际的加速相对较大的,“平方”矩阵由于额外的内存开销,其使用是有限的,由于相当大的工作空间。我们提出了新的Strassen图元的GPU,可以组成生成一个家庭的Strassen算法。我们的算法利用GPU上的内存和线程层次结构,重用从GEMM继承的共享内存和寄存器文件,融合额外的操作,并避免额外的工作空间。我们进一步利用内核内和内核间的并行性,流,并采用原子操作。我们还为NVIDIA Volta GPU开发了一个性能模型,以选择适当的阻塞参数并预测GEMM和Strassen的性能。总体而言,我们的1级Strassen可以实现高达1.11倍的加速比,交叉点小至1,536,而NVIDIA Tesla V100 GPU上的cublasSgemm。通过额外的工作空间,我们的2级Strassen可以实现1.19倍的加速比,交叉点为7,680。