Instructions to use Felipe97/llama-cpp-compiled with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use Felipe97/llama-cpp-compiled with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf Felipe97/llama-cpp-compiled # Run inference directly in the terminal: llama cli -hf Felipe97/llama-cpp-compiled
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf Felipe97/llama-cpp-compiled # Run inference directly in the terminal: llama cli -hf Felipe97/llama-cpp-compiled
Build from source code
git clone https://github.com/ggml-org/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-app # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama serve -hf Felipe97/llama-cpp-compiled # Run inference directly in the terminal: ./build/bin/llama cli -hf Felipe97/llama-cpp-compiled
Use Docker
docker model run hf.co/Felipe97/llama-cpp-compiled
- Llama new
- LM Studio
- Jan
- Ollama
How to use Felipe97/llama-cpp-compiled with Ollama:
ollama run hf.co/Felipe97/llama-cpp-compiled
- Unsloth Desktop
- Docker Model Runner
How to use Felipe97/llama-cpp-compiled with Docker Model Runner:
docker model run hf.co/Felipe97/llama-cpp-compiled
- Lemonade
How to use Felipe97/llama-cpp-compiled with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull Felipe97/llama-cpp-compiled
Run and chat with the model
lemonade run user.llama-cpp-compiled-{{QUANT_TAG}}List all available models
lemonade list
- Atomic Chat
Download ggml/src/ggml-hexagon/htp/get-rows-ops.c from Felipe97/llama-cpp-compiled: direct link, hf CLI and curl.
- Browser
- Download file 22.6 kB
-
https://huggingface.co/Felipe97/llama-cpp-compiled/resolve/main/ggml/src/ggml-hexagon/htp/get-rows-ops.c
- Command line
-
hf download hf://Felipe97/llama-cpp-compiled/ggml/src/ggml-hexagon/htp/get-rows-ops.c
-
curl -L -o get-rows-ops.c https://huggingface.co/Felipe97/llama-cpp-compiled/resolve/main/ggml/src/ggml-hexagon/htp/get-rows-ops.c
22.6 kB
| struct get_rows_context { | |
| struct htp_ops_context * octx; | |
| const struct htp_get_rows_kernel_params * kparams; | |
| struct htp_get_rows_vtcm_layout vtcm_layout; | |
| uint8_t * vtcm_base; | |
| uint32_t task_start; | |
| uint32_t tasks; | |
| uint32_t tasks_per_thread; | |
| }; | |
| GET_ROWS_THREAD_ST_FN(int32_t) | |
| GET_ROWS_THREAD_ST_FN(int64_t) | |
| GET_ROWS_THREAD_DT_FN(f32, F32_BYTES, int32_t, { if (cur_elems > 0) hvx_copy_f32_uu((uint8_t *)dst_spad, (const uint8_t *)src_spad, cur_elems); }) | |
| GET_ROWS_THREAD_DT_FN(f32, F32_BYTES, int64_t, { if (cur_elems > 0) hvx_copy_f32_uu((uint8_t *)dst_spad, (const uint8_t *)src_spad, cur_elems); }) | |
| GET_ROWS_THREAD_DT_FN(f16, F16_BYTES, int32_t, { hvx_dequantize_row_f16_f32((float *)dst_spad, src_spad, ne00); }) | |
| GET_ROWS_THREAD_DT_FN(f16, F16_BYTES, int64_t, { hvx_dequantize_row_f16_f32((float *)dst_spad, src_spad, ne00); }) | |
| GET_ROWS_THREAD_DT_FN(q8_0, Q8_0_BYTES, int32_t, { hvx_dequantize_row_q8_0_f32((float *)dst_spad, src_spad, ne00); }) | |
| GET_ROWS_THREAD_DT_FN(q8_0, Q8_0_BYTES, int64_t, { hvx_dequantize_row_q8_0_f32((float *)dst_spad, src_spad, ne00); }) | |
| int op_get_rows(struct htp_ops_context * octx) { | |
| const struct htp_get_rows_kernel_params * kparams = (const struct htp_get_rows_kernel_params *) octx->kernel_params; | |
| if (octx->src[0]->type != HTP_TYPE_F32 && | |
| octx->src[0]->type != HTP_TYPE_F16 && | |
| octx->src[0]->type != HTP_TYPE_Q8_0 && | |
| octx->src[0]->type != HTP_TYPE_I32) { | |
| return HTP_STATUS_NO_SUPPORT; | |
| } | |
| if ((octx->src[0]->type == HTP_TYPE_I32 && octx->dst->type != HTP_TYPE_I32) || | |
| (octx->src[0]->type != HTP_TYPE_I32 && octx->dst->type != HTP_TYPE_F32)) { | |
| return HTP_STATUS_NO_SUPPORT; | |
| } | |
| if (octx->src[1]->type != HTP_TYPE_I32 && octx->src[1]->type != HTP_TYPE_I64) { | |
| return HTP_STATUS_NO_SUPPORT; | |
| } | |
| if (octx->flags & HTP_OPFLAGS_SKIP_COMPUTE) { | |
| return HTP_STATUS_OK; | |
| } | |
| const struct htp_tensor * dst = octx->dst; | |
| const uint32_t total_tasks = kparams->total_tasks; | |
| const size_t dst_row_size = htp_tensor_get_row_size(dst->type, dst->ne[0]); | |
| uint32_t task_start = 0; | |
| uint32_t tasks = total_tasks; | |
| if (octx->ctx->mdev.count > 1) { | |
| uint32_t tasks_per_chunk = 1; | |
| htp_tensor_mdev_rows_per_chunk(dst, dst_row_size / dst->ne[0], (uint32_t) dst_row_size, &tasks_per_chunk); | |
| const struct htp_tensor_mdev_range range = htp_tensor_mdev_partition(total_tasks, tasks_per_chunk, octx->ctx->mdev.idx, octx->ctx->mdev.count, &octx->ctx->mdev.count_div); | |
| task_start = range.start; | |
| tasks = range.count; | |
| } | |
| if (tasks == 0) { | |
| return HTP_STATUS_OK; | |
| } | |
| if (!htp_ops_context_set_n_threads(octx, (uint32_t) kparams->n_threads)) { | |
| return HTP_STATUS_INVAL_PARAMS; | |
| } | |
| const uint32_t n_threads = octx->n_threads; | |
| struct get_rows_context grctx; | |
| grctx.octx = octx; | |
| grctx.kparams = kparams; | |
| grctx.vtcm_base = (uint8_t *)octx->ctx->vtcm_base; | |
| grctx.task_start = task_start; | |
| grctx.tasks = tasks; | |
| grctx.tasks_per_thread = fastdiv(tasks + n_threads - 1, &octx->n_threads_div); | |
| const uint32_t ne00 = octx->src[0]->ne[0]; | |
| htp_get_rows_vtcm_layout_build(&grctx.vtcm_layout, octx->src[0]->type, ne00, n_threads); | |
| const bool is_i32 = (octx->src[1]->type == HTP_TYPE_I32); | |
| work_queue_func_t q_func = NULL; | |
| if (kparams->use_dma) { | |
| q_func = (work_queue_func_t)(is_i32 ? get_rows_thread_st_int32_t : get_rows_thread_st_int64_t); | |
| } else { | |
| switch (octx->src[0]->type) { | |
| case HTP_TYPE_F32: q_func = (work_queue_func_t)(is_i32 ? get_rows_thread_f32_int32_t : get_rows_thread_f32_int64_t); break; | |
| case HTP_TYPE_F16: q_func = (work_queue_func_t)(is_i32 ? get_rows_thread_f16_int32_t : get_rows_thread_f16_int64_t); break; | |
| case HTP_TYPE_Q8_0: q_func = (work_queue_func_t)(is_i32 ? get_rows_thread_q8_0_int32_t : get_rows_thread_q8_0_int64_t); break; | |
| case HTP_TYPE_I32: q_func = (work_queue_func_t)(is_i32 ? get_rows_thread_st_int32_t : get_rows_thread_st_int64_t); break; | |
| default: return HTP_STATUS_NO_SUPPORT; | |
| } | |
| } | |
| FARF(HIGH, "get-rows: (%ux%ux%ux%u) x (%ux%ux%ux%u) -> (%ux%ux%ux%u) : src0-vtcm-size %zu dst-vtcm-size %zu use-dma %d n-threads %d\n", | |
| octx->src[0]->ne[0], octx->src[0]->ne[1], octx->src[0]->ne[2], octx->src[0]->ne[3], | |
| octx->src[1]->ne[0], octx->src[1]->ne[1], octx->src[1]->ne[2], octx->src[1]->ne[3], | |
| octx->dst->ne[0], octx->dst->ne[1], octx->dst->ne[2], octx->dst->ne[3], | |
| grctx.vtcm_layout.src0_bytes_per_thread * n_threads, | |
| grctx.vtcm_layout.dst_bytes_per_thread * n_threads, | |
| kparams->use_dma, n_threads); | |
| work_queue_run(octx->ctx->work_queue, q_func, &grctx, n_threads); | |
| return HTP_STATUS_OK; | |
| } | |