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

[Issue]: Torch Dynamo - AttributeError: 'SymInt' object has no attribute 'dtype' #77

Open
onesnep opened this issue Apr 21, 2024 · 0 comments

Comments

@onesnep
Copy link

onesnep commented Apr 21, 2024

Problem Description

Hi, I'm trying to use the migraphx torch dynamo backend with stable diffusion via a1111 webui and am encountering an error during the compile step. See traceback below.

rocm packages
hip-dev/jammy,now 6.1.40091.60100-82~22.04 amd64 [installed,automatic]
hip-doc/jammy,now 6.1.40091.60100-82~22.04 amd64 [installed,automatic]
hip-runtime-amd/jammy,now 6.1.40091.60100-82~22.04 amd64 [installed,automatic]
hip-samples/jammy,now 6.1.40091.60100-82~22.04 amd64 [installed,automatic]
hipblas-dev/jammy,now 2.1.0.60100-82~22.04 amd64 [installed,automatic]
hipblas/jammy,now 2.1.0.60100-82~22.04 amd64 [installed,automatic]
hipblaslt-dev/jammy,now 0.7.0.60100-82~22.04 amd64 [installed,automatic]
hipblaslt/jammy,now 0.7.0.60100-82~22.04 amd64 [installed,automatic]
hipcc/jammy,now 1.0.0.60100-82~22.04 amd64 [installed,automatic]
hipcub-dev/jammy,now 3.1.0.60100-82~22.04 amd64 [installed,automatic]
hipfft-dev/jammy,now 1.0.14.60100-82~22.04 amd64 [installed,automatic]
hipfft/jammy,now 1.0.14.60100-82~22.04 amd64 [installed,automatic]
hipfort-dev/jammy,now 0.4.0.60100-82~22.04 amd64 [installed,automatic]
hipify-clang/jammy,now 17.0.0.60100-82~22.04 amd64 [installed,automatic]
hiprand-dev/jammy,now 2.10.16.60100-82~22.04 amd64 [installed,automatic]
hiprand/jammy,now 2.10.16.60100-82~22.04 amd64 [installed,automatic]
hipsolver-dev/jammy,now 2.1.0.60100-82~22.04 amd64 [installed,automatic]
hipsolver/jammy,now 2.1.0.60100-82~22.04 amd64 [installed,automatic]
hipsparse-dev/jammy,now 3.0.1.60100-82~22.04 amd64 [installed,automatic]
hipsparse/jammy,now 3.0.1.60100-82~22.04 amd64 [installed,automatic]
hipsparselt-dev/jammy,now 0.1.0.60100-82~22.04 amd64 [installed,automatic]
hipsparselt/jammy,now 0.1.0.60100-82~22.04 amd64 [installed,automatic]
hiptensor-dev/jammy,now 1.2.0.60100-82~22.04 amd64 [installed,automatic]
hiptensor/jammy,now 1.2.0.60100-82~22.04 amd64 [installed,automatic]
hsa-rocr-dev/jammy,now 1.13.0.60100-82~22.04 amd64 [installed,automatic]
hsa-rocr/jammy,now 1.13.0.60100-82~22.04 amd64 [installed,automatic]
hsakmt-roct-dev/jammy,now 20240125.3.30.60100-82~22.04 amd64 [installed,automatic]
intel-microcode/jammy-updates,jammy-security,now 3.20231114.0ubuntu0.22.04.1 amd64 [installed,automatic]
libprocps8/jammy-updates,jammy-security,now 2:3.3.17-6ubuntu2.1 amd64 [installed,automatic]
libwebrtc-audio-processing1/jammy,now 0.3.1-0ubuntu5 amd64 [installed,automatic]
miopen-hip-dev/jammy,now 3.1.0.60100-82~22.04 amd64 [installed,automatic]
miopen-hip/jammy,now 3.1.0.60100-82~22.04 amd64 [installed,automatic]
procps/jammy-updates,jammy-security,now 2:3.3.17-6ubuntu2.1 amd64 [installed,automatic]
python3-ptyprocess/jammy,jammy,now 0.7.0-3 all [installed,automatic]
rocalution-dev/jammy,now 3.1.1.60100-82~22.04 amd64 [installed,automatic]
rocalution/jammy,now 3.1.1.60100-82~22.04 amd64 [installed,automatic]
rocblas-dev/jammy,now 4.1.0.60100-82~22.04 amd64 [installed,automatic]
rocblas/jammy,now 4.1.0.60100-82~22.04 amd64 [installed,automatic]
rocfft-dev/jammy,now 1.0.27.60100-82~22.04 amd64 [installed,automatic]
rocfft/jammy,now 1.0.27.60100-82~22.04 amd64 [installed,automatic]
rocm-cmake/jammy,now 0.12.0.60100-82~22.04 amd64 [installed,automatic]
rocm-core/jammy,now 6.1.0.60100-82~22.04 amd64 [installed,automatic]
rocm-dbgapi/jammy,now 0.71.0.60100-82~22.04 amd64 [installed,automatic]
rocm-debug-agent/jammy,now 2.0.3.60100-82~22.04 amd64 [installed,automatic]
rocm-developer-tools/jammy,now 6.1.0.60100-82~22.04 amd64 [installed,automatic]
rocm-device-libs/jammy,now 1.0.0.60100-82~22.04 amd64 [installed,automatic]
rocm-gdb/jammy,now 14.1.60100-82~22.04 amd64 [installed,automatic]
rocm-hip-libraries/jammy,now 6.1.0.60100-82~22.04 amd64 [installed,automatic]
rocm-hip-runtime-dev/jammy,now 6.1.0.60100-82~22.04 amd64 [installed,automatic]
rocm-hip-runtime/jammy,now 6.1.0.60100-82~22.04 amd64 [installed,automatic]
rocm-hip-sdk/jammy,now 6.1.0.60100-82~22.04 amd64 [installed,automatic]
rocm-language-runtime/jammy,now 6.1.0.60100-82~22.04 amd64 [installed,automatic]
rocm-llvm/jammy,now 17.0.0.24103.60100-82~22.04 amd64 [installed,automatic]
rocm-ml-libraries/jammy,now 6.1.0.60100-82~22.04 amd64 [installed,automatic]
rocm-ml-sdk/jammy,now 6.1.0.60100-82~22.04 amd64 [installed,automatic]
rocm-opencl-dev/jammy,now 2.0.0.60100-82~22.04 amd64 [installed,automatic]
rocm-opencl-icd-loader/jammy,now 1.2.60100-82~22.04 amd64 [installed,automatic]
rocm-opencl-runtime/jammy,now 6.1.0.60100-82~22.04 amd64 [installed,automatic]
rocm-opencl-sdk/jammy,now 6.1.0.60100-82~22.04 amd64 [installed,automatic]
rocm-opencl/jammy,now 2.0.0.60100-82~22.04 amd64 [installed,automatic]
rocm-openmp-sdk/jammy,now 6.1.0.60100-82~22.04 amd64 [installed,automatic]
rocm-smi-lib/jammy,now 7.0.0.60100-82~22.04 amd64 [installed,automatic]
rocm-utils/jammy,now 6.1.0.60100-82~22.04 amd64 [installed,automatic]
rocm/jammy,now 6.1.0.60100-82~22.04 amd64 [installed]
rocminfo/jammy,now 1.0.0.60100-82~22.04 amd64 [installed,automatic]
rocprim-dev/jammy,now 3.1.0.60100-82~22.04 amd64 [installed,automatic]
rocprofiler-dev/jammy,now 2.0.60100.60100-82~22.04 amd64 [installed,automatic]
rocprofiler-plugins/jammy,now 2.0.60100.60100-82~22.04 amd64 [installed,automatic]
rocprofiler-register/jammy,now 0.3.0.60100-82~22.04 amd64 [installed,automatic]
rocprofiler/jammy,now 2.0.60100.60100-82~22.04 amd64 [installed,automatic]
rocrand-dev/jammy,now 3.0.1.60100-82~22.04 amd64 [installed,automatic]
rocrand/jammy,now 3.0.1.60100-82~22.04 amd64 [installed,automatic]
rocsolver-dev/jammy,now 3.25.0.60100-82~22.04 amd64 [installed,automatic]
rocsolver/jammy,now 3.25.0.60100-82~22.04 amd64 [installed,automatic]
rocsparse-dev/jammy,now 3.1.2.60100-82~22.04 amd64 [installed,automatic]
rocsparse/jammy,now 3.1.2.60100-82~22.04 amd64 [installed,automatic]
rocthrust-dev/jammy,now 3.0.1.60100-82~22.04 amd64 [installed,automatic]
roctracer-dev/jammy,now 4.1.60100.60100-82~22.04 amd64 [installed,automatic]
roctracer/jammy,now 4.1.60100.60100-82~22.04 amd64 [installed,automatic]
rocwmma-dev/jammy,now 1.4.0.60100-82~22.04 amd64 [installed,automatic]
pip list
 Package                   Version
