Instructions to use MoritzMo123/kfac-svd_uniform_llama-3-8b_0.6 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use MoritzMo123/kfac-svd_uniform_llama-3-8b_0.6 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="MoritzMo123/kfac-svd_uniform_llama-3-8b_0.6", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("MoritzMo123/kfac-svd_uniform_llama-3-8b_0.6", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use MoritzMo123/kfac-svd_uniform_llama-3-8b_0.6 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "MoritzMo123/kfac-svd_uniform_llama-3-8b_0.6" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "MoritzMo123/kfac-svd_uniform_llama-3-8b_0.6", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/MoritzMo123/kfac-svd_uniform_llama-3-8b_0.6
- SGLang
How to use MoritzMo123/kfac-svd_uniform_llama-3-8b_0.6 with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "MoritzMo123/kfac-svd_uniform_llama-3-8b_0.6" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "MoritzMo123/kfac-svd_uniform_llama-3-8b_0.6", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "MoritzMo123/kfac-svd_uniform_llama-3-8b_0.6" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "MoritzMo123/kfac-svd_uniform_llama-3-8b_0.6", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use MoritzMo123/kfac-svd_uniform_llama-3-8b_0.6 with Docker Model Runner:
docker model run hf.co/MoritzMo123/kfac-svd_uniform_llama-3-8b_0.6
unsloth/llama-3-8b — uniform search — 0.6 target ratio
This model was compressed using kfac_svd with uniform rank search starting from unsloth/llama-3-8b as base model. You may check out our publication, the OpenReview page and project page for details on kfac-svd and our LEMS rank search.
Update (2026-10-23). The weights were recomputed with the fixed KFAC-SVD implementation. The first release of the code (v1, used for the published paper) whitened the output side of each weight with the Cholesky factor L of G = LLᵀ instead of Lᵀ. The correct version was described by the algorithm in the paper already. Those weights, which the paper's tables report, remain available as revision
v1-paper:AutoModelForCausalLM.from_pretrained("MoritzMo123/kfac-svd_uniform_llama-3-8b_0.6", revision="v1-paper", trust_remote_code=True).
Compression Details
| Metric | Value |
|---|---|
| Base Model | unsloth/llama-3-8b |
| Method | kfac_svd |
| Search Method | uniform |
| Target Ratio | 0.6 |
| Compression Metric | params |
| Recommended Dtype | float16 |
| Compressed Layers | 224 |
| Total Parameters | 5,237,117,152 |
Usage
The checkpoint records its recommended dtype in config.json; no explicit torch_dtype argument should be needed with this remote-code wrapper. For standard Transformers models, torch_dtype="auto" is the portable fallback.
from transformers import AutoModelForCausalLM, AutoTokenizer
model = AutoModelForCausalLM.from_pretrained(
"MoritzMo123/kfac-svd_uniform_llama-3-8b_0.6",
trust_remote_code=True,
device_map="auto",
)
tokenizer = AutoTokenizer.from_pretrained("MoritzMo123/kfac-svd_uniform_llama-3-8b_0.6")
inputs = tokenizer('Hello, ', return_tensors="pt").to(model.device)
outputs = model.generate(**inputs, max_new_tokens=50)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
Evaluation Results
| Dataset | Perplexity |
|---|---|
| wikitext2 | 33.97 |
| ptb | 536.55 |
| c4 | 325.43 |
Zero-shot accuracy (LM-Eval, %):
| Task | Accuracy |
|---|---|
| OpenBookQA | 19.00 |
| ARC-e | 38.38 |
| ARC-c | 19.03 |
| WinoGrande | 54.54 |
| HellaSwag | 29.03 |
| PIQA | 57.45 |
| Average | 36.24 |
Rank Allocation
Per-layer ranks (click to expand)
| Layer | Rank |
|---|---|
model.layers.0.mlp.down_proj |
1911 |
model.layers.0.mlp.gate_proj |
1911 |
model.layers.0.mlp.up_proj |
1911 |
model.layers.0.self_attn.k_proj |
491 |
model.layers.0.self_attn.o_proj |
1228 |
model.layers.0.self_attn.q_proj |
1228 |
model.layers.0.self_attn.v_proj |
491 |
model.layers.1.mlp.down_proj |
1911 |
model.layers.1.mlp.gate_proj |
1911 |
model.layers.1.mlp.up_proj |
1911 |
model.layers.1.self_attn.k_proj |
491 |
model.layers.1.self_attn.o_proj |
1228 |
model.layers.1.self_attn.q_proj |
1228 |
model.layers.1.self_attn.v_proj |
491 |
model.layers.10.mlp.down_proj |
1911 |
model.layers.10.mlp.gate_proj |
1911 |
model.layers.10.mlp.up_proj |
1911 |
model.layers.10.self_attn.k_proj |
491 |
model.layers.10.self_attn.o_proj |
1228 |
model.layers.10.self_attn.q_proj |
1228 |
model.layers.10.self_attn.v_proj |
491 |
model.layers.11.mlp.down_proj |
1911 |
model.layers.11.mlp.gate_proj |
1911 |
model.layers.11.mlp.up_proj |
1911 |
model.layers.11.self_attn.k_proj |
491 |
model.layers.11.self_attn.o_proj |
1228 |
model.layers.11.self_attn.q_proj |
1228 |
model.layers.11.self_attn.v_proj |
491 |
model.layers.12.mlp.down_proj |
1911 |
model.layers.12.mlp.gate_proj |
1911 |
model.layers.12.mlp.up_proj |
1911 |
model.layers.12.self_attn.k_proj |
491 |
model.layers.12.self_attn.o_proj |
1228 |
model.layers.12.self_attn.q_proj |
1228 |
model.layers.12.self_attn.v_proj |
491 |
model.layers.13.mlp.down_proj |
1911 |
model.layers.13.mlp.gate_proj |
1911 |
model.layers.13.mlp.up_proj |
1911 |
model.layers.13.self_attn.k_proj |
491 |
model.layers.13.self_attn.o_proj |
1228 |
model.layers.13.self_attn.q_proj |
1228 |
model.layers.13.self_attn.v_proj |
491 |
model.layers.14.mlp.down_proj |
1911 |
model.layers.14.mlp.gate_proj |
1911 |
model.layers.14.mlp.up_proj |
1911 |
model.layers.14.self_attn.k_proj |
491 |
model.layers.14.self_attn.o_proj |
1228 |
model.layers.14.self_attn.q_proj |
1228 |
model.layers.14.self_attn.v_proj |
491 |
model.layers.15.mlp.down_proj |
1911 |
model.layers.15.mlp.gate_proj |
1911 |
model.layers.15.mlp.up_proj |
1911 |
model.layers.15.self_attn.k_proj |
491 |
model.layers.15.self_attn.o_proj |
1228 |
model.layers.15.self_attn.q_proj |
1228 |
model.layers.15.self_attn.v_proj |
491 |
model.layers.16.mlp.down_proj |
1911 |
model.layers.16.mlp.gate_proj |
1911 |
model.layers.16.mlp.up_proj |
1911 |
model.layers.16.self_attn.k_proj |
491 |
model.layers.16.self_attn.o_proj |
1228 |
model.layers.16.self_attn.q_proj |
1228 |
model.layers.16.self_attn.v_proj |
491 |
model.layers.17.mlp.down_proj |
1911 |
model.layers.17.mlp.gate_proj |
1911 |
model.layers.17.mlp.up_proj |
1911 |
model.layers.17.self_attn.k_proj |
491 |
model.layers.17.self_attn.o_proj |
1228 |
model.layers.17.self_attn.q_proj |
1228 |
model.layers.17.self_attn.v_proj |
491 |
model.layers.18.mlp.down_proj |
1911 |
model.layers.18.mlp.gate_proj |
1911 |
model.layers.18.mlp.up_proj |
1911 |
model.layers.18.self_attn.k_proj |
491 |
model.layers.18.self_attn.o_proj |
1228 |
model.layers.18.self_attn.q_proj |
1228 |
model.layers.18.self_attn.v_proj |
491 |
model.layers.19.mlp.down_proj |
1911 |
model.layers.19.mlp.gate_proj |
1911 |
model.layers.19.mlp.up_proj |
1911 |
model.layers.19.self_attn.k_proj |
491 |
model.layers.19.self_attn.o_proj |
1228 |
model.layers.19.self_attn.q_proj |
1228 |
model.layers.19.self_attn.v_proj |
491 |
model.layers.2.mlp.down_proj |
1911 |
model.layers.2.mlp.gate_proj |
1911 |
model.layers.2.mlp.up_proj |
1911 |
model.layers.2.self_attn.k_proj |
491 |
model.layers.2.self_attn.o_proj |
1228 |
model.layers.2.self_attn.q_proj |
1228 |
model.layers.2.self_attn.v_proj |
491 |
model.layers.20.mlp.down_proj |
1911 |
model.layers.20.mlp.gate_proj |
1911 |
model.layers.20.mlp.up_proj |
1911 |
model.layers.20.self_attn.k_proj |
491 |
model.layers.20.self_attn.o_proj |
1228 |
model.layers.20.self_attn.q_proj |
1228 |
model.layers.20.self_attn.v_proj |
491 |
model.layers.21.mlp.down_proj |
1911 |
model.layers.21.mlp.gate_proj |
1911 |
model.layers.21.mlp.up_proj |
1911 |
model.layers.21.self_attn.k_proj |
491 |
model.layers.21.self_attn.o_proj |
1228 |
model.layers.21.self_attn.q_proj |
1228 |
model.layers.21.self_attn.v_proj |
491 |
model.layers.22.mlp.down_proj |
1911 |
model.layers.22.mlp.gate_proj |
1911 |
model.layers.22.mlp.up_proj |
1911 |
model.layers.22.self_attn.k_proj |
491 |
model.layers.22.self_attn.o_proj |
1228 |
model.layers.22.self_attn.q_proj |
1228 |
model.layers.22.self_attn.v_proj |
491 |
model.layers.23.mlp.down_proj |
1911 |
model.layers.23.mlp.gate_proj |
1911 |
model.layers.23.mlp.up_proj |
1911 |
model.layers.23.self_attn.k_proj |
491 |
model.layers.23.self_attn.o_proj |
1228 |
model.layers.23.self_attn.q_proj |
1228 |
model.layers.23.self_attn.v_proj |
491 |
model.layers.24.mlp.down_proj |
1911 |
model.layers.24.mlp.gate_proj |
1911 |
model.layers.24.mlp.up_proj |
1911 |
model.layers.24.self_attn.k_proj |
491 |
model.layers.24.self_attn.o_proj |
1228 |
model.layers.24.self_attn.q_proj |
1228 |
model.layers.24.self_attn.v_proj |
491 |
model.layers.25.mlp.down_proj |
1911 |
model.layers.25.mlp.gate_proj |
1911 |
model.layers.25.mlp.up_proj |
1911 |
model.layers.25.self_attn.k_proj |
491 |
model.layers.25.self_attn.o_proj |
1228 |
model.layers.25.self_attn.q_proj |
1228 |
model.layers.25.self_attn.v_proj |
491 |
model.layers.26.mlp.down_proj |
1911 |
model.layers.26.mlp.gate_proj |
1911 |
model.layers.26.mlp.up_proj |
1911 |
model.layers.26.self_attn.k_proj |
491 |
model.layers.26.self_attn.o_proj |
1228 |
model.layers.26.self_attn.q_proj |
1228 |
model.layers.26.self_attn.v_proj |
491 |
model.layers.27.mlp.down_proj |
1911 |
model.layers.27.mlp.gate_proj |
1911 |
model.layers.27.mlp.up_proj |
1911 |
model.layers.27.self_attn.k_proj |
491 |
model.layers.27.self_attn.o_proj |
1228 |
model.layers.27.self_attn.q_proj |
1228 |
model.layers.27.self_attn.v_proj |
491 |
model.layers.28.mlp.down_proj |
1911 |
model.layers.28.mlp.gate_proj |
1911 |
model.layers.28.mlp.up_proj |
1911 |
model.layers.28.self_attn.k_proj |
491 |
model.layers.28.self_attn.o_proj |
1228 |
model.layers.28.self_attn.q_proj |
1228 |
model.layers.28.self_attn.v_proj |
491 |
model.layers.29.mlp.down_proj |
1911 |
model.layers.29.mlp.gate_proj |
1911 |
model.layers.29.mlp.up_proj |
1911 |
model.layers.29.self_attn.k_proj |
491 |
model.layers.29.self_attn.o_proj |
1228 |
model.layers.29.self_attn.q_proj |
1228 |
model.layers.29.self_attn.v_proj |
491 |
model.layers.3.mlp.down_proj |
1911 |
model.layers.3.mlp.gate_proj |
1911 |
model.layers.3.mlp.up_proj |
1911 |
model.layers.3.self_attn.k_proj |
491 |
model.layers.3.self_attn.o_proj |
1228 |
model.layers.3.self_attn.q_proj |
1228 |
model.layers.3.self_attn.v_proj |
491 |
model.layers.30.mlp.down_proj |
1911 |
model.layers.30.mlp.gate_proj |
1911 |
model.layers.30.mlp.up_proj |
1911 |
model.layers.30.self_attn.k_proj |
491 |
model.layers.30.self_attn.o_proj |
1228 |
model.layers.30.self_attn.q_proj |
1228 |
model.layers.30.self_attn.v_proj |
491 |
model.layers.31.mlp.down_proj |
1911 |
model.layers.31.mlp.gate_proj |
1911 |
model.layers.31.mlp.up_proj |
1911 |
model.layers.31.self_attn.k_proj |
491 |
model.layers.31.self_attn.o_proj |
1228 |
model.layers.31.self_attn.q_proj |
1228 |
model.layers.31.self_attn.v_proj |
491 |
model.layers.4.mlp.down_proj |
1911 |
model.layers.4.mlp.gate_proj |
1911 |
model.layers.4.mlp.up_proj |
1911 |
model.layers.4.self_attn.k_proj |
491 |
model.layers.4.self_attn.o_proj |
1228 |
model.layers.4.self_attn.q_proj |
1228 |
model.layers.4.self_attn.v_proj |
491 |
model.layers.5.mlp.down_proj |
1911 |
model.layers.5.mlp.gate_proj |
1911 |
model.layers.5.mlp.up_proj |
1911 |
model.layers.5.self_attn.k_proj |
491 |
model.layers.5.self_attn.o_proj |
1228 |
model.layers.5.self_attn.q_proj |
1228 |
model.layers.5.self_attn.v_proj |
491 |
model.layers.6.mlp.down_proj |
1911 |
model.layers.6.mlp.gate_proj |
1911 |
model.layers.6.mlp.up_proj |
1911 |
model.layers.6.self_attn.k_proj |
491 |
model.layers.6.self_attn.o_proj |
1228 |
model.layers.6.self_attn.q_proj |
1228 |
model.layers.6.self_attn.v_proj |
491 |
model.layers.7.mlp.down_proj |
1911 |
model.layers.7.mlp.gate_proj |
1911 |
model.layers.7.mlp.up_proj |
1911 |
model.layers.7.self_attn.k_proj |
491 |
model.layers.7.self_attn.o_proj |
1228 |
model.layers.7.self_attn.q_proj |
1228 |
model.layers.7.self_attn.v_proj |
491 |
model.layers.8.mlp.down_proj |
1911 |
model.layers.8.mlp.gate_proj |
1911 |
model.layers.8.mlp.up_proj |
1911 |
model.layers.8.self_attn.k_proj |
491 |
model.layers.8.self_attn.o_proj |
1228 |
model.layers.8.self_attn.q_proj |
1228 |
model.layers.8.self_attn.v_proj |
491 |
model.layers.9.mlp.down_proj |
1911 |
model.layers.9.mlp.gate_proj |
1911 |
model.layers.9.mlp.up_proj |
1911 |
model.layers.9.self_attn.k_proj |
491 |
model.layers.9.self_attn.o_proj |
1228 |
model.layers.9.self_attn.q_proj |
1228 |
model.layers.9.self_attn.v_proj |
491 |
Hydra Configuration Summary
| Config Field | Value |
|---|---|
| Model | unsloth/llama-3-8b |
| SVD Method | kfac_svd |
| Search Method | uniform |
| Compression Target | 0.6 |
| Target Metric | params |
| Calibration Dataset | wikitext2 |
| Calibration Samples | 256 |
| Sequence Length | 2048 |
| Seed | 42 |
- Downloads last month
- 163
Model tree for MoritzMo123/kfac-svd_uniform_llama-3-8b_0.6
Base model
unsloth/llama-3-8bDataset used to train MoritzMo123/kfac-svd_uniform_llama-3-8b_0.6
Collection including MoritzMo123/kfac-svd_uniform_llama-3-8b_0.6
Paper for MoritzMo123/kfac-svd_uniform_llama-3-8b_0.6
Evaluation results
- Perplexity on WikiText-2test set self-reported33.970
- Perplexity on PTBtest set self-reported536.550
- Perplexity on C4validation set self-reported325.430
- Accuracy on OpenBookQA (zero-shot)test set self-reported19.000
- Accuracy on ARC-e (zero-shot)test set self-reported38.380
- Accuracy on ARC-c (zero-shot)test set self-reported19.030
- Accuracy on WinoGrande (zero-shot)validation set self-reported54.540
- Accuracy on HellaSwag (zero-shot)validation set self-reported29.030