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

"LayerNormKernelImpl" not implemented for 'BFloat16' #7

Closed
wangshankun opened this issue Feb 7, 2023 · 5 comments
Closed

"LayerNormKernelImpl" not implemented for 'BFloat16' #7

wangshankun opened this issue Feb 7, 2023 · 5 comments

Comments

@wangshankun
Copy link

Version:
image

Loading model :
RWKV-4-Pile-7B-Instruct-test1-20230124

Error:
Traceback (most recent call last):
File "chat.py", line 175, in
model = RWKV_RNN(args)
File "/opt/conda/lib/python3.8/site-packages/torch/jit/_script.py", line 272, in init_then_script
original_init(self, *args, **kwargs)
File "/root/work/ChatRWKV/src/model_run.py", line 103, in init
x = self.LN(self.w.emb.weight, self.w.blocks[0].ln0)
File "/root/work/ChatRWKV/src/model_run.py", line 111, in LN
return F.layer_norm(x, (self.args.n_embd,), weight=w.weight, bias=w.bias)
File "/opt/conda/lib/python3.8/site-packages/torch/nn/functional.py", line 2346, in layer_norm
return torch.layer_norm(input, normalized_shape, weight, bias, eps, torch.backends.cudnn.enabled)
RuntimeError: "LayerNormKernelImpl" not implemented for 'BFloat16'

@BlinkDL
Copy link
Owner

BlinkDL commented Feb 7, 2023

Your GPU does not support bf16. Use fp16.

@BlinkDL BlinkDL closed this as completed Feb 8, 2023
@cxj01
Copy link

cxj01 commented Feb 8, 2023

I had the same problem. How did you solve it?

@BlinkDL
Copy link
Owner

BlinkDL commented Feb 8, 2023

Ok this is indeed an issue due to a previous change. Fix it. Please try latest version.

@BlinkDL BlinkDL reopened this Feb 8, 2023
@cxgreat2014
Copy link

cpu模式,6G模型:

RuntimeError: "LayerNormKernelImpl" not implemented for 'Half'

@BlinkDL
Copy link
Owner

BlinkDL commented Feb 13, 2023

cpu模式,6G模型:

RuntimeError: "LayerNormKernelImpl" not implemented for 'Half'

fp16 (good for GPU, does NOT support CPU) // fp32 (good for CPU) // bf16 (worse accuracy, supports CPU)

@BlinkDL BlinkDL closed this as completed Feb 17, 2023
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

4 participants