1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
//! What the process does with the work it is asked to run, and what that
//! work triggered.
//!
//! Two levels decide what a launch does. The [`ProcessMode`] is the whole
//! process's, on every device: it is where the state it governs lives — each
//! server's compile queue, the tune cache keyed by tune key, measurements
//! any other work on a device would skew, pages shared across streams. A
//! stream only knows whether its launches run, its [`StreamMode`]: the process mode
//! sets every stream's default, and a measurement — autotune's candidates, a
//! throughput probe — switches the stream it measures on to
//! [`StreamMode::Execute`] while it measures. The stream never knows why.
//!
//! Under [`ProcessMode::CompileOnly`] every launch and every tune's
//! candidates only queue their kernels, so a pass gathers everything a
//! workload and its tuning reach; nothing compiles until a later launch loads
//! a kernel — the first of a [`CompileAndAutotune`](ProcessMode::CompileAndAutotune)
//! pass, or the first tune before it measures — which compiles the whole
//! queue in one batch. Under `CompileAndAutotune` every launch compiles its
//! kernel and is discarded, and the tunes measure. A workload then pays for
//! compilation and tuning without paying for the work that provoked them,
//! which is what makes producing a shippable environment affordable.
//!
//! A [`ProcessModeOverride`] counts what it triggers into a
//! [`StatisticsCollector`], which a [`StatisticsReader`] reads from any
//! thread: the kernels obtained and the tunes measured, counted to it by the
//! code doing the work, on every device.
//!
//! **Buffers are left as they were** under either process mode that discards
//! launches, so anything read back is meaningless. It only suits a pass
//! driven by the *shapes* it produces, which is what keys the caches, and
//! never one that branches on a computed value.
//!
//! The verdict is resolved where the launch is issued, on the stream it goes
//! out on, and handed to the server as a [`LaunchMode`].
pub use LaunchMode;
pub use ;
pub use ;
pub use ;
// Only a persisted pick names it.
pub use IssuedRecorder;
pub use TunePick;
pub use ;
pub use ;