Skip to content

Commit eace136

Browse files
committed
Update minerU Gaudi support for minerU v2.6.4
1 parent 17a7946 commit eace136

File tree

1 file changed

+69
-4
lines changed

1 file changed

+69
-4
lines changed

scripts/docs/mineru部署手册.md

Lines changed: 69 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
# MinerU Gaudi 部署指南
22

3-
本指南提供在 MinerU v2.5.4 上使用 Intel Gaudi 作为硬件加速器通过 pipeline后端/VLLM 后端进行部署的详细步骤。
3+
本指南提供在 MinerU v2.5.4 和 MinerU v2.6.4 上使用 Intel Gaudi 作为硬件加速器通过 pipeline后端/VLLM 后端进行部署的详细步骤。
44

55
## 前提条件
66

77
- 已安装 Intel Gaudi 软件栈
88
- 支持 Gaudi 对应驱动版本的基础Docker镜像
99

10-
## 使用MinerU v2.5.4
10+
## 使用MinerU v2.5.4,v2.6.4
1111

1212
### 1. 启动docker
1313

@@ -55,11 +55,30 @@ https://github.com/opendatalab/MinerU/blob/master/mineru.template.json
5555

5656
```bash
5757
git clone https://github.com/HabanaAI/vllm-fork.git -b aice/v1.22.0
58-
pip install -e . -i https://mirrors.aliyun.com/pypi/simple
5958
git clone https://github.com/vllm-project/vllm.git
6059
cp -r vllm/vllm/v1/sample/logits_processor vllm-fork/vllm/v1/sample/logits_processor
60+
cd vllm-fork
61+
VLLM_TARGET_DEVICE=hpu pip install . -i https://mirrors.aliyun.com/pypi/simple
6162
```
6263

64+
以下修改针对minerU 2.5.4 及2.6.x 版本中出现的问题
65+
mineru.cli.client:parse_doc:211 - name 'LogitsProcessor' is not defined
66+
在docker 内部修改 MinerULogitsProcessors配置,替换v1的LogitsProcessor
67+
/usr/local/lib/python3.10/dist-packages/mineru_vl_utils/__init__.py
68+
'''bash
69+
--- __init__.py.prev 2025-11-24 01:09:19.275702572 +0000
70+
+++ __init__.py 2025-11-24 01:08:36.723701017 +0000
71+
@@ -7,7 +7,7 @@
72+
__lazy_attrs__ = {
73+
"MinerUClient": (".mineru_client", "MinerUClient"),
74+
"MinerUSamplingParams": (".mineru_client", "MinerUSamplingParams"),
75+
- "MinerULogitsProcessor": (".logits_processor.vllm_v1_no_repeat_ngram", "VllmV1NoRepeatNGramLogitsProcessor"),
76+
- "MinerULogitsProcessor": (".logits_processor.vllm_v0_no_repeat_ngram", "VllmV0NoRepeatNGramLogitsProcessor"),
77+
}
78+
79+
if TYPE_CHECKING:
80+
'''
81+
6382
#### 4.2 在Gaudi上运行vlm-vllm-engine backend
6483

6584
#### 4.2.1 设置环境变量
@@ -94,7 +113,7 @@ export VLLM_FP32_SOFTMAX_VISION=true
94113
#### 4.2.2 使用命令行方式运行Mineru
95114

96115
```bash
97-
mineru -p <input_path> -o <output_path> -b vlm-vllm-engine
116+
mineru -p <input_path> -o <output_path> -b vlm-vllm-engine
98117
```
99118

100119
#### 4.2.3 使用 http-client/server 方式运行Mineru
@@ -218,3 +237,49 @@ vim /usr/local/lib/python3.10/dist-packages/ultralytics/nn/autobackend.py
218237
```bash
219238
$ MINERU_DEVICE_MODE=hpu mineru -p ./test.pdf -o ./ -d hpu -b pipeline -m ocr
220239
```
240+
241+
### 6. 针对MinerU v2.6.4 相关更新
242+
243+
#### 6.1 部署方式
244+
245+
在v2.6.4 上部署vllm-backend和pipeline backend命令与v2.5.4相同,可以参考前面5个章节内容进行
246+
247+
#### 6.2 新功能支持
248+
249+
MinerU 天枢API 服务部署在Gaudi上的支持。
250+
天枢服务主要提供面向企业基的增强服务部署,在Gaudi上已经验证了单卡单worker部署方式。
251+
天枢服务包括但不限于如下功能:
252+
##### 企业级功能
253+
- ✅ **异步处理** - 客户端立即响应(~100ms),无需等待处理完成
254+
- ✅ **任务持久化** - SQLite 存储,服务重启任务不丢失
255+
- ✅ **优先级队列** - 重要任务优先处理
256+
- ✅ **自动清理** - 定期清理旧结果文件,保留数据库记录
257+
258+
项目链接
259+
https://github.com/opendatalab/MinerU/tree/master/projects/mineru_tianshu
260+
261+
##### 部署步骤
262+
''' bash
263+
cd MinerU/projects/mineru_tianshu
264+
pip install -r requirements.txt
265+
python start_all.py --workers-per-device 1 --devices auto 2>&1 \
266+
| tee tianshu.log >/dev/null &
267+
268+
'''
269+
#### API 访问
270+
Gaudi 目前支持vlm-vllm-engine访问方式
271+
'''
272+
curl -X 'POST' \
273+
'http://10.239.129.55:8000/api/v1/tasks/submit' \
274+
-H 'accept: application/json' \
275+
-H 'Content-Type: multipart/form-data' \
276+
-F '[email protected];type=application/pdf' \
277+
-F 'backend=vlm-vllm-engine' \
278+
-F 'lang=ch' \
279+
-F 'method=auto' \
280+
-F 'formula_enable=true' \
281+
-F 'table_enable=true' \
282+
-F 'priority=0'
283+
'''
284+
详细API 参考
285+
http://localhost:8000/docs

0 commit comments

Comments
 (0)