MCPcopy Create free account
hub / github.com/Tiiny-AI/PowerInfer / offload_tensor

Method offload_tensor

llama.cpp:3029–3038  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3027 }
3028
3029 bool offload_tensor(ggml_tensor * meta_tensor) {
3030 size_t tensor_data_size = ggml_nbytes(meta_tensor);
3031 if (!llama_reduce_vram_budget(tensor_data_size)) {
3032 return false;
3033 }
3034 // allocate in VRAM
3035 ggml_set_backend(meta_tensor, GGML_BACKEND_GPU);
3036 vram_allocated_bytes += tensor_data_size;
3037 return true;
3038 }
3039
3040 bool reserve(size_t tensor_bytes) {
3041 return llama_reduce_vram_budget(tensor_bytes);

Callers

nothing calls this directly

Calls 3

llama_reduce_vram_budgetFunction · 0.85
ggml_set_backendFunction · 0.85
ggml_nbytesFunction · 0.70

Tested by

no test coverage detected