Skip to content

v0.2.0

Choose a tag to compare

@IxMxAMAR IxMxAMAR released this 02 Oct 14:55
· 10 commits to main since this release

int8 Q·K for fp16, and bf16 models on the hand-written kernels.

python -m pip install --no-deps sageattention-2.2.0+amd.gfx12.2-cp312-cp312-win_amd64.whl

Requirements (unchanged): Windows 10/11, Python 3.12, PyTorch 2.13.0+rocm10.0.0, an RX 9070 or RX 9070 XT.

What changed

  • fp16 now computes Q·K in int8, with one scale per token. Inside real Krea2 renders its per-call error is 0.82× the fp8 kernel's, at the same step time. SAGEATTN_SK1_INT8=0 brings back v0.1.0's fp8 kernel, bit for bit.
  • bf16 models now run on the hand-written kernels (on by default). Against PR #368's bf16 path: 0.76 of its time non-causal, 0.44 causal. In a bf16 Krea2 render: 6.9 % faster per step than PyTorch SDPA at 1 MP and 14.2 % at 2 MP. SAGEATTN_SK1_BF16=0 sends bf16 back to PR #368's path.
  • Fallback order for fp16 is int8 kernel, fp8 kernel, PR #368. Nothing raises unless you set a switch to 1.

Worth knowing

  • On long sequences (around 47k tokens, non-causal, i.e. 720p-video lengths) int8 is up to 1.7 % slower per attention call than the fp8 kernel. If you'd rather have the speed there, set SAGEATTN_SK1_INT8=0. bf16 models never use int8, so they aren't affected.
  • head_dim 64 still uses PR #368's kernel. A head_dim 64 kernel was built and tested, and it was slower.

See the README for the numbers and docs/FINDINGS.md (F155–F159) for how they were measured.

sha256 b6b76ad32b4ccddae728341d0c3f345f57c7e459fa4fa62152dc711516b566db