Paper VIIIReading edition

Device scheduling and amortization

Reading tools
Reading libraryFind statementsInspect Lean
Switch work

Saved reading

Read side by side

Start reading

Resources & source

Original TeX with line links · Download TeX

The wording and mathematics follow the retained manuscript. This reading format does not add a proof review or extend Lean coverage.

Skip contents and start reading

10 Device scheduling and amortization

10.1 Shape classes

Definition 10.1: Shape class

Two active packet blocks lie in the same shape class when their input dimension, output dimension, right hand side count, scalar type, accumulation type, and kernel contract agree.

Proposition 10.2: Launch reduction by shape

Suppose \(B\) independent active blocks fall into \(g\) shape classes, and suppose the backend accepts one batched array or pointer list for each class. Grouped execution then requires at most \(g\) launches instead of \(B\), without changing the arithmetic or the output.

Proof of Proposition 10.2

Place all blocks in one class along a batch dimension and invoke one batched kernel for that class. Every block receives the same local computation. One launch per class is sufficient.

CUDA provides graph capture and replay for repeated dependency graphs [NVIDIA2026]. These mechanisms reduce repeated launch work, but they do not change the operator or its arithmetic count.

10.2 Critical path

Theorem 10.3: Acyclic schedule depth

Let a packet task graph be acyclic. Assume every task takes one normalized stage, every edge is a dependency, and an unlimited number of independent tasks may run concurrently. For a nonempty finite graph, the minimum possible number of sequential stages equals the number of vertices on a longest directed path. The empty task graph has depth zero.

Proof of Theorem 10.3

Every path gives a lower bound because its tasks must execute in order. The topological level schedule in Theorem 6.5 achieves exactly this depth. With no tasks, the empty schedule has depth zero.

10.3 One time costs

Theorem 10.4: Amortization threshold

Let \(s\geq0\) be a one time setup cost. Let \(t_b,t_c\ge0\) be the baseline and candidate times per use and let \(R\in{\mathbb N}\) be a reuse count. If \(t_b>t_c\), the candidate is faster after \(R\) uses exactly when

\[ R> \frac{s}{t_b-t_c}. \]

The smallest integer reuse count is

\[ \boxed{ R_{\min} = \left\lfloor \frac{s}{t_b-t_c} \right\rfloor+1. } \]

If \(t_b\leq t_c\), no positive reuse count amortizes a positive setup cost.

Proof of Theorem 10.4

Compare

\[ s+Rt_c \]

with

\[ Rt_b. \]

Rearranging gives the stated inequality.

Corollary 10.5: Graph replay threshold

If graph capture costs \(c\ge0\), ordinary execution costs \(t_o\ge0\), and replay costs \(0\le t_r<t_o\), then capture is profitable when

\[ R> \frac{c}{t_o-t_r}. \]

Proof of Corollary 10.5

Apply Theorem 10.4 with setup cost \(c\).

Corollary 10.6: Materialization threshold

Suppose a compressed representation costs \(t_c\ge0\) per downstream use, an explicit representation costs \(t_e\ge0\) per use, and one time materialization costs \(m\ge0\), with reuse count \(R\in{\mathbb N}\). Materialization is profitable exactly when

\[ R> \frac{m}{t_c-t_e} \]

and \(t_c>t_e\).

Proof of Corollary 10.6

Compare repeated compressed use with materialization followed by repeated explicit use.

Source and conversion record

Source SHA-256: ef616bca9291ac766d492b88f3166be4bc2b39f9ba6034dea3a4bcf2d2bf5d7f

Unsupported prose commands stop the build. The mathematical expression sequence is checked against the source, with manuscript macros expanded for display.

Conversion records

Notation in Paper VIII

Look up a symbol without leaving this chapter. Select text before opening help to search for it.

Search this work’s notation.

    Symbols can have different meanings in different passages. Read each result in its own context.

    Open the full notation index