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

Add FP32 fallback support on ldm/modules/diffusionmodules/openaimodel.py #344

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Commits on Nov 21, 2023

  1. Add FP32 fallback support on ldm/modules/diffusionmodules/openaimodel.py

    This tries to execute interpolate with FP32 if it failed.
    
    Background is that
    on some environment such as Mx chip MacOS devices, we get error as follows:
    
    ```
    "      File "ldm/modules/diffusionmodules/openaimodel.py", line 115, in forward
            x = F.interpolate(x, scale_factor=2, mode="nearest")
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
          File "torch/nn/functional.py", line 3931, in interpolate
            return torch._C._nn.upsample_nearest2d(input, output_size, scale_factors)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        RuntimeError: "upsample_nearest2d_channels_last" not implemented for 'Half'
    ```
    
    Therefore this commit adds the FP32 fallback execution to solve it.
    hidenorly committed Nov 21, 2023
    Configuration menu
    Copy the full SHA
    ca92a14 View commit details
    Browse the repository at this point in the history