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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
// RLX — versatile ML compiler + runtime.
// Copyright (C) 2026 Eugene Hauptmann, Nataliya Kosmyna.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, version 3.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
//! Declared optional features of an [`crate::ExecutableGraph`].
//!
//! The [`ExecutableGraph`](crate::ExecutableGraph) trait grew a long tail of
//! defaulted methods (MoE residency, GPU handles, KV row feeds, async
//! pipeline, …). Most backends leave those as no-ops / `false`. Callers that
//! need to branch on support should prefer:
//!
//! 1. [`ExecutableGraph::capabilities`] for a cheap advisory bitmask, then
//! 2. the concrete method's return value (`false` / `None`) as the source of
//! truth — capabilities can lag a backend that forgot to override them.
//!
//! Method groups on [`ExecutableGraph`](crate::ExecutableGraph):
//!
//! | Group | Methods |
//! |-------|---------|
//! | Core run | `set_param`, `run`, `run_raw`, `run_slots`, `arena_ptr`, `finalize_params` |
//! | Clone | `clone_box` |
//! | Extent / RNG | `set_active_extent`, `set_rng`, `rng` |
//! | MoE | `set_moe_resident_experts*`, `enable_moe_topk_capture`, `take_moe_*` |
//! | Persistent / GPU handles | `bind_handle`, `read_handle`, `bind_gpu_handle`, … |
//! | KV resident | `register_kv_row_feed`, `feed_kv_row`, `seed_resident_kv_prefix_from`, … |
//! | Typed I/O | `set_param_typed`, `run_typed` |
//! | Async pipeline | `commit_no_wait`, `sync_pending`, `run_pipelined` |
/// Advisory feature flags for a compiled executable.