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

clip skip prompt token doesn't work with fp16 models #309

Closed
ssube opened this issue Apr 1, 2023 · 0 comments
Closed

clip skip prompt token doesn't work with fp16 models #309

ssube opened this issue Apr 1, 2023 · 0 comments
Labels
model/diffusion status/fixed issues that have been fixed and released type/bug broken features
Milestone

Comments

@ssube
Copy link
Owner

ssube commented Apr 1, 2023

[2023-04-01 22:21:34,745] ERROR: 329721 139777349949248 onnx_web.worker.worker: error while running job          
Traceback (most recent call last):                                                                                                                                                               
  File "/opt/onnx-web/api/onnx_web/worker/worker.py", line 60, in worker_main                                                                                                                    
    job.fn(context, *job.args, **job.kwargs)                                                                                                                                                     
  File "/opt/onnx-web/api/onnx_web/diffusers/run.py", line 78, in run_txt2img_pipeline                                                                                                           
    result = pipe(                                                                                                                                                                               
  File "/home/ssube/miniconda3/envs/onnx-web-rocm/lib/python3.9/site-packages/diffusers/pipelines/stable_diffusion/pipeline_onnx_stable_diffusion.py", line 234, in __call__
    prompt_embeds = self._encode_prompt(
  File "/home/ssube/miniconda3/envs/onnx-web-rocm/lib/python3.9/site-packages/torch/autograd/grad_mode.py", line 27, in decorate_context
    return func(*args, **kwargs)
  File "/opt/onnx-web/api/onnx_web/diffusers/utils.py", line 88, in expand_prompt
    norm_state = layer_norm(
  File "/home/ssube/miniconda3/envs/onnx-web-rocm/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1194, in _call_impl
    return forward_call(*input, **kwargs)
  File "/home/ssube/miniconda3/envs/onnx-web-rocm/lib/python3.9/site-packages/torch/nn/modules/normalization.py", line 190, in forward
    return F.layer_norm(
  File "/home/ssube/miniconda3/envs/onnx-web-rocm/lib/python3.9/site-packages/torch/nn/functional.py", line 2515, in layer_norm
    return torch.layer_norm(input, normalized_shape, weight, bias, eps, torch.backends.cudnn.enabled)
RuntimeError: "LayerNormKernelImpl" not implemented for 'Half'

This is because of the call to layer_norm = torch.nn.LayerNorm(last_state.shape[2]) on the CPU without any type conversion (CPU ops need to be fp32).

@ssube ssube added type/bug broken features model/diffusion status/planned issues that have been planned but not started labels Apr 1, 2023
@ssube ssube added this to the v0.10 milestone Apr 1, 2023
@ssube ssube added status/fixed issues that have been fixed and released and removed status/planned issues that have been planned but not started labels Apr 2, 2023
@ssube ssube closed this as completed Apr 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
model/diffusion status/fixed issues that have been fixed and released type/bug broken features
Projects
None yet
Development

No branches or pull requests

1 participant