以下の内容はhttps://touch-sp.hatenablog.com/entry/2026/01/15/124632より取得しました。


Windows用にflash-attentionをビルドする方法

Developer Command Prompt for VS 2022内で作業しました。

管理者権限は必要ありませんでした。

重要!!

スタートメニューから開いたDeveloper Command Prompt for VS 2022ではうまくいきませんでした。

Windows Terminalから開いたDeveloper Command Prompt for VS 2022では問題ありません。

二つは同じようで異なるようです。

アイコンも少し異なります。右がWindows Terminalから開いたものです。

手順

仮想環境の作成

py -3.13 -m venv env
env\Scripts\activate

ライブラリのインストール

python -m pip install --upgrade pip
pip install torch torchvision --index-url https://download.pytorch.org/whl/cu126
pip install ninja packaging

リポジトリのクローン

git clone https://github.com/Dao-AILab/flash-attention.git
cd flash-attention

git checkout v2.8.3
git config submodule.csrc/composable_kernel.update none
git submodule update --init --recursive

ビルド

こちらからWindowsWhlBuilder_cuda.batをダウンロードして実行

WindowsWhlBuilder_cuda.bat

PCの環境によって以下の数字は変更した方が良さそうです。

set MAX_JOBS=8




以上の内容はhttps://touch-sp.hatenablog.com/entry/2026/01/15/124632より取得しました。
このページはhttp://font.textar.tv/のウェブフォントを使用してます

不具合報告/要望等はこちらへお願いします。
モバイルやる夫Viewer Ver0.14