Struct furiosa_device::Device
source · pub struct Device { /* private fields */ }
Expand description
Abstraction for a single Furiosa NPU device.
About Furiosa NPU
A Furiosa NPU device contains a number of cores and offers several ways called
DeviceMode
to combine multiple cores to a single logical device,
as following:
Single
: A logical device is composed of a single core.Fusion
: Multiple cores work together as if they were one device. This mode is useful when a DNN model requires much computation power and large memory capacity.MultiCore
: A logical device uses multiple cores, each of which communicates to one another through interconnect. In this mode, partitions of a model or multiple models can be pipelined. (SeeDeviceConfig
andfind_device_files
).
Hence a Furiosa NPU device exposes several devfs files for each purpose
above. They can be listed by calling dev_files
method, which returns a list of DeviceFile
s.
Each DeviceFile
again offers mode
method to
identify its DeviceMode
.
Implementations§
source§impl Device
impl Device
sourcepub fn device_index(&self) -> u8
pub fn device_index(&self) -> u8
Returns the device index (e.g., 0 for npu0).
sourcepub fn alive(&self) -> DeviceResult<bool>
pub fn alive(&self) -> DeviceResult<bool>
Returns a liveness state of the device.
sourcepub fn atr_error(&self) -> DeviceResult<HashMap<String, u32>>
pub fn atr_error(&self) -> DeviceResult<HashMap<String, u32>>
Returns error states of the device.
sourcepub fn busname(&self) -> DeviceResult<String>
pub fn busname(&self) -> DeviceResult<String>
Returns PCI bus number of the device.
sourcepub fn pci_dev(&self) -> DeviceResult<String>
pub fn pci_dev(&self) -> DeviceResult<String>
Returns PCI device ID of the device.
sourcepub fn device_sn(&self) -> DeviceResult<String>
pub fn device_sn(&self) -> DeviceResult<String>
Returns serial number of the device.
sourcepub fn device_uuid(&self) -> DeviceResult<String>
pub fn device_uuid(&self) -> DeviceResult<String>
Returns UUID of the device.
sourcepub fn firmware_version(&self) -> DeviceResult<String>
pub fn firmware_version(&self) -> DeviceResult<String>
Retrieves firmware revision from the device.
sourcepub fn driver_version(&self) -> DeviceResult<String>
pub fn driver_version(&self) -> DeviceResult<String>
Retrieves driver version for the device.
sourcepub fn heartbeat(&self) -> DeviceResult<u32>
pub fn heartbeat(&self) -> DeviceResult<u32>
Returns uptime of the device.
sourcepub fn clock_frequency(&self) -> DeviceResult<Vec<ClockFrequency>>
pub fn clock_frequency(&self) -> DeviceResult<Vec<ClockFrequency>>
Returns clock frequencies of components in the device.
sourcepub fn numa_node(&self) -> DeviceResult<NumaNode>
pub fn numa_node(&self) -> DeviceResult<NumaNode>
Retrieve NUMA node ID associated with the NPU’s PCI lane
sourcepub fn dev_files(&self) -> &Vec<DeviceFile>
pub fn dev_files(&self) -> &Vec<DeviceFile>
List device files under this device.
sourcepub fn performance_counters(&self) -> Vec<(&DeviceFile, PerformanceCounter)>
pub fn performance_counters(&self) -> Vec<(&DeviceFile, PerformanceCounter)>
List performance counters for each device files.
sourcepub async fn get_status_core(&self, core: u8) -> DeviceResult<CoreStatus>
pub async fn get_status_core(&self, core: u8) -> DeviceResult<CoreStatus>
Examine a specific core of the device, whether it is available or not.
sourcepub async fn get_status_all(&self) -> DeviceResult<HashMap<u8, CoreStatus>>
pub async fn get_status_all(&self) -> DeviceResult<HashMap<u8, CoreStatus>>
Examine each core of the device, whether it is available or not.
sourcepub fn get_hwmon_fetcher(&self) -> &Fetcher
pub fn get_hwmon_fetcher(&self) -> &Fetcher
Returns Fetcher
for hwmon metric of the device.
Trait Implementations§
source§impl Ord for Device
impl Ord for Device
source§impl PartialEq<Device> for Device
impl PartialEq<Device> for Device
source§impl PartialOrd<Device> for Device
impl PartialOrd<Device> for Device
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read more