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
107624b2
Unverified
Commit
107624b2
authored
Jul 14, 2025
by
Xiaomeng Zhao
Committed by
GitHub
Jul 14, 2025
Browse files
Merge pull request #3017 from myhloli/dev
Dev
parents
03ea29bd
f6c0d9d3
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
23 deletions
+26
-23
docs/zh/index.md
docs/zh/index.md
+2
-2
docs/zh/usage/advanced_cli_parameters.md
docs/zh/usage/advanced_cli_parameters.md
+22
-21
docs/zh/usage/cli_tools.md
docs/zh/usage/cli_tools.md
+2
-0
No files found.
docs/zh/index.md
View file @
107624b2
...
...
@@ -3,6 +3,7 @@
<p
align=
"center"
>
<img
src=
"../images/MinerU-logo.png"
width=
"300px"
style=
"vertical-align:middle;"
>
</p>
</div>
<!-- icon -->
...
...
@@ -21,9 +22,8 @@
[

](https://arxiv.org/abs/2409.18839)
[

](https://deepwiki.com/opendatalab/MinerU)
<div
align=
"center"
>
<a
href=
"https://trendshift.io/repositories/11174"
target=
"_blank"
><img
src=
"https://trendshift.io/api/badge/repositories/11174"
alt=
"opendatalab%2FMinerU | Trendshift"
style=
"width: 250px; height: 55px;"
width=
"250"
height=
"55"
/></a>
<!-- hot link -->
<p
align=
"center"
>
...
...
docs/zh/usage/advanced_cli_parameters.md
View file @
107624b2
...
...
@@ -4,20 +4,21 @@
### 显存优化参数
> [!TIP]
>sglang加速模式目前支持在最低8G显存的Turing架构显卡上运行,但在显存<24G的显卡上可能会遇到显存不足的问题, 可以通过使用以下参数来优化显存使用:
>- 如果您使用单张显卡遇到显存不足的情况时,可能需要调低KV缓存大小,`--mem-fraction-static 0.5`,如仍出现显存不足问题,可尝试进一步降低到`0.4`或更低。
>- 如您有两张以上显卡,可尝试通过张量并行(TP)模式简单扩充可用显存:`--tp-size 2`
>
sglang加速模式目前支持在最低8G显存的Turing架构显卡上运行,但在显存<24G的显卡上可能会遇到显存不足的问题, 可以通过使用以下参数来优化显存使用:
>
- 如果您使用单张显卡遇到显存不足的情况时,可能需要调低KV缓存大小,`--mem-fraction-static 0.5`,如仍出现显存不足问题,可尝试进一步降低到`0.4`或更低。
>
- 如您有两张以上显卡,可尝试通过张量并行(TP)模式简单扩充可用显存:`--tp-size 2`
### 性能优化参数
> [!TIP]
>如果您已经可以正常使用sglang对vlm模型进行加速推理,但仍然希望进一步提升推理速度,可以尝试以下参数:
>- 如果您有超过多张显卡,可以使用sglang的多卡并行模式来增加吞吐量:`--dp-size 2`
>- 同时您可以启用`torch.compile`来将推理速度加速约15%:`--enable-torch-compile`
> 如果您已经可以正常使用sglang对vlm模型进行加速推理,但仍然希望进一步提升推理速度,可以尝试以下参数:
>
> - 如果您有超过多张显卡,可以使用sglang的多卡并行模式来增加吞吐量:`--dp-size 2`
> - 同时您可以启用`torch.compile`来将推理速度加速约15%:`--enable-torch-compile`
### 参数传递说明
> [!TIP]
>- 如果您想了解更多有关`sglang`的参数使用方法,请参考 [sglang官方文档](https://docs.sglang.ai/backend/server_arguments.html#common-launch-commands)
>- 所有sglang官方支持的参数都可用通过命令行参数传递给 MinerU,包括以下命令:`mineru`、`mineru-sglang-server`、`mineru-gradio`、`mineru-api`
>
- 如果您想了解更多有关`sglang`的参数使用方法,请参考 [sglang官方文档](https://docs.sglang.ai/backend/server_arguments.html#common-launch-commands)
>
- 所有sglang官方支持的参数都可用通过命令行参数传递给 MinerU,包括以下命令:`mineru`、`mineru-sglang-server`、`mineru-gradio`、`mineru-api`
## GPU 设备选择与配置
...
...
@@ -31,7 +32,7 @@
### 常见设备配置示例
> [!TIP]
>
-
以下是一些常见的 `CUDA_VISIBLE_DEVICES` 设置示例:
> 以下是一些常见的 `CUDA_VISIBLE_DEVICES` 设置示例:
> ```bash
> CUDA_VISIBLE_DEVICES=1 Only device 1 will be seen
> CUDA_VISIBLE_DEVICES=0,1 Devices 0 and 1 will be visible
...
...
@@ -42,12 +43,12 @@
### 实际应用场景
> [!TIP]
>以下是一些可能的使用场景:
>- 如果您有多张显卡,需要指定卡0和卡1,并使用多卡并行来启动'sglang-server',可以使用以下命令:
>
以下是一些可能的使用场景:
>
- 如果您有多张显卡,需要指定卡0和卡1,并使用多卡并行来启动'sglang-server',可以使用以下命令:
> ```bash
> CUDA_VISIBLE_DEVICES=0,1 mineru-sglang-server --port 30000 --dp-size 2
> ```
>- 如果您有多张显卡,需要在卡0和卡1上启动两个`fastapi`服务,并分别监听不同的端口,可以使用以下命令:
>
- 如果您有多张显卡,需要在卡0和卡1上启动两个`fastapi`服务,并分别监听不同的端口,可以使用以下命令:
> ```bash
> # 在终端1中
> CUDA_VISIBLE_DEVICES=0 mineru-api --host 127.0.0.1 --port 8000
...
...
docs/zh/usage/cli_tools.md
View file @
107624b2
...
...
@@ -63,6 +63,8 @@ Options:
## 环境变量说明
MinerU命令行工具的某些参数存在相同功能的环境变量配置,通常环境变量配置的优先级高于命令行参数,且在所有命令行工具中都生效。
以下是常用的环境变量及其说明:
-
`MINERU_DEVICE_MODE`
:用于指定推理设备,支持
`cpu/cuda/cuda:0/npu/mps`
等设备类型,仅对
`pipeline`
后端生效。
-
`MINERU_VIRTUAL_VRAM_SIZE`
:用于指定单进程最大 GPU 显存占用(GB),仅对
`pipeline`
后端生效。
-
`MINERU_MODEL_SOURCE`
:用于指定模型来源,支持
`huggingface/modelscope/local`
,默认为
`huggingface`
,可通过环境变量切换为
`modelscope`
或使用本地模型。
...
...
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