------------------------- --------------------------
absl-py                   2.1.0
accelerate                0.21.0
aenum                     3.1.15
aiofiles                  23.2.1
aiohttp                   3.9.3
aiosignal                 1.3.1
altair                    5.2.0
annotated-types           0.6.0
antlr4-python3-runtime    4.9.3
anyio                     3.7.1
async-timeout             4.0.3
attrs                     23.2.0
av                        12.0.0
blendmodes                2022
certifi                   2024.2.2
cffi                      1.16.0
chardet                   5.2.0
charset-normalizer        3.3.2
clean-fid                 0.1.35
click                     8.1.7
clip                      1.0
coloredlogs               15.0.1
colorlog                  6.8.2
contourpy                 1.2.0
cssselect2                0.7.0
cycler                    0.12.1
deprecation               2.1.0
depth_anything            2024.1.22.0
dill                      0.3.8
dsine                     2024.3.23
dynamicprompts            0.31.0
einops                    0.4.1
embreex                   2.17.7.post4
exceptiongroup            1.2.0
facexlib                  0.3.0
fastapi                   0.94.0
ffmpy                     0.3.2
filelock                  3.13.1
filterpy                  1.4.5
flatbuffers               23.5.26
fonttools                 4.49.0
frozenlist                1.4.1
fsspec                    2024.2.0
ftfy                      6.1.3
fvcore                    0.1.5.post20221221
geffnet                   1.0.2
gitdb                     4.0.11
GitPython                 3.1.32
glob2                     0.5
gradio                    3.41.2
gradio_client             0.5.0
h11                       0.12.0
handrefinerportable       2024.2.12.0
httpcore                  0.15.0
httpx                     0.24.1
huggingface-hub           0.20.3
humanfriendly             10.0
idna                      3.6
imageio                   2.34.0
importlib-resources       6.1.1
inflection                0.5.1
iopath                    0.1.9
Jinja2                    3.1.3
jsonmerge                 1.8.0
jsonschema                4.21.1
jsonschema-specifications 2023.12.1
kiwisolver                1.4.5
kornia                    0.6.7
lark                      1.1.2
lazy_loader               0.3
lightning-utilities       0.10.1
llvmlite                  0.42.0
lxml                      5.1.0
mapbox-earcut             1.0.1
MarkupSafe                2.1.5
matplotlib                3.8.3
mediapipe                 0.10.9
mpmath                    1.3.0
multidict                 6.0.5
networkx                  3.2.1
numba                     0.59.0
numpy                     1.26.2
nvidia-cublas-cu12        12.1.3.1
nvidia-cuda-cupti-cu12    12.1.105
nvidia-cuda-nvrtc-cu12    12.1.105
nvidia-cuda-runtime-cu12  12.1.105
nvidia-cudnn-cu12         8.9.2.26
nvidia-cufft-cu12         11.0.2.54
nvidia-curand-cu12        10.3.2.106
nvidia-cusolver-cu12      11.4.5.107
nvidia-cusparse-cu12      12.1.0.106
nvidia-nccl-cu12          2.19.3
nvidia-nvjitlink-cu12     12.3.101
nvidia-nvtx-cu12          12.1.105
omegaconf                 2.2.3
onnxruntime               1.17.0
open-clip-torch           2.20.0
opencv-contrib-python     4.9.0.80
opencv-python             4.9.0.80
orjson                    3.9.14
packaging                 23.2
pandas                    2.2.0
piexif                    1.1.3
Pillow                    9.5.0
pip                       22.0.2
portalocker               2.8.2
protobuf                  3.20.3
psutil                    5.9.5
pybind11_global           2.12.0
pycollada                 0.8
pycparser                 2.21
pydantic                  1.10.14
pydantic_core             2.16.2
pydub                     0.25.1
pyfunctional              1.4.3
pyparsing                 3.1.1
python-dateutil           2.8.2
python-dotenv             1.0.1
python-multipart          0.0.9
pytorch-lightning         1.9.4
pytorch-triton-rocm       3.0.0+0a22a91d04
pytz                      2024.1
PyWavelets                1.5.0
PyYAML                    6.0.1
referencing               0.33.0
regex                     2023.12.25
reportlab                 4.1.0
requests                  2.31.0
resize-right              0.0.2
rpds-py                   0.18.0
Rtree                     1.2.0
safetensors               0.4.2
scikit-image              0.21.0
scipy                     1.12.0
semantic-version          2.10.0
Send2Trash                1.8.2
sentencepiece             0.1.99
setuptools                59.6.0
shapely                   2.0.3
six                       1.16.0
smmap                     5.0.1
sniffio                   1.3.0
sounddevice               0.4.6
spandrel                  0.1.6
starlette                 0.26.1
svg.path                  6.3
svglib                    1.5.1
sympy                     1.12
tabulate                  0.9.0
termcolor                 2.4.0
tifffile                  2024.2.12
timm                      0.9.12
tinycss2                  1.2.1
tokenizers                0.13.3
tomesd                    0.1.3
toolz                     0.12.1
torch                     2.4.0.dev20240420+rocm6.0
torch_migraphx            0.0.3
torchdiffeq               0.2.3
torchmetrics              1.3.1
torchsde                  0.2.6
torchvision               0.19.0.dev20240420+rocm6.0
tqdm                      4.66.2
trampoline                0.1.2
transformers              4.30.2
trimesh                   4.1.4
triton                    2.2.0
typing_extensions         4.9.0
tzdata                    2024.1
urllib3                   2.2.1
uvicorn                   0.27.1
vhacdx                    0.0.5
wcwidth                   0.2.13
webencodings              0.5.1
websockets                11.0.3
xatlas                    0.0.9
xxhash                    3.4.1
yacs                      0.1.8
yarl                      1.9.4
    Traceback (most recent call last):
      File "/home/user/stable-diffusion-webui/modules/call_queue.py", line 57, in f
        res = list(func(*args, **kwargs))
      File "/home/user/stable-diffusion-webui/modules/call_queue.py", line 36, in f
        res = func(*args, **kwargs)
      File "/home/user/stable-diffusion-webui/modules/txt2img.py", line 110, in txt2img
        processed = processing.process_images(p)
      File "/home/user/stable-diffusion-webui/modules/processing.py", line 785, in process_images
        res = process_images_inner(p)
      File "/home/user/stable-diffusion-webui/extensions/sd-webui-controlnet/scripts/batch_hijack.py", line 59, in processing_process_images_hijack
        return getattr(processing, '__controlnet_original_process_images_inner')(p, *args, **kwargs)
      File "/home/user/stable-diffusion-webui/modules/processing.py", line 921, in process_images_inner
        samples_ddim = p.sample(conditioning=p.c, unconditional_conditioning=p.uc, seeds=p.seeds, subseeds=p.subseeds, subseed_strength=p.subseed_strength, prompts=p.prompts)
      File "/home/user/stable-diffusion-webui/modules/processing.py", line 1257, in sample
        samples = self.sampler.sample(self, x, conditioning, unconditional_conditioning, image_conditioning=self.txt2img_image_conditioning(x))
      File "/home/user/stable-diffusion-webui/modules/sd_samplers_kdiffusion.py", line 234, in sample
        samples = self.launch_sampling(steps, lambda: self.func(self.model_wrap_cfg, x, extra_args=self.sampler_extra_args, disable=False, callback=self.callback_state, **extra_params_kwargs))
      File "/home/user/stable-diffusion-webui/modules/sd_samplers_common.py", line 261, in launch_sampling
        return func()
      File "/home/user/stable-diffusion-webui/modules/sd_samplers_kdiffusion.py", line 234, in <lambda>
        samples = self.launch_sampling(steps, lambda: self.func(self.model_wrap_cfg, x, extra_args=self.sampler_extra_args, disable=False, callback=self.callback_state, **extra_params_kwargs))
      File "/home/user/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch/utils/_contextlib.py", line 115, in decorate_context
        return func(*args, **kwargs)
      File "/home/user/stable-diffusion-webui/repositories/k-diffusion/k_diffusion/sampling.py", line 145, in sample_euler_ancestral
        denoised = model(x, sigmas[i] * s_in, **extra_args)
      File "/home/user/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1532, in _wrapped_call_impl
        return self._call_impl(*args, **kwargs)
      File "/home/user/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1541, in _call_impl
        return forward_call(*args, **kwargs)
      File "/home/user/stable-diffusion-webui/modules/sd_samplers_cfg_denoiser.py", line 237, in forward
        x_out = self.inner_model(x_in, sigma_in, cond=make_condition_dict(cond_in, image_cond_in))
      File "/home/user/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1532, in _wrapped_call_impl
        return self._call_impl(*args, **kwargs)
      File "/home/user/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1541, in _call_impl
        return forward_call(*args, **kwargs)
      File "/home/user/stable-diffusion-webui/repositories/k-diffusion/k_diffusion/external.py", line 167, in forward
        return self.get_v(input * c_in, self.sigma_to_t(sigma), **kwargs) * c_out + input * c_skip
      File "/home/user/stable-diffusion-webui/repositories/k-diffusion/k_diffusion/external.py", line 177, in get_v
        return self.inner_model.apply_model(x, t, cond)
      File "/home/user/stable-diffusion-webui/modules/sd_hijack_utils.py", line 18, in <lambda>
        setattr(resolved_obj, func_path[-1], lambda *args, **kwargs: self(*args, **kwargs))
      File "/home/user/stable-diffusion-webui/modules/sd_hijack_utils.py", line 32, in __call__
        return self.__orig_func(*args, **kwargs)
      File "/home/user/stable-diffusion-webui/repositories/stable-diffusion-stability-ai/ldm/models/diffusion/ddpm.py", line 858, in apply_model
        x_recon = self.model(x_noisy, t, **cond)
      File "/home/user/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1532, in _wrapped_call_impl
        return self._call_impl(*args, **kwargs)
      File "/home/user/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1541, in _call_impl
        return forward_call(*args, **kwargs)
      File "/home/user/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch/_dynamo/eval_frame.py", line 403, in _fn
        return fn(*args, **kwargs)
      File "/home/user/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1532, in _wrapped_call_impl
        return self._call_impl(*args, **kwargs)
      File "/home/user/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1541, in _call_impl
        return forward_call(*args, **kwargs)
      File "/home/user/stable-diffusion-webui/repositories/stable-diffusion-stability-ai/ldm/models/diffusion/ddpm.py", line 1335, in forward
        out = self.diffusion_model(x, t, context=cc)
      File "/home/user/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1532, in _wrapped_call_impl
        return self._call_impl(*args, **kwargs)
      File "/home/user/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1541, in _call_impl
        return forward_call(*args, **kwargs)
      File "/home/user/stable-diffusion-webui/modules/sd_unet.py", line 91, in UNetModel_forward
        return original_forward(self, x, timesteps, context, *args, **kwargs)
      File "/home/user/stable-diffusion-webui/repositories/stable-diffusion-stability-ai/ldm/modules/diffusionmodules/openaimodel.py", line 797, in forward
        h = module(h, emb, context)
      File "/home/user/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1532, in _wrapped_call_impl
        return self._call_impl(*args, **kwargs)
      File "/home/user/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1541, in _call_impl
        return forward_call(*args, **kwargs)
      File "/home/user/stable-diffusion-webui/repositories/stable-diffusion-stability-ai/ldm/modules/diffusionmodules/openaimodel.py", line 82, in forward
        x = layer(x, emb)
      File "/home/user/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1532, in _wrapped_call_impl
        return self._call_impl(*args, **kwargs)
      File "/home/user/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1541, in _call_impl
        return forward_call(*args, **kwargs)
      File "/home/user/stable-diffusion-webui/repositories/stable-diffusion-stability-ai/ldm/modules/diffusionmodules/openaimodel.py", line 249, in forward
        return checkpoint(
      File "/home/user/stable-diffusion-webui/repositories/stable-diffusion-stability-ai/ldm/modules/diffusionmodules/util.py", line 121, in checkpoint
        return CheckpointFunction.apply(func, len(inputs), *args)
      File "/home/user/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch/autograd/function.py", line 571, in apply
        return super().apply(*args, **kwargs)  # type: ignore[misc]
      File "/home/user/stable-diffusion-webui/repositories/stable-diffusion-stability-ai/ldm/modules/diffusionmodules/util.py", line 136, in forward
        output_tensors = ctx.run_function(*ctx.input_tensors)
      File "/home/user/stable-diffusion-webui/repositories/stable-diffusion-stability-ai/ldm/modules/diffusionmodules/openaimodel.py", line 262, in _forward
        h = self.in_layers(x)
      File "/home/user/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1532, in _wrapped_call_impl
        return self._call_impl(*args, **kwargs)
      File "/home/user/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1541, in _call_impl
        return forward_call(*args, **kwargs)
      File "/home/user/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch/nn/modules/container.py", line 217, in forward
        input = module(input)
      File "/home/user/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1532, in _wrapped_call_impl
        return self._call_impl(*args, **kwargs)
      File "/home/user/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1541, in _call_impl
        return forward_call(*args, **kwargs)
      File "/home/user/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch/_dynamo/convert_frame.py", line 977, in catch_errors
        return callback(frame, cache_entry, hooks, frame_state, skip=1)
      File "/home/user/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch/_dynamo/convert_frame.py", line 818, in _convert_frame
        result = inner_convert(
      File "/home/user/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch/_dynamo/convert_frame.py", line 411, in _convert_frame_assert
        return _compile(
      File "/home/user/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch/_utils_internal.py", line 70, in wrapper_function
        return function(*args, **kwargs)
      File "/usr/lib/python3.10/contextlib.py", line 79, in inner
        return func(*args, **kwds)
      File "/home/user/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch/_dynamo/convert_frame.py", line 700, in _compile
        guarded_code = compile_inner(code, one_graph, hooks, transform)
      File "/home/user/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch/_dynamo/utils.py", line 267, in time_wrapper
        r = func(*args, **kwargs)
      File "/home/user/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch/_dynamo/convert_frame.py", line 568, in compile_inner
        out_code = transform_code_object(code, transform)
      File "/home/user/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch/_dynamo/bytecode_transformation.py", line 1116, in transform_code_object
        transformations(instructions, code_options)
      File "/home/user/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch/_dynamo/convert_frame.py", line 173, in _fn
        return fn(*args, **kwargs)
      File "/home/user/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch/_dynamo/convert_frame.py", line 515, in transform
        tracer.run()
      File "/home/user/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch/_dynamo/symbolic_convert.py", line 2237, in run
        super().run()
      File "/home/user/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch/_dynamo/symbolic_convert.py", line 875, in run
        while self.step():
      File "/home/user/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch/_dynamo/symbolic_convert.py", line 790, in step
        self.dispatch_table[inst.opcode](self, inst)
      File "/home/user/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch/_dynamo/symbolic_convert.py", line 2394, in RETURN_VALUE
        self._return(inst)
      File "/home/user/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch/_dynamo/symbolic_convert.py", line 2379, in _return
        self.output.compile_subgraph(
      File "/home/user/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch/_dynamo/output_graph.py", line 1082, in compile_subgraph
        self.compile_and_call_fx_graph(tx, pass2.graph_output_vars(), root)
      File "/usr/lib/python3.10/contextlib.py", line 79, in inner
        return func(*args, **kwds)
      File "/home/user/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch/_dynamo/output_graph.py", line 1274, in compile_and_call_fx_graph
        compiled_fn = self.call_user_compiler(gm)
      File "/home/user/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch/_dynamo/utils.py", line 267, in time_wrapper
        r = func(*args, **kwargs)
      File "/home/user/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch/_dynamo/output_graph.py", line 1365, in call_user_compiler
        raise BackendCompilerFailed(self.compiler_fn, e).with_traceback(
      File "/home/user/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch/_dynamo/output_graph.py", line 1346, in call_user_compiler
        compiled_fn = compiler_fn(gm, self.example_inputs())
      File "/home/user/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch/_dynamo/repro/after_dynamo.py", line 127, in debug_wrapper
        compiled_gm = compiler_fn(gm, example_inputs)
      File "/home/user/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch/__init__.py", line 1783, in __call__
        return self.compiler_fn(model_, inputs_, **self.kwargs)
      File "/home/user/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch_migraphx/dynamo/backends.py", line 43, in migraphx_backend
        return migraphx_aot_backend(gm, example_inputs, **kwargs)
      File "/home/user/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch_migraphx/dynamo/backends.py", line 60, in migraphx_aot_backend
        compiled_gm = lower_aten_to_mgx(aten_gm, example_inputs, **kwargs)
      File "/home/user/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch_migraphx/dynamo/lower_dynamo.py", line 72, in lower_aten_to_mgx
        mgx_mod = lower_subgraph(mod, partition_inputs, name=name, **kwargs)
      File "/home/user/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch_migraphx/dynamo/lower_dynamo.py", line 104, in lower_subgraph
        interpreter = MGXInterpreter(module, inputs, verbose_log=verbose)
      File "/home/user/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch_migraphx/fx/fx2mgx.py", line 72, in __init__
        self.input_specs = [(s.dtype, s.size(), s.stride())
      File "/home/user/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch_migraphx/fx/fx2mgx.py", line 72, in <listcomp>
        self.input_specs = [(s.dtype, s.size(), s.stride())
    torch._dynamo.exc.BackendCompilerFailed: backend='migraphx' raised:
    AttributeError: 'SymInt' object has no attribute 'dtype'


    You can suppress this exception and fall back to eager by setting:
        import torch._dynamo
        torch._dynamo.config.suppress_errors = True

I would appreciate any guidance.

Operating System

Ubuntu 22.04.4 LTS

CPU

AMD Ryzen 5600X

GPU

AMD Radeon RX 6800XT

ROCm Version

ROCm 6.1.0

ROCm Component

AMDMIGraphX

Steps to Reproduce

I compiled torch_migraphx from source on 4a5fdcf. I inserted the following snippet into sd_hijack.py at line 206 to test compile functionality.

        try:
           import torch._dynamo as dynamo
           torch._dynamo.config.verbose = True
           m.model = torch.compile(m.model, fullgraph=False, backend="migraphx")
           print("Model compiled set")
       except Exception as err:
           print(f"Model compile not supported: {err}")

(Optional for Linux users) Output of /opt/rocm/bin/rocminfo --support

=====================    
HSA System Attributes    
=====================    
Runtime Version:         1.13
Runtime Ext Version:     1.4
System Timestamp Freq.:  1000.000000MHz
Sig. Max Wait Duration:  18446744073709551615 (0xFFFFFFFFFFFFFFFF) (timestamp count)
Machine Model:           LARGE                              
System Endianness:       LITTLE                             
Mwaitx:                  DISABLED
DMAbuf Support:          YES

==========               
HSA Agents               
==========               
*******                  
Agent 1                  
*******                  
  Name:                    AMD Ryzen 5 5600X 6-Core Processor 
  Uuid:                    CPU-XX                             
  Marketing Name:          AMD Ryzen 5 5600X 6-Core Processor 
  Vendor Name:             CPU                                
  Feature:                 None specified                     
  Profile:                 FULL_PROFILE                       
  Float Round Mode:        NEAR                               
  Max Queue Number:        0(0x0)                             
  Queue Min Size:          0(0x0)                             
  Queue Max Size:          0(0x0)                             
  Queue Type:              MULTI                              
  Node:                    0                                  
  Device Type:             CPU                                
  Cache Info:              
    L1:                      32768(0x8000) KB                   
  Chip ID:                 0(0x0)                             
  ASIC Revision:           0(0x0)                             
  Cacheline Size:          64(0x40)                           
  Max Clock Freq. (MHz):   3700                               
  BDFID:                   0                                  
  Internal Node ID:        0                                  
  Compute Unit:            12                                 
  SIMDs per CU:            0                                  
  Shader Engines:          0                                  
  Shader Arrs. per Eng.:   0                                  
  WatchPts on Addr. Ranges:1                                  
  Features:                None
  Pool Info:               
    Pool 1                   
      Segment:                 GLOBAL; FLAGS: FINE GRAINED        
      Size:                    32773644(0x1f4160c) KB             
      Allocatable:             TRUE                               
      Alloc Granule:           4KB                                
      Alloc Recommended Granule:4KB                                
      Alloc Alignment:         4KB                                
      Accessible by all:       TRUE                               
    Pool 2                   
      Segment:                 GLOBAL; FLAGS: KERNARG, FINE GRAINED
      Size:                    32773644(0x1f4160c) KB             
      Allocatable:             TRUE                               
      Alloc Granule:           4KB                                
      Alloc Recommended Granule:4KB                                
      Alloc Alignment:         4KB                                
      Accessible by all:       TRUE                               
    Pool 3                   
      Segment:                 GLOBAL; FLAGS: COARSE GRAINED      
      Size:                    32773644(0x1f4160c) KB             
      Allocatable:             TRUE                               
      Alloc Granule:           4KB                                
      Alloc Recommended Granule:4KB                                
      Alloc Alignment:         4KB                                
      Accessible by all:       TRUE                               
  ISA Info:                
*******                  
Agent 2                  
*******                  
  Name:                    gfx1030                            
  Uuid:                    GPU-f07b30c9fab82b94               
  Marketing Name:          AMD Radeon RX 6800 XT              
  Vendor Name:             AMD                                
  Feature:                 KERNEL_DISPATCH                    
  Profile:                 BASE_PROFILE                       
  Float Round Mode:        NEAR                               
  Max Queue Number:        128(0x80)                          
  Queue Min Size:          64(0x40)                           
  Queue Max Size:          131072(0x20000)                    
  Queue Type:              MULTI                              
  Node:                    1                                  
  Device Type:             GPU                                
  Cache Info:              
    L1:                      16(0x10) KB                        
    L2:                      4096(0x1000) KB                    
    L3:                      131072(0x20000) KB                 
  Chip ID:                 29631(0x73bf)                      
  ASIC Revision:           1(0x1)                             
  Cacheline Size:          64(0x40)                           
  Max Clock Freq. (MHz):   2575                               
  BDFID:                   3072                               
  Internal Node ID:        1                                  
  Compute Unit:            72                                 
  SIMDs per CU:            2                                  
  Shader Engines:          4                                  
  Shader Arrs. per Eng.:   2                                  
  WatchPts on Addr. Ranges:4                                  
  Coherent Host Access:    FALSE                              
  Features:                KERNEL_DISPATCH 
  Fast F16 Operation:      TRUE                               
  Wavefront Size:          32(0x20)                           
  Workgroup Max Size:      1024(0x400)                        
  Workgroup Max Size per Dimension:
    x                        1024(0x400)                        
    y                        1024(0x400)                        
    z                        1024(0x400)                        
  Max Waves Per CU:        32(0x20)                           
  Max Work-item Per CU:    1024(0x400)                        
  Grid Max Size:           4294967295(0xffffffff)             
  Grid Max Size per Dimension:
    x                        4294967295(0xffffffff)             
    y                        4294967295(0xffffffff)             
    z                        4294967295(0xffffffff)             
  Max fbarriers/Workgrp:   32                                 
  Packet Processor uCode:: 118                                
  SDMA engine uCode::      83                                 
  IOMMU Support::          None                               
  Pool Info:               
    Pool 1                   
      Segment:                 GLOBAL; FLAGS: COARSE GRAINED      
      Size:                    16760832(0xffc000) KB              
      Allocatable:             TRUE                               
      Alloc Granule:           4KB                                
      Alloc Recommended Granule:2048KB                             
      Alloc Alignment:         4KB                                
      Accessible by all:       FALSE                              
    Pool 2                   
      Segment:                 GLOBAL; FLAGS: EXTENDED FINE GRAINED
      Size:                    16760832(0xffc000) KB              
      Allocatable:             TRUE                               
      Alloc Granule:           4KB                                
      Alloc Recommended Granule:2048KB                             
      Alloc Alignment:         4KB                                
      Accessible by all:       FALSE                              
    Pool 3                   
      Segment:                 GROUP                              
      Size:                    64(0x40) KB                        
      Allocatable:             FALSE                              
      Alloc Granule:           0KB                                
      Alloc Recommended Granule:0KB                                
      Alloc Alignment:         0KB                                
      Accessible by all:       FALSE                              
  ISA Info:                
    ISA 1                    
      Name:                    amdgcn-amd-amdhsa--gfx1030         
      Machine Models:          HSA_MACHINE_MODEL_LARGE            
      Profiles:                HSA_PROFILE_BASE                   
      Default Rounding Mode:   NEAR                               
      Default Rounding Mode:   NEAR                               
      Fast f16:                TRUE                               
      Workgroup Max Size:      1024(0x400)                        
      Workgroup Max Size per Dimension:
        x                        1024(0x400)                        
        y                        1024(0x400)                        
        z                        1024(0x400)                        
      Grid Max Size:           4294967295(0xffffffff)             
      Grid Max Size per Dimension:
        x                        4294967295(0xffffffff)             
        y                        4294967295(0xffffffff)             
        z                        4294967295(0xffffffff)             
      FBarrier Max Size:       32                                 
*** Done ***        

Additional Information

I have set PYTHONPATH=/opt/rocm/lib:$PYTHONPATH

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

1 participant