Instructions to use donghyunli/Llama-2-70b-KronQ-W3A16-fake with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use donghyunli/Llama-2-70b-KronQ-W3A16-fake with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="donghyunli/Llama-2-70b-KronQ-W3A16-fake")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("donghyunli/Llama-2-70b-KronQ-W3A16-fake") model = AutoModelForCausalLM.from_pretrained("donghyunli/Llama-2-70b-KronQ-W3A16-fake", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use donghyunli/Llama-2-70b-KronQ-W3A16-fake with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "donghyunli/Llama-2-70b-KronQ-W3A16-fake" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "donghyunli/Llama-2-70b-KronQ-W3A16-fake", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/donghyunli/Llama-2-70b-KronQ-W3A16-fake
- SGLang
How to use donghyunli/Llama-2-70b-KronQ-W3A16-fake 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 "donghyunli/Llama-2-70b-KronQ-W3A16-fake" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "donghyunli/Llama-2-70b-KronQ-W3A16-fake", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'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 "donghyunli/Llama-2-70b-KronQ-W3A16-fake" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "donghyunli/Llama-2-70b-KronQ-W3A16-fake", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use donghyunli/Llama-2-70b-KronQ-W3A16-fake with Docker Model Runner:
docker model run hf.co/donghyunli/Llama-2-70b-KronQ-W3A16-fake
Llama-2-70b-hf — KronQ W3A16 (fake-quant fp16)
Paper: arXiv:2607.07964 · Code: GitHub
⚠️ Fake-quant fp16 checkpoint. 3-bit weights stored in fp16 (KronQ does not pack int3) — same size as bf16, for PPL/accuracy reproduction only. For deployable low-bit see the W4A16 / W2A16 (packed) repos.
Llama-2-70b-hf quantized to 3-bit weights with KronQ, exported as a standard fp16 model.
Results (WikiText-2, seqlen 2048)
Perplexity: 3.66
Zero-shot accuracy:
| PIQA | ARC-E | ARC-C | HellaSwag | WinoGrande | BoolQ | OBQA | Average |
|---|---|---|---|---|---|---|---|
| 82.26 | 81.86 | 58.28 | 82.45 | 78.53 | 82.97 | 48.80 | 73.59 |
(lm-evaluation-harness, 0-shot. acc_norm for PIQA/HellaSwag/ARC/OBQA, acc for WinoGrande/BoolQ.)
Usage
Loads as a standard fp16 model (no KronQ code):
from transformers import AutoModelForCausalLM, AutoTokenizer
m = AutoModelForCausalLM.from_pretrained("donghyunli/Llama-2-70b-KronQ-W3A16-fake", torch_dtype="float16", device_map="auto")
Recipe
Per-channel asymmetric W3, weight-only (a_bits=16), --alpha 0.25, BiIP, act_order, raw H_G.
License
Derivative of Llama-2-70b-hf — llama2 license.
- Downloads last month
- 21
Model tree for donghyunli/Llama-2-70b-KronQ-W3A16-fake
Base model
meta-llama/Llama-2-70b-hf