SoftDTW-CUDA-Torch:面向PyTorch的内存高效GPU加速软动态时间规整
SoftDTW-CUDA-Torch: Memory-Efficient GPU-Accelerated Soft Dynamic Time Warping for PyTorch
AI总结:
SoftDTW-CUDA-Torch通过GPU加速实现高效的软动态时间规整,解决内存消耗和数值稳定性问题,支持任意序列长度和PyTorch自动求导。
摘要:
我们提出了softdtw-cuda-torch,这是一个用于在GPU上计算软动态时间规整(SoftDTW)的开源PyTorch库。我们的实现解决了现有GPU实现SoftDTW的三个关键限制:序列长度上限为1024的硬性限制、小平滑参数在反向传递中的数值不稳定性,以及从配对距离张量中生成导致GPU内存消耗过大的问题。我们引入了(1)分块反向对角线内核执行以去除序列长度限制,(2)对数空间反向传递以防止浮点溢出,以及(3)融合距离计算模式以消除O(BN M)的中间距离张量,相比先前工作实现了高达98%的内存减少。该库支持任意序列长度,完整的PyTorch自动求导集成,以及Soft-DTW重心计算。代码可在https://github.com/BGU-CS-VIL/sdtw-cuda-torch获取。
英文摘要:
We present softdtw-cuda-torch, an open-source PyTorch library for computing Soft Dynamic Time Warping (SoftDTW) on GPUs. Our implementation addresses three key limitations of existing GPU implementations of SoftDTW: a hard sequence-length cap of 1024, numerical instability in the backward pass for small smoothing parameters, and excessive GPU memory consumption from materializing pairwise distance tensors. We introduce (1) tiled anti-diagonal kernel execution that removes the sequence-length constraint, (2) a log-space back-ward pass that prevents floating-point overflow, and (3) a fused distance-computation mode that eliminates the O(BN M ) intermediate distance tensor, achieving up to 98% memory reduction compared to prior work. The library supports arbitrary sequence lengths, full PyTorch autograd integration, and Soft-DTW Barycenter computation. Code is available at https://github.com/BGU-CS-VIL/sdtw-cuda-torch.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。