Commit 0f2e7c0
committed
mem: reduce PaddleOCR rec_batch_num from 6 to 1
Paddle's native inference engine allocates 500 MiB memory arena chunks
during text recognition, proportional to batch size. With the default
rec_batch_num=6, four 500 MiB chunks are allocated simultaneously.
Setting rec_batch_num=1 reduces this to a single chunk, cutting peak
memory on the PaddleOCR code path by ~1,265 MiB (-42.6%).
Latency benchmark (55 text regions, CPU, 5 runs):
- rec_batch_num=6: 39.1s +/- 3.5s
- rec_batch_num=1: 37.0s +/- 2.0s
No throughput regression — on CPU, batch processing is sequential.1 parent 7c5855b commit 0f2e7c0
1 file changed
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
| 51 | + | |
51 | 52 | | |
52 | 53 | | |
53 | 54 | | |
| |||
56 | 57 | | |
57 | 58 | | |
58 | 59 | | |
| 60 | + | |
59 | 61 | | |
60 | 62 | | |
61 | 63 | | |
| |||
0 commit comments