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-vulkan/vulkan-shaders/count_experts.comp from Felipe97/llama-cpp-compiled: direct link, hf CLI and curl.
- Browser
- Download file 4.74 kB
-
https://huggingface.co/Felipe97/llama-cpp-compiled/resolve/main/ggml/src/ggml-vulkan/vulkan-shaders/count_experts.comp
- Command line
-
hf download hf://Felipe97/llama-cpp-compiled/ggml/src/ggml-vulkan/vulkan-shaders/count_experts.comp
-
curl -L -o count_experts.comp https://huggingface.co/Felipe97/llama-cpp-compiled/resolve/main/ggml/src/ggml-vulkan/vulkan-shaders/count_experts.comp
4.74 kB
| layout (push_constant) uniform parameter | |
| { | |
| uint32_t ne00; | |
| uint32_t ne01; | |
| uint32_t nb00; | |
| uint32_t nb01; | |
| uint32_t a_offset; | |
| uint32_t n_experts; | |
| uint32_t hoist_row_ids; | |
| uint32_t ne00mp; | |
| uint32_t ne00L; | |
| } p; | |
| layout(local_size_x = BLOCK_SIZE, local_size_y = 1, local_size_z = 1) in; | |
| layout (binding = 0) readonly buffer A {uint data_a[];}; | |
| layout (binding = 1) writeonly buffer D {uint data_d[];}; | |
| // Upper bound on n_experts for the hoisted row-id path. Must match the limit in | |
| // ggml_vk_mul_mat_id_q_f16 (hoist_row_ids). The non-hoisted reduction below only | |
| // needs BLOCK_SIZE entries. | |
| shared uint vals[MAX_EXPERTS]; | |
| shared uint offsets[MAX_EXPERTS]; | |
| shared uint cursors[MAX_EXPERTS]; | |
| // data_d layout when p.hoist_row_ids is set: | |
| // [0, n_experts) per-expert row count | |
| // [n_experts, 2*n_experts) per-expert start offset into the row id region | |
| // [2*n_experts] total row count | |
| // [2*n_experts + 1, ) row ids grouped by expert, packed as (i01 << 16) | (i00 & 0xffff) | |
| // Otherwise only data_d[expert_id] is written, holding that expert's row count. | |
| void main() { | |
| const uint expert_id = gl_WorkGroupID.x; | |
| const uint num_elements = p.ne00 * p.ne01; | |
| const uint tid = gl_LocalInvocationID.x; | |
| if (p.hoist_row_ids != 0) { | |
| for (uint e = tid; e < p.n_experts; e += BLOCK_SIZE) { | |
| vals[e] = 0; | |
| } | |
| barrier(); | |
| for (uint idx = tid; idx < num_elements; idx += BLOCK_SIZE) { | |
| const uint i01 = fastdiv(idx, p.ne00mp, p.ne00L); | |
| const uint i00 = idx - i01 * p.ne00; | |
| const uint expert = data_a[p.a_offset + i01 * p.nb01 + i00 * p.nb00]; | |
| if (expert < p.n_experts) { | |
| atomicAdd(vals[expert], 1); | |
| } | |
| } | |
| barrier(); | |
| if (gl_SubgroupID == 0) { | |
| // pad the trip count so the subgroup ops stay in uniform control flow | |
| const uint n_experts_padded = (p.n_experts + gl_SubgroupSize - 1) & ~(gl_SubgroupSize - 1); | |
| uint base = 0; | |
| for (uint expert = gl_SubgroupInvocationID; expert < n_experts_padded; expert += gl_SubgroupSize) { | |
| const bool in_range = expert < p.n_experts; | |
| const uint count = in_range ? vals[expert] : 0; | |
| const uint offset = base + subgroupExclusiveAdd(count); | |
| if (in_range) { | |
| data_d[expert] = count; | |
| data_d[p.n_experts + expert] = offset; | |
| offsets[expert] = offset; | |
| cursors[expert] = 0; | |
| } | |
| base += subgroupAdd(count); | |
| } | |
| if (subgroupElect()) { | |
| data_d[2 * p.n_experts] = base; | |
| } | |
| } | |
| if (tid == 0) { | |
| uint offset = 0; | |
| for (uint expert = 0; expert < p.n_experts; ++expert) { | |
| const uint count = vals[expert]; | |
| data_d[expert] = count; | |
| data_d[p.n_experts + expert] = offset; | |
| offsets[expert] = offset; | |
| cursors[expert] = 0; | |
| offset += count; | |
| } | |
| data_d[2 * p.n_experts] = offset; | |
| } | |
| barrier(); | |
| for (uint idx = tid; idx < num_elements; idx += BLOCK_SIZE) { | |
| const uint i01 = fastdiv(idx, p.ne00mp, p.ne00L); | |
| const uint i00 = idx - i01 * p.ne00; | |
| const uint expert = data_a[p.a_offset + i01 * p.nb01 + i00 * p.nb00]; | |
| if (expert < p.n_experts) { | |
| const uint row = atomicAdd(cursors[expert], 1); | |
| const uint packed_row_id = (i01 << 16) | (i00 & 0xffffu); | |
| data_d[2 * p.n_experts + 1 + offsets[expert] + row] = packed_row_id; | |
| } | |
| } | |
| return; | |
| } | |
| uint count = 0; | |
| for (uint idx = tid; idx < num_elements; idx += BLOCK_SIZE) { | |
| const uint i01 = fastdiv(idx, p.ne00mp, p.ne00L); | |
| const uint i00 = idx - i01 * p.ne00; | |
| const uint a = data_a[p.a_offset + i01 * p.nb01 + i00 * p.nb00]; | |
| count += uint(a == expert_id); | |
| } | |
| vals[tid] = count; | |
| barrier(); | |
| [[unroll]] for (uint s = BLOCK_SIZE / 2; s > 0; s >>= 1) { | |
| if (tid < s) { | |
| vals[tid] += vals[tid + s]; | |
| } | |
| barrier(); | |
| } | |
| if (tid == 0) { | |
| data_d[expert_id] = vals[0]; | |
| } | |
| } | |