pub struct FitParams {
pub model_params: LlamaModelParams,
pub context_params: LlamaContextParams,
pub margins: Vec<usize>,
pub n_ctx_min: u32,
pub log_level: ggml_log_level,
}Expand description
Input to fit_params.
Defaults mirror upstream common_params: unset n_ctx (0) so context size
can be reduced, default model params so n_gpu_layers may be adjusted, and
1 GiB per-device memory margins.
Fields§
§model_params: LlamaModelParamsStarting model parameters. Only fields still at their defaults are modified.
context_params: LlamaContextParamsStarting context parameters. Set n_ctx to 0 via
LlamaContextParams::with_n_ctx(None) to let fitting pick a context size.
margins: Vec<usize>Minimum free memory to leave on each device, in bytes (one entry per device).
n_ctx_min: u32Minimum context size when fitting must reduce n_ctx.
log_level: ggml_log_levelMinimum log level printed during fitting.
Implementations§
Source§impl FitParams
impl FitParams
Sourcepub fn with_model_params(self, model_params: LlamaModelParams) -> Self
pub fn with_model_params(self, model_params: LlamaModelParams) -> Self
Override starting model parameters.
Sourcepub fn with_context_params(self, context_params: LlamaContextParams) -> Self
pub fn with_context_params(self, context_params: LlamaContextParams) -> Self
Override starting context parameters.
Sourcepub fn with_margins(self, margins: Vec<usize>) -> Self
pub fn with_margins(self, margins: Vec<usize>) -> Self
Per-device memory margins in bytes (length must be at least max_devices()).
Sourcepub fn with_n_ctx_min(self, n_ctx_min: u32) -> Self
pub fn with_n_ctx_min(self, n_ctx_min: u32) -> Self
Minimum context size when fitting reduces memory by shrinking n_ctx.
Sourcepub fn with_log_level(self, log_level: ggml_log_level) -> Self
pub fn with_log_level(self, log_level: ggml_log_level) -> Self
Minimum log level emitted while fitting.