Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
wangsen
MinerU
Commits
d76ec7da
Unverified
Commit
d76ec7da
authored
Jan 06, 2025
by
Xiaomeng Zhao
Committed by
GitHub
Jan 06, 2025
Browse files
Merge pull request #1420 from myhloli/dev
docs(README): add Ascend NPU acceleration guide
parents
6b2b6132
4d110d31
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
58 additions
and
3 deletions
+58
-3
README.md
README.md
+1
-1
README_zh-CN.md
README_zh-CN.md
+2
-1
docker/ascend_npu/Dockerfile
docker/ascend_npu/Dockerfile
+1
-1
docker/ascend_npu/requirements.txt
docker/ascend_npu/requirements.txt
+0
-0
docs/README_Ascend_NPU_Acceleration_zh_CN.md
docs/README_Ascend_NPU_Acceleration_zh_CN.md
+54
-0
No files found.
README.md
View file @
d76ec7da
...
@@ -288,7 +288,7 @@ If your device supports CUDA and meets the GPU requirements of the mainline envi
...
@@ -288,7 +288,7 @@ If your device supports CUDA and meets the GPU requirements of the mainline envi
### Using NPU
### Using NPU
If your device has NPU acceleration hardware, you can follow the tutorial below to use NPU acceleration:
If your device has NPU acceleration hardware, you can follow the tutorial below to use NPU acceleration:
[
Ascend NPU Acceleration
](
docs/README_Ascend_NPU_Acceleration_zh_CN.md
)
## Usage
## Usage
...
...
README_zh-CN.md
View file @
d76ec7da
...
@@ -284,7 +284,7 @@ pip install -U magic-pdf[full] --extra-index-url https://wheels.myhloli.com -i h
...
@@ -284,7 +284,7 @@ pip install -U magic-pdf[full] --extra-index-url https://wheels.myhloli.com -i h
> docker run --rm --gpus=all nvidia/cuda:12.1.0-base-ubuntu22.04 nvidia-smi
> docker run --rm --gpus=all nvidia/cuda:12.1.0-base-ubuntu22.04 nvidia-smi
> ```
> ```
```
bash
```
bash
wget https://git
hub
.com/
opendatalab
/MinerU/raw/master/docker/china/Dockerfile
-O
Dockerfile
wget https://git
ee
.com/
myhloli
/MinerU/raw/master/docker/china/Dockerfile
-O
Dockerfile
docker build
-t
mineru:latest
.
docker build
-t
mineru:latest
.
docker run
--rm
-it
--gpus
=
all mineru:latest /bin/bash
docker run
--rm
-it
--gpus
=
all mineru:latest /bin/bash
magic-pdf
--help
magic-pdf
--help
...
@@ -292,6 +292,7 @@ pip install -U magic-pdf[full] --extra-index-url https://wheels.myhloli.com -i h
...
@@ -292,6 +292,7 @@ pip install -U magic-pdf[full] --extra-index-url https://wheels.myhloli.com -i h
### 使用NPU
### 使用NPU
如果您的设备存在NPU加速硬件,则可以通过以下教程使用NPU加速:
如果您的设备存在NPU加速硬件,则可以通过以下教程使用NPU加速:
[
NPU加速教程
](
docs/README_Ascend_NPU_Acceleration_zh_CN.md
)
## 使用
## 使用
...
...
docker/
huawei
_npu/Dockerfile
→
docker/
ascend
_npu/Dockerfile
View file @
d76ec7da
...
@@ -33,7 +33,7 @@ RUN python3 -m venv /opt/mineru_venv
...
@@ -33,7 +33,7 @@ RUN python3 -m venv /opt/mineru_venv
# Activate the virtual environment and install necessary Python packages
# Activate the virtual environment and install necessary Python packages
RUN
/bin/bash
-c
"source /opt/mineru_venv/bin/activate &&
\
RUN
/bin/bash
-c
"source /opt/mineru_venv/bin/activate &&
\
pip3 install --upgrade pip -i https://mirrors.aliyun.com/pypi/simple &&
\
pip3 install --upgrade pip -i https://mirrors.aliyun.com/pypi/simple &&
\
wget https://gitee.com/myhloli/MinerU/raw/master/docker/
huawei
_npu/requirements.txt -O requirements.txt &&
\
wget https://gitee.com/myhloli/MinerU/raw/master/docker/
ascend
_npu/requirements.txt -O requirements.txt &&
\
pip3 install -r requirements.txt --extra-index-url https://wheels.myhloli.com -i https://mirrors.aliyun.com/pypi/simple &&
\
pip3 install -r requirements.txt --extra-index-url https://wheels.myhloli.com -i https://mirrors.aliyun.com/pypi/simple &&
\
wget https://gitee.com/ascend/pytorch/releases/download/v6.0.rc2-pytorch2.3.1/torch_npu-2.3.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl &&
\
wget https://gitee.com/ascend/pytorch/releases/download/v6.0.rc2-pytorch2.3.1/torch_npu-2.3.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl &&
\
pip install torch_npu-2.3.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl"
pip install torch_npu-2.3.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl"
...
...
docker/
huawei
_npu/requirements.txt
→
docker/
ascend
_npu/requirements.txt
View file @
d76ec7da
File moved
docs/README_Ascend_NPU_Acceleration_zh_CN.md
0 → 100644
View file @
d76ec7da
# Ascend NPU 加速
## 简介
本文档介绍如何在 Ascend NPU 上使用 MinerU。本文档内容已在
`华为Atlas 800T A2`
服务器上测试通过。
```
CPU:鲲鹏 920 aarch64 2.6GHz
NPU:Ascend 910B 64GB
OS:openEuler 22.03 (LTS-SP3)
```
由于适配 Ascend NPU 的环境较为复杂,建议使用 Docker 容器运行 MinerU。
## 构建镜像
请保持网络状况良好,并执行以下代码构建镜像。
```
bash
wget https://gitee.com/myhloli/MinerU/raw/master/docker/ascend_npu/Dockerfile
-O
Dockerfile
docker build
-t
mineru_npu:latest .
```
如果构建过程中未发生报错则说明镜像构建成功。
## 运行容器
```
bash
docker run
--rm
-it
-u
root
--privileged
=
true
\
--ipc
=
host
\
--network
=
host
\
--device
=
/dev/davinci0
\
--device
=
/dev/davinci1
\
--device
=
/dev/davinci2
\
--device
=
/dev/davinci3
\
--device
=
/dev/davinci4
\
--device
=
/dev/davinci5
\
--device
=
/dev/davinci6
\
--device
=
/dev/davinci7
\
--device
=
/dev/davinci_manager
\
--device
=
/dev/devmm_svm
\
--device
=
/dev/hisi_hdc
\
-v
/var/log/npu/:/usr/slog
\
-v
/usr/local/bin/npu-smi:/usr/local/bin/npu-smi
\
-v
/usr/local/Ascend/driver:/usr/local/Ascend/driver
\
mineru_npu:latest
\
/bin/bash
-c
"echo 'source /opt/mineru_venv/bin/activate' >> ~/.bashrc && exec bash"
magic-pdf
--help
```
## 已知问题
-
paddlepaddle使用内嵌onnx模型,仅支持中英文ocr,不支持其他语言
-
layout模型使用layoutlmv3时会发生间歇性崩溃,建议使用默认配置的doclayout_yolo模型
-
表格解析仅适配了rapid_table模型,其他模型可能会无法使用
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment