Skip to content
Inference Runtime

07. Inference Runtime

Real miniature execution and multi-user scheduling

Dense execution uses DenseStageRunner: each stage applies RMSNorm, attention, residual, and feed-forward computation, then an optional basis transition. Tests compile a real miniature Llama checkpoint and compare two encrypted stages with the original computation and Hugging Face logits. DenseStageEngine also executes those stages through actual worker processes using per-stage AEAD keys, authenticated tensor descriptors, synchronous/streaming public SDK calls, and cancellation; the trusted client retains embedding and LM-head sampling.

Framework adapters

The vLLM adapter uses xurcroh_sharded, disables prefix caching and async scheduling, and supplies a strict loader. SGLang commands disable the radix cache and enable dynamic chunked prefill. xDiT uses the official runner with Ulysses, PipeFusion, and CFG options. Version and parallelism mismatches raise CompatibilityError.

ContinuousBatchScheduler implements bounded running sets and fair chunk scheduling. Dynamic chunks shrink by a configurable smoothing factor while remaining page-aligned. Stage runners keep request-scoped KV caches: full prefill runs once, subsequent calls contain one token, and cache entries are zeroed and removed on completion or cancellation. Native engines supply their own optimized batching and chunked-prefill kernels; local scheduling makes the lifecycle testable without GPUs.

One request round the loop, live: every token of the answer repeats the same protected steps. Choose a question and watch the answer arrive piece by piece.

Watch it live. Choose a question and follow it through the eight steps to the model's answer. No worker ever sees it.

Whose eyes?

You ask

Prompt How is my prompt kept from the workers?

What leaves your device nothing yet

You get

Answers checked
0
Rejected
0

What each worker sees

  • Worker (0,0)
  • Worker (0,1)
  • Worker (1,0)
  • Worker (1,1)

Real numbers from this step: noise. A tick means the worker's signed report was verified.

Step 1 of 8 · Split. Your device shuffles its numbers for the first token and cuts them into two random pieces.

Why it matters Shuffling is a disguise; the random pieces are what hide your data. One piece alone is noise.

  1. ReadableHow is my prompt kept fro…
  2. Numbers—
  3. Shuffled—
  4. Two pieces—
  5. Sealed ×3—
  6. In enclave—
  7. Checked—
  8. Answer—
  • readable: your device, verified results, checked enclaves
  • random pieces and the workers that hold them
  • sealed: encrypted on the way through the relays
  • something that failed a check
  • Your device: The output as it forms. It is decoded from the four recombined results.
  • Relay 1: What this relay sees: sealed bytes it cannot read.
  • Relay 2: What this relay sees: sealed bytes it cannot read.
  • Relay 3: What this relay sees: sealed bytes it cannot read.
  • Worker (0,0): What Worker (0,0) sees: its pieces and its result, which are random numbers.
  • Worker (0,1): What Worker (0,1) sees: its pieces and its result, which are random numbers.
  • Worker (1,0): What Worker (1,0) sees: its pieces and its result, which are random numbers.
  • Worker (1,1): What Worker (1,1) sees: its pieces and its result, which are random numbers.
  • piece 0: One random piece of the input.
  • piece 1: The other random piece of the input.
Try to break it:

About this simulation

Simulation in your browser. The answer, picture and clip are prepared toy models, and the relays and enclaves are stand-ins inside this page; the share arithmetic, the three layers of encryption and the signature checks are real. Pace is set for viewing and measures nothing. The production engine is hardware-validated; this page is a teaching simulation, not a benchmark.

Schematic drawing, step by step
One token through the inference runtimeThe prompt is tokenised and embedded on the client. For every model layer the client splits the hidden state into shares, the workers apply the linear maps to their shares, and the client verifies, combines and applies the nonlinear step. After the last layer the client runs the language-model head and samples the next token locally, then repeats.Prompttokenise + embedon the clientRepeated for every layerSplithidden stateinto sharesWorkerslinear maps onshares onlyVerify + combinenonlinearityon the clientLM head + samplinglocal; output neverleaves the clientlast layernext layerappend the token and continueEncrypted in transit; each worker sees one share.

Walk through the 7 steps with Play or Next, or point at a box to see what it connects to.

The model's answer: Your device splits every number into two random shares. Each worker gets one share of your data and one share of the weights, and a single share is uniformly random on its own. Your device checks the four products and adds them to get the result. This holds as long as the workers do not pool their shares.

Look inside:

Choose a question, step through, and open any part to see what it holds for that question. The questions and answers are prepared; the numbers are computed in your browser.

Figure 7.1: One token through the runtime. Tokenising, the nonlinear steps, the language-model head and sampling stay on the client; workers only apply linear maps to shares.

Physical kernel hooks and multi-GPU timing remain hardware validation tasks. The CPU paths prove numerical and lifecycle behavior, not full vLLM/SGLang/xDiT performance.

Choose your language

All languages are equal. Pick the one you want to browse in.

Europe

Middle East & North Africa

South Asia

Southeast Asia

East Asia

Central Asia & Caucasus

Africa

Oceania

Constructed & Classical