arXiv:2610.02658cs.DCOct 2026

Manuscript Offprint

arXiv:2610.02658

Annotation-Driven Migration of CUDA Programs to Tenstorrent Blackhole

Ayumi Ohno, Shinya Takamaeda-Yamazaki

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Ayumi Ohno

The University of Tokyo, Tokyo, Japan

ayumi0130ohno@is.s.u-tokyo.ac.jp

Shinya Takamaeda-Yamazaki

The University of Tokyo and RIKEN, Tokyo, Japan

shinya@is.s.u-tokyo.ac.jp

Abstract—Tenstorrent Blackhole combines distributed local memories, explicit inter-core communication, and Tensix cores decoupling data movement from computation. CUDA offers a substantial HPC software base but leaves physical data placement and scheduling largely implicit. Migrating CUDA HPC kernels to Blackhole requires spatial mapping across cores and per-core coordination of compute and data-movement kernels. We present an MLIR-based compiler deriving data placement, inter-core communication, and tile computation from a statically shaped affine CUDA subset. Declarative annotations express choices not fixed by the source, including compute/DM operation placement and streaming granularity. We evaluate it on Gaussian elimination, five-point stencil, and symmetric rank-k update. Relative to our compiler's default realizations, the best measured configurations achieve a 4.2×4.2\times speedup for BF16 Gaussian and 2.1−2.2×2.1-2.2\times for FP32 Gaussian and Jacobi. A choice's performance impact can reverse with surrounding policies, precision, and loop schedule, motivating comparison of alternative per-core realizations rather than independent policy selection.

Index Terms—CUDA, High performance computing, Manycore processors, MLIR, Pipeline processing, Tenstorrent

I. INTRODUCTION

Spatial accelerators have emerged as hardware platforms for data-intensive computation, combining distributed local memories with explicit on-chip communication [1]. Cerebras wafer-scale engines, AMD Versal AI Engines, and Tenstorrent Tensix core arrays are prominent examples [2]–[4]. Beyond AI, such systems have also been explored for HPC workloads, including stencils and FFTs [5]–[11]. Tenstorrent Blackhole presents an additional mapping challenge: each Tensix core decouples data movement from computation [4]. Separate RISC-V processors execute compute and data-movement (DM) kernels and communicate through circular buffers (CBs) in L1 memory. Mapping data and computation across Tensix cores is therefore only part of the problem: the compiler must also divide operations between the compute and DM kernels and coordinate their execution within each core. We refer to this intra-core mapping problem as per-core realization, a central focus of this work.

Tenstorrent's standard TTIR-to-TTNN path represents computation through tensor-level operations but does not expose the low-level data movement and synchronization choices used in optimized HPC kernels. Prior Tenstorrent HPC studies [8]–[11] optimize kernels such as stencils and FFTs in TT-Metalium, rather than provide a general compilation path for such programs. At a higher level, TileLoom [12] automates spatiotemporal mapping and inter-core dataflow for workloads such as FlashAttention and GEMM written in tile-based languages. These efforts leave open a general compilation path that exposes alternative per-core realizations for HPC workloads with varied affine access and computation patterns.

A substantial body of HPC kernels and benchmark suites is available in CUDA [13], [14]. CUDA's SIMT abstraction describes computation and memory accesses over threads while leaving physical data placement, movement, and scheduling implicit. Migrating these programs to Blackhole will improve the programming experience, but requires deriving both spatial tile dataflow and a decoupled per-core realization.

We present an MLIR-based compiler that performs this migration for an affine subset of CUDA whose per-core working sets fit in local L1. Given affine iteration domains and access maps together with a compact placement specification, the compiler assigns data and computation to the core grid and derives the communication required for each access. Within each core, it lowers thread-level computation to tile operations, constructs their operands using within-tile transformations, and converts guards to tile masks. It then partitions the operations between the compute and DM kernels and coordinates their execution using L1 buffers and CB synchronization.

The key technical challenge in this migration is that source semantics do not determine a unique per-core realization. For example, arithmetic may run in a compute or DM kernel; a guard may become a compute-side mask or a DM-side copy; work may be divided between the two DM kernels; and CB synchronization may operate at different granularities. The performance of each choice depends on the resulting balance of compute and DM work, so assigning a fixed cost to each choice can be insufficient. We expose these choices as declarative annotations. The compiler checks their applicability, applies the corresponding IR transformations, and lowers the result without handwritten low-level kernels.

We evaluate Gaussian elimination, five-point stencil, and symmetric rank-k update using CUDA programs derived from benchmark suites, subject to the scope and target-independent canonicalization of Section II-C; for each workload, all configurations share the same CUDA input and differ only in their annotation sets. The best measured annotation sets yield 4.2×4.2\times at BF16 for gaussian and 2.1−2.2×2.1-2.2\times at FP32 for gaussian and jacobi_2d, relative to the compiler's own default realizations, in which arithmetic runs on compute, data manipulation on DM, guards become compute-side masked selects, and all DM work uses a single lane. The preferred per-core realization depends on the surrounding policies, arithmetic precision, and loop schedule.

References (25)