MCPcopy Create free account
hub / github.com/appdevforall/CodeOnTheGo / llama_params_fit

Function llama_params_fit

subprojects/llama.cpp/src/llama.cpp:741–760  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

739}
740
741enum llama_params_fit_status llama_params_fit(
742 const char * path_model, struct llama_model_params * mparams, struct llama_context_params * cparams,
743 float * tensor_split, struct llama_model_tensor_buft_override * tensor_buft_overrides,
744 size_t * margins, uint32_t n_ctx_min, enum ggml_log_level log_level) {
745 const int64_t t0_us = llama_time_us();
746 llama_params_fit_status status = LLAMA_PARAMS_FIT_STATUS_SUCCESS;
747 try {
748 llama_params_fit_impl(path_model, mparams, cparams, tensor_split, tensor_buft_overrides, margins, n_ctx_min, log_level);
749 LLAMA_LOG_INFO("%s: successfully fit params to free device memory\n", __func__);
750 } catch (const llama_params_fit_exception & e) {
751 LLAMA_LOG_WARN("%s: failed to fit params to free device memory: %s\n", __func__, e.what());
752 status = LLAMA_PARAMS_FIT_STATUS_FAILURE;
753 } catch (const std::runtime_error & e) {
754 LLAMA_LOG_ERROR("%s: encountered an error while trying to fit params to free device memory: %s\n", __func__, e.what());
755 status = LLAMA_PARAMS_FIT_STATUS_ERROR;
756 }
757 const int64_t t1_us = llama_time_us();
758 LLAMA_LOG_INFO("%s: fitting params to free memory took %.2f seconds\n", __func__, (t1_us - t0_us) * 1e-6);
759 return status;
760}
761
762struct llama_sampler_chain_params llama_sampler_chain_default_params() {
763 struct llama_sampler_chain_params result = {

Callers 2

mainFunction · 0.85
common_init_resultMethod · 0.85

Calls 3

llama_time_usFunction · 0.85
llama_params_fit_implFunction · 0.85
whatMethod · 0.45

Tested by

no test coverage detected