pub struct HardwareConfig {
pub name: String,
pub compute_flops: f64,
pub memory_bandwidth: f64,
pub memory_capacity: u64,
pub kv_cache_capacity: u64,
pub gpu_memory_utilization: f64,
pub bytes_per_param: u32,
}Fields§
§name: StringAccelerator name (e.g., “H100”, “A100”)
compute_flops: f64Compute capacity in FLOPS (for specific precision, e.g., bf16)
memory_bandwidth: f64Memory bandwidth in bytes/sec
memory_capacity: u64Total memory capacity in bytes
kv_cache_capacity: u64KV cache capacity in bytes (subset of memory_capacity) If not specified, calculated from gpu_memory_utilization
gpu_memory_utilization: f64Fraction of GPU memory to use (vLLM default: 0.9) Used to calculate kv_cache_capacity if not explicitly set
bytes_per_param: u32Number of bytes per parameter (1 for fp8, 2 for bf16)
Implementations§
Source§impl HardwareConfig
impl HardwareConfig
Sourcepub fn compute_kv_cache_capacity(&mut self, model_size_bytes: u64)
pub fn compute_kv_cache_capacity(&mut self, model_size_bytes: u64)
Calculate KV cache capacity if not explicitly set Formula: (memory_capacity * gpu_memory_utilization) - model_size This matches vLLM’s behavior: requested_memory - non_kv_cache_memory
Trait Implementations§
Source§impl Clone for HardwareConfig
impl Clone for HardwareConfig
Source§fn clone(&self) -> HardwareConfig
fn clone(&self) -> HardwareConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for HardwareConfig
impl Debug for HardwareConfig
Source§impl<'de> Deserialize<'de> for HardwareConfig
impl<'de> Deserialize<'de> for HardwareConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for HardwareConfig
impl RefUnwindSafe for HardwareConfig
impl Send for HardwareConfig
impl Sync for HardwareConfig
impl Unpin for HardwareConfig
impl UnsafeUnpin for HardwareConfig
impl UnwindSafe for HardwareConfig
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
Mutably borrows from an owned value. Read more