-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
[Bug]: 安装paddlecustom之后再运行paddlenlp会报错 #9403
Comments
使用paddlepaddle cpu 版本的安装包试下吧 |
我安装的就是paddlepaddle cpu 版本。我不是要跑npu,我就是想跑cpu,因为我们自己加了一个sycl分支,然后就是在cpu上跑,遇到了错误,我以为是新分支的问题,然后我去跑custom_cpu分支,也报错,就是不安装paddlecustom就paddlenlp可以跑,但是只要安装了paddlecustom,paddlenlp就会报错,是不是没有兼容好呀,应该修改paddlenlp得哪些代码?是modeling.py里吗? |
python ../tests/test_MNIST_model.py 这个测试能跑吗,能跑的话可能是nlp 需要适配。不能跑就是customdevice 里有些问题 |
python ../tests/test_MNIST_model.py 这个测试能跑。就是安装了paddlecustom之后paddlenlp就不能跑了,感觉是paddlenlp和paddlecustom没适配好 |
我在(https://github.com/PaddlePaddle/PaddleNLP/blob/develop/paddlenlp/transformers/llama/modeling.py)的第81行看到了if get_env_device() in ["npu", "mlu", "gcu"]:。在https://github.com/PaddlePaddle/PaddleNLP/blob/develop/paddlenlp/utils/tools.py第129行看到了elif "gcu" in paddle.device.get_all_custom_device_type(): |
https://github.com/PaddlePaddle/PaddleCustomDevice/tree/develop/backends/custom_cpu 你测试这里的verify 部分能正常跑吗, 看起来是编的有问题,编成GCU版本的customdevice了。 正常打出来是custom_cpu |
可以正常跑。python3 -c "import paddle; print(paddle.device.get_all_custom_device_type())" python3 ../tests/test_MNIST_model.py /usr/local/lib/python3.8/site-packages/paddlenlp/transformers/llama/modeling.py这里是装paddlenlp产生的吧,编paddlecustomdevice不会有modeling.py把。paddlenlp和paddlecustomdevice安装顺序有影响吗? |
就是paddlecustom和paddlenlp单独跑各自github页面那些测试例子都可以跑,就是安装了paddlecustom之后再去用paddlenlp推理就会报错,这是什么原因? |
可能因为当前paddlenlp对应的modeling还没有适配验证对应的算子,在自定义设备上存在算子确实或者不对齐的情况。针对这种情况,一方面需要paddlenlp适配,另一方面需要设备开发人员来适配算子。如果可以的话,可以将适配paddlenlp modeling的代码以PR形式提交,共同适配新硬件。 |
软件环境
重复问题
错误描述
稳定复现步骤 & 代码
from paddlenlp.transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("meta-llama/Llama-3.2-1B")
#model = AutoModelForCausalLM.from_pretrained("Qwen/Qwen2-0.5B", dtype="bfloat16")
model = AutoModelForCausalLM.from_pretrained("meta-llama/Llama-3.2-1B", dtype="float32")
input_features = tokenizer("你好!请自我介绍一下。", return_tensors="pd")
outputs = model.generate(**input_features, max_length=128)
#tokenizer.batch_decode(outputs[0])
print(tokenizer.batch_decode(outputs[0]))
The text was updated successfully, but these errors were encountered: