You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Create pools - one for each GPU. Each pool will have args.workers_per_gpu workers. # We use pools to manage workers for each GPU.pools= []
forgpu_idinrange(args.num_gpus):
# Create processes_per_gpu workers for each GPUpool=mp.Pool(
processes=args.workers_per_gpu,
initializer=init_worker,
initargs=(gpu_id,)
)
pools.append(pool)
results= []
# The PDFs for each pool (GPU) are fixed with the for-loop below.# Create tasks - 现在每个任务只处理一个或少量文件fori, (file_path, output_dir) inenumerate(zip(pdf_files, output_dir_wrt_pdf_files)):
gpu_id=i%args.num_gpus# GPU仍然循环分配# Use partial to bind gpu_id to process_filebound_process=partial(worker, gpu_id)
results.append(pools[gpu_id].apply_async(bound_process, (file_path, output_dir)))
Description of the bug | 错误描述
我用python mp进行的多卡并行,多GPU内存调用没有问题,但是CPU(SLRUM中request的mem)却爆了,请问有人有类似情况吗?
How to reproduce the bug | 如何复现
API调用
Operating system | 操作系统
Linux
Python version | Python 版本
3.10
Software version | 软件版本 (magic-pdf --version)
0.10.x
Device mode | 设备模式
cuda
The text was updated successfully, but these errors were encountered: