rlx_llada2/llada2/capabilities.rs
1// RLX — versatile ML compiler + runtime.
2// Copyright (C) 2026 Eugene Hauptmann, Nataliya Kosmyna.
3//
4// This program is free software: you can redistribute it and/or modify
5// it under the terms of the GNU General Public License as published by
6// the Free Software Foundation, version 3.
7//
8// This program is distributed in the hope that it will be useful,
9// but WITHOUT ANY WARRANTY; without even the implied warranty of
10// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11// GNU General Public License for more details.
12//
13// You should have received a copy of the GNU General Public License
14// along with this program. If not, see <https://www.gnu.org/licenses/>.
15
16use crate::config::LLaDA2MoeConfig;
17use anyhow::Result;
18use rlx_core::validate_standard_device;
19use rlx_runtime::Device;
20
21/// Supported execution devices (standard RLX backends).
22pub fn validate_device(cfg: &LLaDA2MoeConfig, device: Device) -> Result<()> {
23 let _ = cfg;
24 validate_standard_device("llada2", device)
25}
26
27/// VRAM / unified-memory budget hint for MoE offload sizing.
28pub fn default_memory_budget_bytes(device: Device) -> Option<usize> {
29 rlx_core::device_memory_for_moe_offload(device).map(|(free, _)| free)
30}
31
32#[cfg(test)]
33mod tests {
34 use super::*;
35 use rlx_core::STANDARD_DEVICES;
36
37 #[test]
38 fn all_standard_backends_supported() {
39 let cfg = crate::synth::tiny_cfg();
40 for dev in STANDARD_DEVICES {
41 validate_device(&cfg, *dev).expect("supported");
42 }
43 }
44}