Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Loading models in AMD #222

Open
3 of 6 tasks
JulianFelipeMK opened this issue Dec 28, 2024 · 3 comments
Open
3 of 6 tasks

[Bug]: Loading models in AMD #222

JulianFelipeMK opened this issue Dec 28, 2024 · 3 comments

Comments

@JulianFelipeMK
Copy link

Checklist

  • The issue exists after disabling all extensions
  • The issue exists on a clean installation of webui
  • The issue is caused by an extension, but I believe it is caused by a bug in the webui
  • The issue exists in the current version of the webui
  • The issue has not been reported before recently
  • The issue has been reported before but has not been fixed yet

What happened?

I have an AMD 7800xt card. I run reforge with rocm, I do not know exactly the reason, nor remember why, but to run any application that requires pytorch I must add the following command in the terminal that will run reforge, the following: export HSA_OVERRIDE_GFX_VERSION=11.0.0, that said.

the issue comes when I change the model, it keeps loading infinitely and it is as if it was running something, the issue is that, when I remove the line
export HSA_OVERRIDE_GFX_VERSION=11.0.0.0, I run reforge again, the bug of the infinite loading disappears and allows me to load the models without problems but it doesn't execute the promps anymore.

this means that, every time I want to load a model, I have to do this process

Steps to reproduce the problem

scenario 1 - load models correctly:
run reforge, without adding to the terminal the command export HSA_OVERRIDE_GFX_VERSION=11.0.0

scenario 2 - infinite model loading, but executing prompts correctly:
run reforge, adding the command export HSA_OVERRIDE_GFX_VERSION=11.0.0 to the terminal.

What should have happened?

to load the models correctly and not keep loading infinitely, without having to remove the line in the HSA_OVERRIDE_GFX_VERSION=11.0.0 terminal.

What browsers do you use to access the UI ?

Mozilla Firefox

Sysinfo

sysinfo-2024-12-28-16-54.json

Console logs

when I just run without the command: 

Python 3.10.16 (main, Dic 4 2024, 08:53:38) [GCC 13.2.0]
Version: f1.1.5-v1.10.1RC-latest-875-g1b2aac23
Confirmación hash: 1b2aac23ac5483135e9cb8a6247cce099862e969
Legacy Preprocessor init warning: No se ha podido instalar insightface automáticamente. Por favor, intente ejecutar `pip install insightface` manualmente.
Iniciando Web UI con argumentos: 
VRAM total 16368 MB, RAM total 15887 MB
Configurar estado de vram a: NORMAL_VRAM
Dispositivo: cuda:0 AMD Radeon RX 7800 XT : nativo
VAE dtype: torch.float32
CUDA Stream Activado:  False
/media/julian/16A0C49DA0C48529/Linux/ia/stable-diffusion-webui-reForge/.venv/lib/python3.10/site-packages/transformers/utils/hub.py:127: FutureWarning: El uso de `TRANSFORMERS_CACHE` está obsoleto y será eliminado en la versión 5 de Transformers. Utilice `HF_HOME` en su lugar.
  warnings.warn(
/media/julian/16A0C49DA0C48529/Linux/ia/stable-diffusion-webui-reForge/.venv/lib/python3.10/site-packages/timm/models/layers/__init__.py:48: FutureWarning: Importar desde timm.models.layers está obsoleto, por favor importa a través de timm.layers
  warnings.warn(f «Importing from {__name__} is deprecated, please import via timm.layers», FutureWarning)
Usando optimización subcuadrática para atención cruzada, si tienes problemas de memoria o velocidad prueba a usar: --attention-split
Ubicación del preprocesador ControlNet: /media/julian/16A0C49DA0C48529/Linux/ia/stable-diffusion-webui-reForge/models/ControlNetPreprocessor
/media/julian/16A0C49DA0C48529/Linux/ia/stable-diffusion-webui-reForge/.venv/lib/python3.10/sit

with the command:

Python 3.10.16 (main, Dec  4 2024, 08:53:38) [GCC 13.2.0]
Version: f1.1.5-v1.10.1RC-latest-875-g1b2aac23
Commit hash: 1b2aac23ac5483135e9cb8a6247cce099862e969
Legacy Preprocessor init warning: Unable to install insightface automatically. Please try run `pip install insightface` manually.
Launching Web UI with arguments: 
Total VRAM 16368 MB, total RAM 15887 MB
Set vram state to: NORMAL_VRAM
Device: cuda:0 AMD Radeon RX 7800 XT : native
VAE dtype: torch.float32
CUDA Stream Activated:  False
/media/julian/16A0C49DA0C48529/Linux/ia/stable-diffusion-webui-reForge/.venv/lib/python3.10/site-packages/transformers/utils/hub.py:127: FutureWarning: Using `TRANSFORMERS_CACHE` is deprecated and will be removed in v5 of Transformers. Use `HF_HOME` instead.
  warnings.warn(
/media/julian/16A0C49DA0C48529/Linux/ia/stable-diffusion-webui-reForge/.venv/lib/python3.10/site-packages/timm/models/layers/__init__.py:48: FutureWarning: Importing from timm.models.layers is deprecated, please import via timm.layers
  warnings.warn(f"Importing from {__name__} is deprecated, please import via timm.layers", FutureWarning)
Using sub quadratic optimization for cross attention, if you have memory or speed issues try using: --attention-split
ControlNet preprocessor location: /media/julian/16A0C49DA0C48529/Linux/ia/stable-diffusion-webui-reForge/models/ControlNetPreprocessor
/media/julian/16A0C49DA0C48529/Linux/ia/stable-diffusion-webui-reForge/.venv/lib/python3.10/site-packages/diffusers/models/transformers/transformer_2d.py:34: FutureWarning: `Transformer2DModelOutput` is deprecated and will be removed in version 1.0.0. Importing `Transformer2DModelOutput` from `diffusers.models.transformer_2d` is deprecated and this will be removed in a future version. Please use `from diffusers.models.modeling_outputs import Transformer2DModelOutput`, instead.
  deprecate("Transformer2DModelOutput", "1.0.0", deprecation_message)
Loading model Checkpoints/duchaitenPonyXLNo_v60.safetensors [354679d31b] (1 of 1)
Loading weights [354679d31b] from /media/julian/16A0C49DA0C48529/Linux/ia/stable-diffusion-webui-reForge/models/Stable-diffusion/Checkpoints/duchaitenPonyXLNo_v60.safetensors
2024-12-28 11:52:15,547 - ControlNet - INFO - ControlNet UI callback registered.
Running on local URL:  http://127.0.0.1:7860

To create a public link, set `share=True` in `launch()`.
Startup time: 9.5s (prepare environment: 2.4s, import torch: 3.5s, import gradio: 0.6s, setup paths: 0.5s, import ldm: 0.1s, other imports: 0.2s, load scripts: 1.3s, create ui: 0.6s, gradio launch: 0.2s).
model_type EPS
UNet ADM Dimension 2816
Using split attention in VAE
Working with z of shape (1, 4, 32, 32) = 4096 dimensions.
Using split attention in VAE
/media/julian/16A0C49DA0C48529/Linux/ia/stable-diffusion-webui-reForge/.venv/lib/python3.10/site-packages/transformers/tokenization_utils_base.py:1601: FutureWarning: `clean_up_tokenization_spaces` was not set. It will be set to `True` by default. This behavior will be depracted in transformers v4.45, and will be then set to `False` by default. For more details check this issue: https://github.com/huggingface/transformers/issues/31884
  warnings.warn(
extra {'cond_stage_model.clip_l.logit_scale', 'cond_stage_model.clip_l.text_projection'}
left over keys: dict_keys(['cond_stage_model.clip_l.transformer.text_model.embeddings.position_ids'])
loaded straight to GPU
To load target model SDXL
Begin to load 1 model
[Memory Management] Current Free GPU Memory (MB) =  11036.2353515625
[Memory Management] Model Memory (MB) =  0.03814697265625
[Memory Management] Minimal Inference Memory (MB) =  1024.0
[Memory Management] Estimated Remaining GPU Memory (MB) =  10012.197204589844
Moving model(s) has taken 0.03 seconds
To load target model SDXLClipModel
Begin to load 1 model
[Memory Management] Current Free GPU Memory (MB) =  11026.1826171875
[Memory Management] Model Memory (MB) =  2144.3535232543945
[Memory Management] Minimal Inference Memory (MB) =  1024.0
[Memory Management] Estimated Remaining GPU Memory (MB) =  7857.8290939331055
Moving model(s) has taken 0.17 seconds
Model Checkpoints/duchaitenPonyXLNo_v60.safetensors [354679d31b] loaded in 11.4s (calculate hash: 0.7s, load weights from disk: 0.7s, forge load real models: 8.1s, calculate empty prompt: 1.9s).

Additional information

No response

@Panchovix
Copy link
Owner

Hi there, can you try dev branch?

@JulianFelipeMK
Copy link
Author

Ok, I've switched to the dev branch, now the problem is that I can't change the model at all with or without the command

export HSA_OVERRIDE_GFX_VERSION=11.0.0.0

@Panchovix
Copy link
Owner

Sorry for the delay.

Maybe it could be from the torch version?

If on your venv you try to update torch with

pip install --upgrade torch torchvision --index-url https://download.pytorch.org/whl/rocm6.2

And then try normally, it works? You can try SDP arttention. I don't have an AMD card to test sadly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants