arXiv:2601.13994cs.DCcs.AI2026-01被引 2

为PyTorch补齐了可微稀疏线性代数能力,支持多设备、多后端高效求解。

torch-sla: Differentiable Sparse Linear Algebra with Adjoint Solvers and Sparse Tensor Parallelism for PyTorch

  • 统一自动微分接口,自动按设备和问题规模切换求解器后端。
  • 支持批量求解与共享/独立稀疏模式,可在多GPU间分布式执行。
  • 采用O(1)图反向传播框架,实现稀疏矩阵求解的高效可微计算。

可微稀疏线性代数是科学机器学习的基础,但PyTorch缺乏统一库:torch.sparse仅提供底层内核,且spsolve非可微、仅限CPU;torch.linalg则仅支持稠密运算。本文提出torch-sla,一个开源库,填补此空白。它通过单一自动微分感知接口,支持直接、迭代、非线性及特征值求解器,兼容五种后端——CPU上的SciPy与Eigen,GPU上的cuDSS、CuPy及原生PyTorch迭代求解器——并根据设备与问题规模自动调度。支持基于共享或独立稀疏模式的批量求解,以及通过域分解与环带交换实现的多GPU分布式执行。其可扩展性得益于O(1)图反向传播框架与自动微分兼容的分布式环带交换层。项目地址:https://www.torchsla.com/。

原文摘要 · Abstract (English)

Differentiable sparse linear algebra is foundational for scientific machine learning, yet PyTorch lacks a unified library for it: torch.sparse provides only low-level kernels and a non-differentiable, CPU-only spsolve, and torch.linalg is dense-only. We present torch-sla, an open-source library that fills this gap. It exposes a single autograd-aware API for direct, iterative, nonlinear, and eigenvalue solvers across five interchangeable backends -- SciPy and Eigen on CPU, cuDSS, CuPy, and a PyTorch-native iterative solver on GPU -- with automatic dispatch by device and problem size. The library further supports batched solves over shared or distinct sparsity patterns and distributed multi-GPU execution via domain decomposition with halo exchange. These capabilities are made scalable by an O(1)-graph adjoint differentiation framework and an autograd-compatible distributed halo-exchange layer. The library is available at https://www.torchsla.com/.

稀疏计算可微分PyTorch分布式

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。