Fengshenbang-LM
Fengshenbang-LM copied to clipboard
RuntimeError: CUDA error: CUBLAS_STATUS_INVALID_VALUE when calling `cublasGemmStridedBatchedExFix( handle, opa, opb, m, n, k, (void*)(&falpha), a, CUDA_R_16F, lda, stridea, b, CUDA_R_16F, ldb, strideb, (void*)(&fbeta), c, CUDA_R_16F, ldc, stridec, num_batches, CUDA_R_32F, CUBLAS_GEMM_DEFAULT_TENSOR_OP)`
when i run : # Taiyi-Stable-Diffusion-1B-Chinese-v0.1
get :
import torch from diffusers import StableDiffusionPipeline torch.backends.cudnn.benchmark = True pipe = StableDiffusionPipeline.from_pretrained("IDEA-CCNL/Taiyi-Stable-Diffusion-1B-Chinese-v0.1", torch_dtype=torch.float16) pipe.to('cuda') prompt = '飞流直下三千尺,油画' image = pipe(prompt, guidance_scale=7.5).images[0]
Traceback (most recent call last): File "", line 1, in File "/home/anaconda3/envs/s20230220e310fsb/lib/python3.10/site-packages/torch/autograd/grad_mode.py", line 27, in decorate_context return func(*args, **kwargs) File "/home/anaconda3/envs/s20230220e310fsb/lib/python3.10/site-packages/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion.py", line 604, in call prompt_embeds = self._encode_prompt( File "/home/anaconda3/envs/s20230220e310fsb/lib/python3.10/site-packages/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion.py", line 320, in _encode_prompt prompt_embeds = self.text_encoder( File "/home/anaconda3/envs/s20230220e310fsb/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1194, in _call_impl return forward_call(*input, **kwargs) File "/home/anaconda3/envs/s20230220e310fsb/lib/python3.10/site-packages/transformers/models/bert/modeling_bert.py", line 1019, in forward encoder_outputs = self.encoder( File "/home/anaconda3/envs/s20230220e310fsb/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1194, in _call_impl return forward_call(*input, **kwargs) File "/home/anaconda3/envs/s20230220e310fsb/lib/python3.10/site-packages/transformers/models/bert/modeling_bert.py", line 609, in forward layer_outputs = layer_module( File "/home/anaconda3/envs/s20230220e310fsb/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1194, in _call_impl return forward_call(*input, **kwargs) File "/home/anaconda3/envs/s20230220e310fsb/lib/python3.10/site-packages/transformers/models/bert/modeling_bert.py", line 495, in forward self_attention_outputs = self.attention( File "/home/anaconda3/envs/s20230220e310fsb/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1194, in _call_impl return forward_call(*input, **kwargs) File "/home/anaconda3/envs/s20230220e310fsb/lib/python3.10/site-packages/transformers/models/bert/modeling_bert.py", line 425, in forward self_outputs = self.self( File "/home/anaconda3/envs/s20230220e310fsb/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1194, in _call_impl return forward_call(*input, kwargs) File "/home/anaconda3/envs/s20230220e310fsb/lib/python3.10/site-packages/transformers/models/bert/modeling_bert.py", line 323, in forward attention_scores = torch.matmul(query_layer, key_layer.transpose(-1, -2)) RuntimeError: CUDA error: CUBLAS_STATUS_INVALID_VALUE when calling `cublasGemmStridedBatchedExFix( handle, opa, opb, m, n, k, (void)(&falpha), a, CUDA_R_16F, lda, stridea, b, CUDA_R_16F, ldb, strideb, (void)(&fbeta), c, CUDA_R_16F, ldc, stridec, num_batches, CUDA_R_32F, CUBLAS_GEMM_DEFAULT_TENSOR_OP)
Environment Linux version 3.10.0-693.el7.x86_64 ([email protected]) (gcc version 4.8.5 20150623 (Red Hat 4.8.5-16) (GCC) ) https://github.com/hpcaitech/ColossalAI/issues/1 SMP Tue Aug 22 21:09:27 UTC 2017
python=3.10.9
conda 4.14.0
nvcc: NVIDIA (R) Cuda compiler driver Copyright (c) 2005-2022 NVIDIA Corporation Built on Wed_Jun__8_16:49:14_PDT_2022 Cuda compilation tools, release 11.7, V11.7.99 Build cuda_11.7.r11.7/compiler.31442593_0
我也遇到这个问题,您是如何解决的呢
同问,我也遇到了这个问题
楼主解决了吗
我也遇到了相同的问题,请问有什么解决方法吗?
你们的transformers版本是多少?试下: pip install -U transformers pip install -U diffusers