# From KTIR to SpyreCode: An MLIR Dataflow Backend for IBM Spyre

DevFeed: [From KTIR to SpyreCode: An MLIR Dataflow Backend for IBM Spyre](<https://devfeed.tech/articles/from-ktir-to-spyrecode-an-mlir-dataflow-backend-for-ibm-spyre-91072.md>)

Original publisher: [Read original article](<https://pytorch.org/blog/from-ktir-to-spyrecode-an-mlir-dataflow-backend-for-ibm-spyre/>)

Author: Swagath Venkataramani, Bardia Mahjour, Prasanth Chatarasi, Alberto Mannari, Viji Srinivasan, and the IBM Spyre Team

Published: 2026-10-20T16:00:15Z

Content type: article

Language: en

Sources: [PyTorch](<https://devfeed.tech/sources/blog-pytorch.md>)

Topics: [mlir](<https://devfeed.tech/topics/mlir.md>), [PyTorch](<https://devfeed.tech/topics/pytorch.md>), [dma](<https://devfeed.tech/topics/dma.md>), [vectorization techniques](<https://devfeed.tech/topics/vectorization-techniques.md>), [ibm](<https://devfeed.tech/topics/ibm.md>)

Tags: [2](<https://devfeed.tech/tags/2.md>), [3](<https://devfeed.tech/tags/3.md>), [about](<https://devfeed.tech/tags/about.md>), [abstract](<https://devfeed.tech/tags/abstract.md>), [abstraction](<https://devfeed.tech/tags/abstraction.md>), [account](<https://devfeed.tech/tags/account.md>), [activation](<https://devfeed.tech/tags/activation.md>), [backend](<https://devfeed.tech/tags/backend.md>), [blog](<https://devfeed.tech/tags/blog.md>), [chip](<https://devfeed.tech/tags/chip.md>), [compiler](<https://devfeed.tech/tags/compiler.md>), [dataflow](<https://devfeed.tech/tags/dataflow.md>), [first](<https://devfeed.tech/tags/first.md>), [ibm](<https://devfeed.tech/tags/ibm.md>), [kernel](<https://devfeed.tech/tags/kernel.md>), [memory](<https://devfeed.tech/tags/memory.md>), [mlir](<https://devfeed.tech/tags/mlir.md>), [post](<https://devfeed.tech/tags/post.md>), [pytorch](<https://devfeed.tech/tags/pytorch.md>), [torch](<https://devfeed.tech/tags/torch.md>), [work](<https://devfeed.tech/tags/work.md>)

## AI overview

KTIR carries Inductor's core assignments, tensor placement and scratchpad residency into the Spyre backend, where an open-source MLIR Dataflow Scheduler turns each compute group into a hardware-ready pipeline. Guided by an architecture description, it routes transfers through available memories and engines, nests tile and vector pipelines, and adds buffering and parallelism before emitting DataflowIR. Device-specific stages convert that representation into SpyreCode with symbolic tensor addresses and shapes; the runtime prepares its binary once and resolves symbols at launch. Version 1 supports elementwise operations, broadcasts and reductions across multi-core programs; the post says it was validated on representative transformer operations. Its scheduling choices use local heuristics, with cost-model optimization and matrix multiplication support described as future work.

## Source excerpt

TL;DR Torch-spyre's Inductor decides how each kernel's work is divided across Spyre's cores and manages tensor residency between on-chip scratchpad and off-chip memory, and the backend compiler turns those decisions... The post From KTIR to SpyreCode: An MLIR Dataflow Backend for IBM Spyre appeared first on PyTorch.