SYSTEM NOTICE

Auto translation by AI. Be sure, accuracy, nuances and authorial intent may not be fully reflected.
見出し画像

Upgrading CUDA to 13 for ComfyUI and Testing MiniMax H3

I posted an article about MiniMax H3, but since the generation speed seemed slower than others, I decided to investigate.

It seems that when the CUDA version reaches 13 or higher, various things change. (I have been using CUDA 12.8 until now.)

Since the GPU I have on hand is a 4090, I cannot benefit from the Blackwell architecture, but the 50X0 series can expect speedups with nvpf4.

So, this time, I will upgrade CUDA to 13 and check if the generation speed increases.

I will be modifying the ComfyUI Python environment, so please only try this if you are confident.


Environment

OS: Windows 11
GPU: GeForce RTX 4090
CPU: i9-13900KF
memory: 128G


Settings

I will change to the following settings.

・Python: 3.11.6 (no change)
・torch: 2.11.0+cu130
・triton-windows: 3.7.1


Procedure

Execute the following command

# ComfyUIポータブル版のフォルダに移動
cd ComfyUI_windows_portable

# コマンドプロンプトをpowershellに変更
powershell


# 0. バックアップ(ポータブル環境の最も確実なロールバック手段。数GBありますが強く推奨)
Copy-Item -Recurse python_embeded python_embeded_backup_cu128

# 1. PyTorch本体をCUDA 13版へ
.\python_embeded\python.exe -m pip install --upgrade torch==2.11.0+cu130 torchvision==0.26.0+cu130 torchaudio==2.11.0+cu130 --extra-index-url https://download.pytorch.org/whl/cu130

# 2. triton-windowsをtorch 2.11対応版へ
.\python_embeded\python.exe -m pip install --upgrade triton-windows==3.7.1.post27

# 3. sageattentionをcu130ビルドに差し替え
.\python_embeded\python.exe -m pip install --force-reinstall --no-deps https://github.com/woct0rdho/SageAttention/releases/download/v2.2.0-windows.post6/sageattention-2.2.0+cu130torch2.10.0andhigher.post6-cp310-abi3-win_amd64.whl

# 4. 旧torch(2.7)向けビルドで確実に壊れるものを削除(ComfyUI本体はPyTorchアテンションに自動フォールバックするので動作に支障なし)
.\python_embeded\python.exe -m pip uninstall -y xformers flash_attn

# 5. 動作確認
.\python_embeded\python.exe -c "import torch; print(torch.__version__, torch.version.cuda, torch.cuda.is_available(), torch.cuda.get_device_name(0))"

# 期待される確認結果: 2.11.0+cu130 13.0 True NVIDIA GeForce RTX 4090
# 問題が起きた場合のロールバックは、python_embeded を削除して python_embeded_backup_cu128 をリネームして戻す


Results

I will test the workflow generated in the following article.
I removed '--reserve-vram 6.0'.

The generation results are as follows.
The generation result itself doesn't matter, but the generation time has changed from about 10 minutes with CUDA 12.8.

The generation time was 132 seconds, CPU memory was 72GB, and GPU memory was 67GB (22GB VRAM + 45GB shared memory).


Impressions

It's fast.
No extra options needed either. This is really fast.
I wonder if other models will get faster too.
I must try out various things.

いいなと思ったら応援しよう!