Last updated: 2026-06-12

Inference Runtime

Lib

All API Sections

ZINC_RT reference-runtime module.

Exposes the M0 engine, IR, CPU ring, and scalar CPU kernels through one importable package so `forward_zinc_rt` can exercise the runtime without pulling the same files into multiple Zig modules.

12 exports 0 methods src/zinc_rt/lib.zig

12 exports shown

constant

engine

#
pub const engine = @import("engine.zig")

Top-level runtime handle and tier-selection helpers.

Other zinc_rt submodules go through this surface to obtain the active execution tier (CPU reference, T1 PM4, T2 UMQ, Metal, etc.).

src/zinc_rt/lib.zig:10

constant

ir_op

#
pub const ir_op = @import("ir/op.zig")

IR opcode definitions used by the M0/M1 decode graph.

Op kinds are stable identifiers shared by the emitter and the validator.

src/zinc_rt/lib.zig:14

constant

ir_graph

#
pub const ir_graph = @import("ir/graph.zig")

IR graph container — nodes plus their op/argument metadata.

`forward_zinc_rt` emits one of these per token before lowering to the tier the engine selected.

src/zinc_rt/lib.zig:19

constant

kmd

#
pub const kmd = @import("kmd.zig")

Kernel-mode-driver glue.

Houses helpers and constants shared by the ring backends (UMQ user queues, KFD compute queues) so they describe submissions in one place.

src/zinc_rt/lib.zig:24

constant

ring

#
pub const ring = @import("ring/mod.zig")

Common ring-submission surface — what every concrete ring backend (CPU, UMQ, KFD, CS) implements so the engine can speak to them uniformly.

src/zinc_rt/lib.zig:28

constant

cpu_ring

#
pub const cpu_ring = @import("ring/cpu.zig")

Reference CPU ring used by the scalar M1 forward path.

Executes ops synchronously on the host so we have a ground-truth correctness oracle for the GPU rings.

src/zinc_rt/lib.zig:33

constant

umq

#
pub const umq = @import("ring/umq.zig")

T2 user-mode queue ring backed by `DRM_IOCTL_AMDGPU_USERQ`.

The "blessed" direct path when amdgpu firmware admits compute user queues.

src/zinc_rt/lib.zig:37

constant

kfd

#
pub const kfd = @import("ring/kfd.zig")

T1 PM4 ring backed by `/dev/kfd` (the ROCm/tinygrad ABI).

Fallback when UMQ is rejected; talks PM4 packets to the compute scheduler directly.

src/zinc_rt/lib.zig:41

constant

cs

#
pub const cs = @import("ring/cs.zig")

Generic libdrm compute-stream submission used by the PM4 backends.

Wraps context create/submit so the ring backends share one BO/syncobj path.

src/zinc_rt/lib.zig:45

constant

pm4_packet

#
pub const pm4_packet = @import("ring/packet.zig")

PM4 packet builders (NOPs, indirect-buffer dispatch, COPY_DATA, fences).

Consumed by both the UMQ and KFD rings to produce wire-compatible command-buffer bytes.

src/zinc_rt/lib.zig:50

constant

kernels

#
pub const kernels = @import("isa/cpu_zig/mod.zig")

Scalar CPU kernels (dequantization, matvec, softmax, etc.) used by the reference forward path and by GPU-tier correctness checks.

src/zinc_rt/lib.zig:54

constant

fast_pool

#
pub const fast_pool = @import("fast_pool.zig")

Tiny fixed-size worker pool used to fan out per-layer / per-expert work in the scalar M1 decode path without paying allocator/scheduler overhead.

src/zinc_rt/lib.zig:58