Skip to content

feat(kv): default the Hadamard rotation on for packed INT4 (#61) - #74

Merged
geisten merged 1 commit into
mainfrom
fix/int4-rotation-default-main
Jul 5, 2026
Merged

geisten merged 1 commit into
mainfrom
fix/int4-rotation-default-main

Conversation

@geisten

@geisten geisten commented Jul 5, 2026

Copy link
Copy Markdown
Owner

Restores a commit that was intended for #65 but did not make it into the squash merge (the squash was computed from an earlier state of the branch), so main currently ships packed INT4 with rotation opt-in only — i.e. GEIST_KV_INT4=1 alone hits the quality cliff.

INT4-without-rotation is a real quality regression: KL(fp32) 0.0127 vs 0.0086 with rotation (~6× INT8 vs ~4×), and the rotation is ~free — even net-faster than plain INT8 at long context (crossover measured in #65). So packed INT4 should rotate by default; GEIST_KV_ROT=0 opts out, =1 forces on. Plain INT8 stays opt-in (unchanged).

Verified: GEIST_KV_INT4=1 output is now byte-identical to GEIST_KV_INT4=1 GEIST_KV_ROT=1 and differs from GEIST_KV_ROT=0 (gemma4-e2b).

🤖 Generated with Claude Code

INT4-without-rotation is a real quality cliff (KL 0.0127 vs 0.0086 with
rotation, ~6x INT8 vs ~4x) and the rotation is ~free — even net-faster than
plain INT8 at long context. Make GEIST_KV_INT4 rotate by default;
GEIST_KV_ROT=0 opts out. Plain INT8 stays opt-in (unchanged).
@geisten
geisten merged commit 6e7a91f into main Jul 5, 2026
6 checks passed
@geisten
geisten deleted the fix/int4-rotation-default-main branch July 5, 2026 12:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant