PaddlePaddle / PaddleNLP

👑 Easy-to-use and powerful NLP and LLM library with 🤗 Awesome model zoo, supporting wide-range of NLP tasks from research to industrial applications, including 🗂Text Classification, 🔍 Neural Search, ❓ Question Answering, ℹ️ Information Extraction, 📄 Document Intelligence, 💌 Sentiment Analysis etc.
https://paddlenlp.readthedocs.io
Apache License 2.0
11.86k stars 2.89k forks source link

taskflow和fastdeploy放在一起会产生中断,是怎么回事呢? #8495

Open goldwater668 opened 2 months ago

goldwater668 commented 2 months ago

请提出你的问题

我使用Taskflow和fastdeploy.text放在一起运行会报错如下: I0524 16:09:00.122905 1214780 gpu_info.cc:225] [cudaMalloc] size=0.1875 MB, result=0 I0524 16:09:00.122918 1214780 stats.h:78] HostMemoryStatAllocated0: Update current_value with -196608, after update, current value = 256 I0524 16:09:00.122920 1214780 stats.h:78] HostMemoryStatReserved0: Update current_value with -196608, after update, current value = 256 I0524 16:09:00.122924 1214780 stats.h:78] HostMemoryStatReserved0: Update current_value with 256, after update, current value = 512 I0524 16:09:00.122926 1214780 stats.h:78] HostMemoryStatAllocated0: Update current_value with 256, after update, current value = 512 I0524 16:09:00.122929 1214780 stats.h:78] HostMemoryStatAllocated0: Update current_value with -256, after update, current value = 256 I0524 16:09:00.122931 1214780 stats.h:78] HostMemoryStatReserved0: Update current_value with -256, after update, current value = 256 I0524 16:09:00.122936 1214780 gpu_info.cc:225] [cudaMalloc] size=0.000244141 MB, result=0 I0524 16:09:00.122956 1214780 stats.h:78] HostMemoryStatAllocated0: Update current_value with -256, after update, current value = 0 I0524 16:09:00.122957 1214780 stats.h:78] HostMemoryStatReserved0: Update current_value with -256, after update, current value = 0 [INFO] fastdeploy/runtime/backends/paddle/paddle_backend.cc(29)::BuildOption Will inference_precision float32 Segmentation fault (core dumped)

w5688414 commented 2 months ago

请直接参考fastdeploy的uie的适配步骤,目前人力有限,UIE的相关技术停止更新,欢迎开发者继续贡献。

goldwater668 commented 2 months ago

