Text Generation
GGUF
English
Chinese
spark2_5
spark-x2.5
reasoning
thinking
tool-calling
imatrix
intel-arc
vulkan
conversational
Instructions to use stornic56/Spark-X2.5-4B-GGUF 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 stornic56/Spark-X2.5-4B-GGUF 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 stornic56/Spark-X2.5-4B-GGUF:Q4_K_M # Run inference directly in the terminal: llama cli -hf stornic56/Spark-X2.5-4B-GGUF:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf stornic56/Spark-X2.5-4B-GGUF:Q4_K_M # Run inference directly in the terminal: llama cli -hf stornic56/Spark-X2.5-4B-GGUF:Q4_K_M
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf stornic56/Spark-X2.5-4B-GGUF:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf stornic56/Spark-X2.5-4B-GGUF:Q4_K_M
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf stornic56/Spark-X2.5-4B-GGUF:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf stornic56/Spark-X2.5-4B-GGUF:Q4_K_M
Use Docker
docker model run hf.co/stornic56/Spark-X2.5-4B-GGUF:Q4_K_M
- LM Studio
- Jan
- vLLM
How to use stornic56/Spark-X2.5-4B-GGUF with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "stornic56/Spark-X2.5-4B-GGUF" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "stornic56/Spark-X2.5-4B-GGUF", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/stornic56/Spark-X2.5-4B-GGUF:Q4_K_M
- Ollama
How to use stornic56/Spark-X2.5-4B-GGUF with Ollama:
ollama run hf.co/stornic56/Spark-X2.5-4B-GGUF:Q4_K_M
- Unsloth Desktop
- Pi
How to use stornic56/Spark-X2.5-4B-GGUF with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf stornic56/Spark-X2.5-4B-GGUF:Q4_K_M
Configure the model in Pi
# Install Pi: npm install -g @earendil-works/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "llama-cpp": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "stornic56/Spark-X2.5-4B-GGUF:Q4_K_M" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Docker Model Runner
How to use stornic56/Spark-X2.5-4B-GGUF with Docker Model Runner:
docker model run hf.co/stornic56/Spark-X2.5-4B-GGUF:Q4_K_M
- Lemonade
How to use stornic56/Spark-X2.5-4B-GGUF with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull stornic56/Spark-X2.5-4B-GGUF:Q4_K_M
Run and chat with the model
lemonade run user.Spark-X2.5-4B-GGUF-Q4_K_M
List all available models
lemonade list
- Hermes Agent
How to use stornic56/Spark-X2.5-4B-GGUF with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf stornic56/Spark-X2.5-4B-GGUF:Q4_K_M
Configure Hermes
# Install Hermes: curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash hermes setup # Point Hermes at the local server: hermes config set model.provider custom hermes config set model.base_url http://127.0.0.1:8080/v1 hermes config set model.default stornic56/Spark-X2.5-4B-GGUF:Q4_K_M
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use stornic56/Spark-X2.5-4B-GGUF with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf stornic56/Spark-X2.5-4B-GGUF:Q4_K_M
Configure OpenClaw
# Install OpenClaw: npm install -g openclaw@latest # Register the local server and set it as the default model: openclaw onboard --non-interactive --mode local \ --auth-choice custom-api-key \ --custom-base-url http://127.0.0.1:8080/v1 \ --custom-model-id "stornic56/Spark-X2.5-4B-GGUF:Q4_K_M" \ --custom-provider-id llama-cpp \ --custom-compatibility openai \ --custom-text-input \ --accept-risk \ --skip-health
Run OpenClaw
openclaw agent --local --agent main --message "Hello from Hugging Face"
Upload folder using huggingface_hub
Browse files- .gitattributes +11 -0
- README.md +273 -0
- SHA256SUMS.txt +11 -0
- Spark-X2.5-4B-IQ2_M.gguf +3 -0
- Spark-X2.5-4B-IQ3_M.gguf +3 -0
- Spark-X2.5-4B-IQ4_NL.gguf +3 -0
- Spark-X2.5-4B-Q3_K_M.gguf +3 -0
- Spark-X2.5-4B-Q4_K_M.gguf +3 -0
- Spark-X2.5-4B-Q5_K_M.gguf +3 -0
- Spark-X2.5-4B-Q6_K.gguf +3 -0
- Spark-X2.5-4B-Q8_0.gguf +3 -0
- Spark-X2.5-4B-bf16.gguf +3 -0
- Spark-X2.5-4B-imatrix.gguf +3 -0
- calibration_data.txt +3 -0
- reproducibility/base_model_revision.txt +1 -0
- reproducibility/benchmarks_gpu.txt +56 -0
- reproducibility/calibration.py +5 -0
- reproducibility/fork_commit.txt +1 -0
- reproducibility/imatrix-run.log +21 -0
- reproducibility/q2_k_repetition_loops.log +129 -0
.gitattributes
CHANGED
|
@@ -33,3 +33,14 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 36 |
+
Spark-X2.5-4B-IQ2_M.gguf filter=lfs diff=lfs merge=lfs -text
|
| 37 |
+
Spark-X2.5-4B-IQ3_M.gguf filter=lfs diff=lfs merge=lfs -text
|
| 38 |
+
Spark-X2.5-4B-IQ4_NL.gguf filter=lfs diff=lfs merge=lfs -text
|
| 39 |
+
Spark-X2.5-4B-Q3_K_M.gguf filter=lfs diff=lfs merge=lfs -text
|
| 40 |
+
Spark-X2.5-4B-Q4_K_M.gguf filter=lfs diff=lfs merge=lfs -text
|
| 41 |
+
Spark-X2.5-4B-Q5_K_M.gguf filter=lfs diff=lfs merge=lfs -text
|
| 42 |
+
Spark-X2.5-4B-Q6_K.gguf filter=lfs diff=lfs merge=lfs -text
|
| 43 |
+
Spark-X2.5-4B-Q8_0.gguf filter=lfs diff=lfs merge=lfs -text
|
| 44 |
+
Spark-X2.5-4B-bf16.gguf filter=lfs diff=lfs merge=lfs -text
|
| 45 |
+
Spark-X2.5-4B-imatrix.gguf filter=lfs diff=lfs merge=lfs -text
|
| 46 |
+
calibration_data.txt filter=lfs diff=lfs merge=lfs -text
|
README.md
CHANGED
|
@@ -1,3 +1,276 @@
|
|
| 1 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2 |
license: apache-2.0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
+
quantized_by: stornic56
|
| 3 |
+
pipeline_tag: text-generation
|
| 4 |
+
language:
|
| 5 |
+
- en
|
| 6 |
+
- zh
|
| 7 |
license: apache-2.0
|
| 8 |
+
base_model: XHToken/Spark-X2.5-4B
|
| 9 |
+
base_model_relation: quantized
|
| 10 |
+
tags:
|
| 11 |
+
- spark2_5
|
| 12 |
+
- spark-x2.5
|
| 13 |
+
- reasoning
|
| 14 |
+
- thinking
|
| 15 |
+
- tool-calling
|
| 16 |
+
- imatrix
|
| 17 |
+
- intel-arc
|
| 18 |
+
- vulkan
|
| 19 |
---
|
| 20 |
+
|
| 21 |
+
## Llamacpp imatrix Quantizations of Spark-X2.5-4B by XHToken
|
| 22 |
+
|
| 23 |
+
Using <a href="https://github.com/XHToken/llama.cpp">XHToken/llama.cpp</a> fork commit
|
| 24 |
+
<a href="https://github.com/XHToken/llama.cpp/commit/4a3635c32fc9f044c2bde9ebeabf50c7e1ec5991">b10514-4a3635c32</a> (build tag
|
| 25 |
+
`b10514-4a3635c32`) for quantization.
|
| 26 |
+
|
| 27 |
+
Original model: https://huggingface.co/XHToken/Spark-X2.5-4B
|
| 28 |
+
|
| 29 |
+
**Model details:**
|
| 30 |
+
- Parameter count: 4.11B
|
| 31 |
+
- Input support: text
|
| 32 |
+
- imatrix: yes - [details](#imatrix)
|
| 33 |
+
|
| 34 |
+
[How to run](#how-to-run)
|
| 35 |
+
|
| 36 |
+
**⚠️ Important:** the `spark2_5` architecture is not supported by mainline llama.cpp.
|
| 37 |
+
All files in this repo require the [XHToken/llama.cpp fork](https://github.com/XHToken/llama.cpp)
|
| 38 |
+
at the commit linked above or newer - see [How to run](#how-to-run).
|
| 39 |
+
|
| 40 |
+
## Prompt format
|
| 41 |
+
|
| 42 |
+
The chat template is embedded in every GGUF; run with `--jinja` and it is applied
|
| 43 |
+
automatically. The rendered format is:
|
| 44 |
+
|
| 45 |
+
```
|
| 46 |
+
<|start▁of▁sentence|><|System|>
|
| 47 |
+
{system_prompt}<|end▁of▁sentence|><|start▁of▁sentence|><|User|>
|
| 48 |
+
{prompt}<|end▁of▁sentence|><|start▁of▁sentence|><|Bot|>
|
| 49 |
+
<think>
|
| 50 |
+
```
|
| 51 |
+
|
| 52 |
+
The model is a thinking model by default: reasoning is emitted inside `<think>...</think>`
|
| 53 |
+
before the final answer. The embedded template also supports tool calling, matching the
|
| 54 |
+
upstream `chat_template.jinja`.
|
| 55 |
+
|
| 56 |
+
**Don't know which to choose?** Grab
|
| 57 |
+
[Spark-X2.5-4B-Q4_K_M.gguf](https://huggingface.co/stornic56/Spark-X2.5-4B-GGUF/blob/main/Spark-X2.5-4B-Q4_K_M.gguf)
|
| 58 |
+
(2.60GB) - usually a good mix of size and performance. Download instructions available
|
| 59 |
+
[here](#downloading-using-the-hugging-face-cli).
|
| 60 |
+
|
| 61 |
+
## Available files:
|
| 62 |
+
|
| 63 |
+
| Filename | Quant type | File Size | Description |
|
| 64 |
+
| -------- | ---------- | --------- | ----------- |
|
| 65 |
+
| [Spark-X2.5-4B-bf16.gguf](https://huggingface.co/stornic56/Spark-X2.5-4B-GGUF/blob/main/Spark-X2.5-4B-bf16.gguf) | bf16 | 8.82GB | Full BF16 weights, converted directly from upstream safetensors. |
|
| 66 |
+
| [Spark-X2.5-4B-Q8_0.gguf](https://huggingface.co/stornic56/Spark-X2.5-4B-GGUF/blob/main/Spark-X2.5-4B-Q8_0.gguf) | Q8_0 | 4.37GB | Extremely high quality, generally unneeded but max available quant. |
|
| 67 |
+
| [Spark-X2.5-4B-Q6_K.gguf](https://huggingface.co/stornic56/Spark-X2.5-4B-GGUF/blob/main/Spark-X2.5-4B-Q6_K.gguf) | Q6_K | 3.37GB | Very high quality, near perfect. |
|
| 68 |
+
| [Spark-X2.5-4B-Q5_K_M.gguf](https://huggingface.co/stornic56/Spark-X2.5-4B-GGUF/blob/main/Spark-X2.5-4B-Q5_K_M.gguf) | Q5_K_M | 2.97GB | High quality. |
|
| 69 |
+
| [Spark-X2.5-4B-Q4_K_M.gguf](https://huggingface.co/stornic56/Spark-X2.5-4B-GGUF/blob/main/Spark-X2.5-4B-Q4_K_M.gguf) | Q4_K_M | 2.60GB | Good quality, default size for most use cases. |
|
| 70 |
+
| [Spark-X2.5-4B-IQ4_NL.gguf](https://huggingface.co/stornic56/Spark-X2.5-4B-GGUF/blob/main/Spark-X2.5-4B-IQ4_NL.gguf) | IQ4_NL | 2.47GB | Similar quality to Q4_K_M in a smaller file. |
|
| 71 |
+
| [Spark-X2.5-4B-Q3_K_M.gguf](https://huggingface.co/stornic56/Spark-X2.5-4B-GGUF/blob/main/Spark-X2.5-4B-Q3_K_M.gguf) | Q3_K_M | 2.16GB | Lower quality but usable, good for low RAM availability. Fastest generation quant on Intel Arc (Vulkan) in our benchmarks. |
|
| 72 |
+
| [Spark-X2.5-4B-IQ3_M.gguf](https://huggingface.co/stornic56/Spark-X2.5-4B-GGUF/blob/main/Spark-X2.5-4B-IQ3_M.gguf) | IQ3_M | 2.04GB | Medium-low quality, imatrix-guided, comparable to Q3_K_M. |
|
| 73 |
+
| [Spark-X2.5-4B-IQ2_M.gguf](https://huggingface.co/stornic56/Spark-X2.5-4B-GGUF/blob/main/Spark-X2.5-4B-IQ2_M.gguf) | IQ2_M | 1.63GB | Relatively low quality, imatrix keeps it surprisingly usable; completed our extended coherence test with correct code. |
|
| 74 |
+
|
| 75 |
+
Note: a Q2_K quant was also generated and tested, but **excluded from this release** after
|
| 76 |
+
it produced repetition loops on the extended coherence test, while IQ2_M (a smaller file)
|
| 77 |
+
completed the same test correctly. Evidence: [reproducibility/q2_k_repetition_loops.log](https://huggingface.co/stornic56/Spark-X2.5-4B-GGUF/blob/main/reproducibility/q2_k_repetition_loops.log).
|
| 78 |
+
Quants below IQ2_M (IQ2_XS, IQ1_M, Q1_0 class) were not produced; at this parameter count
|
| 79 |
+
the quality loss is severe.
|
| 80 |
+
|
| 81 |
+
## Downloading using the Hugging Face CLI
|
| 82 |
+
|
| 83 |
+
<details>
|
| 84 |
+
<summary>Click to view download instructions</summary>
|
| 85 |
+
|
| 86 |
+
First, make sure you have the Hugging Face CLI installed:
|
| 87 |
+
|
| 88 |
+
```
|
| 89 |
+
pip install -U "huggingface_hub[cli]"
|
| 90 |
+
```
|
| 91 |
+
|
| 92 |
+
Download a specific file:
|
| 93 |
+
|
| 94 |
+
```
|
| 95 |
+
hf download stornic56/Spark-X2.5-4B-GGUF --include "Spark-X2.5-4B-Q4_K_M.gguf" --local-dir ./
|
| 96 |
+
```
|
| 97 |
+
|
| 98 |
+
</details>
|
| 99 |
+
|
| 100 |
+
## How to run
|
| 101 |
+
|
| 102 |
+
These quants require the XHToken llama.cpp fork. Mainline llama.cpp does not implement
|
| 103 |
+
`spark2_5` and will refuse to load these files.
|
| 104 |
+
|
| 105 |
+
```
|
| 106 |
+
git clone https://github.com/XHToken/llama.cpp.git && cd llama.cpp
|
| 107 |
+
# Intel/AMD GPU via Vulkan: add -DGGML_VULKAN=ON
|
| 108 |
+
# NVIDIA GPU: add -DGGML_CUDA=ON
|
| 109 |
+
# CPU only: plain build works
|
| 110 |
+
cmake -B build -DCMAKE_BUILD_TYPE=Release -DGGML_VULKAN=ON
|
| 111 |
+
cmake --build build --config Release -j 8
|
| 112 |
+
```
|
| 113 |
+
|
| 114 |
+
Interactive chat (template is embedded, `--jinja` applies it):
|
| 115 |
+
|
| 116 |
+
```
|
| 117 |
+
./build/bin/llama-cli -m Spark-X2.5-4B-Q4_K_M.gguf -ngl 99 -c 8192 --jinja -cnv
|
| 118 |
+
```
|
| 119 |
+
|
| 120 |
+
OpenAI-compatible server:
|
| 121 |
+
|
| 122 |
+
```
|
| 123 |
+
./build/bin/llama-server -m Spark-X2.5-4B-Q4_K_M.gguf -ngl 99 -c 16384 --jinja
|
| 124 |
+
```
|
| 125 |
+
|
| 126 |
+
Recommended sampling from the upstream model card: `temp 1.0, top_p 0.95, top_k -1`.
|
| 127 |
+
Use `--temp 0` for deterministic output.
|
| 128 |
+
|
| 129 |
+
**Other runtimes:** Ollama and LM Studio can run these files, but only with builds backed
|
| 130 |
+
by the same fork - see the "Ollama" and "LM Studio" sections of the
|
| 131 |
+
[official model card](https://huggingface.co/XHToken/Spark-X2.5-4B) for the build steps.
|
| 132 |
+
|
| 133 |
+
## Flash Attention
|
| 134 |
+
|
| 135 |
+
The fork enables FlashAttention automatically for the sliding-window layers of `spark2_5`.
|
| 136 |
+
No extra flag is needed.
|
| 137 |
+
|
| 138 |
+
## imatrix
|
| 139 |
+
|
| 140 |
+
All quants below bf16 were made using the imatrix option, computed with `llama-imatrix`
|
| 141 |
+
from this fork. The calibration corpus is the `wikitext-2-raw-v1` train split
|
| 142 |
+
([Salesforce/wikitext](https://huggingface.co/datasets/Salesforce/wikitext)), written to
|
| 143 |
+
disk verbatim and in order by [reproducibility/calibration.py](https://huggingface.co/stornic56/Spark-X2.5-4B-GGUF/blob/main/reproducibility/calibration.py).
|
| 144 |
+
The corpus file is included in this repo:
|
| 145 |
+
[calibration_data.txt](https://huggingface.co/stornic56/Spark-X2.5-4B-GGUF/blob/main/calibration_data.txt).
|
| 146 |
+
|
| 147 |
+
The imatrix is available here:
|
| 148 |
+
[Spark-X2.5-4B-imatrix.gguf](https://huggingface.co/stornic56/Spark-X2.5-4B-GGUF/blob/main/Spark-X2.5-4B-imatrix.gguf).
|
| 149 |
+
|
| 150 |
+
<details>
|
| 151 |
+
<summary>Calibration details</summary>
|
| 152 |
+
|
| 153 |
+
```
|
| 154 |
+
{
|
| 155 |
+
"dataset": "Salesforce/wikitext",
|
| 156 |
+
"config": "wikitext-2-raw-v1",
|
| 157 |
+
"split": "train",
|
| 158 |
+
"rendering": "raw text, no chat template, no special tokens",
|
| 159 |
+
"chunk_size": 512,
|
| 160 |
+
"chunks": 128,
|
| 161 |
+
"tokens_consumed": 65536,
|
| 162 |
+
"consumption_order": "sequential from file start (deterministic)",
|
| 163 |
+
"threads": 8,
|
| 164 |
+
"final_perplexity": "49.3694 +/- 1.09206",
|
| 165 |
+
"imatrix_format": "GGUF (fork default)",
|
| 166 |
+
"notes": "corpus is plain prose; a future revision may render tool-calling and reasoning conversations through the chat template, as done by other maintainers"
|
| 167 |
+
}
|
| 168 |
+
```
|
| 169 |
+
|
| 170 |
+
Reproducibility check: two independent imatrix runs over the same file with the same
|
| 171 |
+
parameters produced identical final perplexity (49.3694 ± 1.09206). Run log:
|
| 172 |
+
[reproducibility/imatrix-run.log](https://huggingface.co/stornic56/Spark-X2.5-4B-GGUF/blob/main/reproducibility/imatrix-run.log).
|
| 173 |
+
|
| 174 |
+
</details>
|
| 175 |
+
|
| 176 |
+
## Which file should I choose?
|
| 177 |
+
|
| 178 |
+
<details>
|
| 179 |
+
<summary>Click here for details</summary>
|
| 180 |
+
|
| 181 |
+
The first thing to figure out is how big a model you can run. If you want the model
|
| 182 |
+
running as fast as possible, fit the whole thing in VRAM: aim for a file 1-2GB smaller
|
| 183 |
+
than your GPU's total VRAM, leaving room for the KV cache (this model's hybrid attention
|
| 184 |
+
keeps the cache small, which helps). If you want maximum quality and can tolerate partial
|
| 185 |
+
CPU offload, add your system RAM and VRAM together and pick a file 1-2GB smaller than
|
| 186 |
+
that total.
|
| 187 |
+
|
| 188 |
+
Next, K-quant or I-quant? On NVIDIA (CUDA) and Apple silicon, I-quants (IQX_X) generally
|
| 189 |
+
offer better quality per bit below Q4. On **Intel Arc via Vulkan (Mesa)**, our measurements
|
| 190 |
+
show the opposite for generation speed: K-quants are faster at equal bit-width, while
|
| 191 |
+
I-quants win on file size - see the benchmarks below. Either way, both families were
|
| 192 |
+
validated for coherence in this release.
|
| 193 |
+
|
| 194 |
+
</details>
|
| 195 |
+
|
| 196 |
+
## Benchmarks
|
| 197 |
+
|
| 198 |
+
Measured with `llama-bench` from the same fork commit, Intel Arc B580 (Battlemage,
|
| 199 |
+
Mesa Vulkan driver), `-ngl 99 -t 4`, 3 runs. Raw log:
|
| 200 |
+
[reproducibility/benchmarks_gpu.txt](https://huggingface.co/stornic56/Spark-X2.5-4B-GGUF/blob/main/reproducibility/benchmarks_gpu.txt).
|
| 201 |
+
|
| 202 |
+
| Quant | pp512 t/s | tg128 t/s |
|
| 203 |
+
| ----- | -------: | -------: |
|
| 204 |
+
| Q8_0 | 2039 | 69.5 |
|
| 205 |
+
| Q6_K | 1844 | 70.5 |
|
| 206 |
+
| Q5_K_M | 1949 | 79.8 |
|
| 207 |
+
| Q4_K_M | 2004 | 93.3 |
|
| 208 |
+
| IQ4_NL | 2079 | 53.9 |
|
| 209 |
+
| Q3_K_M | 1894 | 95.3 |
|
| 210 |
+
| IQ3_M | 1969 | 76.4 |
|
| 211 |
+
| IQ2_M | 2048 | 46.4 |
|
| 212 |
+
|
| 213 |
+
Prompt processing is roughly flat across quants (~2k t/s, compute-bound on the GPU's
|
| 214 |
+
matrix cores). Long-context reading, Q4_K_M with the whole model in VRAM:
|
| 215 |
+
`pp32768 = 309 t/s` (~6GB VRAM total including KV cache). The upstream 1M-token context
|
| 216 |
+
was not validated in this release.
|
| 217 |
+
|
| 218 |
+
CPU reference readings (i3-12100F, 8 threads, single runs, not formal benchmarks):
|
| 219 |
+
BF16 ≈ 4.8 t/s, Q4_K_M ≈ 13.4 t/s, Q3_K_M ≈ 15.6 t/s, IQ2_M ≈ 10.9 t/s generation.
|
| 220 |
+
|
| 221 |
+
## Validation
|
| 222 |
+
|
| 223 |
+
- `test-llama-archs -a spark2_5` from the fork: OK on CPU (NMSE 0.00e+00), Vulkan
|
| 224 |
+
(8.58e-08) and meta buffers. `Roundtrip: SKIP` is expected for this architecture.
|
| 225 |
+
- Greedy decoding (`--temp 0`) produced token-identical output on CPU and Vulkan GPU,
|
| 226 |
+
verified on Q4_K_M.
|
| 227 |
+
- Every published quant completed a 700-token coding coherence test at `--temp 0`;
|
| 228 |
+
Q2_K failed with repetition loops and was excluded (log linked in the files table).
|
| 229 |
+
|
| 230 |
+
## Reproducibility
|
| 231 |
+
|
| 232 |
+
Everything needed to rebuild these files bit-for-bit is in the repo:
|
| 233 |
+
|
| 234 |
+
| File | Content |
|
| 235 |
+
| ---- | ------- |
|
| 236 |
+
| [SHA256SUMS.txt](https://huggingface.co/stornic56/Spark-X2.5-4B-GGUF/blob/main/SHA256SUMS.txt) | Checksums of all GGUFs, imatrix and calibration corpus |
|
| 237 |
+
| [Spark-X2.5-4B-imatrix.gguf](https://huggingface.co/stornic56/Spark-X2.5-4B-GGUF/blob/main/Spark-X2.5-4B-imatrix.gguf) | The importance matrix itself |
|
| 238 |
+
| [calibration_data.txt](https://huggingface.co/stornic56/Spark-X2.5-4B-GGUF/blob/main/calibration_data.txt) | Calibration corpus, verbatim |
|
| 239 |
+
| [reproducibility/calibration.py](https://huggingface.co/stornic56/Spark-X2.5-4B-GGUF/blob/main/reproducibility/calibration.py) | Exact corpus generation script |
|
| 240 |
+
| [reproducibility/fork_commit.txt](https://huggingface.co/stornic56/Spark-X2.5-4B-GGUF/blob/main/reproducibility/fork_commit.txt) | Fork commit used for conversion, imatrix and quantization |
|
| 241 |
+
| [reproducibility/base_model_revision.txt](https://huggingface.co/stornic56/Spark-X2.5-4B-GGUF/blob/main/reproducibility/base_model_revision.txt) | Upstream safetensors revision |
|
| 242 |
+
| [reproducibility/imatrix-run.log](https://huggingface.co/stornic56/Spark-X2.5-4B-GGUF/blob/main/reproducibility/imatrix-run.log) | Imatrix run output (tail of final clean run; identical PPL reproduced across runs) |
|
| 243 |
+
| [reproducibility/benchmarks_gpu.txt](https://huggingface.co/stornic56/Spark-X2.5-4B-GGUF/blob/main/reproducibility/benchmarks_gpu.txt) | Raw llama-bench output |
|
| 244 |
+
| [reproducibility/q2_k_repetition_loops.log](https://huggingface.co/stornic56/Spark-X2.5-4B-GGUF/blob/main/reproducibility/q2_k_repetition_loops.log) | Evidence for the Q2_K exclusion |
|
| 245 |
+
|
| 246 |
+
Exact commands:
|
| 247 |
+
|
| 248 |
+
```
|
| 249 |
+
python convert_hf_to_gguf.py Spark-X2.5-4B --outfile Spark-X2.5-4B-bf16.gguf --outtype bf16
|
| 250 |
+
|
| 251 |
+
./build/bin/llama-imatrix \
|
| 252 |
+
-m Spark-X2.5-4B-bf16.gguf \
|
| 253 |
+
-f calibration_data.txt \
|
| 254 |
+
-o Spark-X2.5-4B-imatrix.gguf \
|
| 255 |
+
-c 512 --chunks 128 -t 8
|
| 256 |
+
|
| 257 |
+
./build/bin/llama-quantize --imatrix Spark-X2.5-4B-imatrix.gguf \
|
| 258 |
+
Spark-X2.5-4B-bf16.gguf Spark-X2.5-4B-Q4_K_M.gguf Q4_K_M
|
| 259 |
+
```
|
| 260 |
+
|
| 261 |
+
## ARM/AVX information
|
| 262 |
+
|
| 263 |
+
llama.cpp automatically repacks weights into an interleaved layout at load time for
|
| 264 |
+
faster inference on ARM and AVX machines, covering Q4_0, IQ4_NL and most K-quants.
|
| 265 |
+
No special quant choice is needed for CPU inference.
|
| 266 |
+
|
| 267 |
+
## Credits
|
| 268 |
+
|
| 269 |
+
Thanks to the XHToken/SparkLLM team for releasing the model and maintaining the llama.cpp
|
| 270 |
+
fork, and to bartowski for the quantization card format this repo follows.
|
| 271 |
+
|
| 272 |
+
## License & attribution
|
| 273 |
+
|
| 274 |
+
The upstream model is released under Apache License 2.0; these derivative quantizations
|
| 275 |
+
inherit it. Preserve upstream attribution when redistributing. This is an unofficial
|
| 276 |
+
community release, not endorsed by XHToken/SparkLLM.
|
SHA256SUMS.txt
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
2ff41881527d095dbc02fe0c9b8e6ecd221dfe28b242d1f03dc5592d1b39fbb2 Spark-X2.5-4B-bf16.gguf
|
| 2 |
+
ec53c7b34670406e293675002a16fce012ceb31987ec062da6e97ebb43da93db Spark-X2.5-4B-imatrix.gguf
|
| 3 |
+
1d5ebeb9baa9101a4e4096055c08414051cf9accaf5ed105dd65e8b0632fd53e Spark-X2.5-4B-IQ2_M.gguf
|
| 4 |
+
46933a5cfb07b7c0652cdfe920c10790e47a35413d5ab48de16795ad59026f2b Spark-X2.5-4B-IQ3_M.gguf
|
| 5 |
+
aae5f3748fa3c8d37cee4d969ea283c15d616123b759667f7261bbdfad2a8e3d Spark-X2.5-4B-IQ4_NL.gguf
|
| 6 |
+
43937c350708aad690184b5ab1256e7ea55865a101e7e7e8ff52bc5e5e31c826 Spark-X2.5-4B-Q3_K_M.gguf
|
| 7 |
+
dc08c21953fbdf797d77fbe7cdecb353d8dc6cb3517c2f911e209bb37633726a Spark-X2.5-4B-Q4_K_M.gguf
|
| 8 |
+
ae851906d46fb622aa4cebea6fa9ca78b213d4258c85b60e943d2dace5a15f6f Spark-X2.5-4B-Q5_K_M.gguf
|
| 9 |
+
8c96b615b376c1178e2e284a389a9fca24bc4e40430ed735b9c88cef921453b7 Spark-X2.5-4B-Q6_K.gguf
|
| 10 |
+
092a263df8c891cdddd98b14b9ed71e44bb84643049fbfe656fb682b71d316c6 Spark-X2.5-4B-Q8_0.gguf
|
| 11 |
+
fc1dd2874bf42e945db9bd38e856ae18010f5c088e7446c706c5ba2f39310ee3 calibration_data.txt
|
Spark-X2.5-4B-IQ2_M.gguf
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:1d5ebeb9baa9101a4e4096055c08414051cf9accaf5ed105dd65e8b0632fd53e
|
| 3 |
+
size 1636324096
|
Spark-X2.5-4B-IQ3_M.gguf
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:46933a5cfb07b7c0652cdfe920c10790e47a35413d5ab48de16795ad59026f2b
|
| 3 |
+
size 2043300096
|
Spark-X2.5-4B-IQ4_NL.gguf
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:aae5f3748fa3c8d37cee4d969ea283c15d616123b759667f7261bbdfad2a8e3d
|
| 3 |
+
size 2476361216
|
Spark-X2.5-4B-Q3_K_M.gguf
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:43937c350708aad690184b5ab1256e7ea55865a101e7e7e8ff52bc5e5e31c826
|
| 3 |
+
size 2165197056
|
Spark-X2.5-4B-Q4_K_M.gguf
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:dc08c21953fbdf797d77fbe7cdecb353d8dc6cb3517c2f911e209bb37633726a
|
| 3 |
+
size 2600224256
|
Spark-X2.5-4B-Q5_K_M.gguf
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:ae851906d46fb622aa4cebea6fa9ca78b213d4258c85b60e943d2dace5a15f6f
|
| 3 |
+
size 2977895936
|
Spark-X2.5-4B-Q6_K.gguf
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:8c96b615b376c1178e2e284a389a9fca24bc4e40430ed735b9c88cef921453b7
|
| 3 |
+
size 3379172096
|
Spark-X2.5-4B-Q8_0.gguf
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:092a263df8c891cdddd98b14b9ed71e44bb84643049fbfe656fb682b71d316c6
|
| 3 |
+
size 4375021056
|
Spark-X2.5-4B-bf16.gguf
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:2ff41881527d095dbc02fe0c9b8e6ecd221dfe28b242d1f03dc5592d1b39fbb2
|
| 3 |
+
size 8229920032
|
Spark-X2.5-4B-imatrix.gguf
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:ec53c7b34670406e293675002a16fce012ceb31987ec062da6e97ebb43da93db
|
| 3 |
+
size 3572672
|
calibration_data.txt
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:fc1dd2874bf42e945db9bd38e856ae18010f5c088e7446c706c5ba2f39310ee3
|
| 3 |
+
size 10914845
|
reproducibility/base_model_revision.txt
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
5e10fcc0286756aebf7c41dc52c1e42d95c70281
|
reproducibility/benchmarks_gpu.txt
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
═══ Q8_0 ═══
|
| 2 |
+
| model | size | params | backend | ngl | test | t/s |
|
| 3 |
+
| ------------------------------ | ---------: | ---------: | ---------- | --: | --------------: | -------------------: |
|
| 4 |
+
| spark2_5 ?B Q8_0 | 4.07 GiB | 4.11 B | Vulkan | 99 | pp512 | 2039.45 ± 11.89 |
|
| 5 |
+
| spark2_5 ?B Q8_0 | 4.07 GiB | 4.11 B | Vulkan | 99 | tg128 | 69.49 ± 0.11 |
|
| 6 |
+
|
| 7 |
+
build: 4a3635c32 (10514)
|
| 8 |
+
═══ Q6_K ═══
|
| 9 |
+
| model | size | params | backend | ngl | test | t/s |
|
| 10 |
+
| ------------------------------ | ---------: | ---------: | ---------- | --: | --------------: | -------------------: |
|
| 11 |
+
| spark2_5 ?B Q6_K | 3.14 GiB | 4.11 B | Vulkan | 99 | pp512 | 1843.87 ± 5.20 |
|
| 12 |
+
| spark2_5 ?B Q6_K | 3.14 GiB | 4.11 B | Vulkan | 99 | tg128 | 70.48 ± 0.02 |
|
| 13 |
+
|
| 14 |
+
build: 4a3635c32 (10514)
|
| 15 |
+
═══ Q5_K_M ═══
|
| 16 |
+
| model | size | params | backend | ngl | test | t/s |
|
| 17 |
+
| ------------------------------ | ---------: | ---------: | ---------- | --: | --------------: | -------------------: |
|
| 18 |
+
| spark2_5 ?B Q5_K - Medium | 2.77 GiB | 4.11 B | Vulkan | 99 | pp512 | 1949.32 ± 9.95 |
|
| 19 |
+
| spark2_5 ?B Q5_K - Medium | 2.77 GiB | 4.11 B | Vulkan | 99 | tg128 | 79.81 ± 0.64 |
|
| 20 |
+
|
| 21 |
+
build: 4a3635c32 (10514)
|
| 22 |
+
═══ Q4_K_M ═══
|
| 23 |
+
| model | size | params | backend | ngl | test | t/s |
|
| 24 |
+
| ------------------------------ | ---------: | ---------: | ---------- | --: | --------------: | -------------------: |
|
| 25 |
+
| spark2_5 ?B Q4_K - Medium | 2.42 GiB | 4.11 B | Vulkan | 99 | pp512 | 2003.62 ± 1.34 |
|
| 26 |
+
| spark2_5 ?B Q4_K - Medium | 2.42 GiB | 4.11 B | Vulkan | 99 | tg128 | 93.31 ± 0.53 |
|
| 27 |
+
|
| 28 |
+
build: 4a3635c32 (10514)
|
| 29 |
+
═══ IQ4_NL ═══
|
| 30 |
+
| model | size | params | backend | ngl | test | t/s |
|
| 31 |
+
| ------------------------------ | ---------: | ---------: | ---------- | --: | --------------: | -------------------: |
|
| 32 |
+
| spark2_5 ?B IQ4_NL - 4.5 bpw | 2.30 GiB | 4.11 B | Vulkan | 99 | pp512 | 2079.09 ± 2.51 |
|
| 33 |
+
| spark2_5 ?B IQ4_NL - 4.5 bpw | 2.30 GiB | 4.11 B | Vulkan | 99 | tg128 | 53.87 ± 0.04 |
|
| 34 |
+
|
| 35 |
+
build: 4a3635c32 (10514)
|
| 36 |
+
═══ Q3_K_M ═══
|
| 37 |
+
| model | size | params | backend | ngl | test | t/s |
|
| 38 |
+
| ------------------------------ | ---------: | ---------: | ---------- | --: | --------------: | -------------------: |
|
| 39 |
+
| spark2_5 ?B Q3_K - Medium | 2.01 GiB | 4.11 B | Vulkan | 99 | pp512 | 1893.78 ± 41.34 |
|
| 40 |
+
| spark2_5 ?B Q3_K - Medium | 2.01 GiB | 4.11 B | Vulkan | 99 | tg128 | 95.29 ± 0.10 |
|
| 41 |
+
|
| 42 |
+
build: 4a3635c32 (10514)
|
| 43 |
+
═══ IQ3_M ═══
|
| 44 |
+
| model | size | params | backend | ngl | test | t/s |
|
| 45 |
+
| ------------------------------ | ---------: | ---------: | ---------- | --: | --------------: | -------------------: |
|
| 46 |
+
| spark2_5 ?B IQ3_S mix - 3.66 bpw | 1.90 GiB | 4.11 B | Vulkan | 99 | pp512 | 1969.10 ± 7.31 |
|
| 47 |
+
| spark2_5 ?B IQ3_S mix - 3.66 bpw | 1.90 GiB | 4.11 B | Vulkan | 99 | tg128 | 76.39 ± 0.48 |
|
| 48 |
+
|
| 49 |
+
build: 4a3635c32 (10514)
|
| 50 |
+
═══ IQ2_M ═══
|
| 51 |
+
| model | size | params | backend | ngl | test | t/s |
|
| 52 |
+
| ------------------------------ | ---------: | ---------: | ---------- | --: | --------------: | -------------------: |
|
| 53 |
+
| spark2_5 ?B IQ2_M - 2.7 bpw | 1.52 GiB | 4.11 B | Vulkan | 99 | pp512 | 2047.56 ± 7.56 |
|
| 54 |
+
| spark2_5 ?B IQ2_M - 2.7 bpw | 1.52 GiB | 4.11 B | Vulkan | 99 | tg128 | 46.36 ± 0.01 |
|
| 55 |
+
|
| 56 |
+
build: 4a3635c32 (10514)
|
reproducibility/calibration.py
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from datasets import load_dataset
|
| 2 |
+
with open("calibration_data.txt", "w", encoding="utf-8") as f:
|
| 3 |
+
ds = load_dataset("Salesforce/wikitext", "wikitext-2-raw-v1", split="train")
|
| 4 |
+
for ex in ds:
|
| 5 |
+
f.write(ex["text"])
|
reproducibility/fork_commit.txt
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
4a3635c32fc9f044c2bde9ebeabf50c7e1ec5991
|
reproducibility/imatrix-run.log
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Command: ./build/bin/llama-imatrix -m Spark-X2.5-4B-BF16.gguf -f calibration_data.txt -o Spark-X2.5-4B-imatrix.gguf -c 512 --chunks 128 -t 8
|
| 2 |
+
# Note: terminal-visible tail of the final (clean) run; early chunks scrolled off.
|
| 3 |
+
# A previous full run produced an identical final PPL (49.3694 +/- 1.09206), confirming determinism.
|
| 4 |
+
# --- run output below ---
|
| 5 |
+
[89]51.5243,[90]51.4395,[91]51.7192,[92]51.8162,[93]52.3294,[94]52.1363,[95]51.7138,[96]51.5093,23.32.001.298 W
|
| 6 |
+
save_imatrix: saving imatrix using GGUF format with a different suffix than .gguf
|
| 7 |
+
23.32.001.316 W save_imatrix: if you want the previous imatrix format, use --output-format dat
|
| 8 |
+
|
| 9 |
+
[97]51.4544,[98]52.8739,[99]52.7433,[100]52.5876,[101]53.3877,[102]52.9241,[103]52.1672,[104]51.4715,[105]50.7402,[106]51.1758,[107]51.6608,[108]50.9367,25.54.279.108 W
|
| 10 |
+
save_imatrix: saving imatrix using GGUF format with a different suffix than .gguf
|
| 11 |
+
25.54.279.127 W save_imatrix: if you want the previous imatrix format, use --output-format dat
|
| 12 |
+
|
| 13 |
+
[109]51.5952,[110]52.0192,[111]51.6026,[112]51.1949,[113]50.7800,[114]51.0304,[115]50.4734,[116]51.0291,28.15.994.809 W
|
| 14 |
+
save_imatrix: saving imatrix using GGUF format with a different suffix than .gguf
|
| 15 |
+
28.15.994.812 W save_imatrix: if you want the previous imatrix format, use --output-format dat
|
| 16 |
+
|
| 17 |
+
[117]51.2028,[118]51.4231,[119]50.3916,[120]50.9860,[121]50.5352,[122]50.0576,[123]49.6900,[124]49.4488,[125]49.1098,[126]49.0112,[127]48.7618,[128]49.3694,
|
| 18 |
+
Final estimate: PPL = 49.3694 +/- 1.09206
|
| 19 |
+
30.23.999.092 W
|
| 20 |
+
save_imatrix: saving imatrix using GGUF format with a different suffix than .gguf
|
| 21 |
+
30.23.999.093 W save_imatrix: if you want the previous imatrix format, use --output-format dat
|
reproducibility/q2_k_repetition_loops.log
ADDED
|
@@ -0,0 +1,129 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
for type in Q2_K IQ2_M; do
|
| 2 |
+
echo "═════════ $type (test extendido) ═════════"
|
| 3 |
+
./build/bin/llama-cli -m ../Spark-X2.5-4B-${type}.gguf \
|
| 4 |
+
-c 2048 -ngl 0 -t 8 --temp 0 --seed 1 -n 700 \
|
| 5 |
+
-cnv -st --jinja --simple-io \
|
| 6 |
+
-p "Write a Python function that checks if a number is prime:" 2>&1 | tail -60
|
| 7 |
+
done
|
| 8 |
+
═════════ Q2_K (test extendido) ═════════
|
| 9 |
+
return True
|
| 10 |
+
|
| 11 |
+
But we should also consider that the number might be negative, zero, or 1. So we can add a check at the beginning.
|
| 12 |
+
|
| 13 |
+
Alternatively, we can use a more efficient approach, but for this problem, a simple loop is fine.
|
| 14 |
+
|
| 15 |
+
We need to write a function that checks if a number is prime.
|
| 16 |
+
|
| 17 |
+
Let's write the function with proper handling.
|
| 18 |
+
|
| 19 |
+
We can also use a helper function to check for divisibility.
|
| 20 |
+
|
| 21 |
+
We should also consider that the number might be negative, zero, or 1. So we can add a check at the beginning.
|
| 22 |
+
|
| 23 |
+
We can write:
|
| 24 |
+
|
| 25 |
+
def is_prime(n):
|
| 26 |
+
if n < 2:
|
| 27 |
+
return False
|
| 28 |
+
if n == 2 or n == 3:
|
| 29 |
+
return True
|
| 30 |
+
for i in range(2, int(n**0.5) + 1):
|
| 31 |
+
if n % i == 0:
|
| 32 |
+
return False
|
| 33 |
+
return True
|
| 34 |
+
|
| 35 |
+
But we should also consider that the number might be negative, zero, or 1. So we can add a check at the beginning.
|
| 36 |
+
|
| 37 |
+
We can also use a more efficient approach, but for this problem, a simple loop is fine.
|
| 38 |
+
|
| 39 |
+
We should also consider that the number might be negative, zero, or 1. So we can add a check at the beginning.
|
| 40 |
+
|
| 41 |
+
We can write:
|
| 42 |
+
|
| 43 |
+
def is_prime(n):
|
| 44 |
+
if n < 2:
|
| 45 |
+
return False
|
| 46 |
+
if n == 2 or n == 3:
|
| 47 |
+
return True
|
| 48 |
+
for i in range(2, int(n**0.5) + 1):
|
| 49 |
+
if n % i == 0:
|
| 50 |
+
return False
|
| 51 |
+
return True
|
| 52 |
+
|
| 53 |
+
But we should also consider that the number might be negative, zero, or 1. So we can add a check at the beginning.
|
| 54 |
+
|
| 55 |
+
We can also use a more efficient approach, but for this problem, a simple loop is fine.
|
| 56 |
+
|
| 57 |
+
We should also consider that the number might be negative, zero, or 1. So we can add a check at the beginning.
|
| 58 |
+
|
| 59 |
+
We can write:
|
| 60 |
+
|
| 61 |
+
def is_prime(n):
|
| 62 |
+
if n < 2:
|
| 63 |
+
return False
|
| 64 |
+
|
| 65 |
+
[ Prompt: 36,6 t/s | Generation: 18,2 t/s ]
|
| 66 |
+
|
| 67 |
+
|
| 68 |
+
Exiting...
|
| 69 |
+
═════════ IQ2_M (test extendido) ═════════
|
| 70 |
+
/clear clear the chat history
|
| 71 |
+
/read <file> add a text file
|
| 72 |
+
/glob <pattern> add text files using globbing pattern
|
| 73 |
+
|
| 74 |
+
|
| 75 |
+
|
| 76 |
+
> Write a Python function that checks if a number is prime:
|
| 77 |
+
|
| 78 |
+
[Start thinking]
|
| 79 |
+
|
| 80 |
+
We are going to write a function that checks if a number is prime.
|
| 81 |
+
Steps:
|
| 82 |
+
1. If the number is less than 2, it is not prime. Return False.
|
| 83 |
+
2. Check for divisors from 2 to the square root of the number (inclusive). If we find a divisor, return False.
|
| 84 |
+
3. If no divisors are found, return True.
|
| 85 |
+
|
| 86 |
+
We can optimize by checking only odd numbers after 2, but note that we must check 2 and then odd numbers.
|
| 87 |
+
|
| 88 |
+
Alternatively, we can write a loop that checks from 2 to n-1, but we can break early when the divisor squared exceeds n.
|
| 89 |
+
|
| 90 |
+
Let's write the function with these steps.
|
| 91 |
+
[End thinking]
|
| 92 |
+
|
| 93 |
+
```python
|
| 94 |
+
def is_prime(n):
|
| 95 |
+
"""
|
| 96 |
+
Check if a given number is prime.
|
| 97 |
+
|
| 98 |
+
Parameters:
|
| 99 |
+
n (int): The number to check for primality.
|
| 100 |
+
|
| 101 |
+
Returns:
|
| 102 |
+
bool: True if n is prime, False otherwise.
|
| 103 |
+
"""
|
| 104 |
+
if n < 2: # 0 and 1 are not prime
|
| 105 |
+
return False
|
| 106 |
+
if n == 2: # 2 is prime
|
| 107 |
+
return True
|
| 108 |
+
if n % 2 == 0: # Even numbers other than 2 are not prime
|
| 109 |
+
return False
|
| 110 |
+
|
| 111 |
+
# Check odd numbers from 3 to the square root of n (inclusive)
|
| 112 |
+
i = 3
|
| 113 |
+
while i * i <= n:
|
| 114 |
+
if n % i == 0:
|
| 115 |
+
return False
|
| 116 |
+
i += 2
|
| 117 |
+
return True
|
| 118 |
+
```
|
| 119 |
+
|
| 120 |
+
**Explanation:**
|
| 121 |
+
1. **Base cases:** If `n` is less than 2, it's not prime. If `n` is 2, it's prime.
|
| 122 |
+
2. **Even numbers:** If `n` is even and not 2, it's not prime.
|
| 123 |
+
3. **Check odd divisors:** We check odd numbers starting from 3 up to the square root of `n` (inclusive). If `n` is divisible by any odd number, it's not prime.
|
| 124 |
+
4. **Efficiency:** By checking only odd numbers and stopping at the square root, the function avoids unnecessary checks and improves performance.
|
| 125 |
+
|
| 126 |
+
[ Prompt: 14,8 t/s | Generation: 10,8 t/s ]
|
| 127 |
+
|
| 128 |
+
|
| 129 |
+
Exiting...
|