pub struct BandwidthProfile {
pub version: Option<u32>,
pub threshold: Option<f64>,
pub gpu: ProfileGpu,
pub dtypes: BTreeMap<String, MoeBackend>,
pub dtype_kernels: BTreeMap<String, KernelBandwidths>,
pub workloads: BTreeMap<String, Workload>,
}Expand description
A measured bandwidth profile for one machine.
These numbers are hardware facts, so a profile is keyed to the card it was taken on. A profile whose GPU name disagrees with the card in front of you is not “close enough”: applying another machine’s split is worse than having no split at all, so the lookups below refuse it rather than approximate.
Fields§
§version: Option<u32>§threshold: Option<f64>§gpu: ProfileGpu§dtypes: BTreeMap<String, MoeBackend>Per-format verdicts, the authoritative source.
dtype_kernels: BTreeMap<String, KernelBandwidths>Per-format measured bandwidths.
workloads: BTreeMap<String, Workload>Per-model detail, consulted when the per-format entry is absent.
Implementations§
Source§impl BandwidthProfile
impl BandwidthProfile
Sourcepub fn matches_gpu(&self, gpu_name: Option<&str>) -> bool
pub fn matches_gpu(&self, gpu_name: Option<&str>) -> bool
Whether this profile describes the card in front of us.
A profile with no recorded GPU name is accepted (an older benchmark), because refusing it would silently discard a measurement the user did take. A profile with a different recorded name is refused.
Sourcepub fn backend_for(&self, format: &str) -> Option<MoeBackend>
pub fn backend_for(&self, format: &str) -> Option<MoeBackend>
The backend this profile recommends for format.
The per-format verdict wins. Failing that, the per-model entries for the same format are aggregated conservatively: hybrid only if every model that was measured picked hybrid, because one model that does not benefit is evidence the machine is on the wrong side of the line.
Sourcepub fn fetch_fraction_for(&self, format: &str) -> Option<f64>
pub fn fetch_fraction_for(&self, format: &str) -> Option<f64>
The fetch fraction this profile implies for format.
Sourcepub fn policy_for(&self, format: &str) -> QStarPolicy
pub fn policy_for(&self, format: &str) -> QStarPolicy
The policy to serve format with, given this profile.
A profile that measured nothing usable for this format yields the unbenchmarked default: a fixed cap of one fetch per layer per step.
Trait Implementations§
Source§impl Clone for BandwidthProfile
impl Clone for BandwidthProfile
Source§fn clone(&self) -> BandwidthProfile
fn clone(&self) -> BandwidthProfile
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for BandwidthProfile
impl Debug for BandwidthProfile
Source§impl Default for BandwidthProfile
impl Default for BandwidthProfile
Source§fn default() -> BandwidthProfile
fn default() -> BandwidthProfile
Source§impl<'de> Deserialize<'de> for BandwidthProfilewhere
BandwidthProfile: Default,
impl<'de> Deserialize<'de> for BandwidthProfilewhere
BandwidthProfile: Default,
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>,
Source§impl PartialEq for BandwidthProfile
impl PartialEq for BandwidthProfile
Source§impl Serialize for BandwidthProfile
impl Serialize for BandwidthProfile
impl StructuralPartialEq for BandwidthProfile
Auto Trait Implementations§
impl Freeze for BandwidthProfile
impl RefUnwindSafe for BandwidthProfile
impl Send for BandwidthProfile
impl Sync for BandwidthProfile
impl Unpin for BandwidthProfile
impl UnsafeUnpin for BandwidthProfile
impl UnwindSafe for BandwidthProfile
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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