uie有个from fastdeploy.text import UIEModel,可是UTC没有这个模型啊,可以给出一点提示吗,谢谢! 我按照https://github.com/PaddlePaddle/PaddleNLP/blob/develop/applications/zero_shot_text_classification/deploy/python/README.md 这里就是使用GPU就是报错 W0524 20:11:52.009776 1447422 gpu_resources.cc:119] Please NOTE: device: 0, GPU Compute Capability: 8.6, Driver API Version: 12.2, Runtime API Version: 11.8 W0524 20:11:52.010421 1447422 gpu_resources.cc:164] device: 0, cuDNN Version: 8.9. I0524 20:11:52.018860 1447422 cuda_stream.h:81] Create CUDAStream 0x155b7930 with priority = 0, flag = 0 I0524 20:11:52.018878 1447422 allocator_facade.cc:435] Set default stream to 0x155b7930 for StreamSafeCUDAAllocator(0xe50c150) in Place(gpu:0) I0524 20:11:52.018890 1447422 allocator_facade.cc:373] Get Allocator by passing in a default stream I0524 20:11:52.018949 1447422 gpu_info.cc:224] [cudaMalloc] size=0.0065918 MB, result=0 I0524 20:11:52.019014 1447422 gpu_info.cc:224] [cudaMalloc] size=0.000244141 MB, result=0 I0524 20:11:52.019026 1447422 gpu_info.cc:224] [cudaMalloc] size=0.000488281 MB, result=0 I0524 20:11:52.019032 1447422 gpu_info.cc:224] [cudaMalloc] size=0.000244141 MB, result=0 I0524 20:11:52.019039 1447422 gpu_info.cc:224] [cudaMalloc] size=0.000488281 MB, result=0 I0524 20:11:52.019047 1447422 gpu_info.cc:224] [cudaMalloc] size=0.000488281 MB, result=0 I0524 20:11:52.019102 1447422 gpu_info.cc:224] [cudaMalloc] size=0.000244141 MB, result=0 I0524 20:11:52.019109 1447422 gpu_info.cc:224] [cudaMalloc] size=0.000244141 MB, result=0 I0524 20:11:52.019120 1447422 gpu_info.cc:224] [cudaMalloc] size=0.120117 MB, result=0 I0524 20:11:52.019546 1447422 gpu_info.cc:224] [cudaMalloc] size=0.0771484 MB, result=0 I0524 20:11:52.019690 1447422 gpu_info.cc:224] [cudaMalloc] size=0.120117 MB, result=0 I0524 20:11:52.019698 1447422 gpu_info.cc:224] [cudaMalloc] size=0.360352 MB, result=0 I0524 20:11:52.035722 1447422 gpu_info.cc:224] [cudaMalloc] size=0.4375 MB, result=0 I0524 20:11:52.037001 1447422 gpu_info.cc:224] [cudaMalloc] size=0.480469 MB, result=0 I0524 20:11:52.037221 1447422 gpu_info.cc:224] [cudaMalloc] size=0.480469 MB, result=0 I0524 20:11:52.037508 1447422 gpu_info.cc:224] [cudaMalloc] size=0.4375 MB, result=0 I0524 20:11:52.038357 1447422 stats.h:79] HostMemoryStatReserved0: Update current_value with 12, after update, current value = 12 I0524 20:11:52.038373 1447422 stats.h:79] HostMemoryStatAllocated0: Update current_value with 12, after update, current value = 12 I0524 20:11:52.038406 1447422 stats.h:79] HostMemoryStatReserved0: Update current_value with 4, after update, current value = 16 I0524 20:11:52.038409 1447422 stats.h:79] HostMemoryStatAllocated0: Update current_value with 4, after update, current value = 16 I0524 20:11:52.038439 1447422 stats.h:79] HostMemoryStatReserved0: Update current_value with 4, after update, current value = 20 I0524 20:11:52.038440 1447422 stats.h:79] HostMemoryStatAllocated0: Update current_value with 4, after update, current value = 20 Segmentation fault (core dumped)

使用cpu没有预测结果 def infer(self, inputs: Dict[str, Any]) -> Dict[str, Any]: outputs = {} outputs["text"] = inputs["text"] outputs["batch_logits"] = [] dtype_list = ["int64", "int64", "int64", "float32", "int64", "int64"] print("inputs:",inputs) for batch in inputs["batches"]: batch = dict(batch) print(batch) print(self.runtime.num_inputs()) for i in range(self.runtime.num_inputs()): input_name = self.runtime.get_input_info(i).name print(input_name) batch[input_name] = batch[input_name].astype(dtype_list[i]) print(batch)

del batch["soft_token_ids"]

        logits = self.runtime.infer(batch)
        outputs["batch_logits"].append(logits)
    return outputs
goldwater668 commented 2 months ago

https://github.com/PaddlePaddle/PaddleNLP/blob/develop/applications/zero_shot_text_classification/deploy/python/README.md

我这里使用的是UTC出现问题,不是UIE,难道UTC也停止更新维护了吗

w5688414 commented 2 months ago

UIE和UTC都已经停止更新,欢迎开发者贡献和完善。另外推荐使用大模型的解决方案

Irisnotiris commented 1 month ago

https://github.com/PaddlePaddle/PaddleNLP/blob/develop/applications/zero_shot_text_classification/deploy/python/README.md

我这里使用的是UTC出现问题,不是UIE,难道UTC也停止更新维护了吗

请问这个问题解决了吗