pub struct TunerFeatures {Show 23 fields
pub model_params_b: f32,
pub hidden_dim_norm: f32,
pub num_layers_norm: f32,
pub num_heads_norm: f32,
pub head_dim_norm: f32,
pub vocab_size_log: f32,
pub batch_size_norm: f32,
pub seq_len_log: f32,
pub cuda_graphs: f32,
pub kv_cache_ratio: f32,
pub is_prefill: f32,
pub quant_type_onehot: [f32; 8],
pub kernel_type_onehot: [f32; 16],
pub gpu_mem_bw_norm: f32,
pub gpu_compute_norm: f32,
pub gpu_sm_norm: f32,
pub gpu_l2_cache_norm: f32,
pub is_zero_copy: f32,
pub arithmetic_intensity: f32,
pub theoretical_efficiency: f32,
pub measured_tps: Option<f32>,
pub best_kernel_id: Option<u8>,
pub bottleneck_class: Option<BottleneckClass>,
}Expand description
Feature vector for ML-based kernel tuning.
All fields normalized to [0, 1] for model input. Total dimension: 42 features.
§Feature Categories
- Static (11): Known before execution (model size, batch size, etc.)
- Quant one-hot (8): Quantization type encoding
- Kernel one-hot (16): Kernel type encoding
- Hardware (5): GPU capabilities
- Derived (2): Computed features (arithmetic intensity, efficiency)
Fields§
§model_params_b: f32Model size in billions (log10 normalized)
Hidden dimension / 16384
num_layers_norm: f32Number of layers / 128
num_heads_norm: f32Number of attention heads / 128
head_dim_norm: f32Head dimension / 256
vocab_size_log: f32Vocabulary size (log10 normalized)
batch_size_norm: f32Batch size M / 64
seq_len_log: f32Sequence length (log2 / 15)
cuda_graphs: f32CUDA graphs enabled (0 or 1)
kv_cache_ratio: f32Number of KV caches / batch_size (for multi-cache detection)
is_prefill: f32Prefill vs decode (0=decode, 1=prefill)
quant_type_onehot: [f32; 8]§kernel_type_onehot: [f32; 16]§gpu_mem_bw_norm: f32Memory bandwidth / 3000 GB/s
gpu_compute_norm: f32Compute TFLOPS / 500
gpu_sm_norm: f32SM count / 200
gpu_l2_cache_norm: f32L2 cache size / 128 MB (v1.1.0: critical for occupancy)
is_zero_copy: f32Zero-copy memory path enabled (0 or 1) (v1.1.0: pinned memory)
arithmetic_intensity: f32Arithmetic intensity (FLOP/byte), normalized
theoretical_efficiency: f32Theoretical efficiency (measured / roofline)
measured_tps: Option<f32>Measured throughput (tokens/second) - training label
best_kernel_id: Option<u8>Best kernel ID - classification label
bottleneck_class: Option<BottleneckClass>Bottleneck class - classification label
Implementations§
Source§impl TunerFeatures
impl TunerFeatures
Sourcepub const DIM: usize
pub const DIM: usize
Total feature dimension (excluding labels) v1.1.0: 11 static + 8 quant + 16 kernel + 5 hardware + 2 derived = 42
Sourcepub fn builder() -> TunerFeaturesBuilder
pub fn builder() -> TunerFeaturesBuilder
Create a new feature builder
Sourcepub fn to_array(&self) -> [f32; 42]
pub fn to_array(&self) -> [f32; 42]
ALB-099: Convert to fixed-size stack array — zero heap allocation. dhat profiling showed 140K Vec allocations from to_vector() in tests.
Sourcepub fn validate(&self) -> Result<(), TunerError>
pub fn validate(&self) -> Result<(), TunerError>
Validate features (F021-F030 falsification criteria)
Trait Implementations§
Source§impl Clone for TunerFeatures
impl Clone for TunerFeatures
Source§fn clone(&self) -> TunerFeatures
fn clone(&self) -> TunerFeatures
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for TunerFeatures
impl Debug for TunerFeatures
Source§impl Default for TunerFeatures
impl Default for TunerFeatures
Source§impl<'de> Deserialize<'de> for TunerFeatures
impl<'de> Deserialize<'de> for TunerFeatures
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>,
Auto Trait Implementations§
impl Freeze for TunerFeatures
impl RefUnwindSafe for TunerFeatures
impl Send for TunerFeatures
impl Sync for TunerFeatures
impl Unpin for TunerFeatures
impl UnsafeUnpin for TunerFeatures
impl UnwindSafe for TunerFeatures
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> FmtForward for T
impl<T> FmtForward for T
Source§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self to use its Binary implementation when Debug-formatted.Source§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self to use its Display implementation when
Debug-formatted.Source§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self to use its LowerExp implementation when
Debug-formatted.Source§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self to use its LowerHex implementation when
Debug-formatted.Source§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self to use its Octal implementation when Debug-formatted.Source§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self to use its Pointer implementation when
Debug-formatted.Source§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self to use its UpperExp implementation when
Debug-formatted.Source§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self to use its UpperHex implementation when
Debug-formatted.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 moreSource§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
Source§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
Source§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
Source§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
Source§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self, then passes self.as_ref() into the pipe function.Source§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self, then passes self.as_mut() into the pipe
function.Source§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self, then passes self.deref() into the pipe function.Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> Tap for T
impl<T> Tap for T
Source§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B> of a value. Read moreSource§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B> of a value. Read moreSource§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R> view of a value. Read moreSource§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R> view of a value. Read moreSource§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap() only in debug builds, and is erased in release builds.Source§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut() only in debug builds, and is erased in release
builds.Source§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref() only in debug builds, and is erased in release
builds.Source§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut() only in debug builds, and is erased in release
builds.Source§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref() only in debug builds, and is erased in release
builds.