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. (SeeDeviceConfigandfind_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 DeviceFiles.
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 PartialOrd for Device
impl PartialOrd for Device
impl Eq for Device
Auto Trait Implementations§
impl !Freeze for Device
impl RefUnwindSafe for Device
impl Send for Device
impl Sync for Device
impl Unpin for Device
impl UnwindSafe for Device
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more