-
Notifications
You must be signed in to change notification settings - Fork 8.1k
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
gpu环境并发请求:RuntimeError: could not execute a primitive #14836
Comments
可以试试升级一下paddlepaddle版本到3.0 rc1 |
I have this problem also when using in a threaded environment (even when doing everything related paddleocr initialization and inference with a threadlock!) and when using it in pytest sessions. Tried with paddlepaddle 3.0 rc1. It works with paddlepaddle-2.6.2, but I'm running into a memory leak there. Kinda breaks PaddleOCR for me currently :/ |
Same as Luux here. |
This is the memory leak I'm talking about: #7823 |
Oh and btw.: I'm using it on CPU. So the problem is also there. |
🔎 Search before asking
🐛 Bug (问题描述)
我用的fastapi(flaskapi也试过,问题一样);
这是fastapi中的代码片段,如果保留async,他其实是单线程(不报错),因为你同时发两个请求,只有一个在处理并且会阻塞另一个请求,也就是另一个请求在排队,如果把async删掉的话,就可以多线程并发处理了,但是会报错,这个报错是从paddleocr传出来的。但是我们的服务是需要多线程的,不能阻塞在那;
@app.post(
"/pdf_parse",
tags=["projects"],
summary="Parse PDF files (supports local files and S3)",
)
async def pdf_parse(
pdf_file: UploadFile = None,
pdf_path: str = None,
parse_method: str = "auto",
is_json_md_dump: bool = False,
output_dir: str = "output",
return_layout: bool = False,
return_info: bool = False,
return_content_list: bool = False,
return_images: bool = False,
):
🏃♂️ Environment (运行环境)
How to reproduce the bug | 如何复现
flaskapi或者fastapi部署服务后,同时发两个请求就会出现以上报错
Operating system | 操作系统
Linux
Python version | Python 版本
3.10
Software version | 软件版本 (magic-pdf --version)
1.0.x
Device mode | 设备模式
cuda
🌰 Minimal Reproducible Example (最小可复现问题的Demo)
fastapi部署服务后,发多次请求会报错,以下提供mineru的代码库,可以直接用mineru的fastapi服务(去掉async def pdf_parse()中的async可多线程并发)进行复现;
https://github.com/opendatalab/MinerU?tab=readme-ov-file
opendatalab/MinerU#1891
The text was updated successfully, but these errors were encountered: