[sdkit.Context] Fallback to cpu device on Windows with AMD GPU#64
Open
st1vms wants to merge 2 commits intoeasydiffusion:mainfrom
Open
[sdkit.Context] Fallback to cpu device on Windows with AMD GPU#64st1vms wants to merge 2 commits intoeasydiffusion:mainfrom
st1vms wants to merge 2 commits intoeasydiffusion:mainfrom
Conversation
Author
|
Also gave a try with suggested commands from (CUDA12/ROCM-night) torch Apparently Windows still doesn't have torch with ROCM support. Don't know if you can reproduce this error, but apparently it is related to This is the relevant poc """PR#64 sdkit"""
from os import path as ospath
from os import getcwd
from sdkit import Context
from sdkit.models import load_model
MODEL_TYPE = "stable-diffusion"
MODEL_PATH = ospath.join(getcwd(), MODEL_TYPE, "v1-5-pruned-emaonly.ckpt")
CONTEXT = Context()
CONTEXT.model_paths[MODEL_TYPE] = MODEL_PATH
load_model(CONTEXT, MODEL_TYPE)This script will throw the These are torch verification steps in REPL: >>> import torch
>>> print(torch.__version__)
2.1.0+cpu
>>> print(torch.rand(5, 3))
tensor([[0.4543, 0.9270, 0.4408],
[0.0567, 0.1613, 0.0919],
[0.9389, 0.8564, 0.9848],
[0.7152, 0.0204, 0.2193],
[0.5769, 0.1634, 0.2768]])
>>> torch.cuda.is_available()
False |
Author
|
Full stacktrace... Using this patch I can go through with cpu device. EDIT: |
Circular import fix `from .utils import log` when running proof of concept.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When trying to load a model with
load_model()on Windows, having an AMD GPU (RX 7900XT),the calling program crashes with error: "Torch was not compiled with CUDA", without falling back to cpu device.
Tested by installing torch packages using:
pip3 install torch torchvision torchaudioThis patch ensures the
sdkit.Context()gets initialized with cpu device when cuda is not available.