随机草图对GPU低精度舍入具有鲁棒性
On the Robustness of Sparse Randomized Sketching to FP16 Rounding on GPUs
AI总结:
研究随机草图在GPU低精度下的性能与精度,提出SparseStack改进CountSketch,发现FP16舍入方式对嵌入质量影响小,分布比量化更关键。
摘要:
随机草图是随机数值线性代数中的核心原语。在现代硬件架构上,特别是在GPU上,稀疏草图的性能受限于内存流量和原子累加,而非浮点吞吐量。这使得草图成为混合精度的自然目标,前提是低精度累加不会降低嵌入质量。我们研究了稀疏子空间嵌入的混合精度GPU实现,重点关注Higgins等人提出的GPU CountSketch内核的SparseStack泛化。SparseStack在相干输入上相对于CountSketch提高了嵌入质量,但其每列额外的非零元素增加了原子更新争用并降低了吞吐量。因此,我们实现了使用确定性舍入到最近、精确随机舍入和抖动舍入的FP16 SparseStack变体,并将它们与FP32 SparseStack、CountSketch、混合精度CountSketch和FlashSketch进行比较。我们的主要实证发现是,在测试的范围内,SparseStack嵌入质量对FP16舍入规则不敏感。确定性、随机和抖动舍入的FP16 SparseStack在不相干、相干和对抗性测试问题上产生几乎相同的子空间失真和草图求解最小二乘精度。主导精度因素是草图分布而非量化规则:SparseStack变体在相干输入上显著改善失真,而所有方法在不相干输入上表现相似。由于确定性舍入的开销最低,它在FP16 SparseStack变体中提供了最佳的性能-精度权衡。
英文摘要:
Randomized sketching replaces large matrices with smaller surrogates that preserve geometry for downstream numerical linear algebra. Sparse sketches promise faster formation than dense projections, but irregular GPU atomic updates become costly when each input row contributes to several output rows, as in SparseStack. FP16 accumulation halves sketch storage and update traffic, relieving cache pressure. How much does this rounding affect sketch geometry and downstream accuracy? For SparseStack with four nonzeros per column, cuSPARSE's FP16 path is slower than its FP32 baseline. Our custom kernel instead pairs FP32 inputs and signed products with packed FP16 vector atomic accumulation, turning lower precision into substantial gains. On NVIDIA H200, it forms complete sketches up to $1.91\times$ faster than our FP32 baseline and up to $1.58\times$ faster than cuSPARSE FP32. Under stated independence and range assumptions, random sketch signs cancel round-to-nearest conversion-error cross terms, giving expected squared Frobenius error no greater than ideal stochastic rounding. We assess accumulation empirically. At a sketch dimension of twice the number of input columns, the least-squares pipeline is $1.44$-$1.47\times$ faster than FP32, with median paired residual increases below $0.4\%$. Rescaling exposes range limitations and cases where stochastic conversion degrades accuracy.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。