inference icon indicating copy to clipboard operation
inference copied to clipboard

两张4090卡上部署rerank模型,无法并行计算

Open yidasanqian opened this issue 8 months ago • 10 comments

Image

Image

asyncio并发跑600份文档rerank,还是单卡100%负载,另一张卡0%,请问是否需要特别的配置?

yidasanqian avatar Apr 10 '25 03:04 yidasanqian

replica(副本) 配置成2.

qinxuye avatar Apr 10 '25 03:04 qinxuye

Image

Image 副本是2,为什么gpu索引不是显示0,1?

yidasanqian avatar Apr 10 '25 03:04 yidasanqian

@qinxuye reranker.xinference_rerank:_rerank_batch:77 - rerank response text: {"detail":"Model actor is out of memory, model id: bge-reranker-v2-m3-1, error: CUDA out of memory. Tried to allocate 2.00 GiB. GPU 0 has a total capacity of 23.55 GiB of which 848.44 MiB is free. Process 159 has 0 bytes memory in use. Including non-PyTorch memory, this process has 0 bytes memory in use. Of the allocated memory 19.13 GiB is allocated by PyTorch, and 525.93 MiB is reserved by PyTorch but unallocated. If reserved but unallocated memory is large try setting PYTORCH_CUDA_ALLOC_CONF=expandable_segments:True to avoid fragmentation. See documentation for Memory Management (https://pytorch.org/docs/stable/notes/cuda.html#environment-variables)"}

怎么配置xinference以避免出现oom

yidasanqian avatar Apr 10 '25 05:04 yidasanqian

你是两张卡吗?配置 replica 2 就行,不需要配置 gpu idx。

qinxuye avatar Apr 10 '25 06:04 qinxuye

你是两张卡吗?配置 replica 2 就行,不需要配置 gpu idx。

不止两张

yidasanqian avatar Apr 10 '25 08:04 yidasanqian

目前多个 replica 还不能指定 gpu idx。

要限制 XInf 的使用可以启动的时候指定 CUDA_VISIBLE_DEVICES 。

qinxuye avatar Apr 10 '25 08:04 qinxuye

是不是可以开多个docker xinf服务实例,每个实例分配一个device idx🤣

Minamiyama avatar Apr 10 '25 08:04 Minamiyama

后续要让 worker_ip 和 gpu_idx 支持多副本/分布式推理。还在设计。

qinxuye avatar Apr 10 '25 09:04 qinxuye

你是两张卡吗?配置 replica 2 就行,不需要配置 gpu idx。

我是两张卡,怎么部署多个replica >2 模型在一张卡上?

jiliangqian avatar Apr 15 '25 12:04 jiliangqian

This issue is stale because it has been open for 7 days with no activity.

github-actions[bot] avatar Apr 22 '25 19:04 github-actions[bot]

This issue was closed because it has been inactive for 5 days since being marked as stale.

github-actions[bot] avatar Apr 28 '25 19:04 github-actions[bot]

请问有解决吗?我配置了 replica 2,还是会报同样的错误,显示单卡显存不足。

3leg0ocat avatar Jun 25 '25 07:06 3leg0ocat