Views
No views yet

.pt files so you don't need to re-run the Q/K/V dump and eigendecomposition yourself.| Model | Calibration | GPQA (BF16) | GPQA (OSCAR INT2) |
|---|---|---|---|
Qwen/Qwen3-4B-Thinking-2507 | seq20000_prompt83_group128 | 67.27 | 67.17 |
Qwen/Qwen3-4B-Thinking-2507 | seq20000_prompt85_group128 (fresh re-dump) | 67.27 | — |
Qwen/Qwen3-8B | seq20000_prompt83_group128 | 56.67 | 55.56 |
Qwen/Qwen3-32B | seq16000_prompt69_group128 | 58.49 | 60.40 |
zai-org/GLM-4.7-FP8 | seq10000_prompt43_group128 | 73.23 | 73.57 |
seq<T>_prompt<N>_group<G> notation: T = total calibration tokens, N = calibration prompt count, G = INT2 quant group size along head_dim.k_rotation_qqt_r_h_pbr.pt — K-side rotation R_K = R · H · P_br where R = eigvec(Σ_Q) is fit on Q's attention-aware covariance, H is a head-dim Hadamard, and P_br is the eigenvalue-sorted bit-reversal permutationv_rotation_sst_r_h_pbr.pt — V-side rotation built on the score-weighted V covariance Σ_V = V^T diag(K^T (Q^T Q) K) V1{
2 "format_version": 1,
3 "objective": "qqt_r_h_pbr", # or "sst_r_h_pbr" for V
4 "source_grouping": "layer",
5 "layers": {
6 0: {"layer_id": 0, "rotation": tensor(head_dim, head_dim)},
7 1: {"layer_id": 1, "rotation": tensor(head_dim, head_dim)},
8 ...
9 }
10}pip install huggingface_hub1from huggingface_hub import snapshot_download
2snapshot_download(
3 repo_id="Zhongzhu/OSCAR-RotationZoo",
4 allow_patterns="Qwen3-8B/**",
5 local_dir="./oscar_rotations",
6)
7# rotations now at ./oscar_rotations/Qwen3-8B/seq20000_prompt83_group128/oscar conda env, then point the eval driver at your downloaded rotation:1ROT_DIR=./oscar_rotations/Qwen3-8B/seq20000_prompt83_group128 \
2 bash rotation/qwen3-8B/eval_gpqa.sh1SGLANG_ENABLE_MIXED_KV_WINDOWS=1 \
2SGLANG_OSCAR_ROTATION_MODE=oscar \
3SGLANG_OSCAR_K_ROTATION_PATH=$ROT_DIR/k_rotation_qqt_r_h_pbr.pt \
4SGLANG_OSCAR_V_ROTATION_PATH=$ROT_DIR/v_rotation_sst_r_h_pbr.pt \
5SGLANG_OSCAR_K_CLIP_RATIO=0.96 \
6SGLANG_OSCAR_V_CLIP_RATIO=0.92 \
7SGLANG_OSCAR_ABSORB_V_ROTATION=1 \
8SGLANG_MIXED_KV_PREFIX_TOKENS=64 \
9SGLANG_MIXED_KV_RECENT_TOKENS=256 \
10HADAMARD_ORDER=128 \
11python -m sglang.launch_server \
12 --model-path Qwen/Qwen3-8B \
13 --tensor-parallel-size 1 \
14 --kv-cache-dtype int2 \
15 --kv-cache-quant-group-size 128 \
16 --prefill-attention-backend fa3 \
17 --decode-attention-backend triton \
18 --disable-radix-cache \
19 --disable-custom-all-reduce \
20 --trust-remote-code1git clone https://github.com/FutureMLS-Lab/OSCAR.git
2cd OSCAR
3bash rotation/qwen3-8B/save_qkv_8b.sh # phase 1 — dump Q/K/V
4bash rotation/qwen3-8B/compute_rotation.sh # phase 2 — fit R = eigvec(Σ_Q)1@article{zhou2026oscar,
2 title = {OSCAR: Offline Spectral Covariance-Aware Rotation for 2-bit KV Cache Quantization},
3 author = {Zhou, Zhongzhu and Zhuang, Donglin and Li, Jisen and Chen, Ziyan and Song, Shuaiwen Leon and Athiwaratkun, Ben and Wu, Xiaoxia},
4 year = {2026},
5 note = {Together AI; University of Sydney; UIUC},
6}