-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathCargo.toml
More file actions
282 lines (251 loc) · 16.1 KB
/
Copy pathCargo.toml
File metadata and controls
282 lines (251 loc) · 16.1 KB
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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
[workspace]
resolver = "2"
members = [
# Core (no backend dependencies)
"crates/core/rlx-ir", # Tensor IR: types, shapes, ops, graph, verifier
"crates/core/rlx-tensor", # Symbolic tensor DSL (operator-overloaded graph building)
"crates/core/rlx-flow", # Block assembly-line API for model builders
"crates/core/rlx-fusion", # MIR fusion passes + fused-op unfuse
"crates/core/rlx-unfuse", # Shared IR unfuse/decompose pass for CUDA/ROCm/wgpu (policy-parameterized)
"crates/core/rlx-autodiff", # Reverse/forward-mode AD on MIR
"crates/core/rlx-compile", # HIR → MIR → LIR pipeline
"crates/core/rlx-opt", # Facade: re-exports fusion + autodiff + compile
"crates/core/rlx-optim", # Training-step optimizers (Adam, AdamW, Lion, SOAP, Muon, …)
"crates/core/rlx-extend", # Facade: stable extension surface (custom ops + LayerStage + DSL) for downstream
# Driver layer (devices, arenas, buffers, streams)
"crates/core/rlx-driver",
# In-graph collective ops (tensor-parallel all-reduce)
"crates/core/rlx-collectives",
# Multi-node pipeline-parallel execution (graph partition + weight-sharded stages)
"crates/core/rlx-distributed",
# CPU backend
"crates/backends/rlx-cpu", # SIMD kernels, BLAS FFI, thread pool, arena executor
# GPU backends
"crates/backends/rlx-metal", # Apple Metal native (MPS + custom MSL kernels)
"crates/backends/rlx-mlx", # Apple MLX (lazy graph + eager modes, hand-rolled C++ shim)
"crates/backends/rlx-coreml", # Apple CoreML / Neural Engine (ANE) — IR → MIL ML Program
"crates/backends/rlx-wgpu", # Cross-platform GPU via wgpu (Metal/Vulkan/DX12/WebGPU)
"crates/backends/rlx-cuda", # NVIDIA CUDA (cuBLAS + NVRTC kernels via cudarc)
"crates/backends/rlx-rocm", # AMD ROCm/HIP — same kernels as rlx-cuda
"crates/backends/rlx-xdna", # AMD XDNA / Ryzen AI NPU (amdxdna) — Device::Xdna detection + AIE seam
"crates/backends/rlx-tpu", # Google TPU via libtpu's PJRT plugin (no Python)
"crates/backends/rlx-egpu", # External GPU over USB4/TB on Apple Silicon — IOKit PCI discovery + PCIDriverKit transport
# Microcontroller backend
"crates/backends/rlx-cortexm", # ARMv7E-M (Cortex-M4/M7) INT8 kernels — nRF52840 etc.
"crates/backends/rlx-cortexm/trainer", # Native fp32 trainer that emits the INT8 model_weights.rs
# FPGA backend
"crates/backends/rlx-fpga", # IR → Verilog → bitstream (per-graph datapath, integer-only Q0.31 requant)
# Cerebras Wafer-Scale Engine backend
"crates/backends/rlx-cerebras", # IR → CSL → fabric simulator (single-PE matmul; multi-PE tiling WIP)
# Native Vulkan compute backend (raw `ash` + embedded SPIR-V kernels)
"crates/backends/rlx-vulkan",
# Qualcomm Hexagon NPU backend (AI Engine Direct / QNN)
"crates/backends/rlx-qnn", # IR → QNN model C++ → qnn-net-run on the x86 reference backend (Adreno is rlx-vulkan)
# Intel oneAPI Level Zero backend (Arc / Data Center Max) — dynamic-loaded
# `libze_loader` + OpenCL-C→SPIR-V compute kernels (peak Intel path).
"crates/backends/rlx-oneapi",
# GPU/accelerator backends (future, ranked by hardware-coverage gap)
# "rlx-directml", # Windows NPUs (Copilot+ / Hexagon / Intel-AMD NPU) via DirectML
"crates/io/rlx-gguf", # GGUF parser + dequant + quant encoders + writer
"crates/io/rlx-gguf-convert", # safetensors / ONNX → GGUF conversion with per-tensor quant
"crates/io/rlx-bake", # Offline weight bake: graph + weights → optimized *.rlx
"crates/io/rlx-pkg", # RLX package format (.rlxp): ZIP64/dir, mmap weights, sidecars, dist
"crates/io/rlx-hub", # Shard-aware HuggingFace download + verification (layer→shard planning)
"crates/io/rlx-mlx-io", # MLX weight layouts: mlx-community dirs, .npz/.npy, affine/mxfp dequant
"crates/io/rlx-dduf", # HuggingFace DDUF (.dduf) ZIP of nested safetensors + JSON
"crates/io/rlx-nemo", # NVIDIA NeMo `.nemo` loader (tar + torch.save ckpt + YAML)
"crates/backends/rlx-gpu-dispatch", # Shape-keyed kernel-variant dispatch table shared by ALL GPU backends
"crates/backends/rlx-gpu-kernels", # Shared CUDA/HIP .cu sources for rlx-cuda + rlx-rocm
"crates/backends/rlx-gpu-host", # Shared host-fallback (D2H→CPU→H2D) staging for rlx-cuda + rlx-rocm
"crates/backends/rlx-mlx-sys", # Vendored MLX C++ + rlx_mlx_shim C ABI
# Proc macros
"crates/core/rlx-macros", # #[rlx_model] AOT compilation macro
# Runtime (user-facing, feature-gated)
"crates/core/rlx-runtime", # Session API, backend dispatch
# Prelude crate — re-exports IR + optimizer + runtime + companion
# crates behind feature gates. The `cargo add rlx` entry point.
"crates/rlx",
# Downstream packages (registered against the custom-op scaffold)
"crates/numerics/rlx-sparse", # Sparse linear algebra (CSR LU/MatVec/CG) — JAX-style downstream
"crates/numerics/rlx-linalg", # Dense linalg (eigh/svd/qr/cholesky/solve_triangular) via LAPACK
"crates/numerics/rlx-peft", # Parameter-efficient adaptation: LoRA/IA3/AdaLoRA/DoRA/OFT
"crates/numerics/rlx-rng", # Bit-exact numpy/torch random streams
"crates/numerics/rlx-vq", # Fused vector-quantization kernel (nearest-codebook cdist→argmin)
"crates/numerics/rlx-fdm", # Force density method — pin-jointed form-finding (jax_fdm port)
"crates/numerics/rlx-lbm", # Moment-encoded lattice Boltzmann (HOME-LBM) — D2Q9/D3Q27
"crates/numerics/rlx-rl", # Flow-map policies + FMQ / QGBS (offline-to-online RL)
"crates/numerics/rlx-bbo", # Black-box + trust-region Q-guidance / QGBS (domain-agnostic f64)
"crates/numerics/rlx-umap", # UMAP / fast-umap custom ops (k-NN from pairwise distances, …)
"crates/numerics/rlx-geo", # Exact integer Delaunay + discrete Voronoi custom ops (per-backend)
"crates/numerics/rlx-fem", # Nonlinear scalar P1 FEM on triangles (Poisson family)
# Benchmark framework (PLAN L5)
"crates/tooling/rlx-bench", # BenchmarkPattern + per-backend timing harness
"crates/tooling/rlx-opscope", # Data-pattern recording harness: inject stat taps, sweep synthetic data, mine exploitable structure
"crates/tooling/rlx-hwprofile", # Host GPU/VRAM detection for device selection + topology planning
"crates/tooling/rlx-check", # `cargo rlx check` — device-free static graph diagnostics
"crates/tooling/rlx-corpus", # Named kernel corpus a compiler change must clear
"crates/tooling/rlx-megakernel", # Standalone study: MoE block composition toward one device program
"crates/tooling/rlxsl", # Scalar-expr manifest → WGSL/CUDA/MSL/GLSL warm-tier kernel codegen
"crates/io/rlx-onnx", # ONNX Runtime inference for .onnx files (PLAN B7)
"crates/io/rlx-onnx-proto", # Vendored pure-Rust ONNX protobuf types (protoc-free)
"crates/io/rlx-onnx-import", # ONNX → RLX HIR import + op lowering
"crates/io/rlx-onnx-conformance", # ONNX op-level ORT parity harness
"crates/io/rlx-torch-import", # PyTorch (torch.export) → RLX HIR import + bundle/crate emit
# Text: tokenizer + chat template + sampling (public surface for downstream LM apps)
"crates/io/rlx-text",
# Python bindings
"crates/bindings/pyrlx", # PyO3 + maturin: run any RLX backend from Python
# C ABI for the distributed node — iOS (staticlib → xcframework) and
# embedded hosts (cdylib), including the host side of an FPGA rank.
"crates/bindings/rlx-ffi",
# WebAssembly entry point — run models in the browser (CPU backend +
# async WebGPU device bring-up via rlx-wgpu)
"crates/bindings/rlx-web",
# WebGL2 GPGPU backend — render-to-texture execution in the browser
# (no compute shaders on WebGL2), forward + backward.
"crates/backends/rlx-webgl",
]
# ── Sanitizer / debug profiles (plan #41) ────────────────────────
#
# Borrowed from MAX's --config=asan / --config=debug-modular pattern.
# Run sanitized builds with:
#
# cargo +nightly build --profile=asan
# cargo +nightly test --profile=asan
#
# AddressSanitizer needs the nightly toolchain on most targets; on
# Apple Silicon it compiles fine via `RUSTFLAGS="-Zsanitizer=address"`
# (which we set per-profile via .cargo/config.toml when present).
# `debug-rlx` is a stable-toolchain debug profile with extra checks
# (overflow, debug-assertions, less inlining for tractable backtraces).
[profile.asan]
inherits = "dev"
debug = "full"
debug-assertions = true
overflow-checks = true
opt-level = 1
lto = false
incremental = false
# ── Workspace-wide lint posture (plan #17) ─────────────────────
#
# Tightens the bar without going to "deny all the things." Crates can
# locally `#[allow(...)]` for genuinely-needed exceptions. Pair with
# `cargo clippy --all-targets -- -D warnings` in CI (see Justfile).
#
# Not yet enabled (would generate ~1000 warnings to fix in one go):
# missing_docs / unsafe_op_in_unsafe_fn / clippy::pedantic.
# Add them as crates reach individual readiness.
[workspace.package]
version = "0.2.16"
edition = "2024"
rust-version = "1.89" # edition=2024 needs ≥1.85; `is_multiple_of` ≥1.87; AVX-VNNI
# `_mm256_dpbusd_*` intrinsics (rlx-cpu x86 Q2_0 dot) ≥1.89
license = "MIT OR Apache-2.0"
authors = ["Eugene Hauptmann", "Nataliya Kosmyna"]
repository = "https://github.com/MIT-RLX/rlx"
homepage = "https://github.com/MIT-RLX/rlx"
documentation = "https://docs.rs/rlx"
keywords = ["ml", "tensor", "compiler", "neural-network", "autodiff"]
categories = ["science", "algorithms", "compilers"]
[workspace.dependencies]
# Internal crates — one source of truth for path + version. Members
# reference these via `{ workspace = true, .. }` (features/optional per-use).
pyrlx = { path = "crates/bindings/pyrlx", version = "0.2.16" }
rlx = { path = "crates/rlx", version = "0.2.16" }
rlx-autodiff = { path = "crates/core/rlx-autodiff", version = "0.2.16" }
rlx-bake = { path = "crates/io/rlx-bake", version = "0.2.16" }
rlx-bbo = { path = "crates/numerics/rlx-bbo", version = "0.2.16" }
rlx-bench = { path = "crates/tooling/rlx-bench", version = "0.2.16" }
rlx-cerebras = { path = "crates/backends/rlx-cerebras", version = "0.2.16" }
rlx-check = { path = "crates/tooling/rlx-check", version = "0.2.16" }
rlx-collectives = { path = "crates/core/rlx-collectives", version = "0.2.16" }
rlx-compile = { path = "crates/core/rlx-compile", version = "0.2.16" }
rlx-coreml = { path = "crates/backends/rlx-coreml", version = "0.2.16" }
rlx-cortexm = { path = "crates/backends/rlx-cortexm", version = "0.2.16" }
rlx-cortexm-trainer = { path = "crates/backends/rlx-cortexm/trainer", version = "0.2.16" }
rlx-cpu = { path = "crates/backends/rlx-cpu", version = "0.2.16" }
rlx-cuda = { path = "crates/backends/rlx-cuda", version = "0.2.16" }
rlx-dduf = { path = "crates/io/rlx-dduf", version = "0.2.16" }
rlx-distributed = { path = "crates/core/rlx-distributed", version = "0.2.16" }
rlx-driver = { path = "crates/core/rlx-driver", version = "0.2.16" }
rlx-extend = { path = "crates/core/rlx-extend", version = "0.2.16" }
rlx-fdm = { path = "crates/numerics/rlx-fdm", version = "0.2.16" }
rlx-lbm = { path = "crates/numerics/rlx-lbm", version = "0.2.16" }
rlx-flow = { path = "crates/core/rlx-flow", version = "0.2.16" }
rlx-fpga = { path = "crates/backends/rlx-fpga", version = "0.2.16" }
rlx-fusion = { path = "crates/core/rlx-fusion", version = "0.2.16" }
rlx-geo = { path = "crates/numerics/rlx-geo", version = "0.2.16" }
rlx-gguf = { path = "crates/io/rlx-gguf", version = "0.2.16" }
rlx-gguf-convert = { path = "crates/io/rlx-gguf-convert", version = "0.2.16" }
rlx-gpu-host = { path = "crates/backends/rlx-gpu-host", version = "0.2.16" }
rlx-gpu-dispatch = { path = "crates/backends/rlx-gpu-dispatch", version = "0.2.16" }
rlx-gpu-kernels = { path = "crates/backends/rlx-gpu-kernels", version = "0.2.16" }
rlx-hub = { path = "crates/io/rlx-hub", version = "0.2.16" }
rlx-hwprofile = { path = "crates/tooling/rlx-hwprofile", version = "0.2.16" }
rlx-ir = { path = "crates/core/rlx-ir", version = "0.2.16" }
rlx-linalg = { path = "crates/numerics/rlx-linalg", version = "0.2.16" }
rlx-peft = { path = "crates/numerics/rlx-peft", version = "0.2.16" }
rlx-rng = { path = "crates/numerics/rlx-rng", version = "0.2.16" }
rlx-macros = { path = "crates/core/rlx-macros", version = "0.2.16" }
rlx-metal = { path = "crates/backends/rlx-metal", version = "0.2.16" }
rlx-mlx = { path = "crates/backends/rlx-mlx", version = "0.2.16" }
rlx-mlx-io = { path = "crates/io/rlx-mlx-io", version = "0.2.16" }
rlx-mlx-sys = { path = "crates/backends/rlx-mlx-sys", version = "0.2.16" }
rlx-nemo = { path = "crates/io/rlx-nemo", version = "0.2.16" }
rlx-oneapi = { path = "crates/backends/rlx-oneapi", version = "0.2.16" }
rlx-onnx = { path = "crates/io/rlx-onnx", version = "0.2.16" }
rlx-onnx-conformance = { path = "crates/io/rlx-onnx-conformance", version = "0.2.16" }
rlx-onnx-import = { path = "crates/io/rlx-onnx-import", version = "0.2.16" }
rlx-onnx-proto = { path = "crates/io/rlx-onnx-proto", version = "0.2.16" }
rlx-opscope = { path = "crates/tooling/rlx-opscope", version = "0.2.16" }
rlx-opt = { path = "crates/core/rlx-opt", version = "0.2.16" }
rlx-optim = { path = "crates/core/rlx-optim", version = "0.2.16" }
rlx-pkg = { path = "crates/io/rlx-pkg", version = "0.2.16" }
rlx-qnn = { path = "crates/backends/rlx-qnn", version = "0.2.16" }
rlx-rl = { path = "crates/numerics/rlx-rl", version = "0.2.16" }
rlx-rocm = { path = "crates/backends/rlx-rocm", version = "0.2.16" }
rlx-runtime = { path = "crates/core/rlx-runtime", version = "0.2.16" }
rlx-sparse = { path = "crates/numerics/rlx-sparse", version = "0.2.16" }
rlx-tensor = { path = "crates/core/rlx-tensor", version = "0.2.16" }
rlx-text = { path = "crates/io/rlx-text", version = "0.2.16" }
rlx-torch-import = { path = "crates/io/rlx-torch-import", version = "0.2.16" }
rlx-tpu = { path = "crates/backends/rlx-tpu", version = "0.2.16" }
rlx-umap = { path = "crates/numerics/rlx-umap", version = "0.2.16" }
rlx-unfuse = { path = "crates/core/rlx-unfuse", version = "0.2.16" }
rlx-vq = { path = "crates/numerics/rlx-vq", version = "0.2.16" }
rlx-vulkan = { path = "crates/backends/rlx-vulkan", version = "0.2.16" }
rlx-ffi = { path = "crates/bindings/rlx-ffi", version = "0.2.16" }
rlx-web = { path = "crates/bindings/rlx-web", version = "0.2.16" }
rlx-webgl = { path = "crates/backends/rlx-webgl", version = "0.2.16" }
rlx-wgpu = { path = "crates/backends/rlx-wgpu", version = "0.2.16" }
rlx-xdna = { path = "crates/backends/rlx-xdna", version = "0.2.16" }
rlx-egpu = { path = "crates/backends/rlx-egpu", version = "0.2.16" }
rlxsl = { path = "crates/tooling/rlxsl", version = "0.2.16" }
[workspace.lints.rust]
unused = { level = "warn" }
[workspace.lints.clippy]
all = { level = "warn", priority = -1 }
# Common false positives in numeric / SIMD code.
manual_range_contains = "allow"
needless_range_loop = "allow"
too_many_arguments = "allow"
upper_case_acronyms = "allow"
# Macro / FFI-driven noise we don't want to silence per call-site.
useless_conversion = "allow" # pyo3 ?-into-PyErr boilerplate
missing_safety_doc = "allow" # cover incrementally; not 1.0.0-blocking
doc_overindented_list_items = "allow" # rustfmt-vs-clippy disagreement
doc_lazy_continuation = "allow" # same family — multi-line list continuations
unnecessary_wraps = "allow" # API symmetry > "this could be infallible"
type_complexity = "allow" # IR types are intentionally explicit
large_enum_variant = "allow" # Op enum carries Box<Graph> in CustomFn / Scan
single_range_in_vec_init = "allow" # `vec![0..1]` is fine in tests / scaffolding
collapsible_if = "allow" # nested-if is often more readable in numeric code
should_implement_trait = "allow" # builder methods named like trait methods
[profile.debug-rlx]
inherits = "dev"
debug = "full"
debug-assertions = true
overflow-checks = true
opt-level = 1
lto = false
incremental = true