Are you facing slow performance when running your models using ComfyUI/SD WebUI or any pytorch program using your Radeon 9070XT, AI Pro R9700, or Strix Halo (Radeon 8060S) ? Then we need your help! Please provide us performance logs when running your models. It will help us tune our libraries for better performance on your models.
Please set the following environment variables depending on your OS:
Windows (powershell)
$env:MIOPEN_ENABLE_LOGGING=1
$env:MIOPEN_ENABLE_LOGGING_CMD=1
$env:HIPBLASLT_LOG_MASK=32
$env:HIPBLASLT_LOG_FILE="your_model_hipblaslt_log.txt"
$env:TORCH_BLAS_PREFER_HIPBLASLT=1
$env:COMFYUI_ENABLE_MIOPEN=1
Linux:
export MIOPEN_ENABLE_LOGGING=1
export MIOPEN_ENABLE_LOGGING_CMD=1
export HIPBLASLT_LOG_MASK=32
export HIPBLASLT_LOG_FILE="your_model_hipblaslt_log.txt"
export TORCH_BLAS_PREFER_HIPBLASLT=1
export COMFYUI_ENABLE_MIOPEN=1
NOTE: hipBLASLt logs every call of every kernel and if you run ComfyUI for more images or some LLM with more prompts, log file can grow to several hundred MBs.
To extract unique GEMM shapes we can sort our log file before uploading. Please use below commands to get only unique ones sorted by number of occurrences which can help us a lot to focus on the most used GEMM kernels.
Windows (powershell)
Get-Content your_model_hipblaslt_log.txt | Group-Object | Sort-Object Count -Descending | Select-Object Count, Name > your_model_sorted_hipblaslt_log.txt
Linux:
sort your_model_hipblaslt_log.txt | uniq -c | sort -nr > your_model_sorted_hipblaslt_log.txt
IMPORTANT: Please make sure you're using the latest ComfyUI master. If you're not using the latest ComfyUI master, please remove/comment out torch.backends.cudnn.enabled = False from comfy/model_management.py within your ComfyUI folder in order to enable MIOpen so the logs can be collected. If you are using the latest ComfyUI from master branch as of December 20th, then you do not need to make this change.
NOTE: Make sure to delete your .miopen folder between runs - e.g., from C:\Users\<username>\.miopen.
An alternative is to add the following line right after import torch in your pytorch scripts:
type(torch.backends.cudnn).enabled = property(lambda self: True, lambda self, v: None)
Then run your workload as usual, for example, SD WebUI, your pytorch scripts, or ComfyUI, using (command) > miopen_output_logs.txt 2>&1 on the same terminal you used to run the above commands.
Then share with us the output logs from hipBLASLt (your_model_hipblaslt_log.txt) and output+MIOpen logs miopen_output_logs.txt from the terminal output in the comments below.
Are you facing slow performance when running your models using ComfyUI/SD WebUI or any pytorch program using your Radeon 9070XT, AI Pro R9700, or Strix Halo (Radeon 8060S) ? Then we need your help! Please provide us performance logs when running your models. It will help us tune our libraries for better performance on your models.
Please set the following environment variables depending on your OS:
Windows (powershell)
Linux:
NOTE: hipBLASLt logs every call of every kernel and if you run ComfyUI for more images or some LLM with more prompts, log file can grow to several hundred MBs.
To extract unique GEMM shapes we can sort our log file before uploading. Please use below commands to get only unique ones sorted by number of occurrences which can help us a lot to focus on the most used GEMM kernels.
Windows (powershell)
Linux:
IMPORTANT: Please make sure you're using the latest ComfyUI
master. If you're not using the latest ComfyUImaster, please remove/comment outtorch.backends.cudnn.enabled = Falsefromcomfy/model_management.pywithin your ComfyUI folder in order to enable MIOpen so the logs can be collected. If you are using the latest ComfyUI frommasterbranch as of December 20th, then you do not need to make this change.NOTE: Make sure to delete your
.miopenfolder between runs - e.g., fromC:\Users\<username>\.miopen.An alternative is to add the following line right after
import torchin your pytorch scripts:Then run your workload as usual, for example, SD WebUI, your pytorch scripts, or ComfyUI, using
(command) > miopen_output_logs.txt 2>&1on the same terminal you used to run the above commands.Then share with us the output logs from hipBLASLt (
your_model_hipblaslt_log.txt) and output+MIOpen logsmiopen_output_logs.txtfrom the terminal output in the comments below.