SageAttention

Last-modified: 2026-06-16 (火) 18:36:53

##執筆中の適当な説明です。加筆募集中##

概要

xformersなどに代わる、より高性能ななにか。
sd-scriptsでの推論(学習は使用できない)やComfyUIの推論高速化に使用する

効果

こちらを参照
sd-scripts / issues #1820

インストール方法

こちら加筆中です。加筆完了までは公式ページかとりあえずこちらをどうぞ
github/musubi_tuner内のインストール説明

  • SageAttentionのインストールと、その依存ライブラリであるtritonが必要です。

tritonインストール

こちらのページを参照
triton

SageAttention導入

外部リンク先を参照のこと
github/SageAttention

pip install SageAttention

おそらく、このあとC言語コンパイルする作業有り。
筆者は導入後の検証用アプリがないので、加筆できていません

別の筆者による注記(暫定)
上記のようにオプションなしでpipインストールすると、PyPIに登録されたSageAttentionのv1がインストールされる。
RTX 30シリーズ以降ではv2の方が有用、というかv1は現在のほとんどの環境で動作しないなずなので、Windowsではwoct0rdho氏が配布しているwheelを利用するのが一般的。musubi_tunerで紹介されているsdbds氏のwheelは使ったことがないので分からない。
自分でコンパイルする場合はpipではなくgit clone等でソースをダウンロード。

  • 例)Pytorch 2.9以上+cu128でwoct0rdho氏のwheelをインストールするコマンド
    pip install https://github.com/woct0rdho/SageAttention/releases/download/v2.2.0-windows.post4/sageattention-2.2.0+cu128torch2.9.0andhigher.post4-cp39-abi3-win_amd64.whl
  • 例)Pytorch 2.9以上+cu130でwoct0rdho氏のwheelをインストールするコマンド
    pip install https://github.com/woct0rdho/SageAttention/releases/download/v2.2.0-windows.post4/sageattention-2.2.0+cu130torch2.9.0andhigher.post4-cp39-abi3-win_amd64.whl