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
I investigated PaddleOCR-VL 1.6 GPU-memory usage on Windows/NVIDIA and found a way to substantially reduce both model-loading and inference VRAM requirements.
On my test system, the approximate PaddleOCR-VL workload increase was reduced from:
~8.35 GiB
to approximately:
~4.3–4.6 GiB
The measured total GPU-board peak in the final configuration was:
5504 MiB
with approximately 0.9–1.2 GiB already occupied by Windows/WDDM/background processes.
The largest inference-side improvement comes from query-chunked global eager attention.
This is not window attention: every query token still attends to the complete K/V sequence.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Summary
I investigated PaddleOCR-VL 1.6 GPU-memory usage on Windows/NVIDIA and found a way to substantially reduce both model-loading and inference VRAM requirements.
On my test system, the approximate PaddleOCR-VL workload increase was reduced from:
to approximately:
The measured total GPU-board peak in the final configuration was:
with approximately 0.9–1.2 GiB already occupied by Windows/WDDM/background processes.
The largest inference-side improvement comes from query-chunked global eager attention.
This is not window attention: every query token still attends to the complete K/V sequence.
Environment
Problem
For the PaddleOCR-VL demo image, the vision attention input was:
The eager attention path calculates the full attention matrix:
For this input, the FP32
[1,16,4884,4884]tensor alone is approximately 1.42 GiB.With additional tensors, softmax intermediates and allocator workspace, this causes a much larger temporary VRAM peak.
Instrumented vision-stage measurements:
Query-chunked global attention
I changed only the query dimension to be processed in blocks:
The K/V tensors remain complete.
Conceptually:
Therefore the attention remains global.
With query chunking, the instrumented vision peak dropped to:
This is a reduction of approximately:
in active vision-stage peak allocation.
End-to-end VRAM measurements
Stock configuration
Optimized, query chunk 1024
The GPU was sampled with
nvidia-smiapproximately every 250 ms.Processing-time measurements
Same local demo image, three runs each.
Unchunked
Chunk 512
Chunk 1024
I am not claiming that chunk 1024 is generally faster from this small benchmark.
The important result is that there was no obvious performance penalty while VRAM usage decreased substantially.
OCR output
The same image completed successfully with:
I did not observe visible OCR degradation on this test image.
This is not yet a full accuracy benchmark, so I am not claiming dataset-level equivalence.
Other changes used in the low-memory configuration
The final test configuration also included:
model.eval()for inferenceempty_cache()after model loading and after the vision encoderI think these should be reviewed independently upstream.
The query-chunked eager-attention change can be isolated into a small patch.
Possible upstream implementation
Instead of hard-coding a chunk size, PaddleX could expose an optional setting:
For example:
or activate chunking only for long sequences:
This would leave the existing behavior unchanged by default.
Related PaddleOCR OOM report
There is an existing PaddleOCR Windows OOM report:
PaddlePaddle/PaddleOCR#17349The failure there occurs during GPU model loading.
The low-memory loading changes I tested address that issue separately from the large eager-attention allocation described above.
Question
Would the PaddleX maintainers be interested in an isolated PR implementing optional query-chunked global eager attention for PaddleOCR-VL inference?
I have preserved the tested patch and benchmark data and can provide a minimal diff.
All reactions