Skip to main content

Crates and implementation details

Which crate owns which layer, and the few constraints that span several pages.

Crate map​

LayerCrate(s)Role
Graph IRpoot-graph-irPrimitive graph, Builder, ops compositions (attention, norms, MoE, ...), and the transform passes
CPU oraclepoot-evalReference evaluator; test-side correctness ground truth
Planningpoot-graph-plancompile: passes, plans, storage, slots and numerics; typed refusals
Kernel importpoot-kernel-attr, pootc#[kernel] attribute; rustc driver that imports kernels from Stable MIR
Kernel IR, synthpoot-kernel-ir, poot-kernelgenKernel body IR; synthesized bodies (elementwise, reduction, tiled GEMM, flash, dequant)
Codegenpoot-codegenKernel IR to LLVM IR to SPIR-V, PTX, AMDGCN code objects or AIE
Runtimespoot-wgpu-runtime, poot-rocm-runtime, poot-ptx-runtime, poot-vulkan-runtime, poot-runtime-commonDevices, buffers, transfers; mechanism only
Executorspoot-wgpu-device (wgpu), poot-rocm-device, poot-ptx-device, poot-vulkan-deviceLoad, bind, capture, replay and read back a plan
NPU devicepoot-npuExperimental Devices for the XDNA2 and Intel NPU4 NPUs; see NPU Offload
Modelspoot-modelsThe Model trait, the family registry, per-family tracers over shared components
Loadingpoot-load, poot-quant, poot-weightsSafetensors and GGUF readers; packed quantization descriptors shared by loader, IR and planner; the weight roles, ids and map
Textpoot-textTokenizer, chat templates and guided-decoding constraints; needs no model and no device
Generationpoot-llmModelHandle and the driver: token loop, sampling suffix, KV slots
Servingpoot-serveOpenAI-compatible HTTP server: one scheduling loop over the driver's step
Toolingpoot-orchestrator, poot-profile, poot-test-utilPod runs, profiling, hardware smoke checks, test helpers

Cross-cutting notes​

  • AIE compilation and NPU execution are separate stages. The compiler produces a typed AIE core object, link recipe and linked artifact with a shape ABI for the planner's serialized schedule (the ordinary kernel body with its thread grid turned into loops); poot-npu's Device loads and runs them through the shared engine. See NPU Offload.
  • The CPU oracle is test-side. poot-eval is the reference that tests and device checks compare against; generation never calls it. See Execution.
  • Attention takes its own value width, split keys and paged keys. The fused attention op types a value head narrower than the key head, a key split into per-head and shared parts (MLA), and a key and value read in place from paged KV pools through a slot map. See Attention.
  • ROCm AQL publication. Replay writes AQL packets to a host-coherent ring, then rings the doorbell. A discrete-GPU device-memory ring needs an explicit store fence first; integrated APUs refuse that constructor.
  • Synthetic versus real checkpoints. Some families are verified only on bounded synthetic checkpoints against the CPU oracle. That is not a real-checkpoint claim; the feature matrix tracks the difference.