README.md

August 13, 2026 · View on GitHub

OXIDE // INFER

Rust-native GPU operators for LLM inference

Checked asynchronous execution, native cuda-oxide kernels, and explicit vendor providers.

CI MIT license Rust 2024 NVIDIA CUDA Project status alpha

Docs · Architecture · Operators · Evidence · Roadmap

Oxide Infer is a GPU operator runtime for Rust inference engines. It defines operator contracts, chooses an explicit provider and algorithm, freezes an immutable plan, checks runtime resources, and retains them until GPU work settles.

The accepted target architecture evolves this alpha into a standalone Rust inference engine: an Oxide-owned server, scheduler, model and KV data plane, with offline TileLang artifacts as the only product custom compute kernels. Mature non-compute capabilities start from a pinned, attributed Rust engine source baseline and are transplanted into Oxide modules; the source engine remains an independent behavioral and performance baseline. That target is not yet the state of the current source; migration gates and the engine benchmark plan keep the distinction explicit.

cuda-oxide compiles native Rust device code. Vendor providers such as cuBLASLt enter through the same checked command runtime without passing through the native-kernel toolchain.

Oxide Infer is an operator layer. Consumer engines retain model graphs, continuous batching, request scheduling, KV-cache policy, distributed control, tokenizers, and serving APIs.

One execution model

Every operator follows one lifecycle:

Spec
  → Provider
  → Algorithm
  → Plan
  → Operands
  → CommandScope
  → Completion

Planning fixes the provider, algorithm, workspace contract, launch configuration, artifact, and CUDA Graph policy. Enqueue does not tune, switch providers, or select a silent fallback.

Architecture

flowchart TB
  Engines["External engine adapters and reference harnesses"]
  Adapter["Engine adapter"]

  subgraph Core["oxide-infer · contracts"]
    Families["attention · gemm · kv_cache<br/>normalization · position · activation<br/>sampling · speculation · moe"]
    Spec["Spec · errors · capabilities · CPU reference"]
  end

  subgraph Cuda["oxide-infer-cuda · execution"]
    Planning["Provider → Algorithm → immutable Plan"]
    Runtime["Operands → CommandScope → Completion"]
    Native["Oxide native provider"]
    Vendor["Vendor providers"]
  end

  Oxide["cuda-oxide<br/>Rust → PTX/cubin"]
  Libraries["cuBLASLt · future vendor libraries"]
  Driver["CUDA Driver · NVIDIA GPU"]
  Lab["oxide-infer-lab<br/>correctness · Graph · sanitizer · performance · engine gates"]

  Engines --> Adapter --> Families --> Spec --> Planning --> Runtime
  Runtime --> Native --> Oxide --> Driver
  Runtime --> Vendor --> Libraries --> Driver
  Lab -. qualifies .-> Core
  Lab -. qualifies .-> Cuda

The native provider owns architecture-specific Rust kernels. sm90a, sm100a, and later modules combine the CUDA primitives that each algorithm needs. TMA is a data-movement primitive. WGMMA and tcgen05 are compute instruction families. They are not runtime providers by themselves.

The architecture document defines ownership, planning, workspace, stream, Graph, artifact, and engine-adapter boundaries.

Operator surface

The table separates source presence from qualification. A source path does not prove device correctness or performance.

FamilyCurrent sourceState
AttentionSingle decode, paged decode, ragged prefill, paged prefillDeclared runner paths device-qualified in R1
KV cachePaged append and RoPE plus paged appendExclusive-page runner path device-qualified in R1
GEMMContiguous BF16 dense through cuBLASLtR1 correctness, Graph, and sanitizer qualified
GEMVNative BF16 M=1 SM90a algorithmExperimental; performance stop recorded, cuBLASLt remains selected
NormalizationRMSNorm for F32, FP16, and BF16Declared runner paths device-qualified in R1
PositionBF16 NeoX RoPE with explicit positionsDeclared runner path device-qualified in R1
ActivationSwiGLU and fused epiloguesPlanned
SamplingLogits transforms, RNG, and token selectionPlanned
Advanced attentionMLA and expanded KV layoutsPlanned
Matrix operationsFP8, grouped GEMM, and MoE shapesPlanned

The operator catalog records the exact dtype, shape, layout, provider, algorithm, and evidence state for every admitted path.

Performance snapshot

