ironaccelerator_neuron/lib.rs
1//! # `ironaccelerator-neuron`
2//!
3//! AWS Neuron backend — covers **Trainium** (trn1 / trn2) and
4//! **Inferentia** (inf1 / inf2). The Neuron Runtime exposes a C API
5//! through `libnrt.so`; we dynamically load it and call `nrt_init` +
6//! `nrt_get_total_nc_count` for device enumeration. NeuronCores are the
7//! scheduling unit Neuron exposes, so each NeuronCore becomes one
8//! `DeviceDescriptor`.
9//!
10//! Instance family is read from AWS metadata-style env hints where
11//! available (`NEURON_RT_VISIBLE_CORES`, `AWS_NEURON_VISIBLE_CORES`,
12//! instance-type file under `/sys/devices/virtual/dmi/id/product_name`
13//! when root is reachable); generation is inferred from the runtime
14//! version string.
15
16#![allow(clippy::missing_safety_doc)]
17
18pub mod backend;
19pub mod drv;
20pub mod runtime;
21
22pub use backend::{NeuronBackend, NEURON_BACKEND};
23
24pub fn register(reg: &mut ironaccelerator_core::BackendRegistry) {
25 reg.register(&NEURON_BACKEND);
26}