How PyTorch Inductor Turns Spyre Kernels into Executable Dataflows

News PyTorch Blog · Source account, not independently verified by us.

PyTorch explains how its backend for IBM’s Spyre accelerator turns Inductor’s chosen division of work into an executable program. A new open-source dataflow scheduler processes KTIR, an MLIR-based intermediate representation, and produces dataflow schedules for Spyre. The post describes a key link between the PyTorch compiler and accelerator hardware.

KTIR records which compute tile handles which data and where that data resides. The backend scheduler is designed to preserve this mapping rather than work it out again. It divides kernels into programs and progressively refines a basic load, compute, and store pipeline into a nested, double-buffered schedule. The transformations are expressed as readable MLIR rewrites. DataflowIR marks the boundary to the subsequent device-specific lowering stages.

The hardware abstraction reflects Spyre’s 32 cores connected in a ring, each with 2 MB of local scratchpad, alongside off-chip memory. Transfers between device memory and scratchpads use 128-byte chunks. KTIR can also represent distributed tensors, access across multiple memory regions, and Spyre-specific operations. According to the post, addresses and some runtime dimensions remain symbolic until the runtime supplies them at launch. The scheduler and dialects are available under Apache-2.0; this post is the middle chapter of a three-part series.

Original post at PyTorch

🇬🇧 https://pytorch.org/blog/from-ktir-to-spyrecode-an-mlir-dataflow-backend-for-ibm-spyre

Leave a Comment

The weekly brief: selected developments, projects and videos