Matched BF16 eager-provider timing against FlashInfer 0.6.17 produced stable rankings for all 14 baseline attention shapes on the recorded H20. Oxide Infer had lower combined median latency in 8 shapes; FlashInfer had lower latency in 6. The two long GQA4 rows below are refreshed from their optimized paths; the other rows retain the full-matrix baseline. Every row uses its matched provider-comparison cohort.

ContractShapeOxideFlashInferLower latency
Paged decode MHAB1, KV 1, NHD, D1289.54 µs13.77 µsOxide 1.44×
Ragged prefill MHAQ 16, KV 16, D1288.25 µs13.99 µsOxide 1.69×
Ragged prefill GQA4Q 32+64, KV 256+1024, D12836.94 µs21.93 µsFlashInfer 1.68×
Paged prefill GQA4Q 32+64, KV 256+1024, D12846.60 µs23.21 µsFlashInfer 2.01×

These are CUDA-event measurements of matched operator paths, not isolated kernel, model, or serving results. See the complete record and raw samples. The current paged-GQA4 record contains separate two-order provider and source-progression cohorts. The optimized ragged-GQA4 record does the same for the dual-tile path.

The experimental native M=1 GEMV met its 10% margin against both Mistral.rs custom GEMV and cuBLASLt on only one of five census shapes. Its stop record keeps the per-order summaries and evidence limits; no engine rollout follows for that frozen candidate.

Providers

Oxide Infer exposes provider selection before execution.

Oxide
  native Rust kernels
  → cuda-oxide
  → PTX or cubin
  → CUDA Driver

CublasLt
  checked vendor plan
  → cuBLASLt
  → CUDA Driver

The command runtime gives both paths the same resource and failure model:

  • caller-selected CUDA context and stream
  • typed read and write regions
  • checked span, alignment, alias, and capacity rules
  • explicit workspace requirements
  • completion-owned resource leases
  • typed device-status failures
  • fixed-address CUDA Graph capture where admitted

Workspace

CrateResponsibility
oxide-inferBackend-independent contracts, errors, capabilities, and CPU references
oxide-infer-cudaPlanning, CUDA command runtime, native kernels, Graphs, and vendor providers
oxide-infer-labNon-published hardware gates, matched benchmarks, fixtures, and evidence generation

The workspace does not split GEMM, kernels, or runtime into additional crates. They remain modules until they need a separate dependency, release, ownership, or safety boundary.

Build and validate

Install mise, then review mise.toml before trusting it.

git clone https://github.com/feichai0017/oxide-infer.git
cd oxide-infer

mise trust
mise install
USE_MISE=1 make install-website
USE_MISE=1 make check

Run CUDA gates inside the pinned Linux environment:

USE_MISE=1 make cuda-doctor
USE_MISE=1 make cuda-check
USE_MISE=1 make cuda-test
USE_MISE=1 make h20

The environment guide lists the pinned Rust, Node.js, CUDA, and cuda-oxide versions. The current device qualification guide defines the recorded H20 correctness, sanitizer, Graph, and performance gates without making H20 the product boundary.

Evidence before claims

Oxide Infer keeps these evidence levels separate:

host reference
  → CUDA correctness
  → lifetime and negative gates
  → CUDA Graph
  → sanitizer
  → matched operator benchmark
  → engine integration
  → serving workload

A lower level does not imply a higher one. Correct output does not prove a speedup. A Graph replay does not prove serving throughput. An adapter hit does not prove end-to-end latency.

Historical Loom Infer records remain immutable. They retain their original provider names, source hashes, and commands.

New Oxide Infer records qualify only the source revision named by each record. See the evidence index.

Roadmap

The roadmap now advances one complete engine profile at a time:

  1. Freeze the TileLang artifact ABI and checked Rust loader.
  2. Replace the current native and vendor paths for one BF16 model profile.
  3. Build the complete Qwen2.5-1.5B prefill and decode plan with no Candle CUDA execution or silent provider fallback.
  4. Build the Oxide API, tokenizer, streaming, and continuous-batch control plane around stable engine request and event types.
  5. Qualify continuous batching, KV paging, cancellation, Graphs, and recovery.
  6. Compare kernels with FlashInfer and the complete server with vLLM and SGLang under matched workloads.
  7. Expand model, dtype, hardware, and distributed coverage only after the first profile passes its release gate.

Each milestone has admission, evidence, and stop conditions in the full roadmap.

Contributing

Start with a real engine call site and one measurable contract. Keep one public execution path per operator. Do not add compatibility facades, hidden fallback, or a new crate without a concrete boundary.

Read CONTRIBUTING.md before adding a provider or changing runtime ownership.

License

MIT