IBM Spyre 成为 PyTorch 原生设备
IBM 的 torch-spyre 团队在 PyTorch 博客发文,介绍如何把面向推理的 Spyre 数据流 AI 加速器接入 PyTorch 的设备体系:用 PrivateUse1 注册名为 spyre 的设备身份,并把分配器、流、事件和 Inductor 编译路径逐一映射到 Spyre 运行时的约束上。文章称,以类型化操作的有序队列取代运行时的图结构后,eager 与编译执行共用一条路径,可以降低启动开销,并让张量真正常驻在 device="spyre" 上。Spyre 定位于在 IBM Z、LinuxONE 和 Power 系统上运行的企业推理工作负载,原文未提供性能或基准数据,且末尾内容有截断。
它展示了把新型数据流加速器接入 PyTorch 标准抽象的一种做法,对评估非 GPU 推理硬件的团队有参考价值。
TL;DR
Spyre becomes a native PyTorch device by connecting PyTorch’s existing device, allocator, stream, and compiler abstractions through torch-spyre to the Spyre runtime and firmware. PrivateUse1 gives Spyre a real device identity, PyTorch allocator storage keeps tensors resident on device="spyre", streams provide familiar ordering semantics, and runtime events connect dependent work across streams. FX graphs stay in the Inductor compiler path. This post focuses on the PyTorch-to-Spyre device/runtime integration: how device identity, allocator-backed storage, streams, events, and compiled-program launch map onto Spyre’s runtime constraints. Once a compiled artifact exists, launch is a prepared recipe of typed operations over ordered queues rather than a graph-based runtime interface. The result is one path for eager and compiled execution, lower launch overhead, and a PyTorch surface that maps cleanly onto Spyre’s hardware.
Spyre is IBM’s dataflow AI accelerator, optimized for inference. It is designed for enterprise teams running AI alongside their applications and data on IBM Z, LinuxONE, and Power systems. Its reduced-precision compute is well suited to the matrix-heavy work in language generation and embedding models.
For developers, the challenge is using that hardware through familiar PyTorch code while keeping up with new models and inference techniques. Efficient execution needs more than a compiler: tensors must be able to stay on the device between operations, launches need to be lightweight, and host work and data transfers should overlap computation wherever dependencies allow. This post explains how IBM’s torch-spyre team builds on the PyTorch community’s interfaces to support those workflows on a dataflow accelerator.
#IBM#Spyre#torch-spyre#PyTorch#Inductor#torch.compile#PrivateUse1#IBM Z#LinuxONE#Power