pub(super) struct GpuSessionConfig<'a> {
pub cache_dir: &'a Path,
pub model_variant: ModelVariant,
pub max_seq_length: usize,
pub intra_threads: usize,
pub ep: EpSelection,
pub device_id: u32,
pub trt_max_workspace_bytes: Option<usize>,
pub gpu_mem_limit_bytes: Option<usize>,
}Expand description
Configuration for loading an ORT session and tokenizer for a single GPU worker.
Bundles the parameters that were previously passed individually to load_models,
removing the 9-argument list and the associated #[allow(clippy::too_many_arguments)]
suppression. All fields map 1:1 to the corresponding WorkerConfig fields.
Fields§
§cache_dir: &'a PathPath to the ONNX model cache directory.
model_variant: ModelVariantONNX model variant (FP32, FP16, INT8).
max_seq_length: usizeMaximum tokenized sequence length.
intra_threads: usizeIntra-op thread count for ORT sessions.
ep: EpSelectionExecution provider selection.
device_id: u32GPU device ID for this worker.
trt_max_workspace_bytes: Option<usize>Optional TRT EP workspace size cap in bytes.
gpu_mem_limit_bytes: Option<usize>Optional CUDA EP device memory limit in bytes.
Auto Trait Implementations§
impl<'a> Freeze for GpuSessionConfig<'a>
impl<'a> RefUnwindSafe for GpuSessionConfig<'a>
impl<'a> Send for GpuSessionConfig<'a>
impl<'a> Sync for GpuSessionConfig<'a>
impl<'a> Unpin for GpuSessionConfig<'a>
impl<'a> UnsafeUnpin for GpuSessionConfig<'a>
impl<'a> UnwindSafe for GpuSessionConfig<'a>
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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>
Converts
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>
Converts
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