docling-project / docling-project/docling

Deadlock when warning "'pin_memory' argument is set as true but no accelerator is found, then device pinned memory won't be used." is raised

Open
#2,190 3 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Python
Stars
66.4k
Forks
4.8k
Avg merge
2d 21h
Merged PRs (30d)
84

Description

### Bug
I have python code that uses docling to process a large amount of documents from URLs. The code uses 200 threads to concurrently access and parse urls into markdown format (using `ThreadPoolExecutor`). After approx. 10 minutes, I get a many of these warnings: `pin_memory' argument is set as true but no accelerator is found, then device pinned memory won't be used.` -raised by pytorch dataloader - possibly from each thread. And after some time my program stops responding. If I run my program again (with different URLs), it continues to work and after 10 minutes the deadlock happens again.

Also, it seems like docling does not recognize my hardware:
```
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 515.105.01 Driver Version: 515.105.01 CUDA Version: 11.7 |
|-------------------------------+----------------------+----------------------+
| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
| | | MIG M. |
|===============================+======================+======================|
| 0 Tesla V100-PCIE... On | 00000000:81:00.0 Off | 0 |
| N/A 30C P0 24W / 250W | 0MiB / 16384MiB | 0% Default |
| | | N/A |
+-------------------------------+----------------------+----------------------+
| 1 Tesla V100-PCIE... On | 00000000:82:00.0 Off | 0 |
| N/A 30C P0 24W / 250W | 0MiB / 16384MiB | 0% Default |
| | | N/A |
+-------------------------------+----------------------+----------------------+

+-----------------------------------------------------------------------------+
| Processes: |
| GPU GI CI PID Type Process name GPU Memory |
| ID ID Usage |
|=============================================================================|
| No running processes found |
+-----------------------------------------------------------------------------+
```

### Steps to reproduce
Use 200 or more threads to parse a large corpus of URLs to markdown using a single docling converter object using `concurrent.futures.ThreadPoolExecutor`.

### Docling version
```
Docling version: 2.49.0
Docling Core version: 2.46.0
Docling IBM Models version: 3.9.0
Docling Parse version: 4.2.3
Python: cpython-312 (3.12.10)
Platform: Linux-5.4.0-215-generic-x86_64-with-glibc2.31
```

### Python version
Python 3.12.10

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.