Released v1.0.0-preview Graphcore IPU Poplar & PopART SDK Hardware & Native Substrate

Poplar.NET

C ABI shim and managed .NET wrapper for Graphcore Poplar/PopART computational graph compilation and execution.

Poplar.NET provides a safe, idiomatic .NET 10 surface for interacting with Graphcore IPUs. By pairing a thin native C ABI shim (libpoplar_shim) with managed SafeHandle lifecycle management, it allows .NET applications to construct tensor graphs, manage multi-tile SRAM allocations, execute asynchronous ring-pipe streams, and run PopART ONNX models on bare-metal IPU accelerators without memory leaks or unsafe pointer arithmetic.

NuGet: dotnet add package HFLabs.Poplar.NET --version 1.0.0
Hardware Target Graphcore Colossus IPU

MK2 GC200 with 1,472 parallel processing tiles & 900MB high-speed In-Processor SRAM

Binding Pattern Safe Native Handles

Zero-leak C ABI shim and SafeHandle subclasses for devices, graphs, engines & streams

Stream Engine Ring-Pipe IPC

Asynchronous host-to-device streaming across zero-copy pinned buffers with token flow control

Exception Hierarchy Typed .NET Errors

Translates Poplar recovery actions & engine codes into rich, actionable C# exceptions

Architecture

4 Core Architectural Pillars

A layered bridge between the native Graphcore C++ ecosystem and modern managed .NET 10 applications.

🔌 Native Layer

Native C ABI Shim (libpoplar_shim)

A thin C++ wrapper library compiling against the Graphcore Poplar & PopART SDK headers. Flattens C++ class hierarchies, complex templates, and virtual method tables into pure extern "C" exported function symbols for zero-overhead P/Invoke interoperability.

🛡️ Managed C#

Managed Driver API (Poplar.NET)

Idiomatic .NET 10 surface with safe wrappers for Device, Graph, Engine, Session, and Tensor. Encapsulates raw native pointers inside SafeHandle implementations with deterministic IDisposable cleanup, preventing device tile memory leaks.

⚡ Model Engine

PopART Graph & ONNX Execution

Construct computational graphs programmatically or load pre-trained ONNX models directly into IPU tile memory. Supports both training and inference sessions with hardware optimizer bindings (SGD, Adam, LAMB).

🌉 Ecosystem Bridge

Accelerator & QueryAccel Interop

Serves as the IPU compute backend for HFLabs Accelerator Layer (heterogeneous plan routing) and QueryAccel (PostgreSQL Foreign Data Wrapper and SQL Server CLR aggregate pushdown).

Subsystem Breakdown

Driver Subsystem Capabilities

Comprehensive managed abstractions covering physical hardware discovery, graph construction, engine compilation, and error handling.

IPUDeviceManager

Device Discovery & Tile Partitioning
  • Enumerates physical IPU devices, multi-IPU PCIe topologies, and IPU-Link bridges
  • Configures virtual device targets and offline simulated device profiles
  • Performs tile health verification and memory allocation checks

PoplarGraphBuilder

Computational Graph Construction
  • Adds tensor nodes with custom tile-mapping heuristics and data layouts
  • Connects computation vertices across arithmetic, reduction, and activation domains
  • Configures deterministic tile sync barriers and exchange phases

EngineSessionHost

Compilation & Execution Lifecycle
  • Compiles Poplar graph targets into optimized executable engine artifacts
  • Maintains warm in-memory engine caches for instantaneous query execution
  • Coordinates ring-pipe streams with non-blocking async completion tokens

PoplarExceptionBridge

Fault Isolation & Recovery Mapping
  • Translates Poplar SDK recovery actions into typed C# exception classes
  • Propagates cancellation tokens to abort in-flight tile execution immediately
  • Captures detailed tile trace dumps and engine diagnostics on assertion failure
C# Driver API

Idiomatic .NET IPU Graph Execution

Safe, clean C# syntax with automatic unmanaged resource cleanup and stream synchronization.

PoplarGraphExecutionExample.cs
using System;
using System.Threading.Tasks;
using HFLabs.Hardware.Poplar;

// 1. Discover physical IPU devices or attach to virtual simulator
using var device = IPUDevice.Create(deviceId: 0, IPUModel.ColossusMK2);

// 2. Construct computational graph with target-mapped tensors
using var graph = new PoplarGraph(device.Target);
var inputTensor = graph.AddVariable(DataType.Float32, new[] { 1024, 1536 }, "embeddings");
var weights = graph.AddConstant(DataType.Float32, new[] { 1536, 512 }, weightData);

// 3. Add tile-optimized matrix multiplication vertex
var outputTensor = graph.MatMul(inputTensor, weights);
graph.CreateHostWrite("in_stream", inputTensor);
graph.CreateHostRead("out_stream", outputTensor);

// 4. Compile engine and execute asynchronously via ring-pipe streams
using var engine = graph.CompileEngine(new EngineOptions { OptimizationLevel = 3 });
using var session = engine.CreateSession(device);

await session.WriteStreamAsync("in_stream", batchPayloadMemory);
await session.RunAsync(cancellationToken);
await session.ReadStreamAsync("out_stream", resultBufferMemory);
Active Development

Explore HFLabs Hardware & Native Substrates

Learn how Poplar.NET, LevelZero.NET, and Abigen combine to deliver zero-compromise hardware compute for .NET